00001 /* 00002 * lib-controler-gmap : Le contrôleur de 3-G-cartes, surcouche de lib-controler. 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-controler-gmap 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 PARAMETER_SELECTION_HH 00026 #define PARAMETER_SELECTION_HH 00027 //****************************************************************************** 00028 #include "parameter.hh" 00029 #include "kernel-types.hh" 00030 //****************************************************************************** 00031 namespace GMap3d 00032 { 00033 class CControlerGMap; 00034 class CDart; 00035 00036 class CParameterSelection : public CParameter 00037 { 00038 public: 00040 00041 CParameterSelection(CControlerGMap* AMap, 00042 int ANbSelectionLevels, 00043 int ANbRef = 0); 00044 00045 CParameterSelection(const CParameterSelection &); 00046 virtual ~CParameterSelection(); 00047 virtual CParameter * copy() const; 00049 00051 00052 virtual void save(std::ostream &); 00053 virtual void load(std::istream &); 00054 virtual void reinit(); 00055 00057 00059 00060 // Pour récupérer les informations de sélection 00061 int getNbSelectionLevels() const; 00062 00063 int getSelectionLevel () const; 00064 int getNextSelectionLevel(int AIndex=1) const; 00065 void setSelectionLevel (int ALevel); 00066 00067 bool getHalfSelection() const; 00068 void setHalfSelection(bool ABool); 00069 00070 // Pour récupérer les marques de sélections 00071 int getSelectionMark () const; 00072 int getSelectionMark (int ALevel) const; 00073 int getNextSelectionMark(int AIndex=1) const; 00074 00075 // Accéder à l'orbite de selection. 00076 TOrbit getSelectionOrbit () const; 00077 void setSelectionOrbit (TOrbit AOrbit); 00078 void setNextSelectionOrbit(); 00079 00080 // Pour récupérer les dernier brins sélectionnés 00081 CDart* getLastSelectedDart () const; 00082 CDart* getLastSelectedDart (int ALevel) const; 00083 CDart* getNextLastSelectedDart(int AIndex=1) const; 00084 00085 // Sélection des dernier brins 00086 void setLastSelectedDart(CDart* ALastDart); 00087 void setLastSelectedDart(int ALevel, CDart* ALastDart); 00088 00089 // Déselection des dernier brins 00090 void unsetLastSelectedDart (); 00091 void unsetLastSelectedDart (int ALevel); 00092 void unsetNextLastSelectedDart(int AIndex=1); 00093 void unsetAllLastSelectedDarts(); 00094 00095 // Pour échanger les niveaux de sélections. 00096 void swapLevels(int ALevel1, int ALevel2); 00097 00099 bool getChanged() const; 00100 00102 void setChanged(); 00103 00105 void unsetChanged(); 00106 00108 virtual int getType() const; 00109 00110 // Pour sélectionner ou déséllectionner une orbite selon son état actuel. 00111 // Utilisé par le picking. 00112 void toggleOrbitSelection (CDart* ADart); 00113 00115 00116 private: 00117 00119 00120 CControlerGMap* FControlerGMapV; 00121 00122 int FNbLevels; 00123 int FCurrentLevel; 00124 int* FMarks; 00125 CDart** FLasts; 00126 00127 TOrbit FSelectionOrbit; 00128 bool FHalfSelection; 00129 00131 bool FChanged; 00132 00134 }; 00135 00136 } // namespace GMap3d 00137 //****************************************************************************** 00138 #endif // PARAMETER_SELECTION_HH 00139 //******************************************************************************