V-ART
graphicobj.h
Go to the documentation of this file.
1 
5 #ifndef VART_GRAPHICOBJ_H
6 #define VART_GRAPHICOBJ_H
7 
8 #include "vart/scenenode.h"
9 #include "vart/boundingbox.h"
10 
11 namespace VART {
18  class GraphicObj : public SceneNode {
19  public:
20  // PUBLIC TYPES
22 
23  // PUBLIC METHODS
24  GraphicObj();
25 
27  void Show();
29  void Hide();
31  void ToggleVisibility();
32 
34  void ToggleRecVisibility();
35 
37  bool IsVisible();
38 
40  virtual void ComputeBoundingBox() = 0;
41 
47 
49  const BoundingBox& GetBoundingBox() const { return bBox; }
50 
52  void SetBBoxVisibility(bool value) { bBox.visible = value; };
53 
55  void SetBBoxColor(VART::Color value) { bBox.SetColor(value); }
56 
58  const BoundingBox& GetRecursiveBoundingBox() const { return recBBox; }
59 
61  void ToggleBBoxVisibility();
62 
65 
70  unsigned int PickName() const { return pickName; }
71 
76  virtual void DrawForPicking() const;
77 
78  // PUBLIC ATTRIBUTES
81 
82  protected:
83  bool show;
85  BoundingBox recBBox; // recursive bounding box
86 
88  unsigned int pickName;
89 
90  }; // end class declaration
91 } // end namespace
92 #endif
virtual void ComputeBoundingBox()=0
Computes the bounding box.
Base class for objects that compose a scene graph.
Definition: scenenode.h:25
ShowType howToShow
Defines how to show the object.
Definition: graphicobj.h:80
virtual void DrawForPicking() const
Draws and object, setting pick info.
Definition: graphicobj.cpp:90
bool visible
Indicates wether the bounding box is visible.
Definition: boundingbox.h:91
void Hide()
Makes the object invisible.
Definition: graphicobj.cpp:23
void SetBBoxVisibility(bool value)
Sets the bounding box visibility.
Definition: graphicobj.h:52
Header file for V-ART class "SceneNode".
void ComputeRecursiveBoundingBox()
Computes the recursive bounding box.
Definition: graphicobj.cpp:63
void ToggleVisibility()
Toggles the object's visibility.
Definition: graphicobj.cpp:27
BoundingBox recBBox
Definition: graphicobj.h:85
RGBA color representation.
Definition: color.h:24
bool IsVisible()
Checks whether the object is visible.
Definition: graphicobj.cpp:59
Axis aligned bounding box.
Definition: boundingbox.h:23
void SetColor(const Color &value)
Sets the bounding box color.
Definition: boundingbox.h:93
void ToggleRecVisibility()
Toggles the recursive object's visibility.
Definition: graphicobj.cpp:31
An scene node that is associated with a shape.
Definition: graphicobj.h:18
unsigned int pickName
A number that uniquely identifies the object for picking purposes.
Definition: graphicobj.h:88
void Show()
Makes the object visible.
Definition: graphicobj.cpp:19
Header file for V-ART class "BoundingBox".
BoundingBox bBox
Definition: graphicobj.h:84
void ToggleRecBBoxVisibility()
Toggles the recursive bounding box visibility.
Definition: graphicobj.cpp:55
void ToggleBBoxVisibility()
Toggles the bounding box visibility.
Definition: graphicobj.cpp:51
const BoundingBox & GetBoundingBox() const
Returns the bounding box.
Definition: graphicobj.h:49
void SetBBoxColor(VART::Color value)
Sets the bounding box color of graphics object.
Definition: graphicobj.h:55
unsigned int PickName() const
Returns the pick name.
Definition: graphicobj.h:70
const BoundingBox & GetRecursiveBoundingBox() const
Returns the recursive bounding box.
Definition: graphicobj.h:58