0022815: Missing delete operator for placement new
[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
27   virtual ~OpenGl_PriorityList () {}
28
29   void Add (const OpenGl_Structure *AStructure, const Standard_Integer APriority);
30
31   //! Remove structure and returns its priority, if the structure is not found,
32   //! method returns negative value
33   Standard_Integer Remove (const OpenGl_Structure *AStructure);
34
35   Standard_Integer NbStructures () const { return myNbStructures; }
36
37   void Render (const Handle(OpenGl_Workspace) &AWorkspace) const;
38
39   //! Returns the number of available priority levels
40   Standard_Integer NbPriorities() const;
41
42   //! Append priority list of acceptable type (with similar number of priorities
43   //! or less). Returns Standard_False if the list can not be accepted.
44   Standard_Boolean Append (const OpenGl_PriorityList& theOther);
45
46  protected:
47
48   OpenGl_ArrayOfStructure myArray;
49   Standard_Integer        myNbStructures;
50
51  public:
52   DEFINE_STANDARD_ALLOC
53 };
54
55 #endif //_OpenGl_PriorityList_Header