1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library 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. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #ifndef HYDROGUI_PRSIMAGEFRAME_H
19 #define HYDROGUI_PRSIMAGEFRAME_H
21 #include <GraphicsView_Object.h>
23 #include <QGraphicsEllipseItem>
25 class HYDROGUI_PrsImage;
28 Class : HYDROGUI_PrsImageFrame
29 Description : Presentation for image frame object
31 class HYDROGUI_PrsImageFrame : public GraphicsView_Object
34 class UnscaledGraphicsEllipseItem;
36 enum AnchorType { Undefined = 0, TopLeft, TopRight, BottomLeft, BottomRight };
38 typedef QMap <int, UnscaledGraphicsEllipseItem*> AnchorMap;
39 typedef QMapIterator<int, UnscaledGraphicsEllipseItem*> AnchorMapIterator;
42 HYDROGUI_PrsImageFrame( HYDROGUI_PrsImage* thePrsImage );
43 virtual ~HYDROGUI_PrsImageFrame();
47 virtual QRectF boundingRect() const;
49 // from GraphicsView_Object
50 virtual void compute();
52 virtual bool hasSpecificZValue() const { return true; }
54 virtual bool isSelectable() const { return false; }
55 virtual bool isMovable() const { return false; }
58 void computeAnchorItems();
59 void updateVisibility();
62 HYDROGUI_PrsImage* myPrsImage;
63 AnchorMap myAnchorMap;
67 Class : UnscaledGraphicsEllipseItem
68 Description : Class for unscaled ellipse item
70 class HYDROGUI_PrsImageFrame::UnscaledGraphicsEllipseItem : public QGraphicsEllipseItem
73 UnscaledGraphicsEllipseItem( QGraphicsItem* );
74 virtual ~UnscaledGraphicsEllipseItem();
77 void setBasePoint( const QPointF& thePoint ) { myBasePoint = thePoint; }
78 const QPointF& getBasePoint() const { return myBasePoint; }
81 virtual QRectF boundingRect() const;
82 virtual void paint( QPainter*, const QStyleOptionGraphicsItem*, QWidget* );