X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_Prs.cxx;h=d2f43b784582c21c4dc6e63087ccf21ae94025e5;hb=5cae7e874afd2fc1b6f61023e8ebd33a933db3c7;hp=f0a9f554418737cfbf01046029f6790055cbd70c;hpb=d74afc6389ed4e656c9451ac01b4065470746fd8;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_Prs.cxx b/src/HYDROGUI/HYDROGUI_Prs.cxx index f0a9f554..d2f43b78 100644 --- a/src/HYDROGUI/HYDROGUI_Prs.cxx +++ b/src/HYDROGUI/HYDROGUI_Prs.cxx @@ -22,15 +22,20 @@ #include "HYDROGUI_Prs.h" +#include + +#include + //======================================================================= // name : HYDROGUI_Prs // Purpose : Constructor //======================================================================= -HYDROGUI_Prs::HYDROGUI_Prs( const Handle(HYDROData_Object)& theObject ) +HYDROGUI_Prs::HYDROGUI_Prs( const Handle(HYDROData_Entity)& theObject ) : GraphicsView_Object(), myObject( theObject ), myIsToUpdate( false ) { + myHighlightCursor = new QCursor( Qt::PointingHandCursor ); } //======================================================================= @@ -39,4 +44,30 @@ HYDROGUI_Prs::HYDROGUI_Prs( const Handle(HYDROData_Object)& theObject ) //======================================================================= HYDROGUI_Prs::~HYDROGUI_Prs() { + if( myHighlightCursor ) + { + delete myHighlightCursor; + myHighlightCursor = 0; + } +} + +//================================================================ +// Function : addTo +// Purpose : +//================================================================ +void HYDROGUI_Prs::addTo( GraphicsView_ViewPort* theViewPort ) +{ + GraphicsView_Object::addTo( theViewPort ); + + double aZValue = 0; + GraphicsView_ObjectListIterator anIter( theViewPort->getObjects() ); + while( anIter.hasNext() ) + { + if( HYDROGUI_Prs* aPrs = dynamic_cast( anIter.next() ) ) + { + double aZValueRef = aPrs->zValue(); + aZValue = qMax( aZValue, aZValueRef ); + } + } + setZValue( aZValue + 1 ); }