0022819: Redesign of OpenGl driver
[occt.git] / src / OpenGl / OpenGl_PriorityList.hxx
1 // File:      OpenGl_PriorityList.hxx
2 // Created:   2 November 2011
3 // Author:    Sergey ZERCHANINOV
4 // Copyright: OPEN CASCADE 2011
5
6 #ifndef _OpenGl_PriorityList_Header
7 #define _OpenGl_PriorityList_Header
8
9 #include <NCollection_Sequence.hxx>
10 #include <NCollection_Array1.hxx>
11
12 #include <InterfaceGraphic_telem.hxx>
13
14 #include <Handle_OpenGl_Workspace.hxx>
15
16 class OpenGl_Structure;
17
18 typedef NCollection_Sequence<const OpenGl_Structure*> OpenGl_SequenceOfStructure;
19 typedef NCollection_Array1<OpenGl_SequenceOfStructure> OpenGl_ArrayOfStructure;
20
21 class OpenGl_PriorityList
22 {
23  public:
24
25   OpenGl_PriorityList (const Standard_Integer ANbPriorities = 11) : myArray(0,(ANbPriorities-1)), myNbStructures(0) {}
26   virtual ~OpenGl_PriorityList () {}
27
28   void Add (const OpenGl_Structure *AStructure, const Standard_Integer APriority);
29   void Remove (const OpenGl_Structure *AStructure);
30
31   Standard_Integer NbStructures () const { return myNbStructures; }
32
33   void Render (const Handle(OpenGl_Workspace) &AWorkspace) const;
34
35  protected:
36
37   OpenGl_ArrayOfStructure myArray;
38   Standard_Integer myNbStructures;
39
40  public:
41   IMPLEMENT_MEMORY_OPERATORS
42 };
43
44 #endif //_OpenGl_PriorityList_Header