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_Table6_Att.h * 00026 * Auteur : DEXET Martine * 00027 *----------------------------------------------------------------------------* 00028 * Ce fichier contient la spécification de la classe Ineq_Table6_Att. Cette * 00029 * classe permet de stocker un objet de la classe Ineq_Table6 en tant * 00030 * qu'attribut. * 00031 * * 00032 *****************************************************************************/ 00033 00034 00035 #ifndef INEQ_TABLE6_ATT_H 00036 #define INEQ_TABLE6_ATT_H 00037 00038 #include "ineq-table-6.hh" 00039 #include "attribute.hh" 00040 00041 00042 00043 /****************************************************************************** 00044 * Classe Ineq_Table6_Att * 00045 *****************************************************************************/ 00046 00047 class Ineq_Table6_Att : public CAttribute { 00048 00049 public: 00050 00051 // Constructeurs. 00052 Ineq_Table6_Att(); 00053 Ineq_Table6_Att(CVertex const & p); 00054 Ineq_Table6_Att(CVertex const & p1, CVertex const & p2); 00055 Ineq_Table6_Att(Ineq_Table6 *t); 00056 00057 // Destructeur. 00058 virtual ~Ineq_Table6_Att(); 00059 00060 // Surcharge des méthodes de la classe CAttribute. 00061 TAttributeId getType() const; 00062 Ineq_Table6* Get_Data(); 00063 CAttribute * copy() const; 00064 void destroy(); 00065 void save(std::ostream &fd) const; 00066 void load(std::istream &fd); 00067 00068 private: 00069 00070 // Pointeur sur un objet de la classe Ineq_Table6. 00071 Ineq_Table6 * tab; 00072 }; 00073 00074 /****************************************************************************** 00075 * Fichier : Ineq_Table6_Att.inl * 00076 * Auteur : DEXET Martine * 00077 *----------------------------------------------------------------------------* 00078 * Ce fichier contient l'implémentation des méthodes de la classe * 00079 * Ineq_Table6_Att. * 00080 * * 00081 *****************************************************************************/ 00082 00083 #include "user.hh" 00084 00085 // Constructeurs. 00086 inline 00087 Ineq_Table6_Att::Ineq_Table6_Att() 00088 { 00089 tab = new Ineq_Table6(); 00090 } 00091 00092 inline 00093 Ineq_Table6_Att::Ineq_Table6_Att(CVertex const & p) 00094 { 00095 tab = new Ineq_Table6(p); 00096 } 00097 00098 inline 00099 Ineq_Table6_Att::Ineq_Table6_Att(CVertex const & p1, CVertex const & p2) 00100 { 00101 tab = new Ineq_Table6(p1, p2); 00102 } 00103 00104 inline 00105 Ineq_Table6_Att::Ineq_Table6_Att(Ineq_Table6 * t) 00106 { 00107 tab = t; 00108 } 00109 00110 00111 // Destructeur. 00112 inline 00113 Ineq_Table6_Att::~Ineq_Table6_Att() 00114 { 00115 delete tab; 00116 } 00117 00118 00119 // Surcharge des méthodes de la classe CAttribute. 00120 inline 00121 TAttributeId Ineq_Table6_Att::getType() const 00122 { 00123 return INEQ6_ATTRIBUTE_ID; 00124 } 00125 00126 inline 00127 Ineq_Table6 * Ineq_Table6_Att::Get_Data() 00128 { 00129 return tab; 00130 } 00131 00132 inline 00133 CAttribute * Ineq_Table6_Att::copy() const 00134 { 00135 Ineq_Table6 * t = new Ineq_Table6(*(this->tab)); 00136 00137 return new Ineq_Table6_Att(t); 00138 } 00139 00140 00141 inline 00142 void Ineq_Table6_Att::destroy() 00143 { 00144 delete this; 00145 } 00146 00147 00148 inline 00149 void Ineq_Table6_Att::save(std::ostream &fd) const 00150 { 00151 for (int i=0; i<6; i++) 00152 fd << *tab->Get_Ineq(i); 00153 } 00154 00155 inline 00156 void Ineq_Table6_Att::load(std::istream &fd) 00157 { 00158 Inequation iq; 00159 00160 for (int i=0; i<6; i++) 00161 { 00162 fd >> iq; 00163 tab->Set_Ineq(i, iq); 00164 } 00165 } 00166 00167 #endif