23 #include <qopengltexture.h>
25 #pragma warning(disable : 4284)
42 #define IMG(id) OLocalizator::getPicture("TYAltimetrieGraphic", (id))
47 float hueRange[2] = {0.4f, 0.15f};
48 float saturationRange[2] = {1.0f, 0.8f};
49 float valueRange[2] = {0.5f, 0.25f};
62 float hsvMinValue[3] = {80.0f, 255.0f, 255.0f};
63 float hsvMaxValue[3] = {120.0f, 255.0f, 112.0f};
71 hsvMinValue[1], hsvMinValue[2]);
73 hsvMaxValue[1], hsvMaxValue[2]);
78 hsvMinValue[1], hsvMinValue[2]);
80 hsvMaxValue[1], hsvMaxValue[2]);
90 for (
int i = 0; i < getElement()->getListFaces().size(); i++)
92 TYElementGraphic* pTYElementGraphic = getElement()->getFace(i)->getGraphicObject();
93 childs.push_back(pTYElementGraphic);
96 pTYElementGraphic->
getChilds(childs, recursif);
105 for (
int i = 0; i < getElement()->getListFaces().size(); i++)
108 (
float)(getElement()->getFace(i)->getPoints()[0]._y),
109 (
float)(getElement()->getFace(i)->getPoints()[0]._z));
111 (
float)(getElement()->getFace(i)->getPoints()[1]._y),
112 (
float)(getElement()->getFace(i)->getPoints()[1]._z));
114 (
float)(getElement()->getFace(i)->getPoints()[2]._y),
115 (
float)(getElement()->getFace(i)->getPoints()[2]._z));
122 if (getElement() == NULL)
138 double zmin = NAN, zmax = NAN, zrange = NAN;
141 zrange = zmax - zmin;
142 double color0[3], color1[3], color2[3];
146 for (
int i = 0; i < getElement()->getListFaces().size(); i++)
150 scalar = (getElement()->getFace(i)->getPoints()[0]._z - zmin) / zrange;
152 color0[0] = oColor0.
r;
153 color0[1] = oColor0.
g;
154 color0[2] = oColor0.
b;
156 scalar = (getElement()->getFace(i)->getPoints()[1]._z - zmin) / zrange;
158 color1[0] = oColor1.
r;
159 color1[1] = oColor1.
g;
160 color1[2] = oColor1.
b;
162 scalar = (getElement()->getFace(i)->getPoints()[2]._z - zmin) / zrange;
164 color2[0] = oColor2.
r;
165 color2[1] = oColor2.
g;
166 color2[2] = oColor2.
b;
170 scalar = (getElement()->getFace(i)->getPoints()[0]._z - zmin);
172 color0[0] = oColor0.
r;
173 color0[1] = oColor0.
g;
174 color0[2] = oColor0.
b;
176 scalar = (getElement()->getFace(i)->getPoints()[1]._z - zmin);
178 color1[0] = oColor1.
r;
179 color1[1] = oColor1.
g;
180 color1[2] = oColor1.
b;
182 scalar = (getElement()->getFace(i)->getPoints()[2]._z - zmin);
184 color2[0] = oColor2.
r;
185 color2[1] = oColor2.
g;
186 color2[2] = oColor2.
b;
189 TYElementGraphic* pTYElementGraphic = getElement()->getFace(i)->getGraphicObject();
191 if (pPolygonGraphic != NULL)
193 pPolygonGraphic->unsetTextureBg();
194 pPolygonGraphic->setTexture(
false);
200 pPolygonGraphic->setAltimetrieColor(color0, color1, color2);
201 pPolygonGraphic->display(renderContext);
207 glDisable(GL_TEXTURE_2D);
263 _glTexture.setMinificationFilter(QOpenGLTexture::Nearest);
264 _glTexture.setMagnificationFilter(QOpenGLTexture::Nearest);
265 _glTexture.setWrapMode(QOpenGLTexture::Repeat);
271 glEnable(GL_TEXTURE_2D);
274 glColor3f(1.0, 1.0, 1.0);
278 glAlphaFunc(GL_GREATER, (GLclampf)0);
279 glEnable(GL_ALPHA_TEST);
double SIGNE(double a)
Return the number sign.
Representation graphique de l'altimetrie (fichier header)
list< TYElementGraphic * > TYListPtrTYElementGraphic
List de pointeur de TYElement.
#define TYDIRPREFERENCEMANAGER
Gestion de la table de correspondance indice/element pour le picking (fichier header)
Contexte de rendu utilisé par les fonctions d'affichage.
@ Picking
The current render is only done for picking purpose.
virtual void Enlarge(const OPoint3D &pt)
Enlarge the box with the point if the point is outside the box.
OPoint3D _min
Minimal coordinates of the OBox.
OPoint3D _max
Maximal coordinates of the OBox.
static const OColor WHITE
double _y
y coordinate of OCoord3D
double _z
z coordinate of OCoord3D
double _x
x coordinate of OCoord3D
double norme() const
Computes the length of this vector.
OVector3D _bgImageOrientation
virtual ~TYAltimetrieGraphic()
void setBackgroundImage(QImage &image, int semiX, int semiY, TYPoint ptPosition, OVector3D bgImageOrientation)
QOpenGLTexture _glTexture
virtual OBox computeBoundingBox() const
TYAltimetrieGraphic(TYAltimetrie *pElement)
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
virtual void update(bool force=false)
virtual void display(TYRenderContext &renderContext)
void unsetBackgroundImage()
Assigne une altitude a chaque point de l'espace.
static void getLinearColorTable(const unsigned int &nbColors, const float *hueRange, const float *saturationRange, const float *valueRange, OLookupTable &outColors)
Generation de la table de couleurs basee sur une rampe lineaire ( y = x+0.5/255 )
classe graphique pour un element de base
bool _visible
Inique si l'element est visible.
virtual void update(bool force=false)
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
static void addElement(TYElement *pElt)
classe graphique pour un polygone