VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtOsgForest.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2007 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtOsgForest.h,v $ $Revision: 1.35 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtOsgForest_H_
14 #define DtOsgForest_H_
15 
16 #include <vrvOsg/vrvOsg.h>
17 #include <vrvCore/DtForestObject.h>
18 #include <vrvCore/DtAgentManager.h>
19 #include <osg/ref_ptr>
20 #include <osg/Group>
21 
22 namespace makVrv
23 {
24  class DtOsgModelInstance;
25 
29  {
30 
31  public:
32 
33  typedef std::map<DtUniqueID, osg::PositionAttitudeTransform*> TreePatMap;
34 
36  friend class DtOsgForestClassesCreator;
37  friend class DtOsgForestCreator;
38 
40  virtual ~DtOsgForest();
41 
45 
46 
48  virtual void removeTree(DtUniqueID id);
49 
51  virtual void removeAllTrees();
52 
54  virtual void setTreeClippingPlane(float fFar);
55 
57  virtual void setTree3DLodDistances(float fNear, float fFar);
58 
60  virtual void getTreeClippingPlane(float& fFar);
61 
63  virtual void getTree3DLodDistances(float& fNear, float& fFar);
64 
66  virtual void setTreeBillboardDistances(float fStart, float fEnd);
67 
69  virtual void getTreeBillboardDistances(float& fStart, float& fEnd);
70 
72 
76 
77 
79  virtual void addUniqueTree(const DtTreeRecord& record);
80 
82  unsigned int treeCount() const;
83 
85  virtual DtTreeRecord* findTreeRecord(DtUniqueID id);
86 
88  virtual DtTreeModel* findTreeModel( const std::string& modelDef);
89 
91  virtual DtModelInstance* findModelInstance( const std::string& modelDef);
92 
94  virtual osg::Group* rootGroup();
95 
97 
98  protected:
99 
101  DtOsgForest(DtDe& de, DtUniqueID id);
102 
104  virtual bool createTree(const DtTreeRecord& record);
105 
106  virtual osg::PositionAttitudeTransform* createPat( const DtTreeRecord &record );
107 
109  virtual DtOsgModelInstance* findOsgModelInstance( const std::string& modelDef);
110 
112  virtual osg::PositionAttitudeTransform* findPat(const DtUniqueID id);
113 
115  virtual void removePat(const DtUniqueID id);
116 
118  virtual void slot_treeModelInstanceToBeDestroyed(const std::string& modelDef);
119 
121  virtual void removeTreeModel( const std::string& modelDef);
122 
124  virtual void slot_treeModelInstanceCreated(const std::string& modelDef);
125 
126  protected:
127 
129 
131  osg::ref_ptr<osg::Group> myRoot;
132  float myFarPlane;
133 
136 
139 
140  };
141 
145  {
146 
147  public:
148 
150  virtual DtForestObject* create(DtDe& de, DtUniqueID id);
151 
152  };
153 
154 }
155 
156 #endif
157 

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)