00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "g-map-vertex.hh"
00026 #include "controler-gmap.hh"
00027 #include <cassert>
00028
00029 using namespace GMap3d;
00030 using namespace std;
00031
00032 void CControlerGMap::getMapGlobalCharacteristics(int* ANbDarts,
00033 int* ANbVertices, int* ANbEdges,
00034 int* ANbFaces, int* ANbVolumes,
00035 int* ANbCC,
00036 int* ANb0Borders, int* ANb1Borders,
00037 int* ANb2Borders, int* ANb3Borders)
00038 {
00039 FMap->getGlobalCharacteristics(ANbDarts,
00040 ANbVertices, ANbEdges, ANbFaces, ANbVolumes,
00041 ANbCC,
00042 ANb0Borders, ANb1Borders, ANb2Borders,
00043 ANb3Borders);
00044 }
00045
00046 bool CControlerGMap::getSurfaceCharacteristics(string* AName,
00047 int* ANbDarts,
00048 int* ANbVertices, int* ANbEdges,
00049 int* ANbFaces,
00050 int* ANb0Borders, int* ANb1Borders,
00051 int* ANb2Borders,
00052 int* ANb2BordersWhenClosed,
00053 int* AEuler, int* AOrient,
00054 int* AGenus)
00055 {
00056
00057 CDart* root;
00058 CDart* last = FParameterSelection->getLastSelectedDart();
00059
00060 int n = FMap->getMarkedCells(ORBIT_VOLUME,
00061 FParameterSelection->getSelectionMark(),
00062 last, & root);
00063
00064 bool ok = n==1 || (n>1 && last != NULL);
00065
00066 if (ok)
00067 {
00068 int nb2WhenClosed;
00069 int orient;
00070 int genus;
00071
00072 int* pNb2WhenClosed = ANb2BordersWhenClosed;
00073 int* pOrient = AOrient;
00074 int* pGenus = AGenus;
00075
00076 if (AName == NULL)
00077 {
00078 if (pNb2WhenClosed == NULL) pNb2WhenClosed = & nb2WhenClosed;
00079 if (pOrient == NULL) pOrient = & orient ;
00080 if (pGenus == NULL) pGenus = & genus ;
00081 }
00082
00083 FMap->getSurfaceCharacteristics(root, ANbDarts,
00084 ANbVertices, ANbEdges, ANbFaces,
00085 ANb0Borders, ANb1Borders, ANb2Borders,
00086 pNb2WhenClosed,
00087 AEuler, pOrient, pGenus);
00088
00089 if (AName != NULL)
00090 *AName = treatAccent(FMap->getSurfaceName(*pNb2WhenClosed, *pOrient,
00091 *pGenus));
00092 }
00093
00094 return ok;
00095 }
00096