1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef HYDROGUI_PRSIMAGEFRAME_H
23 #define HYDROGUI_PRSIMAGEFRAME_H
25 #include <GraphicsView_Object.h>
27 #include <QGraphicsEllipseItem>
29 class HYDROGUI_PrsImage;
32 Class : HYDROGUI_PrsImageFrame
33 Description : Presentation for image frame object
35 class HYDROGUI_PrsImageFrame : public GraphicsView_Object
38 class UnscaledGraphicsEllipseItem;
40 enum AnchorType { Undefined = 0, TopLeft, TopRight, BottomLeft, BottomRight };
42 typedef QMap <int, UnscaledGraphicsEllipseItem*> AnchorMap;
43 typedef QMapIterator<int, UnscaledGraphicsEllipseItem*> AnchorMapIterator;
46 HYDROGUI_PrsImageFrame( HYDROGUI_PrsImage* thePrsImage );
47 virtual ~HYDROGUI_PrsImageFrame();
51 virtual QRectF boundingRect() const;
53 // from GraphicsView_Object
54 virtual void compute();
56 virtual bool hasSpecificZValue() const { return true; }
58 virtual bool isSelectable() const { return false; }
59 virtual bool isMovable() const { return false; }
62 void computeAnchorItems();
63 void updateVisibility();
66 HYDROGUI_PrsImage* myPrsImage;
67 AnchorMap myAnchorMap;
71 Class : UnscaledGraphicsEllipseItem
72 Description : Class for unscaled ellipse item
74 class HYDROGUI_PrsImageFrame::UnscaledGraphicsEllipseItem : public QGraphicsEllipseItem
77 UnscaledGraphicsEllipseItem( QGraphicsItem* );
78 virtual ~UnscaledGraphicsEllipseItem();
81 void setBasePoint( const QPointF& thePoint ) { myBasePoint = thePoint; }
82 const QPointF& getBasePoint() const { return myBasePoint; }
85 virtual QRectF boundingRect() const;
86 virtual void paint( QPainter*, const QStyleOptionGraphicsItem*, QWidget* );