triangle.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: triangle.h,v 1.10.18.1 2007/03/25 21:25:32 oliver Exp $
00005 //
00006 
00007 #ifndef BALL_STRUCTURE_TRIANGLE_H
00008 #define BALL_STRUCTURE_TRIANGLE_H
00009 
00010 #ifndef BALL_STRUCTURE_GRAPHEDGE_H
00011 # include <BALL/STRUCTURE/graphEdge.h>
00012 #endif
00013 
00014 #ifndef BALL_STRUCTURE_GRAPHFACE_H
00015 # include <BALL/STRUCTURE/graphFace.h>
00016 #endif
00017 
00018 #ifndef BALL_STRUCTURE_GRAPHVERTEX_H
00019 # include <BALL/STRUCTURE/graphVertex.h>
00020 #endif
00021 
00022 
00023 namespace BALL
00024 {
00025 
00026   class TriangleEdge;
00027   class TrianglePoint;
00028   class TriangulatedSurface;
00029   class TriangulatedSphere;
00030   class TriangulatedSES;
00031   class TriangulatedSAS;
00032   class SESTriangulator;
00033   class SASTriangulator;
00034 
00035 
00039   class BALL_EXPORT Triangle
00040       : public GraphTriangle< TrianglePoint,TriangleEdge,Triangle >
00041   {
00042     
00043     public:
00044 
00057     friend class TriangleEdge;
00058     friend class TrianglePoint;
00059     friend class TriangulatedSurface;
00060     friend class TriangulatedSphere;
00061     friend class TriangulatedSES;
00062     friend class TriangulatedSAS;
00063     friend class SESTriangulator;
00064     friend class SASTriangulator;
00065 
00066     BALL_CREATE(Triangle)
00067 
00068     
00071 
00075     Triangle();
00076 
00082     Triangle(TrianglePoint* v1, TrianglePoint* v2, TrianglePoint* v3);
00083 
00091     Triangle(TriangleEdge* e1, TriangleEdge* e2, TriangleEdge* e3, bool flip_normal = false);
00092 
00100     Triangle(const Triangle& triangle, bool deep = false);
00101 
00105     virtual ~Triangle();
00106 
00108 
00111 
00119     void set(const Triangle& triangle, bool deep = false);
00120 
00126     Triangle& operator = (const Triangle& triangle);
00127 
00129 
00132 
00138     void setPoint(Position i, TrianglePoint* point)
00139       throw(Exception::IndexOverflow);
00140 
00147     TrianglePoint* getPoint(Position i) const
00148       throw(Exception::IndexOverflow);
00149 
00154     void remove(TriangleEdge* edge);
00155 
00157 
00160 
00164     virtual bool operator == (const Triangle&) const;
00165 
00169     virtual bool operator != (const Triangle&) const;
00170 
00174     virtual bool operator *= (const Triangle&) const;
00175     
00177 
00178   };
00179 
00180 
00184 
00187   BALL_EXPORT std::ostream& operator << (std::ostream& s, const Triangle& triangle);
00188 
00190 
00191 
00192 } // namespace BALL
00193 
00194 
00195 #endif  // BALL_STRUCTURE_TRIANGLE_H