vertex2.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: vertex2.h,v 1.12 2005/12/23 17:02:08 amoll Exp $
00005 //
00006 
00007 #ifndef BALL_VIEW_DATATYPE_VERTEX2_H
00008 #define BALL_VIEW_DATATYPE_VERTEX2_H
00009 
00010 #ifndef BALL_COMMON_H
00011 # include <BALL/common.h>
00012 #endif
00013 
00014 #ifndef BALL_MATHS_VECTOR3_H
00015 # include <BALL/MATHS/vector3.h>
00016 #endif
00017 
00018 namespace BALL
00019 {
00020   namespace VIEW
00021   {
00022 
00032     class BALL_VIEW_EXPORT Vertex2
00033     {
00034       public:
00035 
00036       BALL_CREATE(Vertex2)
00037 
00038       
00041 
00046       Vertex2();
00047 
00050       Vertex2(const Vertex2& vertex);
00051 
00053 
00056 
00059       virtual ~Vertex2();
00060 
00066       virtual void clear();
00067 
00069 
00072 
00077       void set(const Vertex2& vertex);
00078 
00084       const Vertex2& operator = (const Vertex2& vertex);
00085 
00088       void swap(Vertex2& vertex);
00089 
00091 
00094 
00099       void setVertex1(const Vector3& v);
00100 
00104       void setVertex1(const float x, const float y, const float z);
00105 
00110       Vector3& getVertex1();
00111 
00114       const Vector3& getVertex1() const;
00115 
00121       void getVertex1(Vector3& v) const;
00122 
00126       void getVertex1(float& x, float& y, float& z) const;
00127 
00142       void setVertex1Address(const Vector3& v);
00143 
00151       void setDefaultVertex1Address();
00152 
00157       Vector3* getVertex1Address() const;
00158 
00163       void setVertex2(const Vector3& v);
00164 
00168       void setVertex2(const float x, const float y, const float z);
00169 
00174       Vector3& getVertex2();
00175 
00179       const Vector3& getVertex2() const;
00180 
00187       void getVertex2(Vector3& v) const;
00188 
00192       void getVertex2(float& x, float& y, float& z) const;
00193 
00208       void setVertex2Address(const Vector3& v);
00209 
00219       void setDefaultVertex2Address();
00220 
00225       Vector3* getVertex2Address() const;
00226 
00232       void setVertices(const Vector3& vertex1, const Vector3& vertex2);
00233 
00237       void setVertices
00238         (const float vertex1_x,
00239          const float vertex1_y,
00240          const float vertex1_z,
00241          const float vertex2_x,
00242          const float vertex2_y,
00243          const float vertex2_z);
00244 
00253       void setVertexAddresses(const Vector3& vertex1, const Vector3& vertex2);
00254 
00260       void getVertices(Vector3& vertex1, Vector3& vertex2);
00261 
00266       void getVertices
00267         (float& vertex1_x, float& vertex1_y, float& vertex1_z,
00268          float& vertex2_x, float& vertex2_y, float& vertex2_z);
00269 
00280       void setDefaultVertexAddresses();
00281 
00283 
00286 
00296       bool isDefaultVertex1Address() const;
00297 
00307       bool isDefaultVertex2Address() const;
00308 
00319       bool isDefaultVertexAddresses() const;
00320 
00322 
00325 
00329       virtual bool isValid() const;
00330 
00338       virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
00339 
00341 
00342       private:
00343     
00344       /* vertex 1 */
00345       Vector3 vertex1_;
00346 
00347       /* vertex 2 */
00348       Vector3 vertex2_;
00349 
00350       /* vertex 1 pointer */
00351       Vector3* vertex1_ptr_;
00352 
00353       /* vertex 2 pointer */
00354       Vector3* vertex2_ptr_;
00355     };
00356 
00357 
00358 #   ifndef BALL_NO_INLINE_FUNCTIONS
00359 #     include <BALL/VIEW/DATATYPE/vertex2.iC>
00360 #   endif
00361   
00362   } // namespace VIEW
00363 } // namespace BALL
00364 
00365 #endif // BALL_VIEW_DATATYPE_VERTEX2_H