| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /********************************************************************** 00002 VRS - The Virtual Rendering System 00003 Copyright (C) 2001 Computer Graphics Systems Group at the 00004 Hasso-Plattner-Institute, Potsdam, Germany. 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 This library is distributed in the hope that it will be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 See the GNU Lesser General Public License for more details. 00013 You should have received a copy of the GNU Lesser+ General Public 00014 License along with this library; if not, write to the FreeSoftware 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA, 02111-1307, USA. 00016 **********************************************************************/ 00017 00018 // $Id: lodnode.h 6765 2010-02-03 15:58:38Z jan.klimke $ 00019 // $Date: 2010-02-03 16:58:38 +0100 (Wed, 03 Feb 2010) $ 00020 // $Revision: 6765 $ 00021 // $State$ 00022 // $Author: jan.klimke $ 00023 // 00024 // $Log$ 00025 // Revision 1.7 2005/09/20 09:36:11 baumann 00026 // visitor mechanism refined 00027 // 00028 // Revision 1.6 2005/06/16 14:59:06 baumann 00029 // traverse() method for SceneNodeVisitor added 00030 // 00031 // Revision 1.5 2005/01/03 01:43:10 klimetschek 00032 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00033 // - removed vrs.vcproj 00034 // minor things: 00035 // - added all glutexamples to vrs4glut.sln 00036 // - fixed some problems in glutexamples 00037 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00038 // 00039 // Revision 1.4 2004/11/09 09:03:43 baumann 00040 // - completely rewritten 00041 // - several bug fixes 00042 // 00043 // Revision 1.3 2004/10/28 14:16:01 basch 00044 // Class comment changed (Doxygen style) 00045 // 00046 // Revision 1.2 2004/06/03 07:18:05 kirsch 00047 // removed ellipsis constructor (not portable) 00048 // replaced assertions with checkarg macros 00049 // 00050 // Revision 1.1 2004/06/02 20:25:55 skirsch 00051 // initial version 00052 // 00053 00054 #ifndef VRS_LODNODE_H 00055 #define VRS_LODNODE_H 00056 00057 #include <vrs/scenenode.h> 00058 #include <vrs/container/iterator.h> 00059 #include <map> 00060 00061 namespace VRS { 00062 00077 class VRS_CORE_API LODNode : public SceneNode { 00078 00079 public: 00080 LODNode(); 00082 LODNode( 00083 const SO<Iterator<double> >& distances, 00084 const SO<Iterator<SO<SceneNode> > >& nodes 00085 ); 00087 00088 void append( 00089 double distance, 00090 const SO<SceneNode>& node 00091 ); 00094 void remove(double distance); 00096 void clear(); 00098 00099 unsigned int size() const; 00101 double getDistance(unsigned int index) const; 00103 SO<SceneNode> getLodNode(unsigned int index) const; 00105 SO<SceneNode> getCurrentLodNode(double distance) const; 00107 00108 virtual Bounds boundingBox(Engine* engine) const; 00110 00111 virtual void evaluate(Engine* engine); 00112 00114 virtual SceneNodeVisitor::TraversalFlag traverse(SceneNodeVisitor* visitor); 00115 00116 virtual void modified(); 00118 00119 VRS_TYPEINFO(LODNode, SceneNode); 00120 VRS_SERIALIZABLE(LODNode); 00121 00122 protected: 00123 00124 virtual void acceptChildren(std::vector<Visitable*>& appendChildrenHere) const; 00125 00126 00133 virtual double getDistanceFromCamera( Engine* engine ); 00134 mutable Bounds m_bbox; 00135 00136 private: 00137 std::map<double, SO<SceneNode> > m_distNodePairs; 00138 00139 }; 00140 00141 } // namespace VRS 00142 00143 #endif // VRS_LODNODE_H