/usr/include/opencascade/NIS_Drawer.hxx is in libopencascade-visualization-dev 6.5.0.dfsg-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | // File: NIS_Drawer.hxx
// Created: 06.07.07 21:10
// Author: Alexander GRIGORIEV
// Copyright: Open Cascade 2007
#ifndef NIS_Drawer_HeaderFile
#define NIS_Drawer_HeaderFile
#include <Standard_Transient.hxx>
#include <NCollection_List.hxx>
#include <TColStd_PackedMapOfInteger.hxx>
#include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
#include <NIS_DrawList.hxx>
#include <Bnd_B3f.hxx>
#ifdef WNT
// Disable the warning "operator new unmatched by delete"
#pragma warning (push)
#pragma warning (disable:4480)
#endif
class Handle_NIS_InteractiveObject;
class Handle_NIS_View;
class Handle_NIS_Drawer;
class NIS_InteractiveContext;
class NIS_View;
template <class A> class NCollection_Vector;
/**
* Abstract Drawer type
*/
class NIS_Drawer : public Standard_Transient
{
public:
#if (_MSC_VER < 1400)
enum DrawType {
#else
enum DrawType : unsigned int {
#endif
Draw_Normal = 0,
Draw_Transparent = 1,
Draw_Hilighted = 2,
Draw_DynHilighted = 3
};
public:
// ---------- PUBLIC METHODS ----------
/**
* Empty constructor.
*/
inline NIS_Drawer () : myCtx (0L) {}
/**
* Destructor.
*/
Standard_EXPORT virtual ~NIS_Drawer ();
/**
* Query the Interactive Context.
*/
inline NIS_InteractiveContext * GetContext () const
{ return myCtx; }
/**
* Copy the relevant information from another instance of Drawer.
* raises exception if theOther has incompatible type (test IsKind).
*/
Standard_EXPORT virtual void Assign (const Handle_NIS_Drawer& theOther);
/**
* Create a3D bounding box of drawn objects.
* @param pView
* In not NULL, only objects visible in this view are taken.
*/
Standard_EXPORT virtual const Bnd_B3f&
GetBox (const NIS_View * pView = 0L) const;
/**
* Mark all draw lists for update
*/
Standard_EXPORT void SetUpdated (const DrawType theType) const;
Standard_EXPORT void SetUpdated (const DrawType theType1,
const DrawType theType2) const;
Standard_EXPORT void SetUpdated (const DrawType theType1,
const DrawType theType2,
const DrawType theType3) const;
/**
* Switch on/off the dynamic hilight of the given object in the
* given view.
* @param isHilighted
* True if the object should be hilighted, False - if not hilighted
* @param theObj
* Object instance that should be hilighted or unhilighted.
* @param theView
* View where the status of object must be changed. If NULL, the object
* is hilighted/unhilighted in all views.
*/
Standard_EXPORT void SetDynamicHilighted
(const Standard_Boolean isHilighted,
const Handle_NIS_InteractiveObject& theObj,
const Handle_NIS_View& theView = 0L);
/**
* Hash value, for Map interface.
*/
Standard_EXPORT virtual Standard_Integer
HashCode(const Standard_Integer theN) const;
/**
* Matching two instances, for Map interface.
*/
Standard_EXPORT virtual Standard_Boolean
IsEqual (const Handle_NIS_Drawer& theOth) const;
/**
* Obtain the iterator of IDs of associated objects.
*/
inline TColStd_MapIteratorOfPackedMapOfInteger
ObjectIterator () const
{ return TColStd_MapIteratorOfPackedMapOfInteger (myMapID); }
protected:
// ---------- PROTECTED METHODS ----------
/**
* Called before execution of Draw(), once per group of interactive objects.
*/
Standard_EXPORT virtual void BeforeDraw
(const DrawType theType,
const NIS_DrawList& theDrawList );
/**
* Called after execution of Draw(), once per group of interactive objects.
*/
Standard_EXPORT virtual void AfterDraw
(const DrawType theType,
const NIS_DrawList& theDrawList);
/**
* Main function: display the given interactive object in the given view.
*/
Standard_EXPORT virtual void Draw (const Handle_NIS_InteractiveObject&,
const DrawType theType,
const NIS_DrawList& theDrawList)= 0;
Standard_EXPORT virtual void redraw (const DrawType theType,
const Handle_NIS_View& theView);
Standard_EXPORT void addObject (const NIS_InteractiveObject * theObj,
const Standard_Boolean isUpVws);
Standard_EXPORT void removeObject (const NIS_InteractiveObject * theObj,
const Standard_Boolean isUpVws);
Standard_EXPORT virtual NIS_DrawList*
createDefaultList (const Handle_NIS_View&) const;
private:
// ---------- PRIVATE (PROHIBITED) METHODS ----------
NIS_Drawer (const NIS_Drawer& theOther);
NIS_Drawer& operator = (const NIS_Drawer& theOther);
// ---------- PRIVATE METHODS ----------
void prepareList (const NIS_Drawer::DrawType theType,
const NIS_DrawList& theDrawLst);
protected:
// ---------- PROTECTED FIELDS ----------
NCollection_List<NIS_DrawList*> myLists;
private:
// ---------- PRIVATE FIELDS ----------
NIS_InteractiveContext * myCtx;
TColStd_PackedMapOfInteger myMapID;
Bnd_B3f myBox;
friend class NIS_InteractiveContext;
friend class NIS_InteractiveObject;
public:
// Declaration of CASCADE RTTI
DEFINE_STANDARD_RTTI (NIS_Drawer)
};
// Definition of HANDLE object using Standard_DefineHandle.hxx
DEFINE_STANDARD_HANDLE (NIS_Drawer, Standard_Transient)
//=======================================================================
//function : HashCode
//purpose :
//=======================================================================
inline Standard_Integer HashCode (const Handle_NIS_Drawer& theDrawer,
const Standard_Integer theN)
{ return theDrawer.IsNull() ? 0 : theDrawer->HashCode (theN); }
//=======================================================================
//function : IsEqual
//purpose :
//=======================================================================
inline Standard_Boolean IsEqual (const Handle_NIS_Drawer& theDrawer1,
const Handle_NIS_Drawer& theDrawer2)
{ return theDrawer1.IsNull()? Standard_False: theDrawer1->IsEqual(theDrawer2); }
#ifdef WNT
#pragma warning (pop)
#endif
#endif
|