00001 #ifndef __J2K__Maille_HPP__
00002 #define __J2K__Maille_HPP__
00003
00004 #include <j2k/Fred/3d/Sommet.hpp>
00005
00006 class ArcD;
00007 class FaceC;
00008 class Maillage3DH;
00009
00010 DefType(ArcD)
00011 DefType(FaceC)
00012 DefType(Maillage3DH)
00013
00014
00015
00016
00017 class ArcD {
00018
00019 public:
00020 int sini, sfin;
00021
00022 ArcD(): sini(0), sfin(0) { }
00023
00024 ArcD( int ini, int fin ) : sini( ini ), sfin( fin ) { }
00025
00026 ArcD( const ArcD& a ) : sini(a.sini), sfin(a.sfin) { }
00027
00028 const RArcD& operator=( const ArcD& a );
00029
00030 };
00031
00032 inline istream& operator>>( istream& in, const ArcD& a ) {
00033 return in >>a.sini>>a.sfin;
00034 }
00035
00036 inline ostream& operator<<( ostream& out, const ArcD& a ) {
00037 return out <<a.sini<<' '<<a.sfin<<'\n';
00038 }
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 class Face {
00049
00050 public:
00051 int* data;
00052 UINT int card;
00053
00054 Face(int* d = NULL, UINT c = 0 ) : data(d), card(c) { }
00055
00056 virtual UINT count() {
00057 return card;
00058 }
00059
00060 virtual UINT size() = 0;
00061
00062 int AIni() {
00063 return ( (data != NULL) ? data[ 0 ] : (-1) );
00064 }
00065
00066 int AFin() {
00067 return ( (data != NULL) ? data[count() - 1 ] : (-1) );
00068 }
00069
00070 };
00071
00072 istream& operator>>( istream& in, const Face& f );
00073 ostream& operator<<( ostream& out, const Face& f );
00074
00075
00076
00077
00078
00079
00080
00081
00082 class FaceC : public Face {
00083
00084 public:
00085 int dataC[4];
00086
00087 FaceC() : Face( dataC , 4 ) { }
00088
00089 virtual UINT size() { return 4; }
00090 };
00091
00092 inline istream& operator>>( istream& in, const FaceC& f) {
00093 return in >> (Face&)f;
00094 }
00095
00096 inline ostream& operator<<( ostream& out, const FaceC& f) {
00097 return out << (Face&)f;
00098 }
00099
00100
00101
00102
00103
00104 class Maillage3DH {
00105 public:
00106
00107 Sommet3DH* sommets,
00108 * normales;
00109
00110 ArcD* arcs;
00111 FaceC* faces;
00112
00113 int cardsommets,
00114 cardnormales,
00115 cardarcs,
00116 cardfaces;
00117
00118 Maillage3DH( int s = 0, int a = 0, int f = 0 )
00119 : cardsommets (0),
00120 cardnormales(0),
00121 cardarcs (0),
00122 cardfaces (0),
00123 sommets (NULL),
00124 normales (NULL),
00125 arcs (NULL),
00126 faces (NULL)
00127 {
00128 init( s, a, f );
00129 }
00130
00131 virtual ~Maillage3DH() { flush(); }
00132
00133 void init( int s = 0, int a = 0, int f = 0 );
00134
00135 void flush( BOOL fs = TRUE,
00136 BOOL fa = TRUE,
00137 BOOL ff = TRUE,
00138 BOOL fn = TRUE
00139 );
00140
00141 };
00142
00143 istream& operator>>( istream& in, const Maillage3DH& m );
00144 ostream& operator<<( ostream& out, const Maillage3DH& m );
00145
00146 #endif