1 // Created on: 2007-07-09
2 // Created by: Alexander GRIGORIEV
3 // Copyright (c) 2007-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef NIS_DrawList_HeaderFile
17 #define NIS_DrawList_HeaderFile
19 #include <Handle_NIS_View.hxx>
20 #include <Handle_NIS_InteractiveObject.hxx>
21 #include <NCollection_List.hxx>
23 class NIS_InteractiveContext;
25 * This macro defines that OpenGL draw lists will be allocated as array of 5
26 * integers and any of them would not be deleted unless all interactive objects
27 * in the given drawer are removed.
28 * When the macro is undefined every draw list is created when needed and it is
29 * destroyed when there is no objects to show in this draw list.
34 * Implementation of a set of OpenGL draw lists for a given NIS_Drawer and
35 * given NIS_View. Stored in NIS_Drawer instances.
41 // ---------- PUBLIC METHODS ----------
47 Standard_EXPORT NIS_DrawList ();
52 Standard_EXPORT NIS_DrawList (const Handle_NIS_View& theView);
57 Standard_EXPORT virtual ~NIS_DrawList ();
60 * Query the list corresponding to the given type.
62 * Integer value coinciding with the enumerated NIS_Drawer:DrawType.
64 inline Standard_Integer GetListID (const Standard_Integer theType) const
66 { return myListID + theType; }
68 { return myListID[theType]; }
74 * Previous value of myListID
76 Standard_EXPORT void ClearListID (const Standard_Integer theType);
81 * Previous value of myListID
83 Standard_EXPORT void ClearListID (const Handle_NIS_View& theView=NULL);
86 * This method is called to start recording a new list. It must be eventually
87 * followed by EndPrepare.
89 * Integer value coinciding with the enumerated NIS_Drawer::DrawType.
91 Standard_EXPORT virtual void BeginPrepare (const Standard_Integer theType);
94 * This method is called to end recording a new list. It must be preceded
97 * Integer value coinciding with the enumerated NIS_Drawer::DrawType.
99 Standard_EXPORT virtual void EndPrepare (const Standard_Integer theType);
102 * Call the previously prepared list when the screen is redrawn.
104 * Integer value coinciding with the enumerated NIS_Drawer::DrawType.
106 Standard_EXPORT virtual void Call (const Standard_Integer theType);
109 * Query if the given list should be prepared again.
111 * Integer value coinciding with the enumerated NIS_Drawer::DrawType.
113 inline Standard_Boolean IsUpdated (const Standard_Integer theType) const
114 { return myIsUpdated [theType]; }
117 * Set the flag indicating that the List should be updated (rebuilt).
119 Standard_EXPORT void SetUpdated (const Standard_Integer theType);
122 * Query if the given list should be processed by Dynamic Hilighting.
124 inline const NCollection_List<Handle_NIS_InteractiveObject>&
125 DynHilightedList() const
126 { return myDynHilighted; }
131 inline const Handle_NIS_View& GetView () const
135 * Update the list of Dynamically Hilighted entities.
137 Standard_EXPORT Standard_Boolean SetDynHilighted
138 (const Standard_Boolean isHilight,
139 const Handle_NIS_InteractiveObject& theObj);
142 // ---------- PROTECTED METHODS ----------
143 Standard_EXPORT void SetUpdated (const Standard_Integer,
144 const Standard_Boolean);
147 inline void SetListID (const Standard_Integer theID)
148 { myListID = theID; }
152 // ---------- PRIVATE METHODS (PROHIBITED) ----------
153 NIS_DrawList (const NIS_DrawList& theOther);
154 // NIS_DrawList& operator = (const NIS_DrawList& theOther);
157 // ---------- PRIVATE FIELDS ----------
159 Handle_NIS_View myView;
161 Standard_Integer myListID;
163 Standard_Integer myListID[5];
165 Standard_Boolean myIsUpdated[5];
166 NCollection_List<Handle_NIS_InteractiveObject> myDynHilighted;