diff --git a/NEWS.txt b/NEWS.txt index 39fc06d40..9ea4510e1 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -360,7 +360,7 @@ Andes Engineering - http://www.andesengineering.com osgbluemarble an example of how to build PagedLOD database for paging imagery - osgtesselate - an example of how to use osgUtil::Tesselate to + osgtessellate an example of how to use osgUtil::Tesselate to tessellate polygonal boundaries osgsimulation an example of how to use various features in osgSim. diff --git a/include/osg/ShapeDrawable b/include/osg/ShapeDrawable index 632c7b9f6..3eed9ea81 100644 --- a/include/osg/ShapeDrawable +++ b/include/osg/ShapeDrawable @@ -23,7 +23,7 @@ namespace osg { -/** Describe several hints that can be passed to a tesselator (like the one used +/** Describe several hints that can be passed to a Tessellator (like the one used * by \c ShapeDrawable) as a mean to try to influence the way it works. */ class TessellationHints : public Object diff --git a/include/osgSim/OpenFlightOptimizer b/include/osgSim/OpenFlightOptimizer index 406863e32..637827135 100644 --- a/include/osgSim/OpenFlightOptimizer +++ b/include/osgSim/OpenFlightOptimizer @@ -38,11 +38,11 @@ class OSGSIM_EXPORT Optimizer enum OptimizationOptions { - TESSELATE_POLYGON = 0x001, + TESSELLATE_POLYGON = 0x001, MERGE_GEODES = 0x002, MAKE_LIT = 0x004, - DEFAULT_OPTIMIZATIONS = TESSELATE_POLYGON | MERGE_GEODES, - ALL_OPTIMIZATIONS = TESSELATE_POLYGON | MERGE_GEODES + DEFAULT_OPTIMIZATIONS = TESSELLATE_POLYGON | MERGE_GEODES, + ALL_OPTIMIZATIONS = TESSELLATE_POLYGON | MERGE_GEODES }; @@ -59,12 +59,12 @@ class OSGSIM_EXPORT Optimizer public: - class OSGSIM_EXPORT TesselateVisitor : public osg::NodeVisitor + class OSGSIM_EXPORT TessellateVisitor : public osg::NodeVisitor { public: /// default to traversing all children. - TesselateVisitor() : + TessellateVisitor() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {} virtual void apply(osg::Geode& geode); diff --git a/include/osgUtil/DelaunayTriangulator b/include/osgUtil/DelaunayTriangulator index 21d60289c..0ad377030 100644 --- a/include/osgUtil/DelaunayTriangulator +++ b/include/osgUtil/DelaunayTriangulator @@ -73,7 +73,7 @@ public: /** Add vertices and constraint loops from dco * Can be used to generate extra vertices where dco crosses 'this' using - * osgUtil::tessellator to insert overlap vertices. + * osgUtil::Tessellator to insert overlap vertices. */ void merge(DelaunayConstraint *dco); @@ -89,7 +89,7 @@ public: virtual bool contains(const osg::Vec3 testpoint) const; virtual bool outside(const osg::Vec3 testpoint) const; - /** Tesselate the constraint loops so that the crossing points are interpolated + /** Tessellate the constraint loops so that the crossing points are interpolated * and added to the contraints for the triangulation. */ void handleOverlaps(void); diff --git a/include/osgUtil/IntersectVisitor b/include/osgUtil/IntersectVisitor index 1311f80e6..bf90634c8 100644 --- a/include/osgUtil/IntersectVisitor +++ b/include/osgUtil/IntersectVisitor @@ -35,7 +35,7 @@ class OSGUTIL_EXPORT Hit * A Hit is always on a surface as rendered by the Open Scene Graph scene (usually * a triangle or other primitive, but a special hit handler could return a * different value perhaps: a sphere shape might return a Hit on the true sphere - * rather than the approximate tesselated sphere rendered. + * rather than the approximate tessellated sphere rendered. */ public: diff --git a/include/osgUtil/Optimizer b/include/osgUtil/Optimizer index faced43e4..f2eb113f2 100644 --- a/include/osgUtil/Optimizer +++ b/include/osgUtil/Optimizer @@ -77,7 +77,7 @@ class OSGUTIL_EXPORT Optimizer SPATIALIZE_GROUPS = 0x080, COPY_SHARED_NODES = 0x100, TRISTRIP_GEOMETRY = 0x200, - TESSELATE_GEOMETRY = 0x400, + TESSELLATE_GEOMETRY = 0x400, OPTIMIZE_TEXTURE_SETTINGS = 0x800, MERGE_GEODES = 0x1000, FLATTEN_BILLBOARDS = 0x2000, @@ -353,16 +353,16 @@ class OSGUTIL_EXPORT Optimizer }; - /** Tesselate all geodes, to remove POLYGONS.*/ - class OSGUTIL_EXPORT TesselateVisitor : public BaseOptimizerVisitor + /** Tessellate all geodes, to remove POLYGONS.*/ + class OSGUTIL_EXPORT TessellateVisitor : public BaseOptimizerVisitor { public: typedef std::set GroupList; GroupList _groupList; - TesselateVisitor(Optimizer* optimizer=0): - BaseOptimizerVisitor(optimizer, TESSELATE_GEOMETRY) {} + TessellateVisitor(Optimizer* optimizer=0): + BaseOptimizerVisitor(optimizer, TESSELLATE_GEOMETRY) {} virtual void apply(osg::Geode& geode); diff --git a/src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp b/src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp index 957f4f972..d74d63f4f 100644 --- a/src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp +++ b/src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp @@ -240,7 +240,7 @@ class FLTReaderWriter : public ReaderWriter if (!document.getPreserveFace()) { osgUtil::Optimizer optimizer; - optimizer.optimize(document.getHeaderNode(), osgUtil::Optimizer::SHARE_DUPLICATE_STATE | osgUtil::Optimizer::MERGE_GEOMETRY | osgUtil::Optimizer::MERGE_GEODES | osgUtil::Optimizer::TESSELATE_GEOMETRY ); + optimizer.optimize(document.getHeaderNode(), osgUtil::Optimizer::SHARE_DUPLICATE_STATE | osgUtil::Optimizer::MERGE_GEOMETRY | osgUtil::Optimizer::MERGE_GEODES | osgUtil::Optimizer::TESSELLATE_GEOMETRY ); } return document.getHeaderNode(); diff --git a/src/osgPlugins/ac3d/ac3d.cpp b/src/osgPlugins/ac3d/ac3d.cpp index 78b8b24a6..64e095020 100644 --- a/src/osgPlugins/ac3d/ac3d.cpp +++ b/src/osgPlugins/ac3d/ac3d.cpp @@ -735,7 +735,7 @@ class SurfaceBin : public PrimitiveBin { std::vector index; }; std::vector _polygons; - std::vector _toTesselatePolygons; + std::vector _toTessellatePolygons; public: SurfaceBin(unsigned flags, VertexSet *vertexSet) : @@ -768,7 +768,7 @@ class SurfaceBin : public PrimitiveBin { // Compute the normal times the enclosed area. // During that check if the surface is convex. If so, put in the surface as such. - bool needTesselation = false; + bool needTessellation = false; osg::Vec3 prevEdgeNormal; osg::Vec3 weightedNormal(0, 0, 0); osg::Vec3 v0 = _vertexSet->getVertex(_refs[0].index); @@ -776,11 +776,11 @@ class SurfaceBin : public PrimitiveBin { osg::Vec3 side1 = _vertexSet->getVertex(_refs[i-1].index) - v0; osg::Vec3 side2 = _vertexSet->getVertex(_refs[i].index) - v0; osg::Vec3 newNormal = side1^side2; - if (!needTesselation) + if (!needTessellation) { if (3 < nRefs && newNormal*weightedNormal < 0) { - needTesselation = true; + needTessellation = true; } if (i < 3) { @@ -793,7 +793,7 @@ class SurfaceBin : public PrimitiveBin { osg::Vec3 edgeNormal = sideim1^sidei; if (edgeNormal*prevEdgeNormal < 0) { - needTesselation = true; + needTessellation = true; } prevEdgeNormal = edgeNormal; } @@ -802,14 +802,14 @@ class SurfaceBin : public PrimitiveBin { weightedNormal += newNormal; } - if (needTesselation) + if (needTessellation) { - unsigned polygonIndex = _toTesselatePolygons.size(); - _toTesselatePolygons.resize(polygonIndex + 1); + unsigned polygonIndex = _toTessellatePolygons.size(); + _toTessellatePolygons.resize(polygonIndex + 1); for (unsigned i = 0; i < nRefs; ++i) { RefData refData(weightedNormal, _refs[i].texCoord, isSmooth()); VertexIndex vertexIndex = _vertexSet->addRefData(_refs[i].index, refData); - _toTesselatePolygons[polygonIndex].index.push_back(vertexIndex); + _toTessellatePolygons[polygonIndex].index.push_back(vertexIndex); } } else if (nRefs == 3) @@ -888,23 +888,23 @@ class SurfaceBin : public PrimitiveBin { _geometry->setVertexArray(vertexArray); _geometry->setTexCoordArray(0, texcoordArray); - // At first handle the the polygons to tesselate, fix them and append the other polygons later - if (!_toTesselatePolygons.empty()) + // At first handle the the polygons to tessellate, fix them and append the other polygons later + if (!_toTessellatePolygons.empty()) { - for (unsigned i = 0; i < _toTesselatePolygons.size(); ++i) + for (unsigned i = 0; i < _toTessellatePolygons.size(); ++i) { unsigned start = vertexArray->size(); - for (unsigned j = 0; j < _toTesselatePolygons[i].index.size(); ++j) + for (unsigned j = 0; j < _toTessellatePolygons[i].index.size(); ++j) { - pushVertex(_toTesselatePolygons[i].index[j], vertexArray, normalArray, texcoordArray); + pushVertex(_toTessellatePolygons[i].index[j], vertexArray, normalArray, texcoordArray); } - unsigned count = _toTesselatePolygons[i].index.size(); + unsigned count = _toTessellatePolygons[i].index.size(); osg::DrawArrays* drawArray = new osg::DrawArrays(osg::PrimitiveSet::POLYGON, start, count); _geometry->addPrimitiveSet(drawArray); } - osgUtil::Tessellator tessellator; - tessellator.retessellatePolygons(*_geometry); + osgUtil::Tessellator Tessellator; + Tessellator.retessellatePolygons(*_geometry); } // handle triangles diff --git a/src/osgPlugins/bsp/BSPLoad.cpp b/src/osgPlugins/bsp/BSPLoad.cpp index 368dcc7bf..3dba65457 100644 --- a/src/osgPlugins/bsp/BSPLoad.cpp +++ b/src/osgPlugins/bsp/BSPLoad.cpp @@ -7,7 +7,7 @@ -bool BSPLoad::Load(const std::string& filename, int curveTesselation) +bool BSPLoad::Load(const std::string& filename, int curveTessellation) { std::ifstream file(filename.c_str(),std::ios::binary); if(!file.is_open()) @@ -45,7 +45,7 @@ bool BSPLoad::Load(const std::string& filename, int curveTesselation) //Load in faces - LoadFaces(file, curveTesselation); + LoadFaces(file, curveTessellation); //Load textures LoadTextures(file); @@ -96,7 +96,7 @@ void BSPLoad::LoadVertices(std::ifstream& aFile) -void BSPLoad::LoadFaces(std::ifstream& aFile, int /*curveTesselation*/) +void BSPLoad::LoadFaces(std::ifstream& aFile, int /*curveTessellation*/) { //calculate number of load faces int numTotalFaces=m_header.m_directoryEntries[bspFaces].m_length/sizeof(BSP_LOAD_FACE); diff --git a/src/osgPlugins/bsp/BSPLoad.h b/src/osgPlugins/bsp/BSPLoad.h index ea4a20602..5a3dbc242 100644 --- a/src/osgPlugins/bsp/BSPLoad.h +++ b/src/osgPlugins/bsp/BSPLoad.h @@ -174,9 +174,9 @@ class BSPLoad { public: - bool Load(const std::string& filename, int curveTesselation); + bool Load(const std::string& filename, int curveTessellation); void LoadVertices(std::ifstream& aFile); - void LoadFaces(std::ifstream& aFile, int curveTesselation); + void LoadFaces(std::ifstream& aFile, int curveTessellation); void LoadTextures(std::ifstream& aFile); void LoadLightmaps(std::ifstream& aFile); void LoadBSPData(std::ifstream& aFile); diff --git a/src/osgPlugins/bsp/ReaderWriterQ3BSP.cpp b/src/osgPlugins/bsp/ReaderWriterQ3BSP.cpp index a24baf7d2..4129b5a0e 100644 --- a/src/osgPlugins/bsp/ReaderWriterQ3BSP.cpp +++ b/src/osgPlugins/bsp/ReaderWriterQ3BSP.cpp @@ -153,13 +153,13 @@ public: { } - bool Tesselate(int newTesselation,osg::Geometry* aGeometry); + bool Tessellate(int newTessellation,osg::Geometry* aGeometry); BSP_VERTEX m_controlPoints[9]; // Se accede a ellos en la carga protected: - int m_tesselation; + int m_tessellation; std::vector m_vertices; std::vector m_indices; @@ -319,7 +319,7 @@ osg::Geode* ReaderWriterQ3BSP::convertFromBSP(BSPLoad& aLoadData,const osgDB::Re osg::Geometry* patch_geom = new osg::Geometry; - //tesselate the patch + //tessellate the patch osg::StateSet* stateset = patch_geom->getOrCreateStateSet(); if(texture) @@ -334,7 +334,7 @@ osg::Geode* ReaderWriterQ3BSP::convertFromBSP(BSPLoad& aLoadData,const osgDB::Re //patch_group->addChild(map_geode); - current_patch.m_quadraticPatches[y*numPatchesWide+x].Tesselate(8/*aCurveTesselation*/,patch_geom); + current_patch.m_quadraticPatches[y*numPatchesWide+x].Tessellate(8/*aCurveTessellation*/,patch_geom); map_geode->addDrawable(patch_geom); } } @@ -555,27 +555,27 @@ bool ReaderWriterQ3BSP::loadLightMaps(const BSPLoad& aLoadData,std::vectorsetTexCoordArray(1,patch_lmapcoord_array); - for(row=0; rowaddPrimitiveSet(face_indices); diff --git a/src/osgPlugins/dw/ReaderWriterDW.cpp b/src/osgPlugins/dw/ReaderWriterDW.cpp index 881123dc0..64d96fd40 100644 --- a/src/osgPlugins/dw/ReaderWriterDW.cpp +++ b/src/osgPlugins/dw/ReaderWriterDW.cpp @@ -179,7 +179,7 @@ private: int _lightnum; StateSet *dstate; // used to represent the dw material in OSG }; -// structure to use as data for tesselation +// structure to use as data for tessellation typedef struct { double pos[3]; // must be double for the tessellator to detect vertices @@ -327,7 +327,7 @@ public: poses.nrmv=nrm; poses.idx=idx[j]; } - void tesselate(const std::vector verts, const dwmaterial *themat, + void tessellate(const std::vector verts, const dwmaterial *themat, GLUtesselator *ts, _dwobj *dwob, const Matrix *tmat) const; void link(const int idop, const _face *f2, const int idop2,const std::vector verts, const dwmaterial *themat) const; // to join up opposed faces of a hole inline const int getidx(int i) const { return idx[i];} @@ -366,12 +366,12 @@ public: ~prims() { /*delete [] primlengs; delete [] nrms; delete [] gsidx; delete [] nrmidx; delete [] txcoords;*/ } - void addv(avertex *pos) { // tesselation callback + void addv(avertex *pos) { // tessellation callback vertices->push_back(osg::Vec3(pos->pos[0],pos->pos[1],pos->pos[2])); normals->push_back(pos->nrmv); txcoords->push_back(osg::Vec3(pos->uv[0],pos->uv[1],0.0f)); } - void End() { // tesselation is done + void End() { // tessellation is done int nverts=vertices->size()-nbegin; osg::DrawArrays *drw=NULL; switch (primType) { @@ -405,7 +405,7 @@ public: break; } } - void begin(GLenum op) { // part of a tesselator callback - starts a new primitive of type op + void begin(GLenum op) { // part of a Tessellator callback - starts a new primitive of type op primType=op; nbegin=vertices->size(); } @@ -440,10 +440,10 @@ public: drw=new osg::DrawArrays(osg::PrimitiveSet::QUADS,n1,4); gset->addPrimitiveSet(drw); } - void tesselate(_face &fc, const std::vector verts, const dwmaterial *themat,GLUtesselator* ts, _dwobj *dwob) + void tessellate(_face &fc, const std::vector verts, const dwmaterial *themat,GLUtesselator* ts, _dwobj *dwob) { // generates a set of primitives all of one type (eg tris, qstrip trifan...) fc.setNBegin(vertices->size()); - fc.tesselate(verts, themat, ts, dwob, tmat); + fc.tessellate(verts, themat, ts, dwob, tmat); } void buildGeometry() { // at end of all faces, add collection of vertices to geometry gset->setNormalBinding(osg::Geometry::BIND_PER_VERTEX); //BIND_PERPRIM); // @@ -468,9 +468,9 @@ private: const Matrix *tmat; // local texture matrix, or may be NULL for default mapping }; -static prims *prd=NULL; // OK not nice to have a static but the OpenGL tesselator etc wants to be able to refer +static prims *prd=NULL; // OK not nice to have a static but the OpenGL Tessellator etc wants to be able to refer // to things that are not available via an argument -// tesselation subroutines - have 'C' prototypes, not a member of any class... +// tessellation subroutines - have 'C' prototypes, not a member of any class... // But I want ot use the prims class to contain useful information such as texture matrix etc. void CALLBACK myFaceBegin(GLenum op) {// tess 'primitive begins' call back @@ -493,7 +493,7 @@ void CALLBACK combineCallback( GLdouble coords[3], avertex *d[4], void CALLBACK error (GLenum errno) { // tess error code const unsigned char *errm=gluErrorString(errno); - printf("tesselator error %d %s\n", static_cast(errno),errm);//, errm + printf("Tessellator error %d %s\n", static_cast(errno),errm);//, errm } //========== void _face::linkholes(const std::vector verts, const dwmaterial *themat, const _face *f2) const @@ -669,11 +669,11 @@ private: Matrix *mx; // current uvw transform for currently tessealting face }; -void _face::tesselate(const std::vector verts, const dwmaterial *themat, +void _face::tessellate(const std::vector verts, const dwmaterial *themat, GLUtesselator *ts, _dwobj *dwob, const Matrix * /*tmat*/) const { int nvall=getallverts(); int nused=0; - avertex *poses=new avertex[2*nvall]; // passed to tesselator to redraw + avertex *poses=new avertex[2*nvall]; // passed to Tessellator to redraw Matrix mx; // texture matrix transform to plane settrans(mx, nrm, verts,themat); dwob->setmx(&mx); // may be used by combine callback to define txcoord @@ -761,7 +761,7 @@ void _dwobj::buildDrawable(Group *grp, const osgDB::ReaderWriter::Options *optio gluTessCallback(ts, GLU_TESS_COMBINE_DATA, (GLU_TESS_CALLBACK) combineCallback); // for (int nvf=0; nvf<6; nvf++) { // for each length of face // for Geometry we dont need to collect prim types individually - // prd.setmode(nvf , nfnvf); // filter out only this type of tesselated face + // prd.setmode(nvf , nfnvf); // filter out only this type of tessellated face prd=new prims; prd->settmat(tmat); osg::Geometry *gset = new osg::Geometry; @@ -771,9 +771,9 @@ void _dwobj::buildDrawable(Group *grp, const osgDB::ReaderWriter::Options *optio grp->addChild( geode ); // add to the world outside geode->addDrawable(gset); - // each face adds a primitive to the geometry, after it is tesselated + // each face adds a primitive to the geometry, after it is tessellated for (i=0; itesselate(faces[i],verts, themat, ts, this); + prd->tessellate(faces[i],verts, themat, ts, this); } for (i=0; i0 verts.clear(); } -////////// tesselation complete +////////// tessellation complete class ReaderWriterDW : public osgDB::ReaderWriter { diff --git a/src/osgPlugins/flt/GeoSetBuilder.cpp b/src/osgPlugins/flt/GeoSetBuilder.cpp index 2e7e54989..3f8ed6148 100644 --- a/src/osgPlugins/flt/GeoSetBuilder.cpp +++ b/src/osgPlugins/flt/GeoSetBuilder.cpp @@ -321,7 +321,7 @@ osg::Geode* GeoSetBuilder::createOsgGeoSets(osg::Geode* geode) optimizer.optimize(geode, osgUtil::Optimizer::SHARE_DUPLICATE_STATE | osgUtil::Optimizer::MERGE_GEOMETRY | osgUtil::Optimizer::CHECK_GEOMETRY | - osgUtil::Optimizer::TESSELATE_GEOMETRY); + osgUtil::Optimizer::TESSELLATE_GEOMETRY); return geode; } diff --git a/src/osgProducer/GraphicsContextImplementation.cpp b/src/osgProducer/GraphicsContextImplementation.cpp index e504712da..cf500752a 100644 --- a/src/osgProducer/GraphicsContextImplementation.cpp +++ b/src/osgProducer/GraphicsContextImplementation.cpp @@ -263,7 +263,7 @@ bool GraphicsContextImplementation::makeContextCurrentImplementation(osg::Graphi return true; } -bool GraphicsContextImplementation::makeCurrentImplementation() +bool GraphicsContextImplementation::releaseContextImplementation() { osg::notify(osg::NOTICE)<<"GraphicsContextImplementation::makeCurrentImplementation(): not implemented - release not supported under Producer."<accept(visitor); } @@ -77,7 +77,7 @@ void Optimizer::optimize(osg::Node* node, unsigned int options) } -void Optimizer::TesselateVisitor::apply(osg::Geode& geode) +void Optimizer::TessellateVisitor::apply(osg::Geode& geode) { for (unsigned int i=0; i #include #include //GWM July 2005 map is used in constraints. -#include // tesselator triangulates the constrained triangles +#include // Tessellator triangulates the constrained triangles namespace osgUtil { @@ -440,7 +440,7 @@ Triangle_list fillHole(osg::Vec3Array *points, std::vector vind tscx->setTessellationNormal(osg::Vec3(0.0,0.0,1.0)); tscx->setTessellationType(osgUtil::Tessellator::TESS_TYPE_GEOMETRY); tscx->setBoundaryOnly(false); - tscx->setWindingType( osgUtil::Tessellator::TESS_WINDING_ODD); // the commonest tesselation is default, ODD. GE2 allows intersections of constraints to be found. + tscx->setWindingType( osgUtil::Tessellator::TESS_WINDING_ODD); // the commonest tessellation is default, ODD. GE2 allows intersections of constraints to be found. tscx->retessellatePolygons(*(gtess.get())); // this should insert extra vertices where constraints overlap // extract triangles from gtess @@ -862,7 +862,7 @@ bool DelaunayTriangulator::triangulate() // http://www.geom.uiuc.edu/~samuelp/del_project.html // we could also implement the sourcecode in http://gts.sourceforge.net/reference/gts-delaunay-and-constrained-delaunay-triangulations.html // this uses the set of lines which are boundaries of the constraints, including points - // added to the contours by tesselation. + // added to the contours by tessellation. for (linelist::iterator dcitr=constraint_lines.begin();dcitr!=constraint_lines.end();dcitr++) { //DelaunayConstraint *dc=(*dcitr).get(); @@ -911,7 +911,7 @@ bool DelaunayTriangulator::triangulate() // The hole joins vertex ip1 to ip2, and one list of edges lies to the left // of the line ip1-ip2m the other to the right. // a list of vertices forming 2 halves of the removed triangles. - // which in turn are filled in with the tesselator. + // which in turn are filled in with the tessellator. for (titr=triangles.begin(); titr!=triangles.end(); ) { int icut=titr->lineBisects(points_.get(),ip1,p2); @@ -1269,7 +1269,7 @@ osg::Vec3Array* DelaunayConstraint::getPoints(const osg::Vec3Array *points) void DelaunayConstraint::handleOverlaps(void) { - // use tesselator to interpolate crossing vertices. + // use Tessellator to interpolate crossing vertices. osg::ref_ptr tscx=new osgUtil::Tessellator; // this assembles all the constraints tscx->setTessellationType(osgUtil::Tessellator::TESS_TYPE_GEOMETRY); tscx->setBoundaryOnly(true); diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index f676b4f47..e2d28a674 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -47,7 +47,7 @@ void Optimizer::reset() { } -static osg::ApplicationUsageProxy Optimizer_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_OPTIMIZER \" []\"","OFF | DEFAULT | FLATTEN_STATIC_TRANSFORMS | REMOVE_REDUNDANT_NODES | COMBINE_ADJACENT_LODS | SHARE_DUPLICATE_STATE | MERGE_GEOMETRY | MERGE_GEODES | SPATIALIZE_GROUPS | COPY_SHARED_NODES | TRISTRIP_GEOMETRY | OPTIMIZE_TEXTURE_SETTINGS | REMOVE_LOADED_PROXY_NODES | TESSELATE_GEOMETRY | CHECK_GEOMETRY | FLATTEN_BILLBOARDS | TEXTURE_ATLAS_BUILDER"); +static osg::ApplicationUsageProxy Optimizer_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_OPTIMIZER \" []\"","OFF | DEFAULT | FLATTEN_STATIC_TRANSFORMS | REMOVE_REDUNDANT_NODES | COMBINE_ADJACENT_LODS | SHARE_DUPLICATE_STATE | MERGE_GEOMETRY | MERGE_GEODES | SPATIALIZE_GROUPS | COPY_SHARED_NODES | TRISTRIP_GEOMETRY | OPTIMIZE_TEXTURE_SETTINGS | REMOVE_LOADED_PROXY_NODES | TESSELLATE_GEOMETRY | CHECK_GEOMETRY | FLATTEN_BILLBOARDS | TEXTURE_ATLAS_BUILDER"); void Optimizer::optimize(osg::Node* node) { @@ -91,8 +91,8 @@ void Optimizer::optimize(osg::Node* node) if(str.find("~COPY_SHARED_NODES")!=std::string::npos) options ^= COPY_SHARED_NODES; else if(str.find("COPY_SHARED_NODES")!=std::string::npos) options |= COPY_SHARED_NODES; - if(str.find("~TESSELATE_GEOMETRY")!=std::string::npos) options ^= TESSELATE_GEOMETRY; - else if(str.find("TESSELATE_GEOMETRY")!=std::string::npos) options |= TESSELATE_GEOMETRY; + if(str.find("~TESSELLATE_GEOMETRY")!=std::string::npos) options ^= TESSELLATE_GEOMETRY; + else if(str.find("TESSELLATE_GEOMETRY")!=std::string::npos) options |= TESSELLATE_GEOMETRY; if(str.find("~TRISTRIP_GEOMETRY")!=std::string::npos) options ^= TRISTRIP_GEOMETRY; else if(str.find("TRISTRIP_GEOMETRY")!=std::string::npos) options |= TRISTRIP_GEOMETRY; @@ -131,11 +131,11 @@ void Optimizer::optimize(osg::Node* node, unsigned int options) stats.print(osg::notify(osg::NOTICE)); } - if (options & TESSELATE_GEOMETRY) + if (options & TESSELLATE_GEOMETRY) { - osg::notify(osg::INFO)<<"Optimizer::optimize() doing TESSELATE_GEOMETRY"<accept(tsv); } @@ -312,16 +312,16 @@ void Optimizer::optimize(osg::Node* node, unsigned int options) //////////////////////////////////////////////////////////////////////////// -// Tesselate geometry - eg break complex POLYGONS into triangles, strips, fans.. +// Tessellate geometry - eg break complex POLYGONS into triangles, strips, fans.. //////////////////////////////////////////////////////////////////////////// -void Optimizer::TesselateVisitor::apply(osg::Geode& geode) +void Optimizer::TessellateVisitor::apply(osg::Geode& geode) { for(unsigned int i=0;i(geode.getDrawable(i)); if (geom) { - osgUtil::Tessellator tessellator; - tessellator.retessellatePolygons(*geom); + osgUtil::Tessellator Tessellator; + Tessellator.retessellatePolygons(*geom); } } traverse(geode); diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 9f6807f75..73deeac70 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -702,15 +702,11 @@ void Viewer::eventTraversal() { case(osgGA::GUIEventAdapter::CLOSE_WINDOW): { - stopThreading(); + // stopThreading(); gw->close(); - // setThreadingModel(ThreadPerCamera); - - setThreadingModel(SingleThreaded); - - startThreading(); + // startThreading(); break; } diff --git a/src/osgWrappers/osgSim/OpenFlightOptimizer.cpp b/src/osgWrappers/osgSim/OpenFlightOptimizer.cpp index 0b2ae46b1..a982167bb 100644 --- a/src/osgWrappers/osgSim/OpenFlightOptimizer.cpp +++ b/src/osgWrappers/osgSim/OpenFlightOptimizer.cpp @@ -24,7 +24,7 @@ #endif BEGIN_ENUM_REFLECTOR(osgFlightUtil::Optimizer::OptimizationOptions) - I_EnumLabel(osgFlightUtil::Optimizer::TESSELATE_POLYGON); + I_EnumLabel(osgFlightUtil::Optimizer::TESSELLATE_POLYGON); I_EnumLabel(osgFlightUtil::Optimizer::MERGE_GEODES); I_EnumLabel(osgFlightUtil::Optimizer::MAKE_LIT); I_EnumLabel(osgFlightUtil::Optimizer::DEFAULT_OPTIMIZATIONS); @@ -71,9 +71,9 @@ BEGIN_OBJECT_REFLECTOR(osgFlightUtil::Optimizer::MergeGeodesVisitor) ""); END_REFLECTOR -BEGIN_OBJECT_REFLECTOR(osgFlightUtil::Optimizer::TesselateVisitor) +BEGIN_OBJECT_REFLECTOR(osgFlightUtil::Optimizer::TessellateVisitor) I_BaseType(osg::NodeVisitor); - I_Constructor0(____TesselateVisitor, + I_Constructor0(____TessellateVisitor, "default to traversing all children. ", ""); I_Method1(void, apply, IN, osg::Geode &, geode, diff --git a/src/osgWrappers/osgText/Font.cpp b/src/osgWrappers/osgText/Font.cpp index dcee56b06..15539a7b3 100644 --- a/src/osgWrappers/osgText/Font.cpp +++ b/src/osgWrappers/osgText/Font.cpp @@ -154,6 +154,14 @@ BEGIN_OBJECT_REFLECTOR(osgText::Font) __C5_FontImplementation_P1__getImplementation, "", ""); + I_Method1(void, setThreadSafeRefUnref, IN, bool, threadSafe, + __void__setThreadSafeRefUnref__bool, + "Set whether to use a mutex to ensure ref() and unref() are thread safe. ", + ""); + I_Method1(void, resizeGLObjectBuffers, IN, unsigned int, maxSize, + __void__resizeGLObjectBuffers__unsigned_int, + "Resize any per context GLObject buffers to specified size. ", + ""); I_MethodWithDefaults1(void, releaseGLObjects, IN, osg::State *, state, 0, __void__releaseGLObjects__osg_State_P1, "If State is non-zero, this function releases OpenGL objects for the specified graphics context. ", @@ -191,6 +199,9 @@ BEGIN_OBJECT_REFLECTOR(osgText::Font) I_SimpleProperty(unsigned int, TextureWidthHint, __unsigned_int__getTextureWidthHint, 0); + I_SimpleProperty(bool, ThreadSafeRefUnref, + 0, + __void__setThreadSafeRefUnref__bool); END_REFLECTOR BEGIN_ABSTRACT_OBJECT_REFLECTOR(osgText::Font::FontImplementation) @@ -396,9 +407,20 @@ BEGIN_OBJECT_REFLECTOR(osgText::Font::GlyphTexture) __void__apply__osg_State_R1, "Bind the texture object. ", "If the texture object hasn't already been compiled, create the texture mipmap levels. "); + I_Method1(void, setThreadSafeRefUnref, IN, bool, threadSafe, + __void__setThreadSafeRefUnref__bool, + "Set whether to use a mutex to ensure ref() and unref() are thread safe. ", + ""); + I_Method1(void, resizeGLObjectBuffers, IN, unsigned int, maxSize, + __void__resizeGLObjectBuffers__unsigned_int, + "Resize any per context GLObject buffers to specified size. ", + ""); I_SimpleProperty(unsigned int, GlyphImageMargin, __unsigned_int__getGlyphImageMargin, __void__setGlyphImageMargin__unsigned_int); + I_SimpleProperty(bool, ThreadSafeRefUnref, + 0, + __void__setThreadSafeRefUnref__bool); END_REFLECTOR BEGIN_ENUM_REFLECTOR(osgText::KerningType) diff --git a/src/osgWrappers/osgText/Text.cpp b/src/osgWrappers/osgText/Text.cpp index 354a8fecf..a85049beb 100644 --- a/src/osgWrappers/osgText/Text.cpp +++ b/src/osgWrappers/osgText/Text.cpp @@ -388,6 +388,14 @@ BEGIN_OBJECT_REFLECTOR(osgText::Text) __void__accept__osg_PrimitiveFunctor_R1, "accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has. ", ""); + I_Method1(void, setThreadSafeRefUnref, IN, bool, threadSafe, + __void__setThreadSafeRefUnref__bool, + "Set whether to use a mutex to ensure ref() and unref() are thread safe. ", + ""); + I_Method1(void, resizeGLObjectBuffers, IN, unsigned int, maxSize, + __void__resizeGLObjectBuffers__unsigned_int, + "Resize any per context GLObject buffers to specified size. ", + ""); I_MethodWithDefaults1(void, releaseGLObjects, IN, osg::State *, state, 0, __void__releaseGLObjects__osg_State_P1, "If State is non-zero, this function releases OpenGL objects for the specified graphics context. ", @@ -497,6 +505,9 @@ BEGIN_OBJECT_REFLECTOR(osgText::Text) I_SimpleProperty(const osgText::Text::TextureGlyphQuadMap &, TextureGlyphQuadMap, __C5_TextureGlyphQuadMap_R1__getTextureGlyphQuadMap, 0); + I_SimpleProperty(bool, ThreadSafeRefUnref, + 0, + __void__setThreadSafeRefUnref__bool); END_REFLECTOR TYPE_NAME_ALIAS(std::vector< osgText::Font::Glyph * >, osgText::Text::GlyphQuads::Glyphs); diff --git a/src/osgWrappers/osgUtil/DelaunayTriangulator.cpp b/src/osgWrappers/osgUtil/DelaunayTriangulator.cpp index e4beeb099..cd3c85c69 100644 --- a/src/osgWrappers/osgUtil/DelaunayTriangulator.cpp +++ b/src/osgWrappers/osgUtil/DelaunayTriangulator.cpp @@ -51,7 +51,7 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::DelaunayConstraint) ""); I_Method1(void, merge, IN, osgUtil::DelaunayConstraint *, dco, __void__merge__DelaunayConstraint_P1, - "Add vertices and constraint loops from dco Can be used to generate extra vertices where dco crosses 'this' using osgUtil::tessellator to insert overlap vertices. ", + "Add vertices and constraint loops from dco Can be used to generate extra vertices where dco crosses 'this' using osgUtil::Tessellator to insert overlap vertices. ", ""); I_Method1(void, removeVerticesInside, IN, const osgUtil::DelaunayConstraint *, dco, __void__removeVerticesInside__C5_DelaunayConstraint_P1, @@ -71,7 +71,7 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::DelaunayConstraint) ""); I_Method0(void, handleOverlaps, __void__handleOverlaps, - "Tesselate the constraint loops so that the crossing points are interpolated and added to the contraints for the triangulation. ", + "Tessellate the constraint loops so that the crossing points are interpolated and added to the contraints for the triangulation. ", ""); I_SimpleProperty(osg::DrawElementsUInt *, Triangles, __osg_DrawElementsUInt_P1__getTriangles, diff --git a/src/osgWrappers/osgUtil/IntersectVisitor.cpp b/src/osgWrappers/osgUtil/IntersectVisitor.cpp index c0510d98f..814739c42 100644 --- a/src/osgWrappers/osgUtil/IntersectVisitor.cpp +++ b/src/osgWrappers/osgUtil/IntersectVisitor.cpp @@ -40,7 +40,7 @@ TYPE_NAME_ALIAS(std::vector< int >, osgUtil::Hit::VecIndexList); BEGIN_VALUE_REFLECTOR(osgUtil::Hit) I_Constructor0(____Hit, "Describes a point in space produced by an intersection of a line with a scene. ", - "A Hit is always on a surface as rendered by the Open Scene Graph scene (usually a triangle or other primitive, but a special hit handler could return a different value perhaps: a sphere shape might return a Hit on the true sphere rather than the approximate tesselated sphere rendered."); + "A Hit is always on a surface as rendered by the Open Scene Graph scene (usually a triangle or other primitive, but a special hit handler could return a different value perhaps: a sphere shape might return a Hit on the true sphere rather than the approximate tessellated sphere rendered."); I_Constructor1(IN, const osgUtil::Hit &, hit, ____Hit__C5_Hit_R1, "", diff --git a/src/osgWrappers/osgUtil/Optimizer.cpp b/src/osgWrappers/osgUtil/Optimizer.cpp index bc63766b2..5c18f8d00 100644 --- a/src/osgWrappers/osgUtil/Optimizer.cpp +++ b/src/osgWrappers/osgUtil/Optimizer.cpp @@ -73,7 +73,7 @@ BEGIN_ENUM_REFLECTOR(osgUtil::Optimizer::OptimizationOptions) I_EnumLabel(osgUtil::Optimizer::SPATIALIZE_GROUPS); I_EnumLabel(osgUtil::Optimizer::COPY_SHARED_NODES); I_EnumLabel(osgUtil::Optimizer::TRISTRIP_GEOMETRY); - I_EnumLabel(osgUtil::Optimizer::TESSELATE_GEOMETRY); + I_EnumLabel(osgUtil::Optimizer::TESSELLATE_GEOMETRY); I_EnumLabel(osgUtil::Optimizer::OPTIMIZE_TEXTURE_SETTINGS); I_EnumLabel(osgUtil::Optimizer::MERGE_GEODES); I_EnumLabel(osgUtil::Optimizer::FLATTEN_BILLBOARDS); @@ -500,19 +500,19 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::Optimizer::StateVisitor) ""); END_REFLECTOR -TYPE_NAME_ALIAS(std::set< osg::Group * >, osgUtil::Optimizer::TesselateVisitor::GroupList); +TYPE_NAME_ALIAS(std::set< osg::Group * >, osgUtil::Optimizer::TessellateVisitor::GroupList); -BEGIN_OBJECT_REFLECTOR(osgUtil::Optimizer::TesselateVisitor) +BEGIN_OBJECT_REFLECTOR(osgUtil::Optimizer::TessellateVisitor) I_BaseType(osgUtil::BaseOptimizerVisitor); I_ConstructorWithDefaults1(IN, osgUtil::Optimizer *, optimizer, 0, - ____TesselateVisitor__Optimizer_P1, + ____TessellateVisitor__Optimizer_P1, "", ""); I_Method1(void, apply, IN, osg::Geode &, geode, __void__apply__osg_Geode_R1, "", ""); - I_PublicMemberProperty(osgUtil::Optimizer::TesselateVisitor::GroupList, _groupList); + I_PublicMemberProperty(osgUtil::Optimizer::TessellateVisitor::GroupList, _groupList); END_REFLECTOR BEGIN_VALUE_REFLECTOR(osgUtil::Optimizer::TextureAtlasBuilder)