Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYPolygonGraphic.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 
26 #ifndef __TY_POLYGON_GRAPHIC__
27 #define __TY_POLYGON_GRAPHIC__
28 
29 #if _MSC_VER > 1000
30  #pragma once
31 #endif // _MSC_VER > 1000
32 
33 #include "TYElementGraphic.h"
35 
41 {
43 
44  // Methodes
45 public:
49  TYPolygonGraphic(TYPolygon* pElement);
50 
54  virtual ~TYPolygonGraphic();
55 
63  virtual void display(TYElement* pModelerElement = nullptr, GLenum mode = GL_RENDER);
64 
72  virtual void update(bool force = false);
73 
74  void setAltimetrieColor(double color0[3], double color1[3], double color2[3]);
75 
79  virtual void computeBoundingBox();
80  void setTextureBg(int semiXBg, int semiYBg, TYPoint bgImagePosition, OVector3D bgImageOrientation)
81  {
82  _textureBg = true;
83  _semiXBg = semiXBg;
84  _semiYBg = semiYBg;
85  _bgImagePosition = bgImagePosition;
86  _bgImageOrientation = bgImageOrientation;
87  }
89  {
90  _textureBg = false;
91  }
92 
93  // Membres
94 protected:
98  double _color0[3];
99  double _color1[3];
100  double _color2[3];
101  // Pour gerer l'affichage correcte des polygones concaves:
102  GLUtesselator* _gLUtesselator;
105  int _semiXBg;
106  int _semiYBg;
108 };
109 
112 
113 #endif // __TY_POLYGON_GRAPHIC__
Representation graphique d'un element de base (fichier header)
#define TY_DECL_METIER_GRAPHIC(classname)
SmartPtr< TYPolygonGraphic > LPTYPolygonGraphic
Smart Pointer sur TYPolygonGraphic.
The 3D vector class.
Definition: 3d.h:298
classe graphique pour un element de base
classe graphique pour un polygone
virtual void display(TYElement *pModelerElement=nullptr, GLenum mode=GL_RENDER)
GLUtesselator * _gLUtesselator
OVector3D _bgImageOrientation
virtual void computeBoundingBox()
virtual ~TYPolygonGraphic()
void setTextureBg(int semiXBg, int semiYBg, TYPoint bgImagePosition, OVector3D bgImageOrientation)
void setAltimetrieColor(double color0[3], double color1[3], double color2[3])
double _color0[3]
Pour les polygones de l'altimetrie chaque sommet a une couleur differente.
virtual void update(bool force=false)
bool _altimetrie
Indique si ce polygone fait partie de l'altimetrie.
TYPolygonGraphic(TYPolygon *pElement)