From 26875c965d29a97aac18ae68964ef328b119aba5 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 6 Nov 2002 10:46:34 +0000 Subject: [PATCH] Renamed ProceduralGeometry to ShapeDrawable to better reflect its current purpose. --- VisualStudio/osg/osg.dsp | 4 +-- .../osg/{ProceduralGeometry => ShapeDrawable} | 32 +++++++++---------- src/Demos/osgshape/osgshape.cpp | 14 ++++---- src/osg/Makefile | 2 +- ...oceduralGeometry.cpp => ShapeDrawable.cpp} | 20 ++++++------ 5 files changed, 36 insertions(+), 36 deletions(-) rename include/osg/{ProceduralGeometry => ShapeDrawable} (80%) rename src/osg/{ProceduralGeometry.cpp => ShapeDrawable.cpp} (98%) diff --git a/VisualStudio/osg/osg.dsp b/VisualStudio/osg/osg.dsp index 3423d1b49..1ccf2c34e 100755 --- a/VisualStudio/osg/osg.dsp +++ b/VisualStudio/osg/osg.dsp @@ -333,7 +333,7 @@ SOURCE=..\..\src\osg\Projection.cpp # End Source File # Begin Source File -SOURCE=..\..\src\osg\ProceduralGeometry.cpp +SOURCE=..\..\src\osg\ShapeDrawable.cpp # End Source File # Begin Source File @@ -713,7 +713,7 @@ SOURCE=..\..\Include\Osg\Projection # End Source File # Begin Source File -SOURCE=..\..\Include\osg\ProceduralGeometry +SOURCE=..\..\Include\osg\ShapeDrawable # End Source File # Begin Source File diff --git a/include/osg/ProceduralGeometry b/include/osg/ShapeDrawable similarity index 80% rename from include/osg/ProceduralGeometry rename to include/osg/ShapeDrawable index 463c7859b..e36665b97 100644 --- a/include/osg/ProceduralGeometry +++ b/include/osg/ShapeDrawable @@ -2,8 +2,8 @@ //Distributed under the terms of the GNU Library General Public License (LGPL) //as published by the Free Software Foundation. -#ifndef OSG_ProceduralGeometry -#define OSG_ProceduralGeometry 1 +#ifndef OSG_SHAPEDRAWABLE +#define OSG_SHAPEDRAWABLE 1 #include #include @@ -97,22 +97,22 @@ class TessellationHints : public Object }; -class SG_EXPORT ProceduralGeometry : public Drawable +class SG_EXPORT ShapeDrawable : public Drawable { public: - ProceduralGeometry(); + ShapeDrawable(); - ProceduralGeometry(Shape* shape); + ShapeDrawable(Shape* shape); /** Copy constructor using CopyOp to manage deep vs shallow copy.*/ - ProceduralGeometry(const ProceduralGeometry& pg,const CopyOp& copyop=CopyOp::SHALLOW_COPY); + ShapeDrawable(const ShapeDrawable& pg,const CopyOp& copyop=CopyOp::SHALLOW_COPY); - virtual Object* cloneType() const { return osgNew ProceduralGeometry(); } - virtual Object* clone(const CopyOp& copyop) const { return osgNew ProceduralGeometry(*this,copyop); } - virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } + virtual Object* cloneType() const { return osgNew ShapeDrawable(); } + virtual Object* clone(const CopyOp& copyop) const { return osgNew ShapeDrawable(*this,copyop); } + virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } virtual const char* libraryName() const { return "osg"; } - virtual const char* className() const { return "ProceduralGeometry"; } + virtual const char* className() const { return "ShapeDrawable"; } void setTessellationHints(TessellationHints* hints) { _tessellationHints = hints; } @@ -120,22 +120,22 @@ class SG_EXPORT ProceduralGeometry : public Drawable const TessellationHints* getTessellationHints() const { return _tessellationHints.get(); } - /** draw ProceduralGeometry directly ignoring an OpenGL display list which could be attached. + /** draw ShapeDrawable directly ignoring an OpenGL display list which could be attached. * This is the internal draw method which does the drawing itself, - * and is the method to override when deriving from ProceduralGeometry for user-drawn objects. + * and is the method to override when deriving from ShapeDrawable for user-drawn objects. */ virtual void drawImmediateMode(State& state); /** return false, osg::ProceduralGeoemtry does not support accept(AttributeFunctor&).*/ virtual bool supports(AttributeFunctor&) const { return false; } - /** return true, osg::ProceduralGeometry does support accept(ConstAttributeFunctor&).*/ + /** return true, osg::ShapeDrawable does support accept(ConstAttributeFunctor&).*/ virtual bool supports(ConstAttributeFunctor&) const { return true; } /** accept an ConstAttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has.*/ virtual void accept(ConstAttributeFunctor& af) const; - /** return true, osg::ProceduralGeometry does support accept(PrimitiveFunctor&) .*/ + /** return true, osg::ShapeDrawable does support accept(PrimitiveFunctor&) .*/ virtual bool supports(PrimitiveFunctor&) const { return true; } /** accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has.*/ @@ -143,9 +143,9 @@ class SG_EXPORT ProceduralGeometry : public Drawable protected: - ProceduralGeometry& operator = (const ProceduralGeometry&) { return *this;} + ShapeDrawable& operator = (const ShapeDrawable&) { return *this;} - virtual ~ProceduralGeometry(); + virtual ~ShapeDrawable(); virtual bool computeBound() const; diff --git a/src/Demos/osgshape/osgshape.cpp b/src/Demos/osgshape/osgshape.cpp index 4110f9f10..4c1d839cd 100644 --- a/src/Demos/osgshape/osgshape.cpp +++ b/src/Demos/osgshape/osgshape.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include @@ -37,10 +37,10 @@ osg::Geode* createShapes() float radius = 0.8f; float height = 1.0f; - geode->addDrawable(new osg::ProceduralGeometry(osgNew osg::Sphere(osg::Vec3(0.0f,0.0f,0.0f),radius))); - geode->addDrawable(new osg::ProceduralGeometry(osgNew osg::Box(osg::Vec3(2.0f,0.0f,0.0f),2*radius))); - geode->addDrawable(new osg::ProceduralGeometry(osgNew osg::Cone(osg::Vec3(4.0f,0.0f,0.0f),radius,height))); - geode->addDrawable(new osg::ProceduralGeometry(osgNew osg::Cylinder(osg::Vec3(6.0f,0.0f,0.0f),radius,height))); + geode->addDrawable(new osg::ShapeDrawable(osgNew osg::Sphere(osg::Vec3(0.0f,0.0f,0.0f),radius))); + geode->addDrawable(new osg::ShapeDrawable(osgNew osg::Box(osg::Vec3(2.0f,0.0f,0.0f),2*radius))); + geode->addDrawable(new osg::ShapeDrawable(osgNew osg::Cone(osg::Vec3(4.0f,0.0f,0.0f),radius,height))); + geode->addDrawable(new osg::ShapeDrawable(osgNew osg::Cylinder(osg::Vec3(6.0f,0.0f,0.0f),radius,height))); osg::Grid* grid = new osg::Grid; grid->allocateGrid(38,39); @@ -54,7 +54,7 @@ osg::Geode* createShapes() grid->setHeight(c,r,vertex[r+c*39][2]); } } - geode->addDrawable(new osg::ProceduralGeometry(grid)); + geode->addDrawable(new osg::ShapeDrawable(grid)); osg::ConvexHull* mesh = new osg::ConvexHull; osg::Vec3Array* vertices = new osg::Vec3Array(4); @@ -77,7 +77,7 @@ osg::Geode* createShapes() (*indices)[11]=3; mesh->setVertices(vertices); mesh->setIndices(indices); - geode->addDrawable(new osg::ProceduralGeometry(mesh)); + geode->addDrawable(new osg::ShapeDrawable(mesh)); return geode; } diff --git a/src/osg/Makefile b/src/osg/Makefile index e699146b5..84e327c4a 100644 --- a/src/osg/Makefile +++ b/src/osg/Makefile @@ -62,13 +62,13 @@ CXXFILES =\ PolygonStipple.cpp\ PositionAttitudeTransform.cpp\ PrimitiveSet.cpp\ - ProceduralGeometry.cpp\ Projection.cpp\ Quat.cpp\ Sequence.cpp\ ShadeModel.cpp\ ShadowVolumeOccluder.cpp\ Shape.cpp\ + ShapeDrawable.cpp\ State.cpp\ StateSet.cpp\ Stencil.cpp\ diff --git a/src/osg/ProceduralGeometry.cpp b/src/osg/ShapeDrawable.cpp similarity index 98% rename from src/osg/ProceduralGeometry.cpp rename to src/osg/ShapeDrawable.cpp index d945f4944..5c0ceb10c 100644 --- a/src/osg/ProceduralGeometry.cpp +++ b/src/osg/ShapeDrawable.cpp @@ -1,4 +1,4 @@ -#include +#include #include using namespace osg; @@ -1229,29 +1229,29 @@ void PrimitiveShapeVisitor::apply(const CompositeShape& group) /////////////////////////////////////////////////////////////////////////////// // -// ProceduralGeometry itself.. +// ShapeDrawable itself.. // -ProceduralGeometry::ProceduralGeometry() +ShapeDrawable::ShapeDrawable() { } -ProceduralGeometry::ProceduralGeometry(Shape* shape) +ShapeDrawable::ShapeDrawable(Shape* shape) { setShape(shape); } -ProceduralGeometry::ProceduralGeometry(const ProceduralGeometry& pg,const CopyOp& copyop): +ShapeDrawable::ShapeDrawable(const ShapeDrawable& pg,const CopyOp& copyop): Drawable(pg,copyop) { } -ProceduralGeometry::~ProceduralGeometry() +ShapeDrawable::~ShapeDrawable() { } -void ProceduralGeometry::drawImmediateMode(State& state) +void ShapeDrawable::drawImmediateMode(State& state) { if (_shape.valid()) { @@ -1260,11 +1260,11 @@ void ProceduralGeometry::drawImmediateMode(State& state) } } -void ProceduralGeometry::accept(ConstAttributeFunctor&) const +void ShapeDrawable::accept(ConstAttributeFunctor&) const { } -void ProceduralGeometry::accept(PrimitiveFunctor& pf) const +void ShapeDrawable::accept(PrimitiveFunctor& pf) const { if (_shape.valid()) { @@ -1274,7 +1274,7 @@ void ProceduralGeometry::accept(PrimitiveFunctor& pf) const } -bool ProceduralGeometry::computeBound() const +bool ShapeDrawable::computeBound() const { if (_shape.valid())