Triangle.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef TRIANGLE_H_
00034 # define TRIANGLE_H_
00035
00036 #include <V_3D.h>
00037 #include <Segment.h>
00038
00039 #include <vector>
00040 using namespace std;
00041
00042
00044
00047 class Triangle
00048 {
00049 public:
00050
00051
00052
00053
00054
00056 Triangle();
00058 Triangle(const V_3D& x0,const V_3D& x1,const V_3D& x2);
00060 Triangle(const Triangle& t);
00062 ~Triangle();
00063
00064
00065
00066
00067
00069 int destroy();
00070
00072 V_3D normal() const;
00073
00075 double area() const;
00076
00078
00079 Segment get_segment(int k_edge) const;
00080
00081
00082
00083
00084
00085
00087
00089 int barycentric_coordinates(const V_3D& x,double *alpha,double *beta,double *gamma) const;
00090
00092 int is_vertex_inside(const V_3D _x) const;
00093
00094
00096
00104 V_3D closest_point(const V_3D& x,int *type) const;
00105
00107
00114 std::vector <V_3D> plane_intersection(const V_3D& n,const V_3D& x0,int *type) const;
00116
00117 std::vector <V_3D> plane_intersection(const V_3D& n,const V_3D& x0,int *type,int *type_edge_0,int *type_edge_1,int *type_edge_2) const;
00118
00119
00120
00121
00122
00124 V_3D operator()(int index) const;
00126 V_3D& operator()(int index);
00128 V_3D operator[](int index) const;
00130 V_3D operator[](int index);
00131
00133 Triangle& operator=(const Triangle& t);
00134
00135
00136 private:
00137
00138 V_3D x[3];
00139
00140
00141 };
00142
00143 #endif