Code_TYMPAN  4.4.0
Industrial site acoustic simulation
OGLRectangleElement.cpp
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 #include "OGLRectangleElement.h"
21 
22 #if _WIN32
23  #include <windows.h>
24 #endif //_WIN32
25 
26 #include <GL/gl.h>
27 
28 #include "OGLRectangle.h"
30 
32 {
34  m_oPoint0 = OPoint3D(0.0, 0.0, 0.0);
35  m_oPoint1 = OPoint3D(0.0, 0.0, 0.0);
36  m_oPoint2 = OPoint3D(0.0, 0.0, 0.0);
37  m_oPoint3 = OPoint3D(0.0, 0.0, 0.0);
38  m_bIs3D = false;
39  m_bFull = false;
40 }
41 
43 {
45  {
47  }
48 }
49 
51 {
52  m_oColor = oColor;
53 }
54 
56 {
57  if (m_bVisible)
58  {
59  if (m_bIs3D)
60  {
61  // Nouvelle vue
62  glMatrixMode(GL_MODELVIEW);
63  glPushMatrix();
65  // Ancienne vue
66  glPopMatrix();
67  }
68  else
69  {
70  // Nouvelle projection
71  glMatrixMode(GL_PROJECTION);
72  glPushMatrix();
73  glLoadIdentity();
74  unsigned int width = OSizeManager::get()->getWidth();
75  unsigned int height = OSizeManager::get()->getHeight();
76  glOrtho(0, width, 0.0, height, 0.0, 1.0);
77 
78  // Nouvelle vue
79  glMatrixMode(GL_MODELVIEW);
80  glPushMatrix();
81  glLoadIdentity();
82 
84  m_bFull);
85 
86  // Ancienne projection
87  glMatrixMode(GL_PROJECTION);
88  glPopMatrix();
89 
90  // Ancienne vue
91  glMatrixMode(GL_MODELVIEW);
92  glPopMatrix();
93  }
94  }
95 
96  return 0;
97 }
Definition: color.h:31
bool m_bVisible
Definition: OGLElement.h:76
bool m_bIs3D
Definition: OGLElement.h:77
OGLRectangle * m_pOGLRectangleToDisplay
void setColor(const OColor &oColor)
void drawRectangle(const OPoint3D &point0, const OPoint3D &point1, const OPoint3D &point2, const OPoint3D &point3, const OColor &oColor, bool bFalse=false) const
The 3D point class.
Definition: 3d.h:487
static LPOSizeManager get()