Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenWalnut Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
64854001
Commit
64854001
authored
Mar 01, 2011
by
schurade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADD] interpolated/non-interpolated mode for graph
parent
03005924
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
7 deletions
+32
-7
src/dataHandler/WDataSetScalar.h
src/dataHandler/WDataSetScalar.h
+2
-0
src/modules/datasetProfile/WMDatasetProfile.cpp
src/modules/datasetProfile/WMDatasetProfile.cpp
+21
-5
src/modules/datasetProfile/WMDatasetProfile.h
src/modules/datasetProfile/WMDatasetProfile.h
+9
-2
No files found.
src/dataHandler/WDataSetScalar.h
View file @
64854001
...
...
@@ -121,6 +121,8 @@ public:
*/
static
boost
::
shared_ptr
<
WPrototyped
>
getPrototype
();
using
WDataSetSingle
::
getValueAt
;
protected:
/**
...
...
src/modules/datasetProfile/WMDatasetProfile.cpp
View file @
64854001
...
...
@@ -80,8 +80,8 @@ const std::string WMDatasetProfile::getDescription() const
void
WMDatasetProfile
::
connectors
()
{
// the input dataset is just used as source for resolurtion and transformation matrix
m_input
=
boost
::
shared_ptr
<
WModuleInputData
<
WDataSetS
ingle
>
>
(
new
WModuleInputData
<
WDataSetS
ingle
>
(
shared_from_this
(),
"in"
,
"The input dataset."
)
);
m_input
=
boost
::
shared_ptr
<
WModuleInputData
<
WDataSetS
calar
>
>
(
new
WModuleInputData
<
WDataSetS
calar
>
(
shared_from_this
(),
"in"
,
"The input dataset."
)
);
addConnector
(
m_input
);
WModule
::
connectors
();
...
...
@@ -110,6 +110,12 @@ void WMDatasetProfile::properties()
m_propLength
->
setMax
(
500
);
m_propUseLength
=
m_properties
->
addProperty
(
"Use length"
,
"Description."
,
false
);
m_propInterpolate
=
m_properties
->
addProperty
(
"interpolate"
,
"Description."
,
true
);
m_propNumSamples
=
m_properties
->
addProperty
(
"Number of sample points"
,
"Description."
,
100
);
m_propNumSamples
->
setMin
(
1
);
m_propNumSamples
->
setMax
(
500
);
WModule
::
properties
();
}
...
...
@@ -141,7 +147,7 @@ void WMDatasetProfile::moduleMain()
break
;
}
boost
::
shared_ptr
<
WDataSetS
ingle
>
newDataSet
=
m_input
->
getData
();
boost
::
shared_ptr
<
WDataSetS
calar
>
newDataSet
=
m_input
->
getData
();
bool
dataChanged
=
(
m_dataSet
!=
newDataSet
);
bool
dataValid
=
(
newDataSet
);
...
...
@@ -168,7 +174,7 @@ void WMDatasetProfile::moduleMain()
}
if
(
m_propUseLength
->
changed
()
||
m_propLength
->
changed
()
)
if
(
m_propUseLength
->
changed
()
||
m_propLength
->
changed
()
||
m_propInterpolate
->
changed
(
true
)
||
m_propNumSamples
->
changed
(
true
)
)
{
m_dirty
=
true
;
}
...
...
@@ -476,7 +482,17 @@ osg::ref_ptr< osg::Geode > WMDatasetProfile::createGraphGeode()
for
(
int
i
=
0
;
i
<
steps
;
++
i
)
{
value
=
m_dataSet
->
getValueAt
(
m_grid
->
getVoxelNum
(
knobs
[
k
]
->
getPosition
()
+
p1
*
i
)
);
if
(
m_propInterpolate
->
get
()
)
{
bool
success
;
value
=
m_dataSet
->
interpolate
(
knobs
[
k
]
->
getPosition
()
+
p1
*
i
,
&
success
);
}
else
{
value
=
m_dataSet
->
getValueAt
(
m_grid
->
getVoxelNum
(
knobs
[
k
]
->
getPosition
()
+
p1
*
i
)
);
}
x
=
x
+
(
m_oldViewWidth
/
100
);
y
=
10
+
(
value
/
max
*
(
m_oldViewHeight
-
20
)
/
2
);
vertices
->
push_back
(
osg
::
Vec3
(
x
,
y
,
0
)
);
...
...
src/modules/datasetProfile/WMDatasetProfile.h
View file @
64854001
...
...
@@ -32,6 +32,9 @@
#include <osg/Geode>
#include "../../dataHandler/WDataSetScalar.h"
#include "../../dataHandler/WDataSetSingle.h"
#include "../../graphicsEngine/WGEManagedGroupNode.h"
#include "../../graphicsEngine/WROISphere.h"
...
...
@@ -162,12 +165,12 @@ private:
/**
* An input connector that accepts order 1 datasets.
*/
boost
::
shared_ptr
<
WModuleInputData
<
WDataSetS
ingle
>
>
m_input
;
boost
::
shared_ptr
<
WModuleInputData
<
WDataSetS
calar
>
>
m_input
;
/**
* This is a pointer to the dataset the module is currently working on.
*/
boost
::
shared_ptr
<
WDataSetS
ingle
>
m_dataSet
;
boost
::
shared_ptr
<
WDataSetS
calar
>
m_dataSet
;
/**
* stores a pointer to the grid we use;
...
...
@@ -200,6 +203,10 @@ private:
WPropBool
m_propUseLength
;
//!< enforce lengths
WPropBool
m_propInterpolate
;
//!< interpolate the graph
WPropInt
m_propNumSamples
;
//!< number of sample points on the graph
/**
* The root node used for this modules graphics.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment