Changeset 3432
- Timestamp:
- 09/26/04 20:39:34 (9 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 23 modified
-
include/osgUtil/CubeMapGenerator (modified) (3 diffs)
-
include/osgUtil/CullVisitor (modified) (14 diffs)
-
include/osgUtil/DelaunayTriangulator (modified) (2 diffs)
-
include/osgUtil/DisplayRequirementsVisitor (modified) (2 diffs)
-
include/osgUtil/Export (modified) (1 diff)
-
include/osgUtil/GLObjectsVisitor (modified) (1 diff)
-
include/osgUtil/HalfWayMapGenerator (modified) (1 diff)
-
include/osgUtil/HighlightMapGenerator (modified) (1 diff)
-
include/osgUtil/InsertImpostorsVisitor (modified) (4 diffs)
-
include/osgUtil/IntersectVisitor (modified) (2 diffs)
-
include/osgUtil/Optimizer (modified) (15 diffs)
-
include/osgUtil/ReflectionMapGenerator (modified) (1 diff)
-
include/osgUtil/RenderBin (modified) (4 diffs)
-
include/osgUtil/RenderGraph (modified) (2 diffs)
-
include/osgUtil/RenderLeaf (modified) (2 diffs)
-
include/osgUtil/RenderStage (modified) (5 diffs)
-
include/osgUtil/RenderStageLighting (modified) (1 diff)
-
include/osgUtil/SceneView (modified) (12 diffs)
-
include/osgUtil/TangentSpaceGenerator (modified) (1 diff)
-
include/osgUtil/TriStripVisitor (modified) (1 diff)
-
include/osgUtil/UpdateVisitor (modified) (1 diff)
-
src/osgUtil/Optimizer.cpp (modified) (19 diffs)
-
src/osgUtil/RenderBin.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgUtil/CubeMapGenerator
r3035 r3432 31 31 /** This is the base class for cube map generators. 32 32 It exposes the necessary interface to access the six generated images; 33 descendants should only override the compute_color() method.33 descendants should only override the compute_color() method. 34 34 */ 35 35 class OSGUTIL_EXPORT CubeMapGenerator: public osg::Referenced { … … 41 41 inline const osg::Image *getImage(osg::TextureCubeMap::Face face) const; 42 42 43 /** generate the six cube images.43 /** Generate the six cube images. 44 44 If use_osg_system is true, then the OSG's coordinate system is used instead 45 45 of the default OpenGL one. … … 54 54 inline static osg::Vec4 vector_to_color(const osg::Vec3 &vec); 55 55 56 /** override this method to define how colors are computed.56 /** Override this method to define how colors are computed. 57 57 The parameter R is the reflection vector, pointing from the center of the cube. 58 58 The return value should be the RGBA color associated with that reflection ray. -
OpenSceneGraph/trunk/include/osgUtil/CullVisitor
r3230 r3432 43 43 * opaque osg::Drawables into a depth sorted transparent bin and a state 44 44 * sorted opaque bin. The opaque bin is rendered first, and then the 45 * transparent bin i nrendered in order from the furthest osg::Drawable45 * transparent bin is rendered in order from the furthest osg::Drawable 46 46 * from the eye to the one nearest the eye. 47 47 */ … … 155 155 value_type computeNearestPointInFrustum(const osg::Matrix& matrix, const osg::Polytope::PlaneList& planes,const osg::Drawable& drawable); 156 156 157 bool updateCalculatedNearFar(const osg::Matrix& matrix,const osg::BoundingBox& bb);158 159 bool updateCalculatedNearFar(const osg::Matrix& matrix,const osg::Drawable& drawable, bool isBillboard=false);160 161 void updateCalculatedNearFar(const osg::Vec3& pos);162 157 bool updateCalculatedNearFar(const osg::Matrix& matrix,const osg::BoundingBox& bb); 158 159 bool updateCalculatedNearFar(const osg::Matrix& matrix,const osg::Drawable& drawable, bool isBillboard=false); 160 161 void updateCalculatedNearFar(const osg::Vec3& pos); 162 163 163 /** Add a drawable to current render graph.*/ 164 164 inline void addDrawable(osg::Drawable* drawable,osg::RefMatrix* matrix); … … 167 167 inline void addDrawableAndDepth(osg::Drawable* drawable,osg::RefMatrix* matrix,float depth); 168 168 169 /** Add an attribute which is positioned relat edto the modelview matrix.*/169 /** Add an attribute which is positioned relative to the modelview matrix.*/ 170 170 inline void addPositionedAttribute(osg::RefMatrix* matrix,const osg::StateAttribute* attr); 171 171 172 /** Add an attribute which is positioned relat edto the modelview matrix.*/172 /** Add an attribute which is positioned relative to the modelview matrix.*/ 173 173 inline void addPositionedTextureAttribute(unsigned int textureUnit, osg::RefMatrix* matrix,const osg::StateAttribute* attr); 174 174 175 /** reimplement CullStack's popProjectionMatrix() adding clamping of the projection matrix to the computed near and far.*/ 175 /** Re-implement CullStack's popProjectionMatrix() adding clamping of the projection matrix to 176 * the computed near and far.*/ 176 177 virtual void popProjectionMatrix(); 177 178 … … 185 186 virtual bool clampProjectionMatrixImplementation(osg::Matrixd& projection, double& znear, double& zfar) const; 186 187 187 /** clamp the projection float matrix to computed near and far values, use callback if it exists, otherwise use default CullVisitro implemntation.*/ 188 /** Clamp the projection float matrix to computed near and far values, use callback if it exists, 189 * otherwise use default CullVisitor implementation.*/ 188 190 inline bool clampProjectionMatrix(osg::Matrixf& projection, value_type& znear, value_type& zfar) const 189 191 { … … 204 206 } 205 207 206 /** clamp the projection double matrix to computed near and far values, use callback if it exists, otherwise use default CullVisitro implemntation.*/ 208 /** Clamp the projection double matrix to computed near and far values, use callback if it exists, 209 * otherwise use default CullVisitor implementation.*/ 207 210 inline bool clampProjectionMatrix(osg::Matrixd& projection, value_type& znear, value_type& zfar) const 208 211 { … … 231 234 protected: 232 235 233 // /** prevent unwanted copy construction.*/ 234 // CullVisitor(const CullVisitor&): osg::NodeVisitor(), osg::CullStack() {} 235 236 /** prevent unwanted copy operator.*/ 236 /** Prevent unwanted copy operator.*/ 237 237 CullVisitor& operator = (const CullVisitor&) { return *this; } 238 238 … … 252 252 253 253 254 /** create an impostor sprite by setting up a pre-rendering stage254 /** Create an impostor sprite by setting up a pre-rendering stage 255 255 * to generate the impostor texture. */ 256 256 osg::ImpostorSprite* createImpostorSprite(osg::Impostor& node); … … 269 269 270 270 271 typedef std::vector< osg::ref_ptr<RenderLeaf> > RenderLeafList;272 RenderLeafList _reuseRenderLeafList;273 unsigned int _currentReuseRenderLeafIndex;274 275 inline RenderLeaf* createOrReuseRenderLeaf(osg::Drawable* drawable,osg::RefMatrix* projection,osg::RefMatrix* matrix, float depth=0.0f);271 typedef std::vector< osg::ref_ptr<RenderLeaf> > RenderLeafList; 272 RenderLeafList _reuseRenderLeafList; 273 unsigned int _currentReuseRenderLeafIndex; 274 275 inline RenderLeaf* createOrReuseRenderLeaf(osg::Drawable* drawable,osg::RefMatrix* projection,osg::RefMatrix* matrix, float depth=0.0f); 276 276 277 277 osg::ref_ptr<osg::ImpostorSpriteManager> _impostorSpriteManager; … … 318 318 typedef std::multimap<value_type, MatrixPlanesDrawables> DistanceMatrixDrawableMap; 319 319 DistanceMatrixDrawableMap _nearPlaneCandidateMap; 320 320 321 321 }; 322 322 … … 348 348 } 349 349 350 /** Add an attribute which is positioned relat edto the modelview matrix.*/350 /** Add an attribute which is positioned relative to the modelview matrix.*/ 351 351 inline void CullVisitor::addPositionedAttribute(osg::RefMatrix* matrix,const osg::StateAttribute* attr) 352 352 { … … 354 354 } 355 355 356 /** Add an attribute which is positioned relat edto the modelview matrix.*/356 /** Add an attribute which is positioned relative to the modelview matrix.*/ 357 357 inline void CullVisitor::addPositionedTextureAttribute(unsigned int textureUnit, osg::RefMatrix* matrix,const osg::StateAttribute* attr) 358 358 { … … 362 362 inline RenderLeaf* CullVisitor::createOrReuseRenderLeaf(osg::Drawable* drawable,osg::RefMatrix* projection,osg::RefMatrix* matrix, float depth) 363 363 { 364 // skip ofany already reused renderleaf.364 // Skips any already reused renderleaf. 365 365 while (_currentReuseRenderLeafIndex<_reuseRenderLeafList.size() && 366 366 _reuseRenderLeafList[_currentReuseRenderLeafIndex]->referenceCount()>1) … … 370 370 } 371 371 372 // if still within list, element must be singularly referenced 373 // there return it to be reused. 372 // If still within list, element must be singularly referenced then return it to be reused. 374 373 if (_currentReuseRenderLeafIndex<_reuseRenderLeafList.size()) 375 374 { … … 379 378 } 380 379 381 // otherwise need to create new renderleaf.380 // Otherwise need to create new renderleaf. 382 381 RenderLeaf* renderleaf = new RenderLeaf(drawable,projection,matrix,depth); 383 382 _reuseRenderLeafList.push_back(renderleaf); -
OpenSceneGraph/trunk/include/osgUtil/DelaunayTriangulator
r1893 r3432 26 26 { 27 27 28 /** Utility class that triangulates an irreg olar network of sample points.28 /** Utility class that triangulates an irregular network of sample points. 29 29 Just create a DelaunayTriangulator, assign it the sample point array and call 30 30 its triangulate() method to start the triangulation. Then you can obtain the … … 38 38 DelaunayTriangulator(const DelaunayTriangulator ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); 39 39 40 / // Get the const input point array.40 /** Get the const input point array. */ 41 41 inline const osg::Vec3Array *getInputPointArray() const; 42 42 43 / // Get the input point array.43 /** Get the input point array. */ 44 44 inline osg::Vec3Array *getInputPointArray(); 45 45 46 / // Set the input point array.46 /** Set the input point array. */ 47 47 inline void setInputPointArray(osg::Vec3Array *points); 48 48 49 / // Get the const output normal array (optional).49 /** Get the const output normal array (optional). */ 50 50 inline const osg::Vec3Array *getOutputNormalArray() const; 51 51 52 / // Get the output normal array (optional).52 /** Get the output normal array (optional). */ 53 53 inline osg::Vec3Array *getOutputNormalArray(); 54 54 55 / // Set the output normal array (optional).55 /** Set the output normal array (optional). */ 56 56 inline void setOutputNormalArray(osg::Vec3Array *normals); 57 57 58 / // Start triangulation.58 /** Start triangulation. */ 59 59 bool triangulate(); 60 60 61 / // Get the generated primitive (call triangulate() first).61 /** Get the generated primitive (call triangulate() first). */ 62 62 inline const osg::DrawElementsUInt *getTriangles() const; 63 63 64 / // Get the generated primitive (call triangulate() first).64 /** Get the generated primitive (call triangulate() first). */ 65 65 inline osg::DrawElementsUInt *getTriangles(); 66 66 -
OpenSceneGraph/trunk/include/osgUtil/DisplayRequirementsVisitor
r1529 r3432 23 23 namespace osgUtil { 24 24 25 /** A visitor for traversing a scene graph establishing the OpenGL visuals are required26 * to support rendering of that scene graph. The results can then be used by27 * applications to set up the rewindows with the correct visuals. Have a look at28 * src/osgGLUT/Viewer.cpp's Viewer::open() method for an example how to use it.25 /** A visitor for traversing a scene graph establishing which OpenGL visuals are 26 * required to support rendering of that scene graph. The results can then be used by 27 * applications to set up their windows with the correct visuals. Have a look at 28 * src/osgGLUT/Viewer.cpp's Viewer::open() method for an example of how to use it. 29 29 */ 30 30 class OSGUTIL_EXPORT DisplayRequirementsVisitor : public osg::NodeVisitor … … 32 32 public: 33 33 34 /** Default to traversing all children, and req iresDoubleBuffer,34 /** Default to traversing all children, and requiresDoubleBuffer, 35 35 * requiresRGB and requiresDepthBuffer to true and with 36 36 * alpha and stencil off.*/ -
OpenSceneGraph/trunk/include/osgUtil/Export
r1704 r3432 27 27 28 28 #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__) 29 # ifdef OSGUTIL_LIBRARY30 # define OSGUTIL_EXPORT __declspec(dllexport)31 # else32 # define OSGUTIL_EXPORT __declspec(dllimport)33 #endif /* OSGUTIL_LIBRARY */29 # ifdef OSGUTIL_LIBRARY 30 # define OSGUTIL_EXPORT __declspec(dllexport) 31 # else 32 # define OSGUTIL_EXPORT __declspec(dllimport) 33 #endif /* OSGUTIL_LIBRARY */ 34 34 #else 35 #define OSGUTIL_EXPORT35 #define OSGUTIL_EXPORT 36 36 #endif 37 37 -
OpenSceneGraph/trunk/include/osgUtil/GLObjectsVisitor
r3178 r3432 44 44 typedef unsigned int Mode; 45 45 46 /** Construct a GLObjectsVisi or to traverse all child, operating on46 /** Construct a GLObjectsVisitor to traverse all children, operating on 47 47 * node according to specified mode, such as to compile or release 48 48 * display list/texture objects etc. Default mode is to compile -
OpenSceneGraph/trunk/include/osgUtil/HalfWayMapGenerator
r1529 r3432 21 21 { 22 22 23 /** This cube map generator produces an Half-way vector map, useful for24 hardware-based specular lighting effects.25 It computes: C = normalize(R - L), where C is the resulting color,26 R is the reflection vector and L is the light direction.27 */28 class OSGUTIL_EXPORT HalfWayMapGenerator: public CubeMapGenerator {29 public:30 HalfWayMapGenerator(const osg::Vec3 &light_direction, int texture_size = 64);31 HalfWayMapGenerator(const HalfWayMapGenerator ©, const osg::CopyOp ©op);23 /** This cube map generator produces an Half-way vector map, useful for 24 * hardware-based specular lighting effects. 25 * It computes: C = normalize(R - L), where C is the resulting color, 26 * R is the reflection vector and L is the light direction. 27 */ 28 class OSGUTIL_EXPORT HalfWayMapGenerator: public CubeMapGenerator { 29 public: 30 HalfWayMapGenerator(const osg::Vec3 &light_direction, int texture_size = 64); 31 HalfWayMapGenerator(const HalfWayMapGenerator ©, const osg::CopyOp ©op); 32 32 33 protected:34 virtual ~HalfWayMapGenerator() {}35 HalfWayMapGenerator &operator=(const HalfWayMapGenerator &) { return *this; }33 protected: 34 virtual ~HalfWayMapGenerator() {} 35 HalfWayMapGenerator &operator=(const HalfWayMapGenerator &) { return *this; } 36 36 37 inline virtual osg::Vec4 compute_color(const osg::Vec3 &R) const;37 inline virtual osg::Vec4 compute_color(const osg::Vec3 &R) const; 38 38 39 private:40 osg::Vec3 ldir_;41 };39 private: 40 osg::Vec3 ldir_; 41 }; 42 42 43 // INLINE METHODS43 // INLINE METHODS 44 44 45 inline osg::Vec4 HalfWayMapGenerator::compute_color(const osg::Vec3 &R) const46 {47 const osg::Vec3 V = (R / R.length()) - ldir_;48 return vector_to_color(V / V.length());49 }45 inline osg::Vec4 HalfWayMapGenerator::compute_color(const osg::Vec3 &R) const 46 { 47 const osg::Vec3 V = (R / R.length()) - ldir_; 48 return vector_to_color(V / V.length()); 49 } 50 50 51 51 } -
OpenSceneGraph/trunk/include/osgUtil/HighlightMapGenerator
r3035 r3432 22 22 23 23 /** This cube map generator produces a specular highlight map. 24 The vector-color association is: C = (R dot (-L)) ^ n, where C is the25 resulting color, R is the reflection vector, L is the light direction26 and n is the specular exponent.27 */24 * The vector-color association is: C = (R dot (-L)) ^ n, where C is the 25 * resulting color, R is the reflection vector, L is the light direction 26 * and n is the specular exponent. 27 */ 28 28 class OSGUTIL_EXPORT HighlightMapGenerator: public CubeMapGenerator { 29 29 public: -
OpenSceneGraph/trunk/include/osgUtil/InsertImpostorsVisitor
r1529 r3432 23 23 24 24 /** Insert impostor nodes into scene graph. 25 * For example of usage see src/Demos/osgimpostor.25 * For example of usage see examples/osgimpostor. 26 26 */ 27 27 class OSGUTIL_EXPORT InsertImpostorsVisitor : public osg::NodeVisitor … … 29 29 public: 30 30 31 / // default to traversing all children.31 /** Default to traversing all children. */ 32 32 InsertImpostorsVisitor(); 33 33 … … 38 38 unsigned int getMaximumNumberOfNestedImpostors() const { return _maximumNumNestedImpostors; } 39 39 40 /** empty visitor, make it ready for next traversal.*/40 /** Empty visitor, make it ready for next traversal. */ 41 41 void reset(); 42 42 … … 49 49 virtual void apply(osg::Impostor& node); 50 50 51 /* insert the required impostors into the scene graph.*/51 /* Insert the required impostors into the scene graph. */ 52 52 void insertImpostors(); 53 53 -
OpenSceneGraph/trunk/include/osgUtil/IntersectVisitor
r1629 r3432 30 30 31 31 class OSGUTIL_EXPORT Hit 32 { 32 { 33 /** Describes a point in space produced by an intersection of a line with a scene. 34 * A Hit is always on a surface as rendered by the Open Scene Graph scene (usually 35 * a triangle or other primitive, but a special hit handler could return a 36 * different value perhaps: a sphere shape might return a Hit on the true sphere 37 * rather than the approximate tesselated sphere rendered. 38 */ 33 39 public: 34 40 … … 86 92 void addLineSegment(osg::LineSegment* seg); 87 93 88 //typedef std::multiset<Hit> HitList;89 94 typedef std::vector<Hit> HitList; 90 95 typedef std::map<osg::LineSegment*,HitList > LineSegmentHitListMap; -
OpenSceneGraph/trunk/include/osgUtil/Optimizer
r3203 r3432 26 26 namespace osgUtil { 27 27 28 /** Insert impostor nodes into scene graph.29 * For example of usage see src/Demos/osgimpostor.28 /** Traverses scene graph to improve efficiency. See OptimizationOptions. 29 * For example of usage see examples/osgimpostor or osgviewer. 30 30 */ 31 31 … … 70 70 }; 71 71 72 /** reset internal data to initial state - the getPrimissableOptionsMap is cleared.*/72 /** Reset internal data to initial state - the getPermissibleOptionsMap is cleared.*/ 73 73 void reset(); 74 74 75 /** traverse the node and its subgraph with a series of optimization76 * visitors, specifi cied by the OptizationOptions.*/75 /** Traverse the node and its subgraph with a series of optimization 76 * visitors, specified by the OptimizationOptions.*/ 77 77 void optimize(osg::Node* node); 78 78 79 /** traverse the node and its subgraph with a series of optimization80 * visitors, specifi cied by the OptizationOptions.*/79 /** Traverse the node and its subgraph with a series of optimization 80 * visitors, specified by the OptimizationOptions.*/ 81 81 virtual void optimize(osg::Node* node, unsigned int options); 82 82 83 83 84 inline void setPermiss ableOptimizationsForObject(const osg::Object* object, unsigned int options)85 { 86 _permiss ableOptimizationsMap[object] = options;84 inline void setPermissibleOptimizationsForObject(const osg::Object* object, unsigned int options) 85 { 86 _permissibleOptimizationsMap[object] = options; 87 87 } 88 88 89 inline unsigned int getPermiss ableOptimizationsForObject(const osg::Object* object) const90 { 91 Permiss ableOptimizationsMap::const_iterator itr = _permissableOptimizationsMap.find(object);92 if (itr!=_permiss ableOptimizationsMap.end()) return itr->second;89 inline unsigned int getPermissibleOptimizationsForObject(const osg::Object* object) const 90 { 91 PermissibleOptimizationsMap::const_iterator itr = _permissibleOptimizationsMap.find(object); 92 if (itr!=_permissibleOptimizationsMap.end()) return itr->second; 93 93 else return 0xffffffff; 94 94 } 95 95 96 inline bool isOperationPermiss ableForObject(const osg::Object* object,unsigned int option) const97 { 98 return (option & getPermiss ableOptimizationsForObject(object))!=0;96 inline bool isOperationPermissibleForObject(const osg::Object* object,unsigned int option) const 97 { 98 return (option & getPermissibleOptimizationsForObject(object))!=0; 99 99 } 100 100 101 typedef std::map<const osg::Object*,unsigned int> Permiss ableOptimizationsMap;102 103 Permiss ableOptimizationsMap& getPrimissableOptionsMap() { return _permissableOptimizationsMap; }104 const Permiss ableOptimizationsMap& getPrimissableOptionsMap() const { return _permissableOptimizationsMap; }101 typedef std::map<const osg::Object*,unsigned int> PermissibleOptimizationsMap; 102 103 PermissibleOptimizationsMap& getPermissibleOptionsMap() { return _permissibleOptimizationsMap; } 104 const PermissibleOptimizationsMap& getPermissibleOptionsMap() const { return _permissibleOptimizationsMap; } 105 105 106 106 107 107 protected: 108 108 109 Permiss ableOptimizationsMap _permissableOptimizationsMap;109 PermissibleOptimizationsMap _permissibleOptimizationsMap; 110 110 111 111 … … 113 113 114 114 115 /** Flatten Static Tra sform nodes by applying their transform to the115 /** Flatten Static Transform nodes by applying their transform to the 116 116 * geometry on the leaves of the scene graph, then removing the 117 117 * now redundant transforms.*/ … … 133 133 bool removeTransforms(osg::Node* nodeWeCannotRemove); 134 134 135 inline bool isOperationPermiss ableForObject(const osg::Object* object) const136 { 137 return _optimizer ? _optimizer->isOperationPermiss ableForObject(object,FLATTEN_STATIC_TRANSFORMS) : true;135 inline bool isOperationPermissibleForObject(const osg::Object* object) const 136 { 137 return _optimizer ? _optimizer->isOperationPermissibleForObject(object,FLATTEN_STATIC_TRANSFORMS) : true; 138 138 } 139 139 … … 156 156 157 157 158 /** Combine Static Tra sform nodes that sit above onanother.*/158 /** Combine Static Transform nodes that sit above one another.*/ 159 159 class OSGUTIL_EXPORT CombineStaticTransformsVisitor : public osg::NodeVisitor 160 160 { … … 169 169 bool removeTransforms(osg::Node* nodeWeCannotRemove); 170 170 171 inline bool isOperationPermiss ableForObject(const osg::Object* object) const172 { 173 return _optimizer ? _optimizer->isOperationPermiss ableForObject(object,FLATTEN_STATIC_TRANSFORMS) : true;171 inline bool isOperationPermissibleForObject(const osg::Object* object) const 172 { 173 return _optimizer ? _optimizer->isOperationPermissibleForObject(object,FLATTEN_STATIC_TRANSFORMS) : true; 174 174 } 175 175 … … 199 199 void removeEmptyNodes(); 200 200 201 inline bool isOperationPermiss ableForObject(const osg::Object* object) const202 { 203 return _optimizer ? _optimizer->isOperationPermiss ableForObject(object,REMOVE_REDUNDANT_NODES) : true;201 inline bool isOperationPermissibleForObject(const osg::Object* object) const 202 { 203 return _optimizer ? _optimizer->isOperationPermissibleForObject(object,REMOVE_REDUNDANT_NODES) : true; 204 204 } 205 205 … … 224 224 void removeRedundantNodes(); 225 225 226 inline bool isOperationPermissableForObject(const osg::Object* object) const 227 { 228 return _optimizer ? _optimizer->isOperationPermissableForObject(object,REMOVE_REDUNDANT_NODES) : true; 229 } 230 231 Optimizer* _optimizer; 232 }; 233 234 /** Tesselate all geodes, to remove POLYGONS 235 * complementary ranges.*/ 226 inline bool isOperationPermissibleForObject(const osg::Object* object) const 227 { 228 return _optimizer ? _optimizer->isOperationPermissibleForObject(object,REMOVE_REDUNDANT_NODES) : true; 229 } 230 231 Optimizer* _optimizer; 232 }; 233 234 /** Tesselate all geodes, to remove POLYGONS.*/ 236 235 class OSGUTIL_EXPORT TesselateVisitor : public osg::NodeVisitor 237 236 { … … 264 263 void combineLODs(); 265 264 266 inline bool isOperationPermiss ableForObject(const osg::Object* object) const267 { 268 return _optimizer ? _optimizer->isOperationPermiss ableForObject(object,COMBINE_ADJACENT_LODS) : true;265 inline bool isOperationPermissibleForObject(const osg::Object* object) const 266 { 267 return _optimizer ? _optimizer->isOperationPermissibleForObject(object,COMBINE_ADJACENT_LODS) : true; 269 268 } 270 269 … … 293 292 void optimize(); 294 293 295 inline bool isOperationPermiss ableForObject(const osg::Object* object) const296 { 297 return _optimizer ? _optimizer->isOperationPermiss ableForObject(object,SHARE_DUPLICATE_STATE) : true;294 inline bool isOperationPermissibleForObject(const osg::Object* object) const 295 { 296 return _optimizer ? _optimizer->isOperationPermissibleForObject(object,SHARE_DUPLICATE_STATE) : true; 298 297 } 299 298 … … 323 322 void checkGeode(osg::Geode& geode); 324 323 325 inline bool isOperationPermiss ableForObject(const osg::Object* object) const326 { 327 return _optimizer ? _optimizer->isOperationPermiss ableForObject(object,CHECK_GEOMETRY) : true;324 inline bool isOperationPermissibleForObject(const osg::Object* object) const 325 { 326 return _optimizer ? _optimizer->isOperationPermissibleForObject(object,CHECK_GEOMETRY) : true; 328 327 } 329 328 … … 356 355 static bool mergePrimitive(osg::DrawElementsUInt& lhs,osg::DrawElementsUInt& rhs); 357 356 358 inline bool isOperationPermiss ableForObject(const osg::Object* object) const359 { 360 return _optimizer ? _optimizer->isOperationPermiss ableForObject(object,MERGE_GEOMETRY) : true;357 inline bool isOperationPermissibleForObject(const osg::Object* object) const 358 { 359 return _optimizer ? _optimizer->isOperationPermissibleForObject(object,MERGE_GEOMETRY) : true; 361 360 } 362 361 … … 382 381 GroupsToDivideList _groupsToDivideList; 383 382 384 inline bool isOperationPermiss ableForObject(const osg::Object* object) const385 { 386 return _optimizer ? _optimizer->isOperationPermiss ableForObject(object,SPATIALIZE_GROUPS) : true;383 inline bool isOperationPermissibleForObject(const osg::Object* object) const 384 { 385 return _optimizer ? _optimizer->isOperationPermissibleForObject(object,SPATIALIZE_GROUPS) : true; 387 386 } 388 387 … … 407 406 SharedNodeList _sharedNodeList; 408 407 409 inline bool isOperationPermiss ableForObject(const osg::Object* object) const410 { 411 return _optimizer ? _optimizer->isOperationPermiss ableForObject(object,COPY_SHARED_NODES) : true;408 inline bool isOperationPermissibleForObject(const osg::Object* object) const 409 { 410 return _optimizer ? _optimizer->isOperationPermissibleForObject(object,COPY_SHARED_NODES) : true; 412 411 } 413 412 … … 438 437 void apply(osg::Texture& texture); 439 438 440 inline bool isOperationPermiss ableForObject(const osg::Object* object) const441 { 442 return _optimizer ? _optimizer->isOperationPermiss ableForObject(object,OPTIMIZE_TEXTURE_SETTINGS) : true;439 inline bool isOperationPermissibleForObject(const osg::Object* object) const 440 { 441 return _optimizer ? _optimizer->isOperationPermissibleForObject(object,OPTIMIZE_TEXTURE_SETTINGS) : true; 443 442 } 444 443 -
OpenSceneGraph/trunk/include/osgUtil/ReflectionMapGenerator
r1529 r3432 19 19 { 20 20 21 /** This is the most simple cube map generator. It performs a direct association22 between reflection vector and RGBA color (C = R).23 */24 class ReflectionMapGenerator: public CubeMapGenerator {25 public:26 inline ReflectionMapGenerator(int texture_size = 64);27 inline ReflectionMapGenerator(const ReflectionMapGenerator ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY);21 /** This is the most simple cube map generator. It performs a direct association 22 between reflection vector and RGBA color (C = R). 23 */ 24 class ReflectionMapGenerator: public CubeMapGenerator { 25 public: 26 inline ReflectionMapGenerator(int texture_size = 64); 27 inline ReflectionMapGenerator(const ReflectionMapGenerator ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); 28 28 29 protected:30 virtual ~ReflectionMapGenerator() {}31 ReflectionMapGenerator &operator=(const ReflectionMapGenerator &) { return *this; }29 protected: 30 virtual ~ReflectionMapGenerator() {} 31 ReflectionMapGenerator &operator=(const ReflectionMapGenerator &) { return *this; } 32 32 33 inline virtual osg::Vec4 compute_color(const osg::Vec3 &R) const;34 };33 inline virtual osg::Vec4 compute_color(const osg::Vec3 &R) const; 34 }; 35 35 36 // INLINE METHODS36 // INLINE METHODS 37 37 38 inline ReflectionMapGenerator::ReflectionMapGenerator(int texture_size)39 : CubeMapGenerator(texture_size)40 {41 }38 inline ReflectionMapGenerator::ReflectionMapGenerator(int texture_size) 39 : CubeMapGenerator(texture_size) 40 { 41 } 42 42 43 inline ReflectionMapGenerator::ReflectionMapGenerator(const ReflectionMapGenerator ©, const osg::CopyOp ©op)44 : CubeMapGenerator(copy, copyop)45 {46 }43 inline ReflectionMapGenerator::ReflectionMapGenerator(const ReflectionMapGenerator ©, const osg::CopyOp ©op) 44 : CubeMapGenerator(copy, copyop) 45 { 46 } 47 47 48 inline osg::Vec4 ReflectionMapGenerator::compute_color(const osg::Vec3 &R) const49 {50 return vector_to_color(R / R.length());51 }48 inline osg::Vec4 ReflectionMapGenerator::compute_color(const osg::Vec3 &R) const 49 { 50 return vector_to_color(R / R.length()); 51 } 52 52 53 53 } -
OpenSceneGraph/trunk/include/osgUtil/RenderBin
r3299 r3432 26 26 class Statistics; 27 27 /** 28 * RenderBin base class. 28 * RenderBin base class. Renderbin contains geometries to be rendered as a group, 29 * renderbins are rendered once each. They can improve efficiency or 30 * use different rendering algorithms. 31 * A renderBin can contain further renderBins producing a tree hierarchy of renderBins. 29 32 */ 30 33 class OSGUTIL_EXPORT RenderBin : public osg::Object … … 69 72 const RenderStage* getStage() const { return _stage; } 70 73 71 int getBinNum() const { return _binNum; }74 int getBinNum() const { return _binNum; } 72 75 73 76 RenderGraphList& getRenderGraphList() { return _renderGraphList; } … … 91 94 92 95 virtual void sortImplementation(); 93 96 94 97 void setSortMode(SortMode mode); 95 98 SortMode getSortMode() const { return _sortMode; } … … 123 126 const DrawCallback* getDrawCallback() const { return _drawCallback.get(); } 124 127 125 /** extract stats for current draw list. */128 /** Extract stats for current draw list. */ 126 129 bool getStats(Statistics* primStats); 127 130 void getPrims(Statistics* primStats); -
OpenSceneGraph/trunk/include/osgUtil/RenderGraph
r1572 r3432 37 37 }; 38 38 39 /** RenderGraph - contained in a renderBin, defines the scene to be drawn. 40 */ 39 41 class OSGUTIL_EXPORT RenderGraph : public osg::Referenced 40 42 { … … 140 142 } 141 143 142 /** reset the internal contents of a RenderGraph, including deleting all children.*/144 /** Reset the internal contents of a RenderGraph, including deleting all children.*/ 143 145 void reset(); 144 146 145 /** recursively clean the RenderGraph of all its drawables, lights and depths.147 /** Recursively clean the RenderGraph of all its drawables, lights and depths. 146 148 * Leaves children intact, and ready to be populated again.*/ 147 149 void clean(); 148 150 149 /** recursively prune the RenderGraph of empty children.*/151 /** Recursively prune the RenderGraph of empty children.*/ 150 152 void prune(); 151 153 -
OpenSceneGraph/trunk/include/osgUtil/RenderLeaf
r1529 r3432 24 24 namespace osgUtil { 25 25 26 // forward declare RenderGraph26 // Forward declare RenderGraph 27 27 class RenderGraph; 28 28 29 /** container class for all data required for rendering of drawables.29 /** Container class for all data required for rendering of drawables. 30 30 */ 31 31 class OSGUTIL_EXPORT RenderLeaf : public osg::Referenced … … 42 42 43 43 44 inline void set(osg::Drawable* drawable,osg::RefMatrix* projection,osg::RefMatrix* modelview, float depth=0.0f) 45 { 46 _parent = 0; 47 _drawable = drawable; 48 _projection = projection, 49 _modelview = modelview, 50 _depth = depth; 51 } 52 53 inline void reset() 54 { 55 _parent = 0; 56 _drawable = 0; 57 _projection = 0; 58 _modelview = 0; 59 _depth = 0.0f; 60 } 61 62 44 inline void set(osg::Drawable* drawable,osg::RefMatrix* projection,osg::RefMatrix* modelview, float depth=0.0f) 45 { 46 _parent = 0; 47 _drawable = drawable; 48 _projection = projection, 49 _modelview = modelview, 50 _depth = depth; 51 } 52 53 inline void reset() 54 { 55 _parent = 0; 56 _drawable = 0; 57 _projection = 0; 58 _modelview = 0; 59 _depth = 0.0f; 60 } 61 63 62 virtual void render(osg::State& state,RenderLeaf* previous); 64 63 65 /// allow RenderGraph to change the RenderLeaf's _parent.64 /// Allow RenderGraph to change the RenderLeaf's _parent. 66 65 friend class osgUtil::RenderGraph; 67 66 -
OpenSceneGraph/trunk/include/osgUtil/RenderStage
r3214 r3432 24 24 25 25 /** 26 * RenderSta te base class. Used for encapsulate a complete stage in26 * RenderStage base class. Used for encapsulate a complete stage in 27 27 * rendering - setting up of viewport, the projection and model 28 28 * matrices and rendering the RenderBin's enclosed with this RenderStage. … … 82 82 83 83 /** Set the clear accum used in glClearAccum(..). 84 * glClearAcumm is only called if mask & GL_ACCUM_BUFFER_BIT is true */84 * glClearAcumm is only called if mask & GL_ACCUM_BUFFER_BIT is true. */ 85 85 void setClearAccum(const osg::Vec4& color) { _clearAccum=color; } 86 86 … … 91 91 92 92 /** Set the clear depth used in glClearDepth(..). Defaults to 1.0 93 * glClearDepth is only called if mask & GL_DEPTH_BUFFER_BIT is true */93 * glClearDepth is only called if mask & GL_DEPTH_BUFFER_BIT is true. */ 94 94 void setClearDepth(double depth) { _clearDepth=depth; } 95 95 … … 98 98 99 99 100 /** Set the clear stencil value used in glClearStencil(). Defaults to 0 100 /** Set the clear stencil value used in glClearStencil(). Defaults to 0; 101 101 * glClearStencil is only called if mask & GL_STENCIL_BUFFER_BIT is true*/ 102 102 void setClearStencil(int stencil) { _clearStencil=stencil; } … … 126 126 127 127 virtual void draw(osg::State& state,RenderLeaf*& previous); 128 128 129 129 virtual void drawImplementation(osg::State& state,RenderLeaf*& previous); 130 130 131 131 void addToDependencyList(RenderStage* rs); 132 132 133 /** extract stats for current draw list. */133 /** Extract stats for current draw list. */ 134 134 bool getStats(Statistics* primStats); 135 135 -
OpenSceneGraph/trunk/include/osgUtil/RenderStageLighting
r3125 r3432 25 25 26 26 /** 27 * Render Bin base class.27 * RenderStageLighting base class. Used in RenderStage class. 28 28 */ 29 29 class OSGUTIL_EXPORT RenderStageLighting : public osg::Object -
OpenSceneGraph/trunk/include/osgUtil/SceneView
r3429 r3432 28 28 29 29 /** 30 * SceneView is literally a view of a scene, encapsulating the 31 * camera (modelview+projection matrices), global state, lights and the scene itself. Provides 30 * SceneView is literally a view of a scene, encapsulating the 'camera' 31 * (not to be confused with Producer::Camera) (modelview+projection matrices), 32 * global state, lights and the scene itself. Provides 32 33 * methods for setting up the view and rendering it. 33 34 */ … … 51 52 /** Set scene view to use default global state, light, camera 52 53 * and render visitor. 53 */54 */ 54 55 void setDefaults(unsigned int options = STANDARD_SETTINGS); 55 56 56 /** Set the data whichto view. The data will typically be57 /** Set the data to view. The data will typically be 57 58 * an osg::Scene but can be any osg::Node type. 58 59 */ 59 60 void setSceneData(osg::Node* node) { _sceneData = node; } 60 /** Get the scene data whichto view. The data will typically be61 /** Get the scene data to view. The data will typically be 61 62 * an osg::Scene but can be any osg::Node type. 62 63 */ … … 68 69 const osg::Node* getSceneData() const { return _sceneData.get(); } 69 70 70 /** Set the viewport of the scene view to use spec fied osg::Viewport. */71 /** Set the viewport of the scene view to use specified osg::Viewport. */ 71 72 void setViewport(osg::Viewport* viewport) 72 73 { … … 119 120 Defaults to an off blue color.*/ 120 121 void setClearColor(const osg::Vec4& color) { _clearColor=color; } 121 /** Get the color us inged in glClearColor.*/122 /** Get the color used in glClearColor.*/ 122 123 const osg::Vec4& getClearColor() const { return _clearColor; } 123 124 … … 153 154 inline void setProjectionMatrix(const osg::Matrixd& matrix) { _projectionMatrix.set(matrix); } 154 155 155 /** Set to a orthographic projection. See OpenGL glOrtho for documentation further details.*/156 /** Set to an orthographic projection. See OpenGL glOrtho for documentation further details.*/ 156 157 void setProjectionMatrixAsOrtho(double left, double right, 157 158 double bottom, double top, … … 178 179 const osg::Matrixd& getProjectionMatrix() const { return _projectionMatrix; } 179 180 180 /** Get the otho rgraphic settings of the orthographic projection matrix.181 /** Get the othographic settings of the orthographic projection matrix. 181 182 * Returns false if matrix is not an orthographic matrix, where parameter values are undefined.*/ 182 183 bool getProjectionMatrixAsOrtho(double& left, double& right, … … 190 191 double& zNear, double& zFar); 191 192 192 /** Get the frustum setting of a sym etric perspective projection matrix.193 /** Get the frustum setting of a symmetric perspective projection matrix. 193 194 * Returns false if matrix is not a perspective matrix, where parameter values are undefined. 194 * Note, if matrix is not a sym etric perspective matrix then the shear will be lost.195 * Asym etric metrices occur when stereo, power walls, caves and reality center display are used.196 * In these configuration one should use the AsFrustummethod instead.*/195 * Note, if matrix is not a symmetric perspective matrix then the shear will be lost. 196 * Asymmetric matrices occur when stereo, power walls, caves and reality center display are used. 197 * In these configurations one should use the 'getProjectionMatrixAsFrustum' method instead.*/ 197 198 bool getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio, 198 199 double& zNear, double& zFar); … … 291 292 /** Use fusion distance from the value set on the SceneView.*/ 292 293 USE_FUSION_DISTANCE_VALUE, 293 /** Compute the fusion distance by multiplying the screen distance by the fusion distance value.*/294 /** Compute the fusion distance by multiplying the screen distance by the fusion distance value.*/ 294 295 PROPORTIONAL_TO_SCREEN_DISTANCE 295 296 }; … … 309 310 310 311 311 /** set whether the draw method should call renderer->prioritizeTexture.*/312 /** Set whether the draw method should call renderer->prioritizeTexture.*/ 312 313 void setPrioritizeTextures(bool pt) { _prioritizeTextures = pt; } 313 314 314 /** get whether the draw method should call renderer->prioritizeTexture.*/315 /** Get whether the draw method should call renderer->prioritizeTexture.*/ 315 316 bool getPrioritizeTextures() const { return _prioritizeTextures; } 316 317 317 /** callback for overidding the default method for compute the offset projection and view matrices.*/318 /** Callback for overidding the default method for compute the offset projection and view matrices.*/ 318 319 struct ComputeStereoMatricesCallback : public osg::Referenced 319 320 { … … 350 351 for projectWindowIntoObject to produce valid values. Consistent with OpenGL 351 352 windows coordinates are calculated relative to the bottom left of the window, 352 whereas aswindow API's normally have the top left as the origin,353 whereas window API's normally have the top left as the origin, 353 354 so you may need to pass in (mouseX,window_height-mouseY,...). 354 355 Returns true on successful projection. … … 360 361 inline void setFrameStamp(osg::FrameStamp* fs) { _frameStamp = fs; } 361 362 362 /** Set the frame stamp for the current frame.*/363 /** Get the frame stamp for the current frame.*/ 363 364 inline const osg::FrameStamp* getFrameStamp() const { return _frameStamp.get(); } 364 365 … … 400 401 * The init traversal is called once for each SceneView, and should 401 402 * be used to compile display list, texture objects intialize data 402 * not otherwise intializ aed during scene graph loading. Note, is403 * called automatically by update &cull if it hasn't already been called403 * not otherwise intialized during scene graph loading. Note, is 404 * called automatically by update & cull if it hasn't already been called 404 405 * elsewhere. Also init() should only ever be called within a valid 405 406 * graphics context.*/ -
OpenSceneGraph/trunk/include/osgUtil/TangentSpaceGenerator
r3032 r3432 25 25 { 26 26 27 /**28 This class generates three arrays containing tangent-space basis vectors. It takes29 a texture-mapped Geometry object as input, traverses its primitive sets and computes30 Tangent, Normal and Binormal vectors for each vertex, storing them into arrays.31 The resulting arrays can be used as vertex program varying (per-vertex) parameters,32 enabling advanced effects like bump-mapping.33 To use this class, simply call the generate() method specifying the Geometry object34 you want to process and the texture unit that contains UV mapping for the normal map;35 then you can retrieve the TBN arrays by calling getTangentArray(), getNormalArray()36 and getBinormalArray() methods.37 */38 class OSGUTIL_EXPORT TangentSpaceGenerator: public osg::Referenced {39 public:40 TangentSpaceGenerator();41 TangentSpaceGenerator(const TangentSpaceGenerator ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY);27 /** 28 This class generates three arrays containing tangent-space basis vectors. It takes 29 a texture-mapped Geometry object as input, traverses its primitive sets and computes 30 Tangent, Normal and Binormal vectors for each vertex, storing them into arrays. 31 The resulting arrays can be used as vertex program varying (per-vertex) parameters, 32 enabling advanced effects like bump-mapping. 33 To use this class, simply call the generate() method specifying the Geometry object 34 you want to process and the texture unit that contains UV mapping for the normal map; 35 then you can retrieve the TBN arrays by calling getTangentArray(), getNormalArray() 36 and getBinormalArray() methods. 37 */ 38 class OSGUTIL_EXPORT TangentSpaceGenerator: public osg::Referenced { 39 public: 40 TangentSpaceGenerator(); 41 TangentSpaceGenerator(const TangentSpaceGenerator ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); 42 42 43 void generate(osg::Geometry *geo, int normal_map_tex_unit = 0);43 void generate(osg::Geometry *geo, int normal_map_tex_unit = 0); 44 44 45 inline osg::Vec4Array *getTangentArray() { return T_.get(); }46 inline const osg::Vec4Array *getTangentArray() const { return T_.get(); }47 inline void setTangentArray(osg::Vec4Array *array) { T_ = array; }45 inline osg::Vec4Array *getTangentArray() { return T_.get(); } 46 inline const osg::Vec4Array *getTangentArray() const { return T_.get(); } 47 inline void setTangentArray(osg::Vec4Array *array) { T_ = array; } 48 48 49 inline osg::Vec4Array *getNormalArray() { return N_.get(); }50 inline const osg::Vec4Array *getNormalArray() const { return N_.get(); }51 inline void setNormalArray(osg::Vec4Array *array) { N_ = array; }49 inline osg::Vec4Array *getNormalArray() { return N_.get(); } 50 inline const osg::Vec4Array *getNormalArray() const { return N_.get(); } 51 inline void setNormalArray(osg::Vec4Array *array) { N_ = array; } 52 52 53 inline osg::Vec4Array *getBinormalArray() { return B_.get(); }54 inline const osg::Vec4Array *getBinormalArray() const { return B_.get(); }55 inline void setBinormalArray(osg::Vec4Array *array) { B_ = array; }53 inline osg::Vec4Array *getBinormalArray() { return B_.get(); } 54 inline const osg::Vec4Array *getBinormalArray() const { return B_.get(); } 55 inline void setBinormalArray(osg::Vec4Array *array) { B_ = array; } 56 56 57 protected:58 virtual ~TangentSpaceGenerator() {}59 TangentSpaceGenerator &operator=(const TangentSpaceGenerator &) { return *this; }57 protected: 58 virtual ~TangentSpaceGenerator() {} 59 TangentSpaceGenerator &operator=(const TangentSpaceGenerator &) { return *this; } 60 60 61 void compute_basis_vectors(osg::PrimitiveSet *pset, const osg::Array *vx, const osg::Array *nx, const osg::Array *tx, int iA, int iB, int iC);61 void compute_basis_vectors(osg::PrimitiveSet *pset, const osg::Array *vx, const osg::Array *nx, const osg::Array *tx, int iA, int iB, int iC); 62 62 63 private:64 osg::ref_ptr<osg::Vec4Array> T_;65 osg::ref_ptr<osg::Vec4Array> B_;66 osg::ref_ptr<osg::Vec4Array> N_;67 };63 private: 64 osg::ref_ptr<osg::Vec4Array> T_; 65 osg::ref_ptr<osg::Vec4Array> B_; 66 osg::ref_ptr<osg::Vec4Array> N_; 67 }; 68 68 69 69 } -
OpenSceneGraph/trunk/include/osgUtil/TriStripVisitor
r3216 r3432 82 82 } 83 83 84 inline bool isOperationPermiss ableForObject(const osg::Object* object) const84 inline bool isOperationPermissibleForObject(const osg::Object* object) const 85 85 { 86 return _optimizer ? _optimizer->isOperationPermiss ableForObject(object,osgUtil::Optimizer::TRISTRIP_GEOMETRY) : true;86 return _optimizer ? _optimizer->isOperationPermissibleForObject(object,osgUtil::Optimizer::TRISTRIP_GEOMETRY) : true; 87 87 } 88 88 -
OpenSceneGraph/trunk/include/osgUtil/UpdateVisitor
r2313 r3432 94 94 } 95 95 } 96 96 97 97 }; 98 98 -
OpenSceneGraph/trunk/src/osgUtil/Optimizer.cpp
r3203 r3432 55 55 void Optimizer::reset() 56 56 { 57 _permiss ableOptimizationsMap.clear();57 _permissibleOptimizationsMap.clear(); 58 58 } 59 59 … … 294 294 if (ss && ss->getDataVariance()==osg::Object::STATIC) 295 295 { 296 if (isOperationPermiss ableForObject(&node) &&297 isOperationPermiss ableForObject(ss))296 if (isOperationPermissibleForObject(&node) && 297 isOperationPermissibleForObject(ss)) 298 298 { 299 299 addStateSet(ss,&node); … … 306 306 void Optimizer::StateVisitor::apply(osg::Geode& geode) 307 307 { 308 if (!isOperationPermiss ableForObject(&geode)) return;308 if (!isOperationPermissibleForObject(&geode)) return; 309 309 310 310 osg::StateSet* ss = geode.getStateSet(); … … 313 313 if (ss && ss->getDataVariance()==osg::Object::STATIC) 314 314 { 315 if (isOperationPermiss ableForObject(ss))315 if (isOperationPermissibleForObject(ss)) 316 316 { 317 317 addStateSet(ss,&geode); … … 326 326 if (ss && ss->getDataVariance()==osg::Object::STATIC) 327 327 { 328 if (isOperationPermiss ableForObject(drawable) &&329 isOperationPermiss ableForObject(ss))328 if (isOperationPermissibleForObject(drawable) && 329 isOperationPermissibleForObject(ss)) 330 330 { 331 331 addStateSet(ss,drawable); … … 586 586 bool removeTransforms(osg::Node* nodeWeCannotRemove); 587 587 588 inline bool isOperationPermiss ableForObject(const osg::Object* object)588 inline bool isOperationPermissibleForObject(const osg::Object* object) 589 589 { 590 590 // disable if cannot apply transform functor. … … 595 595 if (strcmp(object->className(),"LightPointNode")==0) return false; 596 596 597 return _optimizer ? _optimizer->isOperationPermiss ableForObject(object,Optimizer::FLATTEN_STATIC_TRANSFORMS) : true;597 return _optimizer ? _optimizer->isOperationPermissibleForObject(object,Optimizer::FLATTEN_STATIC_TRANSFORMS) : true; 598 598 } 599 599 … … 832 832 if (os._canBeApplied) 833 833 { 834 if (os._moreThanOneMatrixRequired || !isOperationPermiss ableForObject(object))834 if (os._moreThanOneMatrixRequired || !isOperationPermissibleForObject(object)) 835 835 { 836 836 disableObject(oitr); … … 1152 1152 if (group.getNumParents()>0 && group.getNumChildren()<=1) 1153 1153 { 1154 if (isNodeEmpty(group) && isOperationPermiss ableForObject(&group))1154 if (isNodeEmpty(group) && isOperationPermissibleForObject(&group)) 1155 1155 { 1156 1156 _redundantNodeList.insert(&group); … … 1166 1166 if (transform.getNumParents()>0 && 1167 1167 transform.getDataVariance()==osg::Object::STATIC && 1168 isOperationPermiss ableForObject(&transform))1168 isOperationPermissibleForObject(&transform)) 1169 1169 { 1170 1170 static osg::Matrix identity; … … 1225 1225 if (typeid(*lod.getParent(i))==typeid(osg::Group)) 1226 1226 { 1227 if (isOperationPermiss ableForObject(&lod))1227 if (isOperationPermissibleForObject(&lod)) 1228 1228 { 1229 1229 _groupList.insert(lod.getParent(i)); … … 1449 1449 void Optimizer::CheckGeometryVisitor::checkGeode(osg::Geode& geode) 1450 1450 { 1451 if (isOperationPermiss ableForObject(&geode))1451 if (isOperationPermissibleForObject(&geode)) 1452 1452 { 1453 1453 for(unsigned int i=0;i<geode.getNumDrawables();++i) 1454 1454 { 1455 1455 osg::Geometry* geom = geode.getDrawable(i)->asGeometry(); 1456 if (geom && isOperationPermiss ableForObject(geom))1456 if (geom && isOperationPermissibleForObject(geom)) 1457 1457 { 1458 1458 geom->computeCorrectBindingsAndArraySizes(); … … 1464 1464 bool Optimizer::MergeGeometryVisitor::mergeGeode(osg::Geode& geode) 1465 1465 { 1466 if (!isOperationPermiss ableForObject(&geode)) return false;1466 if (!isOperationPermissibleForObject(&geode)) return false; 1467 1467 1468 1468 #if 1 … … 1985 1985 if (typeid(group)==typeid(osg::Group) || group.asTransform()) 1986 1986 { 1987 if (isOperationPermiss ableForObject(&group))1987 if (isOperationPermissibleForObject(&group)) 1988 1988 { 1989 1989 _groupsToDivideList.insert(&group); … … 2174 2174 void Optimizer::CopySharedSubgraphsVisitor::apply(osg::Node& node) 2175 2175 { 2176 if (node.getNumParents()>1 && !isOperationPermiss ableForObject(&node))2176 if (node.getNumParents()>1 && !isOperationPermissibleForObject(&node)) 2177 2177 { 2178 2178 _sharedNodeList.insert(&node); … … 2216 2216 osg::StateSet* ss = node.getStateSet(); 2217 2217 if (ss && 2218 isOperationPermiss ableForObject(&node) &&2219 isOperationPermiss ableForObject(ss))2218 isOperationPermissibleForObject(&node) && 2219 isOperationPermissibleForObject(ss)) 2220 2220 { 2221 2221 apply(*ss); … … 2227 2227 void Optimizer::TextureVisitor::apply(osg::Geode& geode) 2228 2228 { 2229 if (!isOperationPermiss ableForObject(&geode)) return;2229 if (!isOperationPermissibleForObject(&geode)) return; 2230 2230 2231 2231 osg::StateSet* ss = geode.getStateSet(); 2232 2232 2233 if (ss && isOperationPermiss ableForObject(ss))2233 if (ss && isOperationPermissibleForObject(ss)) 2234 2234 { 2235 2235 apply(*ss); … … 2243 2243 ss = drawable->getStateSet(); 2244 2244 if (ss && 2245 isOperationPermiss ableForObject(drawable) &&2246 isOperationPermiss ableForObject(ss))2245 isOperationPermissibleForObject(drawable) && 2246 isOperationPermissibleForObject(ss)) 2247 2247 { 2248 2248 apply(*ss); … … 2258 2258 osg::StateAttribute* sa = stateset.getTextureAttribute(i,osg::StateAttribute::TEXTURE); 2259 2259 osg::Texture* texture = dynamic_cast<osg::Texture*>(sa); 2260 if (texture && isOperationPermiss ableForObject(texture))2260 if (texture && isOperationPermissibleForObject(texture)) 2261 2261 { 2262 2262 apply(*texture); -
OpenSceneGraph/trunk/src/osgUtil/RenderBin.cpp
r2029 r3432 169 169 // actually we'll do nothing right now, as fine grained sorting by state 170 170 // appears to cost more to do than it saves in draw. The contents of 171 // the RenderGraph leaves is already coa srse grained sorted, this171 // the RenderGraph leaves is already coarse grained sorted, this 172 172 // sorting is as a function of the cull traversal. 173 173 // cout << "doing sortByState "<<this<<endl;
