Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYPolygonGraphic.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
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 
36 class GLUtesselator;
37 
43 {
45 
46  // Methodes
47 public:
51  TYPolygonGraphic(TYPolygon* pElement);
52 
56  virtual ~TYPolygonGraphic();
57 
65  virtual void display(TYRenderContext& renderContext);
66 
74  virtual void update(bool force = false);
75 
76  void setAltimetrieColor(double color0[3], double color1[3], double color2[3]);
77 
81  virtual OBox computeBoundingBox() const;
82  void setTextureBg(int semiXBg, int semiYBg, TYPoint bgImagePosition, OVector3D bgImageOrientation)
83  {
84  _textureBg = true;
85  _semiXBg = semiXBg;
86  _semiYBg = semiYBg;
87  _bgImagePosition = bgImagePosition;
88  _bgImageOrientation = bgImageOrientation;
89  }
91  {
92  _textureBg = false;
93  }
94 
95  // Membres
96 protected:
100  double _color0[3];
101  double _color1[3];
102  double _color2[3];
103  // Pour gerer l'affichage correcte des polygones concaves:
104  GLUtesselator* _gLUtesselator;
107  int _semiXBg;
108  int _semiYBg;
110 };
111 
114 
115 #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 box class.
Definition: 3d.h:1346
The 3D vector class.
Definition: 3d.h:298
classe graphique pour un element de base
classe graphique pour un polygone
GLUtesselator * _gLUtesselator
OVector3D _bgImageOrientation
virtual ~TYPolygonGraphic()
void setTextureBg(int semiXBg, int semiYBg, TYPoint bgImagePosition, OVector3D bgImageOrientation)
virtual OBox computeBoundingBox() const
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)
virtual void display(TYRenderContext &renderContext)