Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYBox.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_BOX__
21 #define __TY_BOX__
22 
23 class OSegment3D;
24 
25 #include "TYPoint.h"
27 
33 class TYBox : public TYElement, public TYColorInterface
34 {
37 
38  // Methodes
39 public:
43  TYBox();
47  TYBox(const TYBox& other);
51  virtual ~TYBox();
52 
54  TYBox& operator=(const TYBox& other);
56  bool operator==(const TYBox& other) const;
58  bool operator!=(const TYBox& other) const;
59 
73  virtual bool deepCopy(const TYElement* pOther, bool copyId = true, bool pUseCopyTag = false);
74 
75  virtual std::string toString() const;
76 
77  virtual DOM_Element toXML(DOM_Element& domElement);
78  virtual int fromXML(DOM_Element domElement);
79 
90  int intersects(const OSegment3D& seg, TYTabPoint& ptList) const;
91 
101  int isInside(const TYPoint& pt) const;
102 
106  void setPosition(const TYPoint& position)
107  {
108  _position = position;
109  }
114  {
115  return _position;
116  }
120  const TYPoint& getPosition() const
121  {
122  return _position;
123  }
124 
125  // Membres
126 public:
128  double _sizeX;
130  double _sizeY;
132  double _sizeZ;
133 
134 protected:
137 };
138 
139 #endif // __TY_BOX__
QDomElement DOM_Element
Definition: QT2DOM.h:30
std::vector< TYPoint > TYTabPoint
Collection de TYPoint.
Definition: TYDefines.h:340
#define OPROTODECL(classname)
Definition: TYElement.h:65
#define TY_EXTENSION_DECL_ONLY(classname)
Definition: TYElement.h:386
Class to define a segment.
Definition: 3d.h:1089
Definition: TYBox.h:34
TYBox & operator=(const TYBox &other)
Operateur =.
Definition: TYBox.cpp:40
bool operator!=(const TYBox &other) const
Operateur !=.
Definition: TYBox.cpp:86
int intersects(const OSegment3D &seg, TYTabPoint &ptList) const
Definition: TYBox.cpp:156
const TYPoint & getPosition() const
Definition: TYBox.h:120
virtual DOM_Element toXML(DOM_Element &domElement)
Definition: TYBox.cpp:117
int isInside(const TYPoint &pt) const
Definition: TYBox.cpp:236
void setPosition(const TYPoint &position)
Definition: TYBox.h:106
bool operator==(const TYBox &other) const
Operateur ==.
Definition: TYBox.cpp:54
TYPoint & getPosition()
Definition: TYBox.h:113
virtual int fromXML(DOM_Element domElement)
Definition: TYBox.cpp:132
double _sizeX
Dimension en X.
Definition: TYBox.h:128
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
Definition: TYBox.cpp:91
TYPoint _position
Position du centre de cette boite.
Definition: TYBox.h:136
virtual std::string toString() const
Definition: TYBox.cpp:110
virtual ~TYBox()
Definition: TYBox.cpp:38
double _sizeZ
Dimension en Z.
Definition: TYBox.h:132
TYBox()
Definition: TYBox.cpp:26
double _sizeY
Dimension en Y.
Definition: TYBox.h:130