Commit ca3092d2 authored by André Reichenbach's avatar André Reichenbach
Browse files

[ADD] additional functions for returning curvature values

parent 0aca3abe
...@@ -1141,22 +1141,32 @@ double WTriangleMesh::calcAngleBetweenNormalizedVectors( osg::Vec3 const& v1, os ...@@ -1141,22 +1141,32 @@ double WTriangleMesh::calcAngleBetweenNormalizedVectors( osg::Vec3 const& v1, os
return acos( temp ); return acos( temp );
} }
double WTriangleMesh::getMainCurvature( std::size_t vtxId ) double WTriangleMesh::getMainCurvature( std::size_t vtxId ) const
{ {
return m_mainNormalCurvature->operator[] ( vtxId ); 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 ); 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 ); 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 ); return m_secondaryCurvaturePrincipalDirection->operator[] ( vtxId );
} }
......
...@@ -414,7 +414,7 @@ public: ...@@ -414,7 +414,7 @@ public:
* *
* \return The estimated main normal curvature. * \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. * Retreive the secondary (minimum) curvature of a vertex.
...@@ -423,7 +423,21 @@ public: ...@@ -423,7 +423,21 @@ public:
* *
* \return The estimated secondary normal curvature. * \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. * Retreive the 3d principal direction of curvature of a vertex.
...@@ -432,7 +446,7 @@ public: ...@@ -432,7 +446,7 @@ public:
* *
* \return The first principal duirection. * \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. * Retreive the 3d principal direction of curvature for the minimum normal curvature of a vertex.
...@@ -441,7 +455,7 @@ public: ...@@ -441,7 +455,7 @@ public:
* *
* \return The second principal duirection. * \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. * Retreive the array of principal directions e.g. for use as texture coords.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment