00001 /* 00002 * lib-gmapkernel : Un noyau de 3-G-cartes et des opérations. 00003 * Copyright (C) 2004, Moka Team, Université de Poitiers, Laboratoire SIC 00004 * http://www.sic.sp2mi.univ-poitiers.fr/ 00005 * Copyright (C) 2009, Guillaume Damiand, CNRS, LIRIS, 00006 * guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/ 00007 * 00008 * This file is part of lib-gmapkernel 00009 * 00010 * This program is free software: you can redistribute it and/or modify 00011 * it under the terms of the GNU Lesser General Public License as published by 00012 * the Free Software Foundation, either version 3 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Lesser General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU Lesser General Public License 00021 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00022 */ 00023 00024 //****************************************************************************** 00025 #ifndef DART_HH 00026 #define DART_HH 00027 //****************************************************************************** 00028 #include "kernel-types.hh" 00029 #include "inline-macro.hh" 00030 00031 #include <bitset> 00032 //****************************************************************************** 00033 class CAttribute; 00034 class CEmbedding; 00035 00036 namespace GMap3d 00037 { 00050 class CDart 00051 { 00052 public: 00053 // @name Constructeurs et destructeur 00054 // @{ 00055 00065 CDart(); 00066 00076 CDart(const CDart& ADart); 00077 00090 CDart(const std::bitset<NB_MARKS>& AMarks); 00091 00099 ~CDart(); 00100 00101 // @} 00111 // @{ 00112 00122 void* getDirectInfo(int ADirectIndex) const; 00123 00130 void setDirectInfo(int ADirectIndex, void* AValue); 00131 00132 // @} 00133 // @name Gestion des plongements 00134 // @{ 00135 00148 CEmbedding* getFirstEmbedding() const; 00149 00160 void setFirstEmbedding(CEmbedding* AEmbedding); 00161 00171 CEmbedding* getEmbedding(TOrbit AOrbit) const; 00172 00183 void addEmbedding(CEmbedding* AEmbedding); 00184 00196 CEmbedding* removeEmbedding(CEmbedding* AEmbedding); 00197 00208 CEmbedding* removeEmbedding(TOrbit AOrbit); 00209 00220 void deleteEmbedding(CEmbedding* AEmbedding); 00221 00231 void deleteEmbedding(TOrbit AOrbit); 00232 00243 void mergeEmbedding(CEmbedding* AEmbedding); 00244 00256 CAttribute* getAttribute (TOrbit AOrbit, TAttributeId AAttribType) const; 00257 00270 void addAttribute(TOrbit AOrbit, CAttribute* AAttribute); 00271 00284 CAttribute* removeAttribute(TOrbit AOrbit, TAttributeId AAttribType); 00285 00295 void deleteAttribute(TOrbit AOrbit, TAttributeId AAttribType); 00296 00308 void setOrbitUsed(TOrbit AOrbit); 00309 00316 bool isOrbitUsed(TOrbit AOrbit) const; 00317 00326 void unsetOrbitUsed(TOrbit AOrbit); 00327 00328 // @} 00329 // @name Chaînage des brins dans la carte généralisée 00330 // @{ 00331 00343 CDart* getNext() const; 00344 00352 CDart* getPrev() const; 00353 00364 void setNext(CDart* ADart); 00365 00373 void setPrev(CDart* ADart); 00374 00375 // @} 00376 // @name Accès aux involutions 00377 // @{ 00378 00389 CDart* getAlpha0() const; 00390 00398 CDart* getAlpha1() const; 00399 00407 CDart* getAlpha2() const; 00408 00416 CDart* getAlpha3() const; 00417 00427 CDart* getAlpha(int ADimension) const; 00428 00439 void setAlpha0(CDart* ADart); 00440 00448 void setAlpha1(CDart* ADart); 00449 00457 void setAlpha2(CDart* ADart); 00458 00466 void setAlpha3(CDart* ADart); 00467 00477 void setAlpha (CDart* ADart, int ADimension); 00478 00488 bool isFree0() const; 00489 00497 bool isFree1() const; 00498 00506 bool isFree2() const; 00507 00515 bool isFree3() const; 00516 00527 bool isFree(int ADimension) const; 00528 00538 void setFree0(); 00539 00545 void setFree1(); 00546 00552 void setFree2(); 00553 00559 void setFree3(); 00560 00572 void setFree(int ADimension); 00573 00574 // @} 00575 // @name Gestion des marques 00576 // @{ 00577 00589 bool getMark(int AMarkNumber) const; 00590 00601 void setMark(int AMarkNumber, bool AValue); 00602 00610 std::bitset<NB_MARKS> getMarks() const; 00611 00620 void setMarks(const std::bitset<NB_MARKS> & AMarks); 00621 00622 // @} 00623 00624 private: 00625 // @name Champs privés 00626 // @{ 00627 00629 CDart* FAlpha[4]; 00630 00632 CEmbedding* FFirstEmbedding; 00633 00635 std::bitset<NB_MARKS> FMarks; 00636 00642 std::bitset<16> FUsedOrbits; 00643 00645 void* FDirectInfo[NB_DIRECT_INFO]; 00646 00651 CDart* FPrev; 00652 CDart* FNext; 00653 00654 // @} 00655 }; 00656 00657 } // namespace GMap3d 00658 //****************************************************************************** 00659 #include INCLUDE_INLINE("dart.icc") 00660 //****************************************************************************** 00661 #endif // DART_HH 00662 //******************************************************************************