Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PsDuplicatedControlParameter.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of openMask © INRIA, CNRS, Universite de Rennes 1 1993-2002, thereinafter the Software
00003  * 
00004  * The Software has been developped within the Siames Project. 
00005  * INRIA, the University of Rennes 1 and CNRS jointly hold intellectual property rights
00006  * 
00007  * The Software has been registered with the Agence pour la Protection des
00008  * Programmes (APP) under registration number IDDN.FR.001.510008.00.S.P.2001.000.41200
00009  *
00010  * This file may be distributed under the terms of the Q Public License
00011  * version 1.0 as defined by Trolltech AS of Norway and appearing in the file
00012  * LICENSE.QPL included in the packaging of this file.
00013  *
00014  * Licensees holding valid specific licenses issued by INRIA, CNRS or Université de Rennes 1 
00015  * for the software may use this file in accordance with that specific license 
00016  *
00017  */
00018 #ifndef PsControlParameterDupliqueHEADER
00019 #define PsControlParameterDupliqueHEADER
00020 
00021 // Un paramètre de contrôle dupliqué se signalera à son objet dupliqué
00022 // associé, lors de chacun de ses changements (lors d'un set ...) 
00023 
00024 #include <PsControlParameter.h>
00029 template <typename Type>
00030 
00031 class PsControlParameterDuplique : public PsControlParameter<Type> {
00032 
00033    public :
00034 
00040       PsControlParameterDuplique (const PsName & nom, PsDuplicatedObject * prop) ;
00042       virtual ~PsControlParameterDuplique (void) ;
00044       virtual void extract (istream & in) ;
00046       virtual void set (const Type & val) ; 
00048       virtual void computeNewValue (const list<PsType *> &) ;
00049 
00050 } ; // PsControlParameterDuplique
00051 
00052 //-----------------------------------------------------------------
00053 //-----------------------------------------------------------------
00054 
00055 template <typename Type>
00056 inline PsControlParameterDuplique<Type>::PsControlParameterDuplique (const PsName & nom, PsDuplicatedObject * prop)
00057                                 : PsControlParameter<Type> (nom, prop) {
00058 
00059 }
00060 
00061 //-----------------------------------------------------------------
00062 
00063 template <class Type>
00064 inline PsControlParameterDuplique<Type>::~PsControlParameterDuplique (void) {
00065 
00066 }
00067 
00068 //-----------------------------------------------------------------
00069 
00070 template <typename Type>
00071 inline void PsControlParameterDuplique<Type>::extract (istream & in) {
00072    PsControlParameter<Type>::extract (in) ;
00073    ((PsDuplicatedObject *)Owner ())->parametreAChange (_effectiveName) ;
00074 }
00075 
00076 //-----------------------------------------------------------------
00077 
00078 template <typename Type>
00079 inline void PsControlParameterDuplique<Type>::set (const Type & val) {
00080    PsControlParameter<Type>::set (val) ;
00081    ((PsDuplicatedObject *)Owner ())->parametreAChange (_effectiveName) ;
00082 }
00083 
00084 //-----------------------------------------------------------------
00085 
00086 template <typename Type>
00087 inline void PsControlParameterDuplique<Type>::computeNewValue (const list<PsType *> & valeurs) {
00088 /*    cerr << _effectiveName << " : il faut integrer :" ; */
00089 /*    list<PsType *>::const_iterator ite ; */
00090 /*    for (ite = valeurs.begin () ; ite != valeurs.end () ; ite ++) { */
00091 /*       cerr << " " << *(*ite) ; */
00092 /*    } */
00093 /*    cerr << endl ; */
00094    PsControlParameter<Type>::set (*((Type *)*valeurs.begin ())) ;
00095 }
00096 
00097 //-----------------------------------------------------------------
00098 
00099 #endif
00100 

logo OpenMask

Documentation generated on Mon Nov 25 15:24:59 2002

Generated with doxygen 1.2.12 by Dimitri van Heesch ,   1997-2001