Fixes to Doxygen files from Neil.
Removed unused set/getReportMode() methods and member variables from IntersectVisitor. Added deep copy construction of Geometry objects.
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#include <osg/StateSet>
|
||||
#include <osg/Texture>
|
||||
#include <osg/Drawable>
|
||||
#include <osg/Array>
|
||||
#include <osg/Primitive>
|
||||
|
||||
using namespace osg;
|
||||
|
||||
@@ -72,3 +74,19 @@ Image* CopyOp::operator() (const Image* image) const
|
||||
return dynamic_cast<Image*>(image->clone(*this));
|
||||
else return const_cast<Image*>(image);
|
||||
}
|
||||
|
||||
Array* CopyOp::operator() (const Array* array) const
|
||||
{
|
||||
if (array && _flags&DEEP_COPY_ARRAYS)
|
||||
return dynamic_cast<Array*>(array->clone(*this));
|
||||
else
|
||||
return const_cast<Array*>(array);
|
||||
}
|
||||
|
||||
Primitive* CopyOp::operator() (const Primitive* primitive) const
|
||||
{
|
||||
if (primitive && _flags&DEEP_COPY_PRIMITIVES)
|
||||
return dynamic_cast<Primitive*>(primitive->clone(*this));
|
||||
else
|
||||
return const_cast<Primitive*>(primitive);
|
||||
}
|
||||
|
||||
@@ -11,14 +11,26 @@ Geometry::Geometry()
|
||||
|
||||
Geometry::Geometry(const Geometry& geometry,const CopyOp& copyop):
|
||||
Drawable(geometry,copyop),
|
||||
_primitives(geometry._primitives),
|
||||
_vertexArray(geometry._vertexArray),
|
||||
_vertexArray(dynamic_cast<Vec3Array*>(copyop(geometry._vertexArray.get()))),
|
||||
_normalBinding(geometry._normalBinding),
|
||||
_normalArray(geometry._normalArray),
|
||||
_normalArray(dynamic_cast<Vec3Array*>(copyop(geometry._normalArray.get()))),
|
||||
_colorBinding(geometry._colorBinding),
|
||||
_colorArray(geometry._colorArray),
|
||||
_texCoordList(geometry._texCoordList)
|
||||
_colorArray(copyop(geometry._colorArray.get()))
|
||||
{
|
||||
for(PrimitiveList::const_iterator pitr=geometry._primitives.begin();
|
||||
pitr!=geometry._primitives.end();
|
||||
++pitr)
|
||||
{
|
||||
Primitive* primitive = copyop(pitr->get());
|
||||
if (primitive) _primitives.push_back(primitive);
|
||||
}
|
||||
|
||||
for(TexCoordArrayList::const_iterator titr=geometry._texCoordList.begin();
|
||||
titr!=geometry._texCoordList.end();
|
||||
++titr)
|
||||
{
|
||||
_texCoordList.push_back(copyop(titr->get()));
|
||||
}
|
||||
}
|
||||
|
||||
Geometry::~Geometry()
|
||||
|
||||
@@ -140,13 +140,13 @@ IntersectVisitor::IntersectVisitor()
|
||||
{
|
||||
// overide the default node visitor mode.
|
||||
setTraversalMode(NodeVisitor::TRAVERSE_ACTIVE_CHILDREN);
|
||||
|
||||
reset();
|
||||
}
|
||||
|
||||
|
||||
IntersectVisitor::~IntersectVisitor()
|
||||
{
|
||||
_hitReportingMode = ONLY_NEAREST_HIT;
|
||||
}
|
||||
|
||||
|
||||
@@ -476,6 +476,7 @@ bool IntersectVisitor::intersect(Drawable& drawable)
|
||||
hit._intersectNormal = thitr->second.second;
|
||||
|
||||
_segHitList[sitr->first.get()].push_back(hit);
|
||||
|
||||
std::sort(_segHitList[sitr->first.get()].begin(),_segHitList[sitr->first.get()].end());
|
||||
|
||||
hitFlag = true;
|
||||
|
||||
Reference in New Issue
Block a user