V-ART
cone.h
Go to the documentation of this file.
1 
5 #ifndef VART_CONE_H
6 #define VART_CONE_H
7 
8 #include "vart/graphicobj.h"
9 #include "vart/material.h"
10 
11 namespace VART {
17 // It is up to the Draw methods to make the above statement true.
18  class Cone : public GraphicObj {
19  public:
25 
27  Cone();
28  Cone( const VART::Cone& cone );
29  VART::Cone & operator = (const VART::Cone& cone);
30 
33  virtual VART::SceneNode * Copy();
34 
35  Cone( float fHi, float fRad );
36  Cone( float fHi, float fRad, bool bS, bool bB );
37 
39  virtual void ComputeBoundingBox();
40 
41  void SetHeight(float h);
43  void SetRadius( float r );
44 
46  void SetMaterial(const Material& mat) { material = mat; }
47 
51  void SetPartsVisibility(PartsID parts);
52 
56  void TogglePartsVisibilty(PartsID parts);
57 
60 
62  void ShowSide( bool yesno );
64  void ShowBottom( bool yesno );
65  float GetHeight();
67  float GetRadius();
69  Material GetMaterial() const { return material; }
71  bool ShowSide();
73  bool ShowBottom();
74  private:
75  // PRIVATE METHODS
78  bool DrawInstanceOGL() const;
79  // PRIVATE ATTRIBUTES
80  float height;
81  float topRadius;
82  float btRadius;
83  bool sidesVisible;
84  bool topVisible;
85  bool bottomVisible;
86  Material material;
87  }; // end class declaration
88 } // end namespace
89 
90 // OPERATORS FOR PartsID
91 
93  return VART::Cone::PartsID(static_cast<int>(a) & static_cast<int>(b));
94 }
95 
97  return VART::Cone::PartsID(static_cast<int>(a) | static_cast<int>(b));
98 }
99 
100 #endif
A cone.
Definition: cone.h:18
Base class for objects that compose a scene graph.
Definition: scenenode.h:25
PartsID GetPartsVisibility()
Returns internal visibility state as PartsID.
Definition: cone.cpp:102
virtual VART::SceneNode * Copy()
Returns a copy of an cone. Every derived class must reimplements this method, to avoid errors with VA...
Definition: cone.cpp:52
PartsID
Bitmask for cone parts.
Definition: cone.h:24
Header file for V-ART class "Material".
Header file for V-ART class "GraphicObj".
float GetHeight()
Definition: cone.cpp:123
void SetRadius(float r)
Sets the value of bottom radius.
Definition: cone.cpp:83
VART::Cone::PartsID operator|(VART::Cone::PartsID a, VART::Cone::PartsID b)
Definition: cone.h:96
void SetHeight(float h)
Definition: cone.cpp:75
An scene node that is associated with a shape.
Definition: graphicobj.h:18
void SetMaterial(const Material &mat)
Material assignment.
Definition: cone.h:46
VART::Cone::PartsID operator&(VART::Cone::PartsID a, VART::Cone::PartsID b)
Definition: cone.h:92
virtual void ComputeBoundingBox()
Computes the bounding box.
Definition: cone.cpp:69
bool ShowSide()
Definition: cone.cpp:133
Material properties for graphical objects.
Definition: material.h:16
bool ShowBottom()
Definition: cone.cpp:139
float GetRadius()
Returns the bottom radius.
Definition: cone.cpp:128
void SetPartsVisibility(PartsID parts)
Sets which parts are visible.
Definition: cone.cpp:90
Cone()
Creates an uninitialized cone.
Definition: cone.cpp:17
VART::Cone & operator=(const VART::Cone &cone)
Definition: cone.cpp:27
void TogglePartsVisibilty(PartsID parts)
Toogle visibility of marked parts.
Definition: cone.cpp:96
Material GetMaterial() const
Returns of copy of the cone's material.
Definition: cone.h:69