Salome HOME
PAL10125 - by double click on reference original object becomes selected
[modules/gui.git] / src / GLViewer / GLViewer_Group.h
1 // File:      GLViewer_Group.h
2 // Created:   March, 2005
3 // Author:    OCC team
4 // Copyright (C) CEA 2005
5
6 #ifndef GLVIEWER_GROUP_H
7 #define GLVIEWER_GROUP_H
8
9 #include <list>
10 #include "GLViewer.h"
11
12 #ifdef WNT
13 #pragma warning( disable:4251 )
14 #endif
15
16 class GLViewer_Object;
17
18 typedef std::list<GLViewer_Object*> OGList;
19 typedef std::list<GLViewer_Object*>::iterator OGIterator;
20
21 /*! Class  GLViewer_Group
22 * Group of GLViewer_Objects for synchronized moving.
23 * If you move one or more objects from group, than all objects from group is moved
24 * If group is empty, it must be deleted
25 */
26
27 class GLVIEWER_API GLViewer_Group
28 {
29 public:
30   GLViewer_Group();
31   ~GLViewer_Group();
32
33   bool    isEmpty();
34   //! Returns number ob objects
35   int     count();
36   
37   //! Returns index of position, else -1
38   int     contains( GLViewer_Object* );
39   int     addObject( GLViewer_Object* );
40   int     removeObject( GLViewer_Object* );
41
42   OGList  getObjects() const { return myList; }
43
44   //! Dragging operation
45   /*! Once = true, if this operation calls only one time for all object*/
46   void    dragingObjects( float x, float y, bool once = false );
47   //!\warning it is for ouv
48   void    updateZoom( GLViewer_Object* sender, float zoom );
49
50 private:
51   //! List of objects
52   OGList      myList;
53   //! This number needs for synchranization group with viewport drag methods
54   int         mySelObjNum;
55 };
56
57 #endif //GLVIEWER_GROUP_H