1 // File: OpenGl_PriorityList.hxx
2 // Created: 2 November 2011
3 // Author: Sergey ZERCHANINOV
4 // Copyright: OPEN CASCADE 2011
6 #ifndef _OpenGl_PriorityList_Header
7 #define _OpenGl_PriorityList_Header
9 #include <NCollection_Sequence.hxx>
10 #include <NCollection_Array1.hxx>
12 #include <InterfaceGraphic_telem.hxx>
14 #include <Handle_OpenGl_Workspace.hxx>
16 class OpenGl_Structure;
18 typedef NCollection_Sequence<const OpenGl_Structure*> OpenGl_SequenceOfStructure;
19 typedef NCollection_Array1<OpenGl_SequenceOfStructure> OpenGl_ArrayOfStructure;
21 class OpenGl_PriorityList
25 OpenGl_PriorityList (const Standard_Integer ANbPriorities = 11) : myArray(0,(ANbPriorities-1)), myNbStructures(0) {}
27 virtual ~OpenGl_PriorityList () {}
29 void Add (const OpenGl_Structure *AStructure, const Standard_Integer APriority);
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);
35 Standard_Integer NbStructures () const { return myNbStructures; }
37 void Render (const Handle(OpenGl_Workspace) &AWorkspace) const;
39 //! Returns the number of available priority levels
40 Standard_Integer NbPriorities() const;
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);
48 OpenGl_ArrayOfStructure myArray;
49 Standard_Integer myNbStructures;
55 #endif //_OpenGl_PriorityList_Header