BALL  1.4.1
triangle.h
Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 
00005 #ifndef BALL_STRUCTURE_TRIANGLE_H
00006 #define BALL_STRUCTURE_TRIANGLE_H
00007 
00008 #ifndef BALL_STRUCTURE_GRAPHEDGE_H
00009 # include <BALL/STRUCTURE/graphEdge.h>
00010 #endif
00011 
00012 #ifndef BALL_STRUCTURE_GRAPHFACE_H
00013 # include <BALL/STRUCTURE/graphFace.h>
00014 #endif
00015 
00016 #ifndef BALL_STRUCTURE_GRAPHVERTEX_H
00017 # include <BALL/STRUCTURE/graphVertex.h>
00018 #endif
00019 
00020 
00021 namespace BALL
00022 {
00023 
00024   class TriangleEdge;
00025   class TrianglePoint;
00026   class TriangulatedSurface;
00027   class TriangulatedSphere;
00028   class TriangulatedSES;
00029   class TriangulatedSAS;
00030   class SESTriangulator;
00031   class SASTriangulator;
00032 
00033 
00037   class BALL_EXPORT Triangle
00038       : public GraphTriangle< TrianglePoint,TriangleEdge,Triangle >
00039   {
00040     
00041     public:
00042 
00055     friend class TriangleEdge;
00056     friend class TrianglePoint;
00057     friend class TriangulatedSurface;
00058     friend class TriangulatedSphere;
00059     friend class TriangulatedSES;
00060     friend class TriangulatedSAS;
00061     friend class SESTriangulator;
00062     friend class SASTriangulator;
00063 
00064     BALL_CREATE(Triangle)
00065 
00066     
00069 
00073     Triangle();
00074 
00080     Triangle(TrianglePoint* v1, TrianglePoint* v2, TrianglePoint* v3);
00081 
00089     Triangle(TriangleEdge* e1, TriangleEdge* e2, TriangleEdge* e3, bool flip_normal = false);
00090 
00098     Triangle(const Triangle& triangle, bool deep = false);
00099 
00103     virtual ~Triangle();
00104 
00106 
00109 
00117     void set(const Triangle& triangle, bool deep = false);
00118 
00124     Triangle& operator = (const Triangle& triangle);
00125 
00127 
00130 
00136     void setPoint(Position i, TrianglePoint* point)
00137       throw(Exception::IndexOverflow);
00138 
00145     TrianglePoint* getPoint(Position i) const
00146       throw(Exception::IndexOverflow);
00147 
00152     void remove(TriangleEdge* edge);
00153 
00155 
00158 
00162     virtual bool operator == (const Triangle&) const;
00163 
00167     virtual bool operator != (const Triangle&) const;
00168 
00172     virtual bool operator *= (const Triangle&) const;
00173     
00175 
00176   };
00177 
00178 
00182 
00185   BALL_EXPORT std::ostream& operator << (std::ostream& s, const Triangle& triangle);
00186 
00188 
00189 
00190 } // namespace BALL
00191 
00192 
00193 #endif  // BALL_STRUCTURE_TRIANGLE_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines