BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
geometricObject.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: geometricObject.h,v 1.39.16.2 2007-03-28 13:51:45 amoll Exp $
5 //
6 
7 #ifndef BALL_VIEW_KERNEL_GEOMETRICOBJECT_H
8 #define BALL_VIEW_KERNEL_GEOMETRICOBJECT_H
9 
10 #ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
12 #endif
13 
14 #ifndef BALL_MATHS_VECTOR3_H
15 # include <BALL/MATHS/vector3.h>
16 #endif
17 
18 #ifdef BALL_DATATYPE_HASHSET_H
19 # include <BALL/DATATYPE/hashSet.h>
20 #endif
21 
22 namespace BALL
23 {
24  class Composite;
25 
26  namespace VIEW
27  {
37  {
38  public:
39 
44 
45  //@} /** @name Constructors and Destructors*/ //@{
46 
47 
57 
61  GeometricObject(const GeometricObject& object);
62 
65  virtual ~GeometricObject();
66 
74  virtual void clear();
75 
79 
82  void set(const GeometricObject& object);
83 
87  GeometricObject& operator = (const GeometricObject& object);
88 
92  void swap(GeometricObject& object);
93 
95 
98 
100  void setComposite(const Composite* composite)
101  { composite_ = composite;}
102 
104  const Composite* getComposite() const
105  { return composite_;}
106 
108 
110 
118  virtual bool isValid() const
119  {return true;}
120 
128  virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
129 
132  void setColor(const ColorRGBA& color)
133  { color_ = color; }
134 
137  void setColor(const ColorUnit& red, const ColorUnit& green,
138  const ColorUnit& blue, const ColorUnit& alpha = (float)1)
139  { color_.set(red, green, blue, alpha);}
140 
143  const ColorRGBA& getColor() const
144  { return color_; }
145 
148  { return color_; }
149 
152  void getColor(ColorUnit& red, ColorUnit& green,
153  ColorUnit& blue, ColorUnit& alpha) const
154  { color_.get(red, green, blue, alpha); }
155 
157  void getColors(HashSet<String>& colors);
158 
160  bool operator == (const GeometricObject& object) const
161  { return this == &object;}
162 
163 
165  bool operator < (const GeometricObject& object) const
166  { return this < &object;}
167 
168  // Method to get all vertices from a geometric object
169  virtual void getVertices(std::vector<Vector3>&) const {};
170 
172 
173  private:
174 
175  void clear_();
176 
177  ColorRGBA color_;
178 
179  // the composite, which is represented by this geometric object
180  const Composite* composite_;
181 
182  };
183 
185  typedef std::list<GeometricObject*> GeometricObjectList;
186 
187 } } // namespaces
188 #endif // BALL_VIEW_KERNEL_GEOMETIRCOBJECT_H
void setColor(const ColorRGBA &color)
#define BALL_CREATE(name)
Definition: create.h:62
void setColor(const ColorUnit &red, const ColorUnit &green, const ColorUnit &blue, const ColorUnit &alpha=(float) 1)
void getColor(ColorUnit &red, ColorUnit &green, ColorUnit &blue, ColorUnit &alpha) const
virtual void getVertices(std::vector< Vector3 > &) const
void setComposite(const Composite *composite)
virtual bool isValid() const
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
std::list< GeometricObject * > GeometricObjectList
BALL_EXPORT bool operator==(const String &s1, const String &s2)
const Composite * getComposite() const
const ColorRGBA & getColor() const
BALL_EXPORT bool operator<(const String &s1, const String &s2)