00001 00002 /* 00003 ** Mesh Converter 00004 ** Copyright (C) 2008 Damien Rohmer 00005 ** 00006 ** This program is free software: you can redistribute it and/or modify 00007 ** it under the terms of the GNU General Public License as published by 00008 ** the Free Software Foundation, either version 3 of the License, or 00009 ** (at your option) any later version. 00010 ** 00011 ** This program is distributed in the hope that it will be useful, 00012 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 ** GNU General Public License for more details. 00015 ** 00016 ** You should have received a copy of the GNU General Public License 00017 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 00021 00022 /* 00023 ** Edge.h 00024 ** 00025 ** Made by damien 00026 ** Login <damien@ortie> 00027 ** 00028 ** Started on Sat May 17 21:03:59 2008 damien 00029 ** Last update Sat May 17 21:03:59 2008 damien 00030 */ 00031 00032 #ifndef EDGE_H_ 00033 # define EDGE_H_ 00034 00035 00036 #include <stdlib.h> 00037 #include <iostream> 00038 #include <cmath> 00039 #include <string> 00040 #include <errno.h> 00041 #include <stdio.h> 00042 00043 #include <tinyXml/tinyxml.h> 00044 #include <tinyXml/tinystr.h> 00045 00046 #include <vector> 00047 00049 00058 class Edge 00059 { 00060 00061 public: 00062 00063 //************************************************// 00064 //************************************************// 00065 //CONSTRUCTORS 00066 //************************************************// 00067 //************************************************// 00068 00069 00071 Edge(); 00073 Edge(const Edge&); 00075 ~Edge(); 00077 int destroy(); 00078 00079 00080 //************************************************// 00081 //************************************************// 00082 //Set 00083 //************************************************// 00084 //************************************************// 00085 00087 int set_index_0(int i0); 00089 int set_index_1(int i1); 00091 int set_index(int i0,int i1); 00092 00094 int set_face_0(int f0); 00096 int set_face_1(int f1); 00098 int set_face(int f0,int f1); 00099 00101 int set_next_edge(int e0); 00103 int set_previous_edge(int e1); 00105 int set_edges(int e0,int e1); 00106 00107 00109 int set_half_edge(int e); 00110 00111 00112 //************************************************// 00113 //************************************************// 00114 //Access 00115 //************************************************// 00116 //************************************************// 00117 00119 int get_index_0() const; 00121 int& get_index_0(); 00123 int get_index_1() const; 00125 int& get_index_1(); 00126 00128 int get_face_0() const; 00130 int& get_face_0(); 00132 int get_face_1() const; 00134 int& get_face_1(); 00135 00137 int get_edge_0() const; 00139 int& get_edge_0(); 00141 int get_edge_1() const; 00143 int& get_edge_1(); 00145 int get_next_edge_index() const; 00147 int& get_next_edge_index(); 00149 int get_previous_edge_index() const; 00151 int& get_previous_edge_index(); 00152 00153 00155 int get_half_edge() const; 00157 int& get_half_edge(); 00158 00159 00160 //************************************************// 00161 //************************************************// 00162 //OPERATORS 00163 //************************************************// 00164 //************************************************// 00165 00166 //affectation operator 00167 const Edge& operator=(const Edge&); 00168 00170 friend bool operator==(const Edge&,const Edge&); 00172 friend bool operator!=(const Edge&,const Edge&); 00174 friend std::ostream& operator << (std::ostream& flux,const Edge& ); 00175 00176 00177 00178 private: 00179 00181 int index_0; 00183 int index_1; 00185 int face_01; 00187 int face_10; 00189 int next_edge; 00191 int previous_edge; 00193 int half_edge; 00194 00195 }; 00196 00197 #endif /* !EDGE_H_ */
1.5.6