36 #include <qvector3d.h>
38 #define IMG(id) OLocalizator::getPicture("TYElementGraphic", (id))
69 if (
getModified() && pParent && pParent->getGraphicObject())
74 pParent->getGraphicObject()->updateTree();
128 glColor3f(1.0f, 0.5f, 0.0f);
132 glBegin(GL_LINE_STRIP);
133 glVertex3f(p1.
_x, p1.
_y, p1.
_z);
134 glVertex3f(p2.
_x, p2.
_y, p2.
_z);
152 if (pGeoNode !=
nullptr)
162 org[0] * mat.
_m[0][0] + org[1] * mat.
_m[0][1] + org[2] * mat.
_m[0][2] + mat.
_m[0][3],
163 org[0] * mat.
_m[2][0] + org[1] * mat.
_m[2][1] + org[2] * mat.
_m[2][2] + mat.
_m[2][3],
164 -(org[0] * mat.
_m[1][0] + org[1] * mat.
_m[1][1] + org[2] * mat.
_m[1][2] + mat.
_m[1][3]));
168 origin = QVector3D(org[0], org[2], -org[1]);
187 oglLineElement.
setPoint1(QVector3D(ret.x(), ret.y(), 0));
188 oglLineElement.
setPoint2(QVector3D(ret.x() + 20, ret.y() + 40, 0));
221 for (
int i = 0; i < childs.size(); i++)
223 childs[i]->getGraphicObject()->setVisible(visible);
243 if (childs.size() > 0)
246 TYListPtrConstTYElementGraphic::iterator ite = childs.begin();
250 for (; ite != childs.end(); ite++)
253 if (pChild !=
nullptr)
265 if (parent !=
nullptr)
268 if (parentGraphicElement !=
nullptr)
276 for (
int i = 0; i < children.size(); i++)
278 childGraphicElement = children[i]->getGraphicObject();
279 if (childGraphicElement !=
nullptr)
All base classes related to 3D manipulation.
Representation graphique d'un element de base (fichier header)
list< const TYElementGraphic * > TYListPtrConstTYElementGraphic
List de pointeur de TYElement.
std::vector< LPTYElement > LPTYElementArray
Realise le rendu VTK et le rendu OpenGL (fichier header)
Contexte de rendu utilisé par les fonctions d'affichage.
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 BLACK
double _y
y coordinate of OCoord3D
double _z
z coordinate of OCoord3D
double _x
x coordinate of OCoord3D
void setVisibility(bool bVisible)
void setDisplayPosition(double displayPositionX, double displayPositionY)
void setPoint2(const QVector3D &point2)
void setColor(const OColor &oColor)
void setLineWidth(float lineWidth)
void setPoint1(const QVector3D &point1)
void setColor(const OColor &oColor)
void setTextToDisplay(const QString &qsText)
void setFont(const QString &qsFontPath)
double _m[4][4]
The 4x4 matrix array.
classe graphique pour un element de base
bool _modified
Indique si l'element associe a ete modifie.
void setOnlyBoundingBox(bool state=true)
void drawName(TYRenderContext &renderContext)
bool _visible
Inique si l'element est visible.
void setModified(bool modified=true)
TYElement * getTYElement()
void setRecursiveVisible(bool visible=true)
static bool _gDrawNormals
Indique si les normals doivent etre visible.
bool _texture
Indique si le texturing est active pour cet element.
void setBoundingBoxVisible(bool state=true)
TYElementGraphic(TYElement *pElt)
bool _highlight
Indique si le highlight est active pour cet element.
void displayNormal(OVector3D normal, OPoint3D p1)
virtual void update(bool force=false)
bool isBoundingBoxVisible() const
static bool _gDrawPlafond
Indique si les plafonds doivent etre visible.
virtual void getChilds(TYListPtrTYElementGraphic &childs, bool recursif=true)
virtual void display(TYRenderContext &renderContext)
void setElement(TYElement *pElt)
TYElement * _pElement
L'element metier auquel cet element graphique metier est associe.
virtual OBox computeBoundingBox() const
void invalidateBoundingBox()
virtual ~TYElementGraphic()
bool _viewOnlyHighlight
Inique si on affiche la bounding box seule.
TYElement * getParent() const
virtual bool isInCurrentCalcul()
virtual QString getName() const
virtual void getChilds(LPTYElementArray &childs, bool recursif=true)
virtual void setIsGeometryModified(bool isModified)
OMatrix localToGlobal() const
OMatrix localToGeoNode(const TYGeometryNode *pGeoNode) const
static TYGeometryNode * GetGeoNode(TYElement *pElement)
const TYRenderViewport viewport
TYElement *const modelerElement
QVector3D worldToDisplay(const QVector3D &world) const