Commit 1d0c1a5e authored by Jan Möbius's avatar Jan Möbius
Browse files

Made some more drawmode functions const

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12633 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 1ed0b4ca
......@@ -146,7 +146,7 @@ DrawMode::DrawMode( ModeFlagSet _flags ) {
modeFlags_ = _flags;
}
DrawMode::operator bool() {
DrawMode::operator bool() const {
return( modeFlags_ != NONE.modeFlags_ );
}
......@@ -210,7 +210,7 @@ DrawMode DrawMode::operator~( ) const {
unsigned int DrawMode::getIndex() {
unsigned int DrawMode::getIndex() const {
if ( modeFlags_.count() == 1 ) {
for ( size_t i = 0 ; i < modeFlags_.size() ; ++i )
if ( modeFlags_[i] )
......@@ -220,11 +220,11 @@ unsigned int DrawMode::getIndex() {
return 0;
}
std::string DrawMode::description()
std::string DrawMode::description() const
{
std::string text("");
VecDrawModes::iterator modeIter, modeEnd( currentDrawModes_.end() );
VecDrawModes::const_iterator modeIter, modeEnd( currentDrawModes_.end() );
for( modeIter = currentDrawModes_.begin(); modeIter != modeEnd; ++modeIter )
{
if( (*this) & modeIter->id_ )
......@@ -240,11 +240,11 @@ std::string DrawMode::description()
//----------------------------------------------------------------------------
std::vector< DrawMode >
DrawMode::getAtomicDrawModes( )
DrawMode::getAtomicDrawModes() const
{
std::vector< DrawMode > draw_mode_ids;
VecDrawModes::iterator modeIter, modeEnd( currentDrawModes_.end() );
VecDrawModes::const_iterator modeIter, modeEnd( currentDrawModes_.end() );
for( modeIter = currentDrawModes_.begin();
modeIter != modeEnd;
++modeIter )
......@@ -272,7 +272,7 @@ DrawMode::containsAtomicDrawMode( DrawMode _atomicDrawMode) const
//----------------------------------------------------------------------------
unsigned int DrawMode::maxModes() {
unsigned int DrawMode::maxModes() const {
return (modeFlags_.size() );
}
......
......@@ -138,13 +138,13 @@ namespace DrawModes {
* If this drawMode is a combination of different drawModes, the returned value will be 0.
* Otherwise the internal flag index will be returned
*/
unsigned int getIndex();
unsigned int getIndex() const;
/** Get a description string for this DrawMode
* An empty string is returned if this is not a valid draw mode.
* this list has the format DrawModeName+DrawMOdeName+...
*/
std::string description();
std::string description() const;
/** \brief Check if this is an atomic draw Mode
*
......@@ -158,17 +158,17 @@ namespace DrawModes {
/** \brief Seperates this drawMode into a list of all seperate atomic drawmodes
*
* A drawMOde can consist of several atomic drawmodes. This function returns a list of the seperated
* A drawMode can consist of several atomic drawmodes. This function returns a list of the seperated
* atomic drawmodes.
*/
std::vector< DrawMode > getAtomicDrawModes();
std::vector< DrawMode > getAtomicDrawModes() const;
/** \brief Get the number of maximum Modes which could be handled by the current implementation
*
*/
unsigned int maxModes();
unsigned int maxModes() const;
operator bool();
operator bool() const;
private:
ModeFlagSet modeFlags_;
......
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