Commit | Line | Data |
---|---|---|
b311480e | 1 | // Created on: 2011-11-02 |
2 | // Created by: Sergey ZERCHANINOV | |
3 | // Copyright (c) 2011-2012 OPEN CASCADE SAS | |
4 | // | |
5 | // The content of this file is subject to the Open CASCADE Technology Public | |
6 | // License Version 6.5 (the "License"). You may not use the content of this file | |
7 | // except in compliance with the License. Please obtain a copy of the License | |
8 | // at http://www.opencascade.org and read it completely before using this file. | |
9 | // | |
10 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its | |
11 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. | |
12 | // | |
13 | // The Original Code and all software distributed under the License is | |
14 | // distributed on an "AS IS" basis, without warranty of any kind, and the | |
15 | // Initial Developer hereby disclaims all such warranties, including without | |
16 | // limitation, any warranties of merchantability, fitness for a particular | |
17 | // purpose or non-infringement. Please see the License for the specific terms | |
18 | // and conditions governing the rights and limitations under the License. | |
19 | ||
2166f0fa SK |
20 | |
21 | #ifndef _OpenGl_PriorityList_Header | |
22 | #define _OpenGl_PriorityList_Header | |
23 | ||
24 | #include <NCollection_Sequence.hxx> | |
25 | #include <NCollection_Array1.hxx> | |
26 | ||
27 | #include <InterfaceGraphic_telem.hxx> | |
28 | ||
29 | #include <Handle_OpenGl_Workspace.hxx> | |
30 | ||
31 | class OpenGl_Structure; | |
32 | ||
33 | typedef NCollection_Sequence<const OpenGl_Structure*> OpenGl_SequenceOfStructure; | |
34 | typedef NCollection_Array1<OpenGl_SequenceOfStructure> OpenGl_ArrayOfStructure; | |
35 | ||
36 | class OpenGl_PriorityList | |
37 | { | |
38 | public: | |
39 | ||
40 | OpenGl_PriorityList (const Standard_Integer ANbPriorities = 11) : myArray(0,(ANbPriorities-1)), myNbStructures(0) {} | |
59f45b7c | 41 | |
2166f0fa SK |
42 | virtual ~OpenGl_PriorityList () {} |
43 | ||
44 | void Add (const OpenGl_Structure *AStructure, const Standard_Integer APriority); | |
59f45b7c | 45 | |
46 | //! Remove structure and returns its priority, if the structure is not found, | |
47 | //! method returns negative value | |
48 | Standard_Integer Remove (const OpenGl_Structure *AStructure); | |
2166f0fa SK |
49 | |
50 | Standard_Integer NbStructures () const { return myNbStructures; } | |
51 | ||
52 | void Render (const Handle(OpenGl_Workspace) &AWorkspace) const; | |
53 | ||
59f45b7c | 54 | //! Returns the number of available priority levels |
55 | Standard_Integer NbPriorities() const; | |
56 | ||
57 | //! Append priority list of acceptable type (with similar number of priorities | |
58 | //! or less). Returns Standard_False if the list can not be accepted. | |
59 | Standard_Boolean Append (const OpenGl_PriorityList& theOther); | |
60 | ||
2166f0fa SK |
61 | protected: |
62 | ||
63 | OpenGl_ArrayOfStructure myArray; | |
59f45b7c | 64 | Standard_Integer myNbStructures; |
2166f0fa SK |
65 | |
66 | public: | |
1c35b92f | 67 | DEFINE_STANDARD_ALLOC |
2166f0fa SK |
68 | }; |
69 | ||
70 | #endif //_OpenGl_PriorityList_Header |