Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYTerrain.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
16 /*
17  *
18  */
19 
20 #ifndef __TY_TERRAIN__
21 #define __TY_TERRAIN__
22 
27 
31 class TYTerrain : public TYElement, public TYColorInterface
32 {
36 
37  // Methodes
38 public:
42  TYTerrain();
46  TYTerrain(const TYTerrain& other);
50  virtual ~TYTerrain();
51 
53  TYTerrain& operator=(const TYTerrain& other);
55  bool operator==(const TYTerrain& other) const;
57  bool operator!=(const TYTerrain& other) const;
58 
67  virtual bool deepCopy(const TYElement* pOther, bool copyId = true, bool pUseCopyTag = false);
68 
69  virtual std::string toString() const;
70 
71  virtual DOM_Element toXML(DOM_Element& domElement);
72  virtual int fromXML(DOM_Element domElement);
73 
77  LPTYSol getSol() const
78  {
79  return _pSol;
80  }
82  {
83  return _pSol._pObj;
84  }
85 
89  void setSol(const LPTYSol pSol)
90  {
91  _pSol = pSol;
92  _pSol->setParent(this);
93  }
94 
99  {
100  return _vegetActive;
101  }
102 
107  {
108  return _pVegetation;
109  }
110 
114  void setVegetation(LPTYVegetation pVeget);
115 
122  void useVegetation(bool state = true);
124  {
125  return _vegetActive;
126  }
127 
132  {
133  return _listPoints;
134  }
138  virtual const TYTabPoint& getListPoints() const
139  {
140  return _listPoints;
141  }
145  virtual void setListPoints(const TYTabPoint& liste)
146  {
147  _listPoints = liste;
148  setIsGeometryModified(true);
149  }
150 
154  double surface();
155 
159  void offsetListPoints();
160 
161  // Membres
162 protected:
165 
168 
171 
174 };
175 
181 typedef std::vector<LPTYTerrainGeoNode> TYTabTerrainGeoNode;
182 
183 #endif // __TY_TERRAIN__
QDomElement DOM_Element
Definition: QT2DOM.h:30
std::vector< TYPoint > TYTabPoint
Collection de TYPoint.
Definition: TYDefines.h:340
#define TY_EXT_GRAPHIC_DECL_ONLY(classname)
Definition: TYElement.h:432
#define OPROTODECL(classname)
Definition: TYElement.h:65
#define TY_EXTENSION_DECL_ONLY(classname)
Definition: TYElement.h:386
TYGeometryNode TYTerrainGeoNode
Noeud geometrique de type TYTerrain.
Definition: TYTerrain.h:177
std::vector< LPTYTerrainGeoNode > TYTabTerrainGeoNode
Collection de noeuds geometriques de type TYTerrain.
Definition: TYTerrain.h:181
SmartPtr< TYTerrainGeoNode > LPTYTerrainGeoNode
Smart Pointer sur TYTerrainGeoNode.
Definition: TYTerrain.h:179
T * _pObj
The real pointer, must derived IRefCount.
Definition: smartptr.h:307
void setParent(TYElement *pParent)
Definition: TYElement.h:692
virtual void setIsGeometryModified(bool isModified)
Definition: TYElement.cpp:253
bool operator!=(const TYTerrain &other) const
Operateur !=.
Definition: TYTerrain.cpp:110
virtual const TYTabPoint & getListPoints() const
Definition: TYTerrain.h:138
virtual void setListPoints(const TYTabPoint &liste)
Definition: TYTerrain.h:145
LPTYSol getSol() const
Definition: TYTerrain.h:77
LPTYSol getSol()
Definition: TYTerrain.h:81
bool isUsingVegetation()
Definition: TYTerrain.h:123
void useVegetation(bool state=true)
Definition: TYTerrain.cpp:243
double surface()
Definition: TYTerrain.cpp:237
bool operator==(const TYTerrain &other) const
Operateur ==.
Definition: TYTerrain.cpp:78
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
Definition: TYTerrain.cpp:115
virtual DOM_Element toXML(DOM_Element &domElement)
Definition: TYTerrain.cpp:151
LPTYSol _pSol
Materiau.
Definition: TYTerrain.h:164
LPTYVegetation getVegetation() const
Definition: TYTerrain.h:106
LPTYVegetation _pVegetation
Vegetation eventuelle.
Definition: TYTerrain.h:167
virtual TYTabPoint & getListPoints()
Definition: TYTerrain.h:131
TYTabPoint _listPoints
Liste de points.
Definition: TYTerrain.h:173
bool _vegetActive
Etat d'utilisation de la vegetation.
Definition: TYTerrain.h:170
bool isVegetActive()
Definition: TYTerrain.h:98
virtual int fromXML(DOM_Element domElement)
Definition: TYTerrain.cpp:176
TYTerrain & operator=(const TYTerrain &other)
Operateur =.
Definition: TYTerrain.cpp:64
void setSol(const LPTYSol pSol)
Definition: TYTerrain.h:89
void offsetListPoints()
Definition: TYTerrain.cpp:279
virtual std::string toString() const
Definition: TYTerrain.cpp:146
virtual ~TYTerrain()
Definition: TYTerrain.cpp:62
void setVegetation(LPTYVegetation pVeget)
Definition: TYTerrain.cpp:264