1 // Copyright (C) 2007-2008 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.
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
33 class QXGRAPH_EXPORT QxGraph_Prs
36 QxGraph_Prs(QxGraph_Canvas*);
37 virtual ~QxGraph_Prs();
39 QxGraph_Canvas* getCanvas() const { return myCanvas; }
41 void addItem(QCanvasItem* theItem, int theDMode = -1);
42 void removeItem(QCanvasItem* theItem, int theDMode = -1);
44 /* add items for display mode theDMode
45 if theDMode is equal to -1 add item for the current (active) display mode */
46 QCanvasItem* addRectangleItem(QRect theRect, int theDMode = -1);
47 QCanvasItem* addPolygonItem(QPointArray thePA, int theDMode = -1);
48 QCanvasItem* addLineItem(QPoint theStart, QPoint theEnd, int theDMode = -1);
49 QCanvasItem* addEllipseItem(int theW, int theH, int theStartAngle, int theAngle, int theDMode = -1);
50 QCanvasItem* addTextItem(QString theText, int theDMode = -1);
52 typedef std::map< int, std::list<QCanvasItem*> > DMode2ItemList;
54 const DMode2ItemList& getDisplayMap() const { return myDisplayMap; }
55 const std::list<QCanvasItem*>& getItems(int theDMode) { return myDisplayMap[theDMode]; }
57 void setDMode(int theDMode) { myDMode = theDMode; }
58 int getDMode() const { return myDMode; }
62 virtual void setToUpdate( const bool );
63 bool isToUpdate() { return needUpdate; }
66 virtual void update();
69 QxGraph_Canvas* myCanvas;
70 DMode2ItemList myDisplayMap;