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:
@@ -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() {}
|
||||
|
||||
Reference in New Issue
Block a user