| 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 // $Id: sceneswitch.h 6378 2008-06-02 13:30:09Z Konstantin_Baumann $ 00018 // $Date: 2008-06-02 15:30:09 +0200 (Mon, 02 Jun 2008) $ 00019 // $Revision: 6378 $ 00020 // $State$ 00021 // $Author: Konstantin_Baumann $ 00022 // 00023 // $Log$ 00024 // Revision 1.24 2005/09/20 09:36:11 baumann 00025 // visitor mechanism refined 00026 // 00027 // Revision 1.23 2005/01/03 01:43:10 klimetschek 00028 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00029 // - removed vrs.vcproj 00030 // minor things: 00031 // - added all glutexamples to vrs4glut.sln 00032 // - fixed some problems in glutexamples 00033 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00034 // 00035 // Revision 1.22 2004/10/28 14:16:01 basch 00036 // Class comment changed (Doxygen style) 00037 // 00038 // Revision 1.21 2004/06/22 16:10:36 kirsch 00039 // cleanup 00040 // 00041 // Revision 1.20 2004/03/12 16:28:41 baumann 00042 // macros VRS_NAMESPACE_BEGIN/_END expanded and removed 00043 // 00044 // Revision 1.19 2004/02/16 16:42:08 baumann 00045 // - moved class VRS::SceneNode from "vrs/sg/" to "vrs/" 00046 // - renamed class VRS::SceneGraphVisitor to class VRS::SceneNodeVisitor 00047 // and moved it from "vrs/sg/" to "vrs/" 00048 // 00049 // Revision 1.18 2004/01/19 11:43:59 baumann 00050 // serialization mechanism improved 00051 // 00052 // Revision 1.17 2003/11/07 14:19:25 kirsch 00053 // removed leading underscore from include guards 00054 // 00055 // Revision 1.16 2003/07/23 18:28:02 baumann 00056 // acceptChildren() implemented for visitor 00057 // 00058 // Revision 1.15 2003/07/22 16:16:03 baumann 00059 // class Visitor renamed to class SceneNodeVisitor 00060 // 00061 // Revision 1.14 2002/10/29 10:32:53 baumann 00062 // macros VRS_CLASSNAME_* and VRS_IMPL_TYPEINFO_* removed 00063 // 00064 // Revision 1.13 2002/10/28 17:12:23 buchholz 00065 // - traverse-method now returns Visitor::TraversalFlag instead of int 00066 // - Visitor and travers method do not take an Engine parameter any more 00067 // - Visitor::visitScene now gets a bool parameter pushHint. 00068 // - Now visitScene is called twice for each object: One call with 00069 // pushHint==true, when the object is pushed, one call with pushHint==false, 00070 // when the object is popped. 00071 // 00072 // Revision 1.12 2002/07/02 15:23:48 baumann 00073 // non-persistent containers now have the prefix NonPersistent, e.g. NonPersistentArray<T> 00074 // persistent containers now have no prefix, e.g. Array<T> 00075 // 00076 // Revision 1.11 2002/03/04 12:04:17 kersting 00077 // directory structure changes 00078 // 00079 // Revision 1.10 2002/03/03 21:44:26 kosta 00080 // VRS_TYPEINFO-macro rewritten 00081 // 00082 // Revision 1.9 2002/02/19 10:34:20 kosta 00083 // undone all changes since 2002-02-15 00084 // 00085 // Revision 1.6 2002/02/12 15:04:34 kosta 00086 // VRS container classes completely rewritten using STL 00087 // 00088 // Revision 1.5 2002/02/05 07:48:26 kosta 00089 // new persistency macros: 00090 // VRS_SERIALIZABLE(CLASS_NAME); 00091 // VRS_SERIALIZABLE_ABSTRACT_CLASS(CLASS_NAME); 00092 // VRS_SERIALIZABLE_NO_SO_CLASS(CLASS_NAME) 00093 // 00094 // Revision 1.4 2002/02/04 13:07:19 kosta 00095 // VRS_SERIALIZABLE macros completely rewritten 00096 // 00097 // Revision 1.3 2002/01/15 16:25:55 kosta 00098 // macros rewritten for a better namespace support 00099 // 00100 // Revision 1.2 2001/11/13 16:36:31 kirsch 00101 // changed line feed to unix style (removed control-M) 00102 // 00103 // Revision 1.1.1.1 2001/06/08 08:09:21 kirsch 00104 // imported alpha-version by olli 00105 // 00106 00107 00108 #ifndef VRS_SCENESWITCH_H 00109 #define VRS_SCENESWITCH_H 00110 00111 #include <vrs/scenenode.h> 00112 00113 namespace VRS { 00114 00115 class Canvas; 00116 template<typename T> class NonPersistentDeque; 00117 00119 class VRS_CORE_API SceneSwitch : public SceneNode { 00120 00121 public: 00122 SceneSwitch(); 00130 virtual void append(SceneNode* node); 00131 virtual void prepend(SceneNode* node); 00132 virtual void insert(int, SceneNode* node); 00133 virtual void remove(int i); 00134 virtual void remove(SceneNode* node); 00135 virtual void clear(); 00137 00138 virtual void setMask(SceneNode* node, Canvas* canvas); 00139 virtual Canvas* getMask(SceneNode* node) const; 00141 00142 virtual int childNodes() const; 00143 virtual SceneNode* childNode(int i) const; 00145 00146 virtual void evaluate(Engine* engine); 00151 virtual SceneNodeVisitor::TraversalFlag traverse(SceneNodeVisitor* visitor); 00155 virtual Bounds boundingBox(Engine* engine) const; 00159 virtual void install(Engine* engine); 00160 virtual void deinstall(Engine* engine); 00165 VRS_TYPEINFO(SceneSwitch, SceneNode); 00166 VRS_SERIALIZABLE(SceneSwitch); 00167 00168 protected: 00169 virtual void acceptChildren(std::vector<Visitable*>& appendChildrenHere) const; 00170 00171 private: 00172 SO<NonPersistentDeque<SO<SceneNode> > > children_; 00173 SO<NonPersistentDeque<WO<Canvas> > > masks_; 00174 }; 00175 00176 } // namespace VRS 00177 00178 #endif // VRS_SCENESWITCH_H