Removed the template versions of the PrimitiveSet constructors as this was

causing problem under VisualStudio6.0.
This commit is contained in:
Robert Osfield
2003-01-15 11:29:30 +00:00
parent 64efc8ecbb
commit d542a2165d
3 changed files with 23 additions and 15 deletions

View File

@@ -233,12 +233,12 @@ class SG_EXPORT DrawArrayLengths : public PrimitiveSet, public VectorSizei
VectorSizei(no),
_first(first) {}
template <class InputIterator>
DrawArrayLengths(GLenum mode, GLint first, InputIterator firstItr,InputIterator lastItr) :
DrawArrayLengths(GLenum mode,GLint first) :
PrimitiveSet(DrawArrayLengthsPrimitiveType,mode),
VectorSizei(firstItr,lastItr),
VectorSizei(),
_first(first) {}
virtual Object* cloneType() const { return new DrawArrayLengths(); }
virtual Object* clone(const CopyOp& copyop) const { return new DrawArrayLengths(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawArrayLengths*>(obj)!=NULL; }
@@ -301,11 +301,6 @@ class SG_EXPORT DrawElementsUByte : public PrimitiveSet, public VectorUByte
PrimitiveSet(DrawElementsUBytePrimitiveType,mode),
VectorUByte(no) {}
template <class InputIterator>
DrawElementsUByte(GLenum mode, InputIterator first,InputIterator last) :
PrimitiveSet(DrawElementsUBytePrimitiveType,mode),
VectorUByte(first,last) {}
virtual Object* cloneType() const { return new DrawElementsUByte(); }
virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUByte(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawElementsUByte*>(obj)!=NULL; }
@@ -388,11 +383,6 @@ class SG_EXPORT DrawElementsUInt : public PrimitiveSet, public VectorUInt
PrimitiveSet(DrawElementsUIntPrimitiveType,mode),
VectorUInt(no) {}
template <class InputIterator>
DrawElementsUInt(GLenum mode, InputIterator first,InputIterator last) :
PrimitiveSet(DrawElementsUIntPrimitiveType,mode),
VectorUInt(first,last) {}
virtual Object* cloneType() const { return new DrawElementsUInt(); }
virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUInt(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawElementsUInt*>(obj)!=NULL; }

View File

@@ -1176,7 +1176,9 @@ Geometry* GeoSet::convertToGeometry()
if (_needprimlen)
{
geom->addPrimitiveSet(new DrawArrayLengths((GLenum)_oglprimtype,0, _primLengths, _primLengths+_numprims ));
DrawArrayLengths* primitives = new DrawArrayLengths((GLenum)_oglprimtype);
primitives->insert(primitives->end(), _primLengths, _primLengths+_numprims );
geom->addPrimitiveSet(primitives);
}
else
{

View File

@@ -37,6 +37,21 @@ struct TriangleAcumulatorFunctor
void TriStripVisitor::stripify(Geometry& geom)
{
if (geom.getNormalBinding()==osg::Geometry::BIND_PER_PRIMITIVE ||
geom.getNormalBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return;
if (geom.getColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE ||
geom.getColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return;
if (geom.getSecondaryColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE ||
geom.getSecondaryColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return;
if (geom.getFogCoordBinding()==osg::Geometry::BIND_PER_PRIMITIVE ||
geom.getFogCoordBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return;
unsigned int numSurfacePrimitives = 0;
unsigned int numNonSurfacePrimitives = 0;
@@ -118,7 +133,8 @@ void TriStripVisitor::stripify(Geometry& geom)
itr!=outPrimitives.end();
++itr)
{
osg::DrawElementsUShort* elements = new osg::DrawElementsUShort(itr->m_Type,itr->m_Indices.begin(),itr->m_Indices.end());
osg::DrawElementsUShort* elements = new osg::DrawElementsUShort(itr->m_Type);
elements->insert(elements->end(),itr->m_Indices.begin(),itr->m_Indices.end());
new_primitives.push_back(elements);
}