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
dc7721c8
Commit
dc7721c8
authored
Oct 07, 2010
by
Alexander Wiebel
Browse files
[CLEAN
#382
] removed wge::osgVec3
parent
981f4313
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
54 deletions
+40
-54
src/graphicsEngine/WGEGeodeUtils.cpp
src/graphicsEngine/WGEGeodeUtils.cpp
+6
-6
src/graphicsEngine/WGEGeometryUtils.cpp
src/graphicsEngine/WGEGeometryUtils.cpp
+30
-30
src/graphicsEngine/WGEUtils.cpp
src/graphicsEngine/WGEUtils.cpp
+1
-1
src/graphicsEngine/WGEUtils.h
src/graphicsEngine/WGEUtils.h
+0
-14
src/modules/effectiveConnectivityCluster/WMEffectiveConnectivityCluster.cpp
...iveConnectivityCluster/WMEffectiveConnectivityCluster.cpp
+2
-2
src/modules/template/WMTemplate.cpp
src/modules/template/WMTemplate.cpp
+1
-1
No files found.
src/graphicsEngine/WGEGeodeUtils.cpp
View file @
dc7721c8
...
...
@@ -174,8 +174,8 @@ osg::ref_ptr< osg::Node > wge::generateSolidBoundingBoxNode( const wmath::WPosit
// transform the cube to match the bbox
osg
::
Matrixd
transformM
;
osg
::
Matrixd
scaleM
;
transformM
.
makeTranslate
(
wge
::
osgVec3
(
pos1
)
);
scaleM
.
makeScale
(
wge
::
osgVec3
(
pos2
-
pos1
)
);
transformM
.
makeTranslate
(
pos1
);
scaleM
.
makeScale
(
pos2
-
pos1
);
// apply transformation to bbox
osg
::
ref_ptr
<
osg
::
MatrixTransform
>
transform
=
new
osg
::
MatrixTransform
();
...
...
@@ -303,10 +303,10 @@ osg::ref_ptr< osg::Geode > wge::genFinitePlane( double xSize, double ySize, cons
colors
->
push_back
(
wge
::
osgColor
(
color
)
);
vertices
->
push_back
(
osgVec3
(
p
.
getPointInPlane
(
xSize
,
ySize
)
)
);
vertices
->
push_back
(
osgVec3
(
p
.
getPointInPlane
(
-
xSize
,
ySize
)
)
);
vertices
->
push_back
(
osgVec3
(
p
.
getPointInPlane
(
-
xSize
,
-
ySize
)
)
);
vertices
->
push_back
(
osgVec3
(
p
.
getPointInPlane
(
xSize
,
-
ySize
)
)
);
vertices
->
push_back
(
p
.
getPointInPlane
(
xSize
,
ySize
)
);
vertices
->
push_back
(
p
.
getPointInPlane
(
-
xSize
,
ySize
)
);
vertices
->
push_back
(
p
.
getPointInPlane
(
-
xSize
,
-
ySize
)
);
vertices
->
push_back
(
p
.
getPointInPlane
(
xSize
,
-
ySize
)
);
geometry
->
addPrimitiveSet
(
new
osg
::
DrawArrays
(
osg
::
PrimitiveSet
::
QUADS
,
0
,
4
)
);
geometry
->
setVertexArray
(
vertices
);
...
...
src/graphicsEngine/WGEGeometryUtils.cpp
View file @
dc7721c8
...
...
@@ -40,35 +40,35 @@ osg::ref_ptr< osg::Vec3Array > wge::generateCuboidQuads( const std::vector< wmat
osg
::
ref_ptr
<
osg
::
Vec3Array
>
vertices
=
osg
::
ref_ptr
<
osg
::
Vec3Array
>
(
new
osg
::
Vec3Array
);
// Surfaces
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
0
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
1
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
2
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
3
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
1
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
5
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
6
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
2
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
5
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
4
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
7
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
6
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
4
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
0
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
3
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
7
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
3
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
2
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
6
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
7
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
0
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
1
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
5
]
)
);
vertices
->
push_back
(
wge
::
osgVec3
(
corners
[
4
]
)
);
vertices
->
push_back
(
corners
[
0
]
);
vertices
->
push_back
(
corners
[
1
]
);
vertices
->
push_back
(
corners
[
2
]
);
vertices
->
push_back
(
corners
[
3
]
);
vertices
->
push_back
(
corners
[
1
]
);
vertices
->
push_back
(
corners
[
5
]
);
vertices
->
push_back
(
corners
[
6
]
);
vertices
->
push_back
(
corners
[
2
]
);
vertices
->
push_back
(
corners
[
5
]
);
vertices
->
push_back
(
corners
[
4
]
);
vertices
->
push_back
(
corners
[
7
]
);
vertices
->
push_back
(
corners
[
6
]
);
vertices
->
push_back
(
corners
[
4
]
);
vertices
->
push_back
(
corners
[
0
]
);
vertices
->
push_back
(
corners
[
3
]
);
vertices
->
push_back
(
corners
[
7
]
);
vertices
->
push_back
(
corners
[
3
]
);
vertices
->
push_back
(
corners
[
2
]
);
vertices
->
push_back
(
corners
[
6
]
);
vertices
->
push_back
(
corners
[
7
]
);
vertices
->
push_back
(
corners
[
0
]
);
vertices
->
push_back
(
corners
[
1
]
);
vertices
->
push_back
(
corners
[
5
]
);
vertices
->
push_back
(
corners
[
4
]
);
return
vertices
;
}
...
...
@@ -80,7 +80,7 @@ osg::Vec3 wge::getQuadNormal( const wmath::WPosition& a,
wmath
::
WPosition
vec2
=
c
-
b
;
wmath
::
WPosition
normal
=
vec2
.
crossProduct
(
vec1
);
normal
.
normalize
();
return
wge
::
osgVec3
(
normal
)
;
return
normal
;
}
osg
::
ref_ptr
<
osg
::
Vec3Array
>
wge
::
generateCuboidQuadNormals
(
const
std
::
vector
<
wmath
::
WPosition
>&
corners
)
...
...
src/graphicsEngine/WGEUtils.cpp
View file @
dc7721c8
...
...
@@ -37,7 +37,7 @@ osg::ref_ptr< osg::Vec3Array > wge::osgVec3Array( const std::vector< wmath::WPos
std
::
vector
<
wmath
::
WPosition
>::
const_iterator
cit
;
for
(
cit
=
posArray
.
begin
();
cit
!=
posArray
.
end
();
++
cit
)
{
result
->
push_back
(
wge
::
osgVec3
(
*
cit
)
);
result
->
push_back
(
*
cit
);
}
return
result
;
}
...
...
src/graphicsEngine/WGEUtils.h
View file @
dc7721c8
...
...
@@ -62,15 +62,6 @@ namespace wge
*/
osg
::
Vec4
osgColor
(
const
WColor
&
color
);
/**
* Converts a given WPosition into an osg::Vec3.
*
* \param pos The WPosition which should be converted
*
* \return The osg::Vec3 vector of pos
*/
osg
::
Vec3
osgVec3
(
const
wmath
::
WPosition
&
pos
);
/**
* Converts a whole vector of WPositions into an osg::Vec3Array.
*
...
...
@@ -169,11 +160,6 @@ inline osg::Vec4 wge::osgColor( const WColor& color )
return
osg
::
Vec4
(
color
.
getRed
(),
color
.
getGreen
(),
color
.
getBlue
(),
color
.
getAlpha
()
);
}
inline
osg
::
Vec3
wge
::
osgVec3
(
const
wmath
::
WPosition
&
pos
)
{
return
osg
::
Vec3
(
pos
[
0
],
pos
[
1
],
pos
[
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/modules/effectiveConnectivityCluster/WMEffectiveConnectivityCluster.cpp
View file @
dc7721c8
...
...
@@ -307,7 +307,7 @@ void WMEffectiveConnectivityCluster::moduleMain()
{
osg
::
ref_ptr
<
WGELabel
>
label1
=
new
WGELabel
();
label1
->
setText
(
voi1
);
label1
->
setAnchor
(
wge
::
osgVec3
(
m_labelPos1
)
);
// the position relative to the current world coordinate system
label1
->
setAnchor
(
m_labelPos1
);
// the position relative to the current world coordinate system
label1
->
setCharacterSize
(
m_labelCharacterSize
->
get
(
true
)
);
layouter
->
addLayoutable
(
label1
);
}
...
...
@@ -316,7 +316,7 @@ void WMEffectiveConnectivityCluster::moduleMain()
{
osg
::
ref_ptr
<
WGELabel
>
label2
=
new
WGELabel
();
label2
->
setText
(
voi2
);
label2
->
setAnchor
(
wge
::
osgVec3
(
m_labelPos2
)
);
// the position relative to the current world coordinate system
label2
->
setAnchor
(
m_labelPos2
);
// the position relative to the current world coordinate system
label2
->
setCharacterSize
(
m_labelCharacterSize
->
get
(
true
)
);
layouter
->
addLayoutable
(
label2
);
}
...
...
src/modules/template/WMTemplate.cpp
View file @
dc7721c8
...
...
@@ -662,7 +662,7 @@ void WMTemplate::TranslateCallback::operator()( osg::Node* node, osg::NodeVisito
osg
::
ref_ptr
<
osg
::
MatrixTransform
>
transform
=
static_cast
<
osg
::
MatrixTransform
*
>
(
node
);
// Build a translation matrix (to comfortably convert between WPosition and osg::Vec3 use the convenience methods in "wge::" namespace)
osg
::
Matrixd
translate
=
osg
::
Matrixd
::
translate
(
wge
::
osgVec3
(
m_module
->
m_aPosition
->
get
(
true
)
)
);
osg
::
Matrixd
translate
=
osg
::
Matrixd
::
translate
(
m_module
->
m_aPosition
->
get
(
true
)
);
// 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