00001 /* 00002 * lib-spamod : Visualisation des objets en discret. 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-spamod 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 * Fichier : Ineq_Use.h * 00026 * Auteur : DEXET Martine * 00027 *----------------------------------------------------------------------------* 00028 * Ce fichier contient la spécification de la classe Ineq_Use. Cette classe * 00029 * permet de représenter un tableau de booléens, comportant six éléments. * 00030 * * 00031 *****************************************************************************/ 00032 00033 00034 #ifndef INEQ_USE_H 00035 #define INEQ_USE_H 00036 00037 00038 00039 /****************************************************************************** 00040 * Classe Ineq_Use * 00041 *****************************************************************************/ 00042 00043 class Ineq_Use { 00044 00045 public: 00046 00047 // Constructeur. 00048 Ineq_Use(); 00049 00050 // Méthode permettant la lecture d'un des booléens du tableau. 00051 bool Get_Use(int i); 00052 00053 // Méthodes permettant l'écriture d'un booléen dans le tableau. 00054 void Set_Use(int i, bool u); 00055 void Set_Used(int i); 00056 void Set_Unused(int i); 00057 00058 00059 private: 00060 00061 // Tableau comportant 6 éléments et contenant des variables booléennes. 00062 bool tab[6]; 00063 }; 00064 00065 /****************************************************************************** 00066 * Fichier : Ineq_Use.inl * 00067 * Auteur : DEXET Martine * 00068 *----------------------------------------------------------------------------* 00069 * Ce fichier contient l'implémentation des méthodes de la classe Ineq_Use. * 00070 * * 00071 *****************************************************************************/ 00072 00073 00074 00075 // Constructeur. 00076 inline 00077 Ineq_Use::Ineq_Use() 00078 { 00079 for (int i=0; i<6; i++) 00080 tab[i] = true; 00081 } 00082 00083 00084 // Méthode permettant la lecture d'un des booléens du tableau. 00085 inline 00086 bool Ineq_Use::Get_Use(int i) 00087 { 00088 return tab[i]; 00089 } 00090 00091 00092 // Méthodes permettant l'écriture d'un booléen dans le tableau. 00093 inline 00094 void Ineq_Use::Set_Use(int i, bool u) 00095 { 00096 tab[i] = u; 00097 } 00098 00099 inline 00100 void Ineq_Use::Set_Used(int i) 00101 { 00102 tab[i] = true; 00103 } 00104 00105 inline 00106 void Ineq_Use::Set_Unused(int i) 00107 { 00108 tab[i] = false; 00109 } 00110 00111 #endif