Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
7a1314ff
Commit
7a1314ff
authored
Oct 07, 2010
by
Alexander Wiebel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CLEAN
#381
] removed now useless function
parent
8decd1e5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
44 deletions
+28
-44
src/graphicsEngine/WGEUtils.h
src/graphicsEngine/WGEUtils.h
+0
-11
src/kernel/modules/navSlices/WMNavSlices.cpp
src/kernel/modules/navSlices/WMNavSlices.cpp
+11
-11
src/modules/arbitraryPlane/WMArbitraryPlane.cpp
src/modules/arbitraryPlane/WMArbitraryPlane.cpp
+12
-12
src/modules/lineGuidedSlice/WMLineGuidedSlice.cpp
src/modules/lineGuidedSlice/WMLineGuidedSlice.cpp
+2
-7
src/modules/marchingCubes/WMMarchingCubes.cpp
src/modules/marchingCubes/WMMarchingCubes.cpp
+2
-2
src/modules/splineSurface/WMSplineSurface.cpp
src/modules/splineSurface/WMSplineSurface.cpp
+1
-1
No files found.
src/graphicsEngine/WGEUtils.h
View file @
7a1314ff
...
...
@@ -88,12 +88,6 @@ namespace wge
*/
osg
::
Vec3
WGE_EXPORT
unprojectFromScreen
(
const
osg
::
Vec3
screen
,
osg
::
ref_ptr
<
osg
::
Camera
>
camera
);
/**
* Conversion of WVector3D to osg::Vec3
* \param v the vector to convert.
*/
osg
::
Vec3
wv3D2ov3
(
wmath
::
WVector3D
v
);
/**
* creates the same color as the atlas colormap shader from the index
*
...
...
@@ -180,11 +174,6 @@ inline osg::Vec3 wge::osgVec3( const wmath::WPosition& pos )
return
osg
::
Vec3
(
pos
[
0
],
pos
[
1
],
pos
[
2
]
);
}
inline
osg
::
Vec3
wge
::
wv3D2ov3
(
wmath
::
WVector3D
v
)
{
return
osg
::
Vec3
(
v
[
0
],
v
[
1
],
v
[
2
]
);
}
inline
osg
::
Matrixd
wge
::
toOSGMatrix
(
const
wmath
::
WMatrix
<
double
>&
matrix
)
{
WAssert
(
(
matrix
.
getNbRows
()
==
3
||
matrix
.
getNbRows
()
==
4
)
&&
(
matrix
.
getNbCols
()
==
3
||
matrix
.
getNbCols
()
==
4
),
...
...
src/kernel/modules/navSlices/WMNavSlices.cpp
View file @
7a1314ff
...
...
@@ -510,7 +510,7 @@ void WMNavSlices::setSlicePosFromPick( WPickInfo pickInfo )
osg
::
Vec3
endPosWorld
=
wge
::
unprojectFromScreen
(
endPosScreen
,
m_viewer
->
getCamera
()
);
osg
::
Vec3
moveDirWorld
=
endPosWorld
-
startPosWorld
;
float
diff
=
wge
::
wv3D2ov3
(
normal
)
*
moveDirWorld
;
float
diff
=
normal
*
moveDirWorld
;
// recognize also small values.
if
(
diff
<
0
&&
diff
>
-
1
)
...
...
@@ -628,7 +628,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
vertices
.
push_back
(
wmath
::
WPosition
(
xPos
,
m_bb
.
second
[
1
],
m_bb
.
first
[
2
]
)
);
for
(
size_t
i
=
0
;
i
<
nbVerts
;
++
i
)
{
sliceVertices
->
push_back
(
wge
::
wv3D2ov3
(
vertices
[
i
]
)
);
sliceVertices
->
push_back
(
vertices
[
i
]
);
}
sliceGeometry
->
setVertexArray
(
sliceVertices
);
...
...
@@ -641,7 +641,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg
::
Vec3Array
*
texCoords
=
new
osg
::
Vec3Array
;
for
(
size_t
i
=
0
;
i
<
nbVerts
;
++
i
)
{
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
)
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
)
);
}
sliceGeometry
->
setTexCoordArray
(
c
,
texCoords
);
++
c
;
...
...
@@ -655,7 +655,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg
::
Vec3Array
*
texCoords
=
new
osg
::
Vec3Array
;
for
(
size_t
i
=
0
;
i
<
nbVerts
;
++
i
)
{
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
)
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
)
);
}
sliceGeometry
->
setTexCoordArray
(
c
,
texCoords
);
++
c
;
...
...
@@ -672,7 +672,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
vertices
.
push_back
(
wmath
::
WPosition
(
m_bb
.
second
[
0
],
yPos
,
m_bb
.
first
[
2
]
)
);
for
(
size_t
i
=
0
;
i
<
nbVerts
;
++
i
)
{
sliceVertices
->
push_back
(
wge
::
wv3D2ov3
(
vertices
[
i
]
)
);
sliceVertices
->
push_back
(
vertices
[
i
]
);
}
sliceGeometry
->
setVertexArray
(
sliceVertices
);
...
...
@@ -684,7 +684,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg
::
Vec3Array
*
texCoords
=
new
osg
::
Vec3Array
;
for
(
size_t
i
=
0
;
i
<
nbVerts
;
++
i
)
{
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
)
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
)
);
}
sliceGeometry
->
setTexCoordArray
(
c
,
texCoords
);
++
c
;
...
...
@@ -698,7 +698,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg
::
Vec3Array
*
texCoords
=
new
osg
::
Vec3Array
;
for
(
size_t
i
=
0
;
i
<
nbVerts
;
++
i
)
{
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
)
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
)
);
}
sliceGeometry
->
setTexCoordArray
(
c
,
texCoords
);
++
c
;
...
...
@@ -714,7 +714,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
vertices
.
push_back
(
wmath
::
WPosition
(
m_bb
.
second
[
0
],
m_bb
.
first
[
1
],
zPos
)
);
for
(
size_t
i
=
0
;
i
<
nbVerts
;
++
i
)
{
sliceVertices
->
push_back
(
wge
::
wv3D2ov3
(
vertices
[
i
]
)
);
sliceVertices
->
push_back
(
vertices
[
i
]
);
}
sliceGeometry
->
setVertexArray
(
sliceVertices
);
...
...
@@ -727,7 +727,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg
::
Vec3Array
*
texCoords
=
new
osg
::
Vec3Array
;
for
(
size_t
i
=
0
;
i
<
nbVerts
;
++
i
)
{
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
)
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
)
);
}
sliceGeometry
->
setTexCoordArray
(
c
,
texCoords
);
++
c
;
...
...
@@ -742,7 +742,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
for
(
size_t
i
=
0
;
i
<
nbVerts
;
++
i
)
{
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
)
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
)
);
}
sliceGeometry
->
setTexCoordArray
(
c
,
texCoords
);
++
c
;
...
...
@@ -818,7 +818,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createCrossGeometry( int slice )
for
(
size_t
i
=
0
;
i
<
vertices
.
size
();
++
i
)
{
crossVertices
->
push_back
(
wge
::
wv3D2ov3
(
vertices
[
i
]
)
);
crossVertices
->
push_back
(
vertices
[
i
]
);
}
colorArray
->
push_back
(
osg
::
Vec3
(
1.0
f
,
0.0
f
,
0.0
f
)
);
...
...
src/modules/arbitraryPlane/WMArbitraryPlane.cpp
View file @
7a1314ff
...
...
@@ -275,10 +275,10 @@ void WMArbitraryPlane::updatePlane()
osg
::
ref_ptr
<
osg
::
Geometry
>
planeGeometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
()
);
osg
::
Vec3Array
*
planeVertices
=
new
osg
::
Vec3Array
;
planeVertices
->
push_back
(
wge
::
wv3D2ov3
(
v0
)
);
planeVertices
->
push_back
(
wge
::
wv3D2ov3
(
v1
)
);
planeVertices
->
push_back
(
wge
::
wv3D2ov3
(
v2
)
);
planeVertices
->
push_back
(
wge
::
wv3D2ov3
(
v3
)
);
planeVertices
->
push_back
(
v0
);
planeVertices
->
push_back
(
v1
);
planeVertices
->
push_back
(
v2
);
planeVertices
->
push_back
(
v3
);
planeGeometry
->
setVertexArray
(
planeVertices
);
osg
::
DrawElementsUInt
*
quad
=
new
osg
::
DrawElementsUInt
(
osg
::
PrimitiveSet
::
QUADS
,
0
);
...
...
@@ -298,10 +298,10 @@ void WMArbitraryPlane::updatePlane()
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
WKernel
::
getRunningKernel
()
->
getSelectionManager
()
->
getGrid
();
osg
::
Vec3Array
*
texCoords
=
new
osg
::
Vec3Array
;
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
v0
)
)
);
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
v1
)
)
);
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
v2
)
)
);
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
v3
)
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
v0
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
v1
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
v2
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
v3
)
);
planeGeometry
->
setTexCoordArray
(
c
,
texCoords
);
++
c
;
...
...
@@ -313,10 +313,10 @@ void WMArbitraryPlane::updatePlane()
osg
::
Vec3Array
*
texCoords
=
new
osg
::
Vec3Array
;
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
v0
)
)
);
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
v1
)
)
);
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
v2
)
)
);
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
v3
)
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
v0
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
v1
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
v2
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
v3
)
);
planeGeometry
->
setTexCoordArray
(
c
,
texCoords
);
++
c
;
...
...
src/modules/lineGuidedSlice/WMLineGuidedSlice.cpp
View file @
7a1314ff
...
...
@@ -185,11 +185,6 @@ void WMLineGuidedSlice::create()
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getScene
()
->
insert
(
m_rootNode
);
}
osg
::
Vec3
wv3D2ov3
(
wmath
::
WVector3D
v
)
// WVector3D to osg::Vec3 conversion
{
return
osg
::
Vec3
(
v
[
0
],
v
[
1
],
v
[
2
]
);
}
void
WMLineGuidedSlice
::
setSlicePosFromPick
(
WPickInfo
pickInfo
)
{
if
(
pickInfo
.
getName
()
==
"Line Guided Slice"
)
...
...
@@ -258,7 +253,7 @@ osg::ref_ptr<osg::Geometry> WMLineGuidedSlice::createGeometry()
const
size_t
nbVerts
=
4
;
for
(
size_t
i
=
0
;
i
<
nbVerts
;
++
i
)
{
sliceVertices
->
push_back
(
wv3D2ov3
(
vertices
[
i
]
)
);
sliceVertices
->
push_back
(
vertices
[
i
]
);
}
sliceGeometry
->
setVertexArray
(
sliceVertices
);
...
...
@@ -271,7 +266,7 @@ osg::ref_ptr<osg::Geometry> WMLineGuidedSlice::createGeometry()
texCoords
->
clear
();
for
(
size_t
i
=
0
;
i
<
nbVerts
;
++
i
)
{
texCoords
->
push_back
(
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
+
wmath
::
WVector3D
(
0.5
,
0.5
,
0.5
)
)
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
vertices
[
i
]
+
wmath
::
WVector3D
(
0.5
,
0.5
,
0.5
)
)
);
}
sliceGeometry
->
setTexCoordArray
(
counter
,
texCoords
);
++
counter
;
...
...
src/modules/marchingCubes/WMMarchingCubes.cpp
View file @
7a1314ff
...
...
@@ -629,7 +629,7 @@ void WMMarchingCubes::updateGraphicsForCallback()
for
(
size_t
i
=
0
;
i
<
m_triMesh
->
vertSize
();
++
i
)
{
osg
::
Vec3
vertPos
=
m_triMesh
->
getVertex
(
i
);
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
wmath
::
WPosition
(
vertPos
[
0
],
vertPos
[
1
],
vertPos
[
2
]
)
)
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
wmath
::
WPosition
(
vertPos
[
0
],
vertPos
[
1
],
vertPos
[
2
]
)
)
);
}
surfaceGeometry
->
setTexCoordArray
(
c
,
texCoords
);
...
...
@@ -660,7 +660,7 @@ void WMMarchingCubes::updateGraphicsForCallback()
for
(
size_t
i
=
0
;
i
<
m_triMesh
->
vertSize
();
++
i
)
{
osg
::
Vec3
vertPos
=
m_triMesh
->
getVertex
(
i
);
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
wmath
::
WPosition
(
vertPos
[
0
],
vertPos
[
1
],
vertPos
[
2
]
)
)
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
wmath
::
WPosition
(
vertPos
[
0
],
vertPos
[
1
],
vertPos
[
2
]
)
)
);
}
surfaceGeometry
->
setTexCoordArray
(
c
,
texCoords
);
}
...
...
src/modules/splineSurface/WMSplineSurface.cpp
View file @
7a1314ff
...
...
@@ -490,7 +490,7 @@ void WMSplineSurface::updateGraphics()
for
(
size_t
i
=
0
;
i
<
m_triMesh
->
vertSize
();
++
i
)
{
osg
::
Vec3
vertPos
=
m_triMesh
->
getVertex
(
i
);
texCoords
->
push_back
(
wge
::
wv3D2ov3
(
grid
->
worldCoordToTexCoord
(
wmath
::
WPosition
(
vertPos
[
0
],
vertPos
[
1
],
vertPos
[
2
]
)
)
)
);
texCoords
->
push_back
(
grid
->
worldCoordToTexCoord
(
wmath
::
WPosition
(
vertPos
[
0
],
vertPos
[
1
],
vertPos
[
2
]
)
)
);
}
surfaceGeometry
->
setTexCoordArray
(
c
,
texCoords
);
}
...
...
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