From Mike Garrity, "There was an on again/off again thread on OSG users about

creating subclasses of osg::Array that referenced data
stored an application's internal data structures. I took
a stab at implementing that and ran into a couple of
downcasts in Geometry.cpp. Enclosed is my take at fixing
those along with a simple example of how to do this."
This commit is contained in:
Robert Osfield
2007-12-11 15:55:02 +00:00
parent 669e86145c
commit be5f709bdb
6 changed files with 451 additions and 85 deletions

View File

@@ -229,6 +229,8 @@ class TemplateArray : public Array, public std::vector<T>
virtual unsigned int getTotalDataSize() const { return this->size()*sizeof(T); }
virtual unsigned int getNumElements() const { return this->size(); }
typedef T ElementDataType; // expose T
protected:
virtual ~TemplateArray() {}
@@ -315,6 +317,8 @@ class TemplateIndexArray : public IndexArray, public std::vector<T>
virtual unsigned int index(unsigned int pos) const { return (*this)[pos]; }
typedef T ElementDataType; // expose T
protected:
virtual ~TemplateIndexArray() {}