myIsTransformationPointPreview( false ),
myTransformationPointMode( None )
{
- myHighlightCursor = new QCursor( Qt::PointingHandCursor );
myTransformationPointCursor = new QCursor( Qt::CrossCursor );
}
//=======================================================================
HYDROGUI_PrsImage::~HYDROGUI_PrsImage()
{
- if( myHighlightCursor )
- {
- delete myHighlightCursor;
- myHighlightCursor = 0;
- }
-
if( myTransformationPointCursor )
{
delete myTransformationPointCursor;
computeTransformationPoints();
}
+//================================================================
+// Function : setTransformationPointMap
+// Purpose :
+//================================================================
+void HYDROGUI_PrsImage::setTransformationPointMap( const TransformationPointMap& theMap )
+{
+ myTransformationPointMap = theMap;
+ if( !theMap.isEmpty() )
+ computeTransformationPoints();
+}
+
//================================================================
// Function : boundingRect
// Purpose :
//================================================================
void HYDROGUI_PrsImage::addTo( GraphicsView_ViewPort* theViewPort )
{
- GraphicsView_Object::addTo( theViewPort );
+ HYDROGUI_Prs::addTo( theViewPort );
theViewPort->addItem( myPrsImageFrame );
-
- double aZValue = 0;
- GraphicsView_ObjectListIterator anIter( theViewPort->getObjects() );
- while( anIter.hasNext() )
- {
- if( HYDROGUI_PrsImage* aPrs = dynamic_cast<HYDROGUI_PrsImage*>( anIter.next() ) )
- {
- double aZValueRef = aPrs->zValue();
- aZValue = qMax( aZValue, aZValueRef );
- }
- }
- setZValue( aZValue + 1 );
}
//================================================================
//================================================================
void HYDROGUI_PrsImage::removeFrom( GraphicsView_ViewPort* theViewPort )
{
- GraphicsView_Object::removeFrom( theViewPort );
+ HYDROGUI_Prs::removeFrom( theViewPort );
theViewPort->removeItem( myPrsImageFrame );
}
return true;
}
- bool anIsSelected = GraphicsView_Object::select( theX, theY, theRect );
+ bool anIsSelected = HYDROGUI_Prs::select( theX, theY, theRect );
myPrsImageFrame->updateVisibility();
return anIsSelected;
}
//================================================================
void HYDROGUI_PrsImage::unselect()
{
- GraphicsView_Object::unselect();
+ HYDROGUI_Prs::unselect();
myPrsImageFrame->updateVisibility();
}
//================================================================
void HYDROGUI_PrsImage::setSelected( bool theState )
{
- GraphicsView_Object::setSelected( theState );
+ HYDROGUI_Prs::setSelected( theState );
myPrsImageFrame->updateVisibility();
}