Commit 170f8bcc authored by Dominik Sibbing's avatar Dominik Sibbing
Browse files

function bool getDrawModeId( const std::string & _name, unsigned int & _Id ) added.

MeshNodeT.cc: #include <OpenMesh/Core/Utils/Property.hh> added.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5700 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f4ec58a0
......@@ -234,6 +234,29 @@ bool addDrawMode( const std::string & _name, unsigned int & _newId )
}
//----------------------------------------------------------------------------
bool getDrawModeId( const std::string & _name, unsigned int & _Id )
{
// check if mode exists
VecDrawModes::iterator modeIter, modeEnd( currentDrawModes_.end() );
for( modeIter = currentDrawModes_.begin();
modeIter != modeEnd;
++modeIter )
{
if( _name == modeIter->name_ )
{
_Id = modeIter->id_;
return true;
}
}
// the DrawMode does not exists
return false;
}
//=============================================================================
} // namespace DrawModes
......
......@@ -171,6 +171,14 @@ namespace DrawModes {
bool addDrawMode( const std::string & _name, unsigned int & _newId );
/** Get the Id of a DrawMode.
The Id of the DrawMode with name \c _name is returned in variable \c _Id.
Returns false if the DrawMode could not been found.
*/
ACGDLLEXPORT
bool getDrawModeId( const std::string & _name, unsigned int & _Id );
/** Get all draw mode IDs that are encoded in _drawMode
*/
ACGDLLEXPORT
......
......@@ -50,7 +50,7 @@
#include "../GL/ColorTranslator.hh"
#include <OpenMesh/Core/System/omstream.hh>
#include <OpenMesh/Core/Utils/Property.hh>
//== NAMESPACES ==============================================================
......
Supports Markdown
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