25 #include "g-map-vertex.hh"
30 #ifdef MODULE_EXTRACTION_IMAGE
31 #include "extraction-images.hh"
32 #endif // MODULE_EXTRACTION_IMAGE
34 using namespace GMap3d;
45 FMap->removeAllDarts();
65 if (FMap->load(AFilename)!=NULL)
69 setMessage(
string(
"Add the map from ") + AFilename +
" done");
75 setMessage(
string(
"Error for loading ")+AFilename);
92 FMap->removeAllDarts();
95 if (FMap->load(AFilename)!=NULL)
99 setMessage(
string(
"Load the map from ")+AFilename+
" done");
105 setMessage(
string(
"Error for loading ")+AFilename);
109 std::cout<<
"isMapOk ? "<<
isMapOk()<<std::endl;
120 res = FMap->save(AFilename, AsciiFormat);
122 setMessage(
string(
"Save in ")+AFilename+
" done");
124 setMessage(
string(
"Error during saving ")+AFilename);
135 res = FMap->save(AFilename, BinaryFormat);
137 setMessage(
string(
"Binary save in ")+AFilename+
" done");
139 setMessage(
string(
"Error during binary saving ")+AFilename);
146 bool AArrow,
bool AFace,
bool ASews,
147 bool AGrid,
bool AVertices)
153 ofstream fout(AFilename, ios::trunc);
154 sauveCarteXfig(AViewId, fout, AArrow, AFace, ASews, AGrid, AVertices);
156 setMessage(
string(
"Export Xfig ")+AFilename+
" done");
169 ofstream fout(AFilename, ios::trunc);
170 bool ok = FMap->exportToPov(fout);
172 setMessage(ok ?
string(
"Export PoV ")+AFilename+
" done" :
173 string(
"Error during export PoV ")+AFilename);
187 ofstream fout(AFilename, ios::trunc);
190 setMessage(
string(
"Export in intervoxel ") + AFilename +
" done");
197 #ifdef MODULE_EXTRACTION_IMAGE
199 #ifndef MODULE_EXTRACTION_WITHOUT_MAGICK
201 bool CControlerGMap::extractImage2D(
const string & AFilename)
208 CExtractionImage extractor(FMap);
210 if (extractor.extract2dImage(AFilename))
214 setMessage(
"Extraction de l'image 2d effectuée");
219 setMessage(
"Erreur durant l'extraction de l'image 2d");
227 #endif // MODULE_EXTRACTION_WITHOUT_MAGICK
229 bool CControlerGMap::extractImage3D(
const string & AFilename,
int AFirstPlane,
230 int ANbPlane,
int ALevel,
int NbChiffres,
231 bool ADestroyBorder,
bool AKeepFictiveEdges,
232 bool AShiftFictiveEdges,
bool AWithPrecodes,
240 CExtractionImage extractor(FMap);
246 extractor.extract3dImageCEAWithPrecodes(AFilename, AFirstPlane,
252 res = extractor.extract3dImageCEA(AFilename, AFirstPlane, ANbPlane,
253 ALevel, ADestroyBorder,
261 extractor.extract3dImageWithPrecodes(AFilename, AFirstPlane,
263 NbChiffres, ADestroyBorder,
267 res = extractor.extract3dImage(AFilename, AFirstPlane, ANbPlane,
268 ALevel, NbChiffres, ADestroyBorder,
277 setMessage(
"Extraction de l'image 3d effectuée");
281 setMessage(
"Erreur durant l'extraction de l'image 3d");
289 bool CControlerGMap::extractOneRegionVoxels(
const std::string & AFilename,
290 int AFirstPlane,
int ANbPlane,
292 int ARed,
int AGreen,
int ABlue,
300 CExtractionImage extractor(FMap);
303 extractor.extractOneRegionVoxels(AFilename, AFirstPlane,
304 ANbPlane, NbChiffres,
305 ARed, AGreen, ABlue, AAlpha);
311 setMessage(
"Extraction des voxels d'une région effectuée");
315 setMessage(
"Erreur durant l'extraction des voxels "
316 "d'une région effectuée");
324 #endif // MODULE_EXTRACTION_IMAGE
334 if (FMap->importOff(AFilename)!=NULL)
338 setMessage(
string(
"Import OFF ") + AFilename +
" done");
344 setMessage(
string(
"Error during import OFF ")+AFilename);
359 if (FMap->exportOff(AFilename))
361 setMessage(
string(
"Export OFF ") + AFilename +
" done");
366 setMessage(
string(
"Error during export OFF ")+AFilename);
379 if (FMap->exportOff3D(AFilename))
381 setMessage(
string(
"Export OFF ")+AFilename+
" done");
386 setMessage(
string(
"Error during export OFF")+AFilename);