00001
00002
00003 #ifndef __J2K__MODELEUR_HPP__
00004 #define __J2K__MODELEUR_HPP__
00005
00006 #include "topolog.h"
00007 #include "modgrf.h"
00008
00009 #ifndef __GENE_TYPE
00010 #define __GENE_TYPE
00011 typedef struct
00012 {
00013 unsigned_ptype : 1,
00014 pvert : 1,
00015 phor : 1,
00016 ponaxis : 2;
00017 } GenerateType;
00018 #endif
00019
00020 typedef char ShapeName[9];
00021
00022 #define ShapeExt ".shp"
00023
00024 #define __ReservedMsg 100
00025 #define MOD_GENERATE_ERROR_OPEN_FIC 100
00026 #define MOD_SOM_ERROR_BAD_FIC_WRITE 101
00027
00028
00029
00030 struct __Result
00031 {
00032 int error;
00033 GenerateType type;
00034 Cardinal cardsommet,
00035 cardarc,
00036 cardface;
00037 };
00038
00039
00040
00041 struct AxisCAO
00042 {
00043 __Result globalresult;
00044 ShapeName name;
00045 Cardinal cardprofil;
00046 Sommet3D* profil;
00047 Vector3D axis;
00048 UINT pas;
00049
00050 AxisCAO ( char* name,
00051 Cardinal c,
00052 Sommet3D* pf,
00053 Vector3D& v,
00054 UINT p );
00055
00056 virtual int GenerateVertex( FILE* f ) = 0;
00057 int GenerateArc ( FILE* f );
00058 int GenerateFace ( FILE* f );
00059
00060 virtual numerotation* AllocNumerotation() = 0;
00061 virtual char* GetErrorMsg() = 0;
00062 };
00063
00064
00065
00066 struct RotProfToProfAxisCAO : public AxisCAO
00067 {
00068 double angle;
00069 Sommet3D* profil1;
00070
00071 RotProfToProfAxisCAO ( Cardinal c,
00072 Sommet3D* pf,
00073 Sommet3D* pf1,
00074 double a,
00075 UINT p,
00076 Vector3D& v,
00077 char*name = NULL) : angle (a),
00078 profil1(pf1),
00079 AxisCAO( name,
00080 c,
00081 pf,
00082 v,
00083 p ) { }
00084
00085 int GenerateVertex( FILE* f );
00086 numerotation* AllocNumerotation();
00087 char* GetErrorMsg();
00088 };
00089
00090
00091
00092 struct RotAxisCAO : public RotProfToProfAxisCAO
00093 {
00094 RotAxisCAO ( Cardinal c,
00095 Sommet3D* pf,
00096 double a,
00097 UINT p,
00098 Vector3D & v,
00099 char*name = NULL): RotProfToProfAxisCAO ( c,
00100 pf,
00101 pf,
00102 a,
00103 p,
00104 v,
00105 name ){ }
00106 };
00107
00108
00109
00110
00111 struct VecAxisCAO : public AxisCAO
00112 {
00113 Vector3D* vectbl;
00114
00115 VecAxisCAO ( Cardinal c,
00116 Sommet3D* pf,
00117 UINT nbv,
00118 Vector3D * v,
00119 char*name = NULL) : vectbl (v),
00120 AxisCAO ( name,
00121 c,
00122 pf,
00123 *v,
00124 nbv ) { }
00125
00126 int GenerateVertex( FILE* f );
00127 numerotation* AllocNumerotation();
00128 char* GetErrorMsg();
00129 };
00130
00131
00132
00133 struct ProfToProfAxisCAO : public AxisCAO
00134 {
00135 Sommet3D* profil1;
00136
00137 ProfToProfAxisCAO ( Cardinal c,
00138 Sommet3D* pf,
00139 Sommet3D* pf1,
00140 UINT nbv,
00141 Vector3D & v,
00142 char*name = NULL) : profil1 ( pf1),
00143 AxisCAO ( name,
00144 c,
00145 pf,
00146 v,
00147 nbv ) { }
00148
00149 int GenerateVertex( FILE* f );
00150 numerotation* AllocNumerotation();
00151 char* GetErrorMsg();
00152 };
00153
00154
00155
00156 struct TransAxisCAO : public ProfToProfAxisCAO
00157 {
00158 TransAxisCAO ( Cardinal c,
00159 Sommet3D* pf,
00160 UINT p,
00161 Vector3D& v,
00162 char*name = NULL) : ProfToProfAxisCAO ( c,
00163 pf,
00164 pf,
00165 p,
00166 v,
00167 name ) { }
00168 };
00169
00170
00171
00172 int Generate ( AxisCAO& m );
00173
00174 #endif // __MODELEUR_H
00175
00176