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
ca3092d2
Commit
ca3092d2
authored
May 14, 2013
by
André Reichenbach
Browse files
[ADD] additional functions for returning curvature values
parent
0aca3abe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
8 deletions
+32
-8
src/core/graphicsEngine/WTriangleMesh.cpp
src/core/graphicsEngine/WTriangleMesh.cpp
+14
-4
src/core/graphicsEngine/WTriangleMesh.h
src/core/graphicsEngine/WTriangleMesh.h
+18
-4
No files found.
src/core/graphicsEngine/WTriangleMesh.cpp
View file @
ca3092d2
...
...
@@ -1141,22 +1141,32 @@ double WTriangleMesh::calcAngleBetweenNormalizedVectors( osg::Vec3 const& v1, os
return
acos
(
temp
);
}
double
WTriangleMesh
::
getMainCurvature
(
std
::
size_t
vtxId
)
double
WTriangleMesh
::
getMainCurvature
(
std
::
size_t
vtxId
)
const
{
return
m_mainNormalCurvature
->
operator
[]
(
vtxId
);
}
double
WTriangleMesh
::
getSecondaryCurvature
(
std
::
size_t
vtxId
)
double
WTriangleMesh
::
getSecondaryCurvature
(
std
::
size_t
vtxId
)
const
{
return
m_secondaryNormalCurvature
->
operator
[]
(
vtxId
);
}
osg
::
Vec3
WTriangleMesh
::
getCurvatureMainPrincipalDirection
(
std
::
size_t
vtxId
)
boost
::
shared_ptr
<
std
::
vector
<
float
>
>
const
&
WTriangleMesh
::
getMainCurvatures
()
const
{
return
m_mainNormalCurvature
;
}
boost
::
shared_ptr
<
std
::
vector
<
float
>
>
const
&
WTriangleMesh
::
getSecondaryCurvatures
()
const
{
return
m_secondaryNormalCurvature
;
}
osg
::
Vec3
WTriangleMesh
::
getCurvatureMainPrincipalDirection
(
std
::
size_t
vtxId
)
const
{
return
m_mainCurvaturePrincipalDirection
->
operator
[]
(
vtxId
);
}
osg
::
Vec3
WTriangleMesh
::
getCurvatureSecondaryPrincipalDirection
(
std
::
size_t
vtxId
)
osg
::
Vec3
WTriangleMesh
::
getCurvatureSecondaryPrincipalDirection
(
std
::
size_t
vtxId
)
const
{
return
m_secondaryCurvaturePrincipalDirection
->
operator
[]
(
vtxId
);
}
...
...
src/core/graphicsEngine/WTriangleMesh.h
View file @
ca3092d2
...
...
@@ -414,7 +414,7 @@ public:
*
* \return The estimated main normal curvature.
*/
double
getMainCurvature
(
std
::
size_t
vtxId
);
double
getMainCurvature
(
std
::
size_t
vtxId
)
const
;
/**
* Retreive the secondary (minimum) curvature of a vertex.
...
...
@@ -423,7 +423,21 @@ public:
*
* \return The estimated secondary normal curvature.
*/
double
getSecondaryCurvature
(
std
::
size_t
vtxId
);
double
getSecondaryCurvature
(
std
::
size_t
vtxId
)
const
;
/**
* Get the vector of main curvature values.
*
* \return The curvature values for all the vertices.
*/
boost
::
shared_ptr
<
std
::
vector
<
float
>
>
const
&
getMainCurvatures
()
const
;
/**
* Get the vector of secondary curvature values.
*
* \return The curvature values for all the vertices.
*/
boost
::
shared_ptr
<
std
::
vector
<
float
>
>
const
&
getSecondaryCurvatures
()
const
;
/**
* Retreive the 3d principal direction of curvature of a vertex.
...
...
@@ -432,7 +446,7 @@ public:
*
* \return The first principal duirection.
*/
osg
::
Vec3
getCurvatureMainPrincipalDirection
(
std
::
size_t
vtxId
);
osg
::
Vec3
getCurvatureMainPrincipalDirection
(
std
::
size_t
vtxId
)
const
;
/**
* Retreive the 3d principal direction of curvature for the minimum normal curvature of a vertex.
...
...
@@ -441,7 +455,7 @@ public:
*
* \return The second principal duirection.
*/
osg
::
Vec3
getCurvatureSecondaryPrincipalDirection
(
std
::
size_t
vtxId
);
osg
::
Vec3
getCurvatureSecondaryPrincipalDirection
(
std
::
size_t
vtxId
)
const
;
/**
* Retreive the array of principal directions e.g. for use as texture coords.
...
...
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