Cafu Engine
PlantNode.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_TREE_NODE_HPP_INCLUDED
8 #define CAFU_TREE_NODE_HPP_INCLUDED
9 
10 #include "Node.hpp"
11 #include "Plants/Tree.hpp"
12 
13 
14 struct PlantDescriptionT;
15 class PlantDescrManT;
16 
17 
18 namespace cf
19 {
20  namespace SceneGraph
21  {
22  class PlantNodeT : public GenericNodeT
23  {
24  public:
25 
26  /// The constructor.
27  PlantNodeT();
28 
29  /// Constructor for creating a PlantNodeT from parameters.
30  PlantNodeT(const PlantDescriptionT* PlantDescription, unsigned long RandomSeed, const Vector3dT& Position, const Vector3fT& Angles);
31 
32  /// Named constructor.
33  static PlantNodeT* CreateFromFile_cw(std::istream& InFile, aux::PoolT& Pool, LightMapManT& LMM, SHLMapManT& SMM, PlantDescrManT& PDM);
34 
35  /// The destructor.
36  ~PlantNodeT();
37 
38  // The NodeT interface.
39  void WriteTo(std::ostream& OutFile, aux::PoolT& Pool) const;
41 
42  // void InitDrawing();
43  bool IsOpaque() const { return false; };
44  void DrawAmbientContrib(const Vector3dT& ViewerPos) const;
45  //void DrawStencilShadowVolumes(const Vector3dT& LightPos, const float LightRadius) const;
46  //void DrawLightSourceContrib(const Vector3dT& ViewerPos, const Vector3dT& LightPos) const;
47  void DrawTranslucentContrib(const Vector3dT& ViewerPos) const;
48 
49 
50  private:
51 
52  PlantNodeT(const PlantNodeT&); ///< Use of the Copy Constructor is not allowed.
53  void operator = (const PlantNodeT&); ///< Use of the Assignment Operator is not allowed.
54 
55 
56  TreeT m_Tree;
57  unsigned long m_RandomSeed;
58  Vector3dT m_Position;
59  Vector3fT m_Angles;
60  std::string m_DescrFileName;
61  BoundingBox3dT m_Bounds;
62  };
63  }
64 }
65 
66 
67 #endif
This class manages lightmaps, e.g. by "allocating" rectangular areas in larger bitmaps.
Definition: LightMapMan.hpp:25
const BoundingBox3T< double > & GetBoundingBox() const
Returns the bounding box of the contents of this scene node.
Definition: PlantNode.cpp:73
Definition: _aux.hpp:111
This class manages SHL maps, e.g. by "allocating" rectangular areas in larger coefficient maps...
Definition: SHLMapMan.hpp:25
The plant description manager holds and manages all plant descriptions so they can be shared with mul...
Definition: PlantDescrMan.hpp:19
Contains a plant description that has all the information needed to create a plant.
Definition: PlantDescription.hpp:23
PlantNodeT()
The constructor.
Definition: PlantNode.cpp:19
Describes a renderable tree.
Definition: Tree.hpp:27
Definition: PlantNode.hpp:22
~PlantNodeT()
The destructor.
Definition: PlantNode.cpp:57
bool IsOpaque() const
TODO / FIXME: This method is a hot-fix for getting the render order with translucent Bezier Patches r...
Definition: PlantNode.hpp:43
static PlantNodeT * CreateFromFile_cw(std::istream &InFile, aux::PoolT &Pool, LightMapManT &LMM, SHLMapManT &SMM, PlantDescrManT &PDM)
Named constructor.
Definition: PlantNode.cpp:40
Definition: Node.hpp:35
void DrawAmbientContrib(const Vector3dT &ViewerPos) const
Draws the contents of this scene node.
Definition: PlantNode.cpp:79