Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
0cd56b48
Commit
0cd56b48
authored
May 04, 2011
by
Sebastian Eichelbaum
Browse files
[FIX] - toolbox base compiles again and uses new matrices
parent
1e8451f9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
37 deletions
+53
-37
src/common/math/linearAlgebra/WMatrixFixed.h
src/common/math/linearAlgebra/WMatrixFixed.h
+21
-5
src/modules/imageSpaceLIC/WMImageSpaceLIC.cpp
src/modules/imageSpaceLIC/WMImageSpaceLIC.cpp
+3
-3
src/modules/isosurfaceRaytracer/WMIsosurfaceRaytracer.cpp
src/modules/isosurfaceRaytracer/WMIsosurfaceRaytracer.cpp
+1
-1
src/modules/modules-base.toolbox
src/modules/modules-base.toolbox
+22
-22
src/modules/navigationSlices/WMNavigationSlices.cpp
src/modules/navigationSlices/WMNavigationSlices.cpp
+3
-3
src/modules/superquadricGlyphs/WMSuperquadricGlyphs.cpp
src/modules/superquadricGlyphs/WMSuperquadricGlyphs.cpp
+1
-1
src/modules/template/WMTemplate.cpp
src/modules/template/WMTemplate.cpp
+2
-2
No files found.
src/common/math/linearAlgebra/WMatrixFixed.h
View file @
0cd56b48
...
...
@@ -499,6 +499,22 @@ public:
return
m2
;
}
/**
* A convenience function to cast the WMatrixFixed types to arbitrary other vector/matrix types that are supported by WMatrixFixed. This
* method is mainly needed for ambiguities during type resolution, if the target methods signature allows several different vec/matrix types.
* Example: you have void do( osg::Vec3f v ) and void do( osg::Vec3d v ). If you do WVector3d_2 myV; do( myV ); This is ambiguous since
* WVector3d_2 can be casted to either osg::Vec3d AND Vec3f implicitly.
*
* \tparam TargetType the type needed (to cast to)
*
* \return the required type
*/
template
<
typename
TargetType
>
TargetType
as
()
const
{
return
operator
TargetType
();
}
/**
* Cast to matrix of same size with different value type.
*
...
...
@@ -536,7 +552,7 @@ public:
*
* \param m the OSG matrix.
*/
explicit
WMatrixFixed
(
const
osg
::
Matrixd
&
m
)
// NOLINT - we do not want it explicit
WMatrixFixed
(
const
osg
::
Matrixd
&
m
)
// NOLINT - we do not want it explicit
{
BOOST_STATIC_ASSERT
(
Rows
==
4
);
BOOST_STATIC_ASSERT
(
Cols
==
4
);
...
...
@@ -555,7 +571,7 @@ public:
*
* \param m the OSG vector.
*/
explicit
WMatrixFixed
(
const
osg
::
Vec3f
&
m
)
// NOLINT - we do not want it explicit
WMatrixFixed
(
const
osg
::
Vec3f
&
m
)
// NOLINT - we do not want it explicit
{
BOOST_STATIC_ASSERT
(
Rows
==
3
);
BOOST_STATIC_ASSERT
(
Cols
==
1
);
...
...
@@ -570,7 +586,7 @@ public:
*
* \param m the OSG vector.
*/
explicit
WMatrixFixed
(
const
osg
::
Vec3d
&
m
)
// NOLINT - we do not want it explicit
WMatrixFixed
(
const
osg
::
Vec3d
&
m
)
// NOLINT - we do not want it explicit
{
BOOST_STATIC_ASSERT
(
Rows
==
3
);
BOOST_STATIC_ASSERT
(
Cols
==
1
);
...
...
@@ -585,7 +601,7 @@ public:
*
* \param m the OSG vector.
*/
explicit
WMatrixFixed
(
const
osg
::
Vec4f
&
m
)
// NOLINT - we do not want it explicit
WMatrixFixed
(
const
osg
::
Vec4f
&
m
)
// NOLINT - we do not want it explicit
{
BOOST_STATIC_ASSERT
(
Rows
==
4
);
BOOST_STATIC_ASSERT
(
Cols
==
1
);
...
...
@@ -601,7 +617,7 @@ public:
*
* \param m the OSG vector.
*/
explicit
WMatrixFixed
(
const
osg
::
Vec4d
&
m
)
// NOLINT - we do not want it explicit
WMatrixFixed
(
const
osg
::
Vec4d
&
m
)
// NOLINT - we do not want it explicit
{
BOOST_STATIC_ASSERT
(
Rows
==
4
);
BOOST_STATIC_ASSERT
(
Cols
==
1
);
...
...
src/modules/imageSpaceLIC/WMImageSpaceLIC.cpp
View file @
0cd56b48
...
...
@@ -223,13 +223,13 @@ void WMImageSpaceLIC::initOSG( boost::shared_ptr< WGridRegular3D > grid, boost::
// not available in the shader
osg
::
StateSet
*
ss
=
xSlice
->
getOrCreateStateSet
();
ss
->
addUniform
(
new
WGEPropertyUniform
<
WPropInt
>
(
"u_vertexShift"
,
m_xPos
)
);
ss
->
addUniform
(
new
osg
::
Uniform
(
"u_vertexShiftDirection"
,
grid
->
getDirectionX
()
)
);
// the axis to move along
ss
->
addUniform
(
new
osg
::
Uniform
(
"u_vertexShiftDirection"
,
grid
->
getDirectionX
()
.
as
<
osg
::
Vec3f
>
()
)
);
// the axis to move along
ss
=
ySlice
->
getOrCreateStateSet
();
ss
->
addUniform
(
new
WGEPropertyUniform
<
WPropInt
>
(
"u_vertexShift"
,
m_yPos
)
);
ss
->
addUniform
(
new
osg
::
Uniform
(
"u_vertexShiftDirection"
,
grid
->
getDirectionY
()
)
);
// the axis to move along
ss
->
addUniform
(
new
osg
::
Uniform
(
"u_vertexShiftDirection"
,
grid
->
getDirectionY
()
.
as
<
osg
::
Vec3f
>
()
)
);
// the axis to move along
ss
=
zSlice
->
getOrCreateStateSet
();
ss
->
addUniform
(
new
WGEPropertyUniform
<
WPropInt
>
(
"u_vertexShift"
,
m_zPos
)
);
ss
->
addUniform
(
new
osg
::
Uniform
(
"u_vertexShiftDirection"
,
grid
->
getDirectionZ
()
)
);
// the axis to move along
ss
->
addUniform
(
new
osg
::
Uniform
(
"u_vertexShiftDirection"
,
grid
->
getDirectionZ
()
.
as
<
osg
::
Vec3f
>
()
)
);
// the axis to move along
// set callbacks for en-/disabling the nodes
xSlice
->
addUpdateCallback
(
new
WGENodeMaskCallback
(
m_showonX
)
);
...
...
src/modules/isosurfaceRaytracer/WMIsosurfaceRaytracer.cpp
View file @
0cd56b48
...
...
@@ -263,7 +263,7 @@ void WMIsosurfaceRaytracer::moduleMain()
cube
->
asTransform
()
->
getChild
(
0
)
->
setName
(
"_DVR Proxy Cube"
);
// Be aware that this name is used in the pick handler.
// because of the underscore in front it won't be picked
// we also set the grid's transformation here
rootNode
->
setMatrix
(
wge
::
toOSGMatrix
(
grid
->
getTransform
ationMatrix
()
)
);
rootNode
->
setMatrix
(
static_cast
<
WMatrix4d_2
>
(
grid
->
getTransform
()
)
);
// bind the texture to the node
osg
::
StateSet
*
rootState
=
cube
->
getOrCreateStateSet
();
...
...
src/modules/modules-base.toolbox
View file @
0cd56b48
# mostly modules from our default whitelist
#
ADD_SUBDIRECTORY( arbitraryRois )
#
ADD_SUBDIRECTORY( colormapper )
#
ADD_SUBDIRECTORY( coordinateHUD )
#
ADD_SUBDIRECTORY( coordinateSystem )
#
ADD_SUBDIRECTORY( distanceMap )
#
ADD_SUBDIRECTORY( distanceMapIsosurface )
#
ADD_SUBDIRECTORY( fiberDisplay )
#
ADD_SUBDIRECTORY( functionalMRIViewer )
#
ADD_SUBDIRECTORY( gridRenderer )
#
ADD_SUBDIRECTORY( hud )
#
ADD_SUBDIRECTORY( imageSpaceLIC )
#
ADD_SUBDIRECTORY( isosurfaceRaytracer )
#
ADD_SUBDIRECTORY( lic )
#
ADD_SUBDIRECTORY( marchingCubes )
#
ADD_SUBDIRECTORY( navigationSlices )
#
ADD_SUBDIRECTORY( overlayAtlas )
#
ADD_SUBDIRECTORY( paintTexture )
#
ADD_SUBDIRECTORY( superquadricGlyphs )
#
ADD_SUBDIRECTORY( template )
#
ADD_SUBDIRECTORY( triangleMeshRenderer )
#
ADD_SUBDIRECTORY( vectorPlot )
#
ADD_SUBDIRECTORY( voxelizer )
ADD_SUBDIRECTORY( arbitraryRois )
ADD_SUBDIRECTORY( colormapper )
ADD_SUBDIRECTORY( coordinateHUD )
ADD_SUBDIRECTORY( coordinateSystem )
ADD_SUBDIRECTORY( distanceMap )
ADD_SUBDIRECTORY( distanceMapIsosurface )
ADD_SUBDIRECTORY( fiberDisplay )
ADD_SUBDIRECTORY( functionalMRIViewer )
ADD_SUBDIRECTORY( gridRenderer )
ADD_SUBDIRECTORY( hud )
ADD_SUBDIRECTORY( imageSpaceLIC )
ADD_SUBDIRECTORY( isosurfaceRaytracer )
ADD_SUBDIRECTORY( lic )
ADD_SUBDIRECTORY( marchingCubes )
ADD_SUBDIRECTORY( navigationSlices )
ADD_SUBDIRECTORY( overlayAtlas )
ADD_SUBDIRECTORY( paintTexture )
ADD_SUBDIRECTORY( superquadricGlyphs )
ADD_SUBDIRECTORY( template )
ADD_SUBDIRECTORY( triangleMeshRenderer )
ADD_SUBDIRECTORY( vectorPlot )
ADD_SUBDIRECTORY( voxelizer )
src/modules/navigationSlices/WMNavigationSlices.cpp
View file @
0cd56b48
...
...
@@ -240,14 +240,14 @@ void WMNavigationSlices::PickCallback::pick( WPickInfo pickInfo )
// dragging was initialized earlier
if
(
m_isPicked
)
{
osg
::
Vec3
startPosScreen
(
m_oldPixelPosition
(
0
)
,
m_oldPixelPosition
(
1
)
,
0.0
);
osg
::
Vec3
endPosScreen
(
newPixelPos
(
0
)
,
newPixelPos
(
1
)
,
0.0
);
osg
::
Vec3
startPosScreen
(
m_oldPixelPosition
[
0
]
,
m_oldPixelPosition
[
1
]
,
0.0
);
osg
::
Vec3
endPosScreen
(
newPixelPos
[
0
]
,
newPixelPos
[
1
]
,
0.0
);
osg
::
Vec3
startPosWorld
=
wge
::
unprojectFromScreen
(
startPosScreen
,
m_camera
);
osg
::
Vec3
endPosWorld
=
wge
::
unprojectFromScreen
(
endPosScreen
,
m_camera
);
osg
::
Vec3
moveDirWorld
=
endPosWorld
-
startPosWorld
;
float
diff
=
normal
*
moveDirWorld
;
float
diff
=
moveDirWorld
*
static_cast
<
osg
::
Vec3
>
(
normal
)
;
m_property
->
set
(
m_property
->
get
()
+
m_dir
*
diff
);
}
...
...
src/modules/superquadricGlyphs/WMSuperquadricGlyphs.cpp
View file @
0cd56b48
...
...
@@ -467,7 +467,7 @@ void WMSuperquadricGlyphs::moduleMain()
m_zPos
->
setMax
(
m_maxZ
);
m_zPos
->
set
(
m_maxZ
/
2
);
m_output
->
setMatrix
(
m_dataSetGrid
->
getTransform
()
);
m_output
->
setMatrix
(
static_cast
<
WMatrix4d_2
>
(
m_dataSetGrid
->
getTransform
()
)
);
// new data -> update OSG Stuff
initOSG
();
...
...
src/modules/template/WMTemplate.cpp
View file @
0cd56b48
...
...
@@ -694,8 +694,8 @@ void WMTemplate::TranslateCallback::operator()( osg::Node* node, osg::NodeVisito
// The node to which this callback has been attached needs to be an osg::MatrixTransform:
osg
::
ref_ptr
<
osg
::
MatrixTransform
>
transform
=
static_cast
<
osg
::
MatrixTransform
*
>
(
node
);
// Build a translation matrix (to comfortably convert between WPosition_2 and osg::Vec3 use the
convenience methods in "wge::" namespace
)
osg
::
Matrixd
translate
=
osg
::
Matrixd
::
translate
(
m_module
->
m_aPosition
->
get
(
true
)
);
// Build a translation matrix (to comfortably convert between WPosition_2 and osg::Vec3 use the
WVector3XXX methods
)
osg
::
Matrixd
translate
=
osg
::
Matrixd
::
translate
(
m_module
->
m_aPosition
->
get
(
true
)
.
as
<
osg
::
Vec3d
>
()
);
// and set the translation matrix
transform
->
setMatrix
(
translate
);
...
...
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