HyperspaceExplorer 0.7.1
|
00001 /* 00002 * File: SurfaceType.h 00003 * Author: lene 00004 * 00005 * Created on December 18, 2011, 3:38 PM 00006 */ 00007 00008 #ifndef SURFACETYPE_H 00009 #define SURFACETYPE_H 00010 00011 #if USE_INT_INDICES 00012 typedef VecMath::uintvec<2> surface_vec_type; 00013 #else 00014 00015 00019 template <unsigned D, unsigned N_vertex> class FacePolygon { 00020 00021 public: 00022 00024 typedef VecMath::Vector<D> vertex_type; 00026 typedef const vertex_type * vertex_ptr_type; 00027 00029 FacePolygon(); 00030 00032 FacePolygon(const VecMath::MultiDimensionalVector< vertex_type, 1 > &original_container, 00033 const vertex_type &v0, const vertex_type &v1, 00034 const vertex_type &v2); 00035 00037 FacePolygon(const VecMath::MultiDimensionalVector< vertex_type, 1 > &original_container, 00038 const vertex_type &v0, const vertex_type &v1, 00039 const vertex_type &v2, const vertex_type &v3); 00040 00042 const vertex_ptr_type &operator[](unsigned i) const; 00043 00045 unsigned index(unsigned i) const; 00046 00048 bool operator==(const FacePolygon<D, 4> &other) const; 00049 00051 void print(); 00052 00053 private: 00055 static unsigned index_of(const vertex_type &x, 00056 const VecMath::MultiDimensionalVector< vertex_type, 1 > &original_container); 00057 00059 vertex_ptr_type _vertices[N_vertex]; 00060 00062 unsigned _indices[N_vertex]; 00063 }; 00064 00065 typedef std::vector< FacePolygon<4, 4> > surface_vec_type; 00066 #endif 00067 00068 #endif /* SURFACETYPE_H */