Fix constness issues of new getSelector method

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3716 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2011-05-11 09:11:03 +00:00
parent c61e99a740
commit 5eaa187004
7 changed files with 50 additions and 1 deletions

View File

@ -114,6 +114,11 @@ public:
*/
virtual const u32 getSelectorCount() const = 0;
//! Get TriangleSelector based on index based on getSelectorCount
/** Only useful for MetaTriangleSelector, others return 'this' or 0
*/
virtual ITriangleSelector* getSelector(u32 index) = 0;
//! Get TriangleSelector based on index based on getSelectorCount
/** Only useful for MetaTriangleSelector, others return 'this' or 0
*/

View File

@ -161,12 +161,23 @@ const u32 CMetaTriangleSelector::getSelectorCount() const
}
/* Returns the TriangleSelector based on index based on getSelectorCount
Only useful for MetaTriangleSelector others return 'this'
*/
ITriangleSelector* CMetaTriangleSelector::getSelector(u32 index)
{
if (index >= TriangleSelectors.size())
return 0;
return TriangleSelectors[index];
}
/* Returns the TriangleSelector based on index based on getSelectorCount
Only useful for MetaTriangleSelector others return 'this'
*/
const ITriangleSelector* CMetaTriangleSelector::getSelector(u32 index) const
{
if(index >= TriangleSelectors.size())
if (index >= TriangleSelectors.size())
return 0;
return TriangleSelectors[index];
}

View File

@ -57,6 +57,9 @@ public:
// Get the number of TriangleSelectors that are part of this one
virtual const u32 getSelectorCount() const;
// Get the TriangleSelector based on index based on getSelectorCount
virtual ITriangleSelector* getSelector(u32 index);
// Get the TriangleSelector based on index based on getSelectorCount
virtual const ITriangleSelector* getSelector(u32 index) const;

View File

@ -206,6 +206,18 @@ const u32 CTerrainTriangleSelector::getSelectorCount() const
}
/* Get the TriangleSelector based on index based on getSelectorCount.
Only useful for MetaTriangleSelector others return 'this' or 0
*/
ITriangleSelector* CTerrainTriangleSelector::getSelector(u32 index)
{
if (index)
return 0;
else
return this;
}
/* Get the TriangleSelector based on index based on getSelectorCount.
Only useful for MetaTriangleSelector others return 'this' or 0
*/

View File

@ -60,6 +60,9 @@ public:
// Get the number of TriangleSelectors that are part of this one
virtual const u32 getSelectorCount() const;
// Get the TriangleSelector based on index based on getSelectorCount
virtual ITriangleSelector* getSelector(u32 index);
// Get the TriangleSelector based on index based on getSelectorCount
virtual const ITriangleSelector* getSelector(u32 index) const;

View File

@ -240,6 +240,18 @@ const u32 CTriangleSelector::getSelectorCount() const
}
/* Get the TriangleSelector based on index based on getSelectorCount.
Only useful for MetaTriangleSelector others return 'this' or 0
*/
ITriangleSelector* CTriangleSelector::getSelector(u32 index)
{
if (index)
return 0;
else
return this;
}
/* Get the TriangleSelector based on index based on getSelectorCount.
Only useful for MetaTriangleSelector others return 'this' or 0
*/

View File

@ -57,6 +57,9 @@ public:
// Get the number of TriangleSelectors that are part of this one
virtual const u32 getSelectorCount() const;
// Get the TriangleSelector based on index based on getSelectorCount
virtual ITriangleSelector* getSelector(u32 index);
// Get the TriangleSelector based on index based on getSelectorCount
virtual const ITriangleSelector* getSelector(u32 index) const;