37 #define IMG(id) OLocalizator::getPicture("TYElementGraphic", (id)) 72 if (
getModified() && pParent && pParent->getGraphicObject())
77 pParent->getGraphicObject()->updateTree();
139 glColor3f(1.0f, 0.5f, 0.0f);
143 glBegin(GL_LINE_STRIP);
144 glVertex3f(p1.
_x, p1.
_y, p1.
_z);
145 glVertex3f(p2.
_x, p2.
_y, p2.
_z);
166 glColor3f(1.0f, 1.0f, 0.5f);
170 glBegin(GL_LINE_LOOP);
171 glVertex3f(org[0] + x, org[1] - y, org[2] - z);
172 glVertex3f(org[0] - x, org[1] - y, org[2] - z);
173 glVertex3f(org[0] - x, org[1] + y, org[2] - z);
174 glVertex3f(org[0] + x, org[1] + y, org[2] - z);
176 glBegin(GL_LINE_LOOP);
177 glVertex3f(org[0] + x, org[1] - y, org[2] + z);
178 glVertex3f(org[0] - x, org[1] - y, org[2] + z);
179 glVertex3f(org[0] - x, org[1] + y, org[2] + z);
180 glVertex3f(org[0] + x, org[1] + y, org[2] + z);
182 glBegin(GL_LINE_STRIP);
183 glVertex3f(org[0] + x, org[1] - y, org[2] - z);
184 glVertex3f(org[0] + x, org[1] - y, org[2] + z);
186 glBegin(GL_LINE_STRIP);
187 glVertex3f(org[0] - x, org[1] - y, org[2] - z);
188 glVertex3f(org[0] - x, org[1] - y, org[2] + z);
190 glBegin(GL_LINE_STRIP);
191 glVertex3f(org[0] - x, org[1] + y, org[2] - z);
192 glVertex3f(org[0] - x, org[1] + y, org[2] + z);
194 glBegin(GL_LINE_STRIP);
195 glVertex3f(org[0] + x, org[1] + y, org[2] - z);
196 glVertex3f(org[0] + x, org[1] + y, org[2] + z);
199 glVertex3f(org[0] + x, org[1] - y, org[2] - z);
200 glVertex3f(org[0] - x, org[1] - y, org[2] - z);
201 glVertex3f(org[0] - x, org[1] + y, org[2] - z);
202 glVertex3f(org[0] + x, org[1] + y, org[2] - z);
203 glVertex3f(org[0] + x, org[1] - y, org[2] + z);
204 glVertex3f(org[0] - x, org[1] - y, org[2] + z);
205 glVertex3f(org[0] - x, org[1] + y, org[2] + z);
206 glVertex3f(org[0] + x, org[1] + y, org[2] + z);
223 origin =
NxVec3(mat.
_m[0][3] + org[0], mat.
_m[2][3] + org[2], -mat.
_m[1][3] - org[1]);
227 origin =
NxVec3(org[0], org[2], -org[1]);
264 glColor4f(1.0f, 1.0f, 0.0f, 0.1f);
268 glVertex3d(org[0] + x, org[1] + y, org[2] - z);
269 glVertex3d(org[0] - x, org[1] + y, org[2] - z);
270 glVertex3d(org[0] - x, org[1] + y, org[2] + z);
271 glVertex3d(org[0] + x, org[1] + y, org[2] + z);
273 glVertex3f(org[0] + x, org[1] - y, org[2] + z);
274 glVertex3f(org[0] - x, org[1] - y, org[2] + z);
275 glVertex3f(org[0] - x, org[1] - y, org[2] - z);
276 glVertex3f(org[0] + x, org[1] - y, org[2] - z);
278 glVertex3f(org[0] + x, org[1] + y, org[2] + z);
279 glVertex3f(org[0] - x, org[1] + y, org[2] + z);
280 glVertex3f(org[0] - x, org[1] - y, org[2] + z);
281 glVertex3f(org[0] + x, org[1] - y, org[2] + z);
283 glVertex3f(org[0] + x, org[1] - y, org[2] - z);
284 glVertex3f(org[0] - x, org[1] - y, org[2] - z);
285 glVertex3f(org[0] - x, org[1] + y, org[2] - z);
286 glVertex3f(org[0] + x, org[1] + y, org[2] - z);
288 glVertex3f(org[0] - x, org[1] + y, org[2] + z);
289 glVertex3f(org[0] - x, org[1] + y, org[2] - z);
290 glVertex3f(org[0] - x, org[1] - y, org[2] - z);
291 glVertex3f(org[0] - x, org[1] - y, org[2] + z);
293 glVertex3f(org[0] + x, org[1] + y, org[2] - z);
294 glVertex3f(org[0] + x, org[1] + y, org[2] + z);
295 glVertex3f(org[0] + x, org[1] - y, org[2] + z);
296 glVertex3f(org[0] + x, org[1] - y, org[2] - z);
314 GLdouble innerRadius,
315 GLdouble outerRadius,
319 gluDisk(qobj, innerRadius, outerRadius, slices, loops);
330 gluCylinder(qobj, baseRadius, topRadius, height, slices, stacks);
335 GLdouble innerRadius,
336 GLdouble outerRadius,
342 gluPartialDisk(qobj, innerRadius, outerRadius, slices, loops, startAngle, sweepAngle);
376 for (
int i = 0; i < childs.size(); i++)
378 childs[i]->getGraphicObject()->setVisible(visible);
390 TYListPtrTYElementGraphic::iterator ite;
393 for (ite = childs.begin(); ite != childs.end(); ite++)
399 boundingBox = pChild->
GetBox();
static const OColor BLACK
OPoint3D _max
Maximal coordinates of the OBox.
static bool _gDrawNormals
Indique si les normals doivent etre visible.
virtual void setIsGeometryModified(bool isModified)
virtual void getChilds(LPTYElementArray &childs, bool recursif=true)
void drawLineBoundingBox()
std::vector< LPTYElement > LPTYElementArray
void setPoint2(const OPoint3D &point2)
list< TYElementGraphic * > TYListPtrTYElementGraphic
List de pointeur de TYElement.
bool _visible
Inique si l'element est visible.
void setFont(const QString &qsFontPath)
virtual bool isInCurrentCalcul()
static NxVec3 worldToDisplay(NxVec3 world)
bool _viewOnlyHighlight
Inique si on affiche la bounding box seule.
void setTextToDisplay(const QString &qsText)
void gluCylinderAndEnlargeBB(GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, GLdouble height, GLint slices, GLint stacks)
void glVertex3dAndEnlargeBB(GLdouble x, GLdouble y, GLdouble z)
void viewOnlyHighlight(bool state=true)
virtual ~TYElementGraphic()
bool getModified(bool andReset=false)
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
TYElement * getParent() const
static OBox _globalBoundingBox
double _y
y coordinate of OCoord3D
double _x
x coordinate of OCoord3D
bool _highlight
Indique si le highlight est active pour cet element.
OPoint3D _min
Minimal coordinates of the OBox.
OMatrix localToGlobal() const
TYElementGraphic(TYElement *pElt)
virtual void Enlarge(const OPoint3D &pt)
Enlarge the box with the point if the point is outside the box.
bool _modified
Indique si l'element associe a ete modifie.
void setColor(const OColor &oColor)
void setLineWidth(float lineWidth)
virtual void update(bool force=false)
void setColor(const OColor &oColor)
void displayNormal(OVector3D normal, OPoint3D p1)
void gluDiskAndEnlargeBB(GLUquadric *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops)
void glVertex3fAndEnlargeBB(GLfloat x, GLfloat y, GLfloat z)
static TYGeometryNode * GetGeoNode(TYElement *pElement)
void setRecursiveVisible(bool visible=true)
void gluPartialDiskAndEnlargeBB(GLUquadric *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops, GLdouble startAngle, GLdouble sweepAngle)
void setDisplayPosition(double displayPositionX, double displayPositionY)
classe graphique pour un element de base
Representation graphique d'un element de base (fichier header)
static bool _gDrawPlafond
Indique si les plafonds doivent etre visible.
virtual void computeBoundingBox()
double _z
z coordinate of OCoord3D
void setElement(TYElement *pElt)
void setModified(bool modified=true)
void setPoint1(const OPoint3D &point1)
virtual QString getName() const
TYElement * _pElement
L'element metier auquel cet element graphique metier est associe.
bool _texture
Indique si le texturing est active pour cet element.
virtual void display(GLenum mode=GL_RENDER)
void highlight(bool state=true)
void setVisibility(bool bVisible)
double _m[4][4]
The 4x4 matrix array.