Changeset 13041 for OpenSceneGraph/trunk/include/osg/LOD
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osg/LOD (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/LOD
r12817 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 36 36 { 37 37 public : 38 38 39 39 LOD(); 40 40 … … 48 48 49 49 virtual void traverse(NodeVisitor& nv); 50 50 51 51 virtual bool addChild(Node *child); 52 52 … … 57 57 typedef std::pair<float,float> MinMaxPair; 58 58 typedef std::vector<MinMaxPair> RangeList; 59 59 60 60 /** Modes which control how the center of object should be determined when computing which child is active.*/ 61 61 enum CenterMode … … 72 72 CenterMode getCenterMode() const { return _centerMode; } 73 73 74 /** Sets the object-space point which defines the center of the osg::LOD. 74 /** Sets the object-space point which defines the center of the osg::LOD. 75 75 center is affected by any transforms in the hierarchy above the osg::LOD.*/ 76 76 inline void setCenter(const vec_type& center) { if (_centerMode!=UNION_OF_BOUNDING_SPHERE_AND_USER_DEFINED) { _centerMode=USER_DEFINED_CENTER; } _userDefinedCenter = center; } 77 77 78 78 /** return the LOD center point. */ 79 79 inline const vec_type& getCenter() const { if ((_centerMode==USER_DEFINED_CENTER)||(_centerMode==UNION_OF_BOUNDING_SPHERE_AND_USER_DEFINED)) return _userDefinedCenter; else return getBound().center(); } 80 80 81 81 82 /** Set the object-space reference radius of the volume enclosed by the LOD. 82 /** Set the object-space reference radius of the volume enclosed by the LOD. 83 83 * Used to determine the bounding sphere of the LOD in the absence of any children.*/ 84 84 inline void setRadius(value_type radius) { _radius = radius; } 85 85 86 86 /** Get the object-space radius of the volume enclosed by the LOD.*/ 87 87 inline value_type getRadius() const { return _radius; } … … 93 93 PIXEL_SIZE_ON_SCREEN 94 94 }; 95 95 96 96 /** Set how the range values should be interpreted when computing which child is active.*/ 97 97 void setRangeMode(RangeMode mode) { _rangeMode = mode; } … … 104 104 Values are floating point distance specified in local objects coordinates.*/ 105 105 void setRange(unsigned int childNo, float min,float max); 106 106 107 107 /** returns the min visible range for specified child.*/ 108 108 inline float getMinRange(unsigned int childNo) const { return _rangeList[childNo].first; } … … 110 110 /** returns the max visible range for specified child.*/ 111 111 inline float getMaxRange(unsigned int childNo) const { return _rangeList[childNo].second; } 112 113 /** returns the number of ranges currently set. 112 113 /** returns the number of ranges currently set. 114 114 * An LOD which has been fully set up will have getNumChildren()==getNumRanges(). */ 115 115 inline unsigned int getNumRanges() const { return _rangeList.size(); }
