Changeset 13041 for OpenSceneGraph/trunk/include/osg/ProxyNode
- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osg/ProxyNode (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/ProxyNode
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 */ … … 24 24 { 25 25 public : 26 26 27 27 ProxyNode(); 28 28 … … 31 31 32 32 META_Node(osg, ProxyNode); 33 33 34 34 typedef osg::BoundingSphere::vec_type vec_type; 35 35 typedef osg::BoundingSphere::value_type value_type; 36 36 37 37 virtual void traverse(NodeVisitor& nv); 38 38 39 39 virtual bool addChild(Node *child); 40 40 virtual bool addChild(Node *child, const std::string& filename); 41 41 42 42 virtual bool removeChildren(unsigned int pos,unsigned int numChildrenToRemove); 43 43 … … 62 62 unsigned int getNumFileNames() const { return _filenameList.size(); } 63 63 64 /** Return the DatabaseRequest object used by the DatabasePager to keep track of file load requests 64 /** Return the DatabaseRequest object used by the DatabasePager to keep track of file load requests 65 65 * being carried on behalf of the DatabasePager. 66 * Note, in normal OSG usage you should not set this value yourself, as this will be managed by 66 * Note, in normal OSG usage you should not set this value yourself, as this will be managed by 67 67 * the osgDB::DatabasePager.*/ 68 68 osg::ref_ptr<osg::Referenced>& getDatabaseRequest(unsigned int childNo) { return _filenameList[childNo].second; } 69 70 /** Return the const DatabaseRequest object.*/ 69 70 /** Return the const DatabaseRequest object.*/ 71 71 const osg::ref_ptr<osg::Referenced>& getDatabaseRequest(unsigned int childNo) const { return _filenameList[childNo].second; } 72 72 … … 85 85 /** Get how the center of object should be determined when computed which child is active.*/ 86 86 CenterMode getCenterMode() const { return _centerMode; } 87 87 88 88 /** Modes which control how the proxynode external reference are loaded.*/ 89 89 enum LoadingExternalReferenceMode … … 100 100 LoadingExternalReferenceMode getLoadingExternalReferenceMode() const { return _loadingExtReference; } 101 101 102 /** Sets the object-space point which defines the center of the osg::ProxyNode. 102 /** Sets the object-space point which defines the center of the osg::ProxyNode. 103 103 center is affected by any transforms in the hierarchy above the osg::ProxyNode.*/ 104 104 inline void setCenter(const vec_type& center) { if (_centerMode!=UNION_OF_BOUNDING_SPHERE_AND_USER_DEFINED) { _centerMode=USER_DEFINED_CENTER; } _userDefinedCenter = center; } 105 105 106 106 /** return the ProxyNode center point. */ 107 107 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(); } 108 108 109 109 110 /** Set the object-space reference radius of the volume enclosed by the ProxyNode. 110 /** Set the object-space reference radius of the volume enclosed by the ProxyNode. 111 111 * Used to determine the bounding sphere of the ProxyNode in the absence of any children.*/ 112 112 inline void setRadius(value_type radius) { _radius = radius; } 113 113 114 114 /** Get the object-space radius of the volume enclosed by the ProxyNode.*/ 115 115 inline value_type getRadius() const { return _radius; } … … 118 118 119 119 protected : 120 120 121 121 virtual ~ProxyNode() {} 122 122 … … 129 129 ref_ptr<Referenced> _databaseOptions; 130 130 std::string _databasePath; 131 131 132 132 LoadingExternalReferenceMode _loadingExtReference; 133 133 134 134 CenterMode _centerMode; 135 135 vec_type _userDefinedCenter; 136 136 value_type _radius; 137 137 138 138 }; 139 139
