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-generic.hh"
00026 using namespace GMap3d;
00027
00028 int CGMapGeneric::getSewDimension(CDart * ADart1, CDart * ADart2)
00029 {
00030 assert(ADart1!=NULL && ADart2!=NULL);
00031
00032 for (int dim=0; dim<=3; ++dim)
00033 if (canSew(ADart1, ADart2, dim) &&
00034 !isSameOrbit(ADart1, ADart2, ORBIT_INF[dim]))
00035 return dim;
00036
00037 return 4;
00038 }
00039
00040 bool CGMapGeneric::intuitiveSew(CDart * ADart1, CDart * ADart2)
00041 {
00042 assert(ADart1!=NULL && ADart2!=NULL);
00043
00044 int dim = getSewDimension(ADart1, ADart2);
00045
00046 if (dim!=4)
00047 sew(ADart1, ADart2, dim);
00048
00049 return dim!=4;
00050 }
00051
00052 int CGMapGeneric::multiSew(CDart * ADart1, int AMarkNumber1,
00053 CDart * ADart2, int ADimension)
00054 {
00055 assert(ADart1 != NULL && ADart2 != NULL);
00056 assert(2 <= ADimension && ADimension <= 3);
00057
00058 if (!isFree(ADart1, ADimension) || !isFree(ADart2, ADimension))
00059 return 0;
00060
00061 int nbSewed = 0;
00062 int treated = getNewMark();
00063
00064 markCopy(AMarkNumber1, treated);
00065 negateMaskMark(treated);
00066
00067 CCoverage * cov1 =
00068 getBasicDynamicCoverage(ADart1, ORBIT_BORDER[ADimension], treated);
00069
00070 for (; cov1->cont(); ++(*cov1))
00071 {
00072
00073 }
00074
00075 delete cov1;
00076
00077 unmarkAll(treated);
00078 freeMark(treated);
00079
00080 return nbSewed;
00081 }
00082