/usr/include/oce/AIS_LocalContext.hxx is in liboce-visualization-dev 0.18.2-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 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | // This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to
// this header file considered to be the "object code" form of the original source.
#ifndef _AIS_LocalContext_HeaderFile
#define _AIS_LocalContext_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineHandle.hxx>
#include <Handle_AIS_LocalContext.hxx>
#include <Handle_AIS_InteractiveContext.hxx>
#include <Standard_Boolean.hxx>
#include <Handle_SelectMgr_SelectionManager.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <TCollection_AsciiString.hxx>
#include <AIS_DataMapOfSelStat.hxx>
#include <Handle_SelectMgr_OrFilter.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <Handle_SelectMgr_Filter.hxx>
#include <SelectMgr_IndexedMapOfOwner.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <AIS_SequenceOfInteractive.hxx>
#include <MMgt_TShared.hxx>
#include <Handle_AIS_InteractiveObject.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_ClearMode.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <AIS_StatusOfDetection.hxx>
#include <Handle_V3d_View.hxx>
#include <AIS_StatusOfPick.hxx>
#include <Handle_SelectMgr_EntityOwner.hxx>
#include <Handle_Standard_Transient.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Handle_AIS_LocalStatus.hxx>
#include <Handle_SelectMgr_SelectableObject.hxx>
class AIS_InteractiveContext;
class SelectMgr_SelectionManager;
class SelectMgr_OrFilter;
class SelectMgr_Filter;
class AIS_InteractiveObject;
class TCollection_AsciiString;
class TColStd_ListOfInteger;
class SelectMgr_ListOfFilter;
class V3d_View;
class TColgp_Array1OfPnt2d;
class TopoDS_Shape;
class SelectMgr_EntityOwner;
class Standard_Transient;
class TColStd_MapOfTransient;
class AIS_LocalStatus;
class SelectMgr_SelectableObject;
//! Defines a specific context for selection.
//! It becomes possible to:
//! + Load InteractiveObjects with a mode to be
//! activated + associate InteractiveObjects with a
//! set of temporary selectable Objects.... + +
//! activate StandardMode of selection for Entities
//! inheriting BasicShape from AIS (Selection Of
//! vertices, edges, wires,faces... + Add Filters
//! acting on detected owners of sensitive primitives
//!
//! - automatically highlight shapes and
//! InteractiveObjects (highlight of detected shape +
//! highlight of detected selectable...
class AIS_LocalContext : public MMgt_TShared
{
public:
Standard_EXPORT AIS_LocalContext();
//! Constructor By Default, the displayed objects are
//! automatically loaded.
Standard_EXPORT AIS_LocalContext(const Handle(AIS_InteractiveContext)& aCtx, const Standard_Integer anIndex, const Standard_Boolean LoadDisplayed = Standard_True, const Standard_Boolean AcceptStandardModes = Standard_True, const Standard_Boolean AcceptErase = Standard_False, const Standard_Boolean UseBothViewers = Standard_False);
//! authorize or not others contexts to erase
//! temporary displayed objects here;
void AcceptErase (const Standard_Boolean aStatus) ;
Standard_Boolean AcceptErase() const;
Standard_EXPORT void SetContext (const Handle(AIS_InteractiveContext)& aCtx) ;
const TCollection_AsciiString& SelectionName() const;
Standard_EXPORT void Terminate (const Standard_Boolean updateviewer = Standard_True) ;
//! to be called when a upper local context was closed...
//! useful to put pack the right projector...
Standard_EXPORT void Reactivate() ;
//! returns true if done...
Standard_EXPORT Standard_Boolean Display (const Handle(AIS_InteractiveObject)& anInteractive, const Standard_Integer DisplayMode = 0, const Standard_Boolean AllowShapeDecomposition = Standard_True, const Standard_Integer ActivationMode = 0) ;
//! loads <anInteractive> with nodisplay...
//! returns true if done
Standard_EXPORT Standard_Boolean Load (const Handle(AIS_InteractiveObject)& anInteractive, const Standard_Boolean AllowShapeDecomposition = Standard_True, const Standard_Integer ActivationMode = 0) ;
//! returns true if done...
Standard_EXPORT Standard_Boolean Erase (const Handle(AIS_InteractiveObject)& anInteractive) ;
Standard_EXPORT Standard_Boolean Remove (const Handle(AIS_InteractiveObject)& aSelectable) ;
Standard_EXPORT Standard_Boolean ClearPrs (const Handle(AIS_InteractiveObject)& anInteractive, const Standard_Integer aMode) ;
//! allows or forbids the shape decomposition into
//! Activated Standard Mode for <aStoredObject>
//! does nothing if the object doesn't inherits
//! BasicShape from AIS
Standard_EXPORT void SetShapeDecomposition (const Handle(AIS_InteractiveObject)& aStoredObject, const Standard_Boolean aStatus) ;
//! according to <atype> , clears the different parts of
//! the selector (filters, modeof activation, objects...)
Standard_EXPORT void Clear (const AIS_ClearMode atype = AIS_CM_All) ;
//! optional : activation of a mode which is not 0 for a selectable...
Standard_EXPORT void ActivateMode (const Handle(AIS_InteractiveObject)& aSelectable, const Standard_Integer aMode) ;
Standard_EXPORT void DeactivateMode (const Handle(AIS_InteractiveObject)& aSelectable, const Standard_Integer aMode) ;
Standard_EXPORT void Deactivate (const Handle(AIS_InteractiveObject)& aSelectable) ;
//! decomposition of shapes into <aType>
Standard_EXPORT void ActivateStandardMode (const TopAbs_ShapeEnum aType) ;
Standard_EXPORT void DeactivateStandardMode (const TopAbs_ShapeEnum aType) ;
const TColStd_ListOfInteger& StandardModes() const;
Standard_EXPORT void AddFilter (const Handle(SelectMgr_Filter)& aFilter) ;
Standard_EXPORT void RemoveFilter (const Handle(SelectMgr_Filter)& aFilter) ;
const SelectMgr_ListOfFilter& ListOfFilter() const;
const Handle(SelectMgr_OrFilter)& Filter() const;
//! if <aStatus> = True , the shapes or subshapes detected
//! by the selector will be automatically hilighted in the
//! main viewer.
//! Else the user has to manage the detected shape outside the
//! Shape Selector....
void SetAutomaticHilight (const Standard_Boolean aStatus) ;
Standard_Boolean AutomaticHilight() const;
Standard_EXPORT AIS_StatusOfDetection MoveTo (const Standard_Integer theXpix, const Standard_Integer theYpix, const Handle(V3d_View)& theView, const Standard_Boolean theToRedrawImmediate) ;
//! returns True if more than one entity
//! was detected at the last Mouse position.
Standard_Boolean HasNextDetected() const;
//! returns True if last detected. the next detected will
//! be first one (endless loop)
Standard_EXPORT Standard_Integer HilightNextDetected (const Handle(V3d_View)& theView, const Standard_Boolean theToRedrawImmediate) ;
Standard_EXPORT Standard_Integer HilightPreviousDetected (const Handle(V3d_View)& theView, const Standard_Boolean theToRedrawImmediate) ;
//! returns True if something was done...
Standard_EXPORT Standard_Boolean UnhilightLastDetected (const Handle(V3d_View)& aView) ;
//! returns the number of selected
Standard_EXPORT AIS_StatusOfPick Select (const Standard_Boolean updateviewer = Standard_True) ;
Standard_EXPORT AIS_StatusOfPick ShiftSelect (const Standard_Boolean updateviewer = Standard_True) ;
Standard_EXPORT AIS_StatusOfPick Select (const Standard_Integer XPMin, const Standard_Integer YPMin, const Standard_Integer XPMax, const Standard_Integer YPMax, const Handle(V3d_View)& aView, const Standard_Boolean updateviewer = Standard_True) ;
Standard_EXPORT AIS_StatusOfPick ShiftSelect (const Standard_Integer XPMin, const Standard_Integer YPMin, const Standard_Integer XPMax, const Standard_Integer YPMax, const Handle(V3d_View)& aView, const Standard_Boolean updateviewer = Standard_True) ;
Standard_EXPORT AIS_StatusOfPick Select (const TColgp_Array1OfPnt2d& Polyline, const Handle(V3d_View)& aView, const Standard_Boolean updateviewer = Standard_True) ;
Standard_EXPORT AIS_StatusOfPick ShiftSelect (const TColgp_Array1OfPnt2d& Polyline, const Handle(V3d_View)& aView, const Standard_Boolean updateviewer = Standard_True) ;
Standard_EXPORT void HilightPicked (const Standard_Boolean updateviewer = Standard_True) ;
Standard_EXPORT void UnhilightPicked (const Standard_Boolean updateviewer = Standard_True) ;
Standard_EXPORT void UpdateSelected (const Standard_Boolean updateviewer = Standard_True) ;
//! Part of advanced selection highlighting mechanism.
//! If no owners belonging to anobj are selected, calls anobj->ClearSelected(),
//! otherwise calls anobj->HilightSelected(). This method can be used to avoid
//! redrawing the whole selection belonging to several Selectable Objects.
Standard_EXPORT void UpdateSelected (const Handle(AIS_InteractiveObject)& anobj, const Standard_Boolean updateviewer = Standard_True) ;
//! useful to update selection with objects coming from
//! Collector or stack
Standard_EXPORT void SetSelected (const Handle(AIS_InteractiveObject)& anobj, const Standard_Boolean updateviewer = Standard_True) ;
//! useful to update selection with objects coming from
//! Collector or stack
Standard_EXPORT void AddOrRemoveSelected (const Handle(AIS_InteractiveObject)& anobj, const Standard_Boolean updateviewer = Standard_True) ;
Standard_EXPORT void AddOrRemoveSelected (const TopoDS_Shape& aShape, const Standard_Boolean updateviewer = Standard_True) ;
Standard_EXPORT void AddOrRemoveSelected (const Handle(SelectMgr_EntityOwner)& theOwner, const Standard_Boolean toUpdateViewer = Standard_True) ;
//! Clears local context selection.
//! @param toUpdateViewer [in] if TRUE the viewer will be updated.
Standard_EXPORT void ClearSelected (const Standard_Boolean toUpdateViewer = Standard_True) ;
//! Clears outdated selection and detection of owners for the
//! interactive object. Use this method if selection structures
//! of the interactive object have changed. The method unhilights
//! and removes outdated entity owners from lists of selected
//! and detected owners.
//! @param theIO [in] the interactive object.
//! @param toClearDeactivated [in] pass TRUE to treat deactivated
//! entity owners as 'outdated' when clearing the selection.
Standard_EXPORT void ClearOutdatedSelection (const Handle(AIS_InteractiveObject)& theIO, const Standard_Boolean toClearDeactivated) ;
Standard_Boolean HasDetected() const;
//! Initialization for iteration through mouse-detected objects in local context.
Standard_EXPORT void InitDetected() ;
//! @return true if there is more mouse-detected objects after the current one
//! during iteration through mouse-detected interactive objects.
Standard_EXPORT Standard_Boolean MoreDetected() const;
//! Gets next current object during iteration through mouse-detected
//! interactive objects.
Standard_EXPORT void NextDetected() ;
//! @return current mouse-detected shape or empty (null) shape, if current interactive object
//! is not a shape (AIS_Shape) or there is no current mouse-detected interactive object at all.
Standard_EXPORT const TopoDS_Shape& DetectedCurrentShape() const;
//! @return current mouse-detected interactive object or null object if there is no current detected.
Standard_EXPORT Handle(AIS_InteractiveObject) DetectedCurrentObject() const;
Standard_EXPORT Standard_Boolean HasDetectedShape() const;
Standard_EXPORT const TopoDS_Shape& DetectedShape() const;
Standard_EXPORT Handle(AIS_InteractiveObject) DetectedInteractive() const;
Standard_EXPORT Handle(SelectMgr_EntityOwner) DetectedOwner() const;
Standard_EXPORT void InitSelected() ;
Standard_EXPORT Standard_Boolean MoreSelected() const;
Standard_EXPORT void NextSelected() ;
//! returns TRUE if the detected entity is a shape
//! coming from a Decomposition of an element.
Standard_EXPORT Standard_Boolean HasShape() const;
//! returns true if current selection is not empty
//! and the owner of selected object contains a shape.
//! This method does not take into account decomposition
//! status of detected shape.
Standard_EXPORT Standard_Boolean HasSelectedShape() const;
Standard_EXPORT TopoDS_Shape SelectedShape() const;
Standard_EXPORT Handle(SelectMgr_EntityOwner) SelectedOwner() const;
Standard_EXPORT Standard_Boolean IsSelected (const Handle(AIS_InteractiveObject)& aniobj) const;
Standard_EXPORT Standard_Boolean IsSelected (const Handle(SelectMgr_EntityOwner)& anOwner) const;
Standard_EXPORT Handle(AIS_InteractiveObject) SelectedInteractive() const;
//! returns TRUE if an interactive element
//! was associated with the current picked entity.
Standard_EXPORT Standard_Boolean HasApplicative() const;
Standard_EXPORT const Handle(Standard_Transient)& SelectedApplicative() const;
Standard_EXPORT void SetDisplayPriority (const Handle(AIS_InteractiveObject)& anObject, const Standard_Integer Prior) ;
Standard_EXPORT Standard_Integer DisplayedObjects (TColStd_MapOfTransient& theMapToFill) const;
Standard_EXPORT Standard_Boolean IsIn (const Handle(AIS_InteractiveObject)& anObject) const;
Standard_EXPORT Standard_Boolean IsDisplayed (const Handle(AIS_InteractiveObject)& anObject) const;
Standard_EXPORT Standard_Boolean IsDisplayed (const Handle(AIS_InteractiveObject)& anObject, const Standard_Integer aMode) const;
Standard_EXPORT const TColStd_ListOfInteger& SelectionModes (const Handle(AIS_InteractiveObject)& anObject) const;
Standard_EXPORT void SubIntensityOn (const Handle(AIS_InteractiveObject)& anObject) ;
Standard_EXPORT void SubIntensityOff (const Handle(AIS_InteractiveObject)& anObject) ;
Standard_EXPORT void Hilight (const Handle(AIS_InteractiveObject)& anObject) ;
Standard_EXPORT void Hilight (const Handle(AIS_InteractiveObject)& anObject, const Quantity_NameOfColor aCol) ;
Standard_EXPORT void Unhilight (const Handle(AIS_InteractiveObject)& anObject) ;
Standard_EXPORT Standard_Boolean IsHilighted (const Handle(AIS_InteractiveObject)& anObject) const;
Standard_EXPORT Standard_Boolean IsHilighted (const Handle(AIS_InteractiveObject)& anObject, Standard_Boolean& WithColor, Quantity_NameOfColor& HiCol) const;
//! Define the current selection sensitivity for
//! this local context according to the view size.
Standard_EXPORT void SetPixelTolerance (const Standard_Integer aPrecision = 2) ;
//! Returns the pixel tolerance.
Standard_EXPORT Standard_Integer PixelTolerance() const;
//! Allows to manage sensitivity of a particular selection of interactive object theObject and
//! changes previous sensitivity value of all sensitive entities in selection with theMode to
//! the given theNewSensitivity.
Standard_EXPORT void SetSelectionSensitivity (const Handle(AIS_InteractiveObject)& theObject, const Standard_Integer theMode, const Standard_Integer theNewSensitivity) ;
//! Resets the transient list of presentations previously displayed in immediate mode
//! and begins accumulation of new list by following AddToImmediateList()/Color()/Highlight() calls.
Standard_EXPORT Standard_Boolean BeginImmediateDraw() ;
//! Resets the transient list of presentations previously displayed in immediate mode.
Standard_EXPORT virtual void ClearImmediateDraw() ;
//! Stores presentation theMode of object theObj in the transient list of presentations to be displayed in immediate mode.
//! Will be taken in account in EndImmediateDraw method.
Standard_EXPORT Standard_Boolean ImmediateAdd (const Handle(AIS_InteractiveObject)& theObj, const Standard_Integer theMode = 0) ;
//! Allows rapid drawing of the view theView by avoiding an update of the whole background.
Standard_EXPORT Standard_Boolean EndImmediateDraw (const Handle(V3d_View)& theView) ;
//! Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode.
Standard_EXPORT Standard_Boolean IsImmediateModeOn() const;
Standard_EXPORT void LoadContextObjects() ;
Standard_EXPORT void UnloadContextObjects() ;
Standard_EXPORT void DisplaySensitive (const Handle(V3d_View)& aView) ;
Standard_EXPORT void ClearSensitive (const Handle(V3d_View)& aView) ;
const Handle(StdSelect_ViewerSelector3d)& MainSelector() const;
Standard_EXPORT Handle(SelectMgr_EntityOwner) FindSelectedOwnerFromIO (const Handle(AIS_InteractiveObject)& anIObj) const;
Standard_EXPORT Handle(SelectMgr_EntityOwner) FindSelectedOwnerFromShape (const TopoDS_Shape& aShape) const;
friend
//! Changes the status of a temporary object. It will be
//! kept at the neutral point, i.e. put in the list of
//! displayed objects along withwith its temporary
//! attributes. These include display mode and
//! selection mode, for example.
//! Returns true if done.
//! inWhichLocal gives the local context in which anIObj
//! is displayed. By default, the index -1 refers to the last
//! Local Context opened.
Standard_EXPORT Standard_Boolean AIS_InteractiveContext::KeepTemporary (const Handle(AIS_InteractiveObject)& anIObj, const Standard_Integer InWhichLocal) ;
DEFINE_STANDARD_RTTI(AIS_LocalContext)
protected:
private:
Standard_EXPORT TCollection_AsciiString Status() const;
Standard_EXPORT const Handle(AIS_LocalStatus)& Status (const Handle(AIS_InteractiveObject)& anObject) const;
Standard_EXPORT void Process (const Handle(SelectMgr_SelectableObject)& anObject) ;
Standard_EXPORT void Process() ;
Standard_EXPORT void ActivateStandardModes (const Handle(SelectMgr_SelectableObject)& anObject) ;
Standard_EXPORT void manageDetected (const Handle(SelectMgr_EntityOwner)& thePickOwner, const Handle(V3d_View)& theView, const Standard_Boolean theToRedrawImmediate) ;
//! returns 0 if the detected entity was Not FilterOK...
Standard_Integer DetectedIndex() ;
Standard_EXPORT void Hilight (const Handle(SelectMgr_EntityOwner)& Own, const Handle(V3d_View)& aview) ;
Standard_EXPORT void Unhilight (const Handle(SelectMgr_EntityOwner)& Ownr, const Handle(V3d_View)& aview) ;
Standard_EXPORT void ClearObjects() ;
Standard_EXPORT void ClearDetected() ;
Standard_EXPORT Standard_Boolean IsDecompositionOn() const;
Standard_EXPORT Standard_Boolean IsShape (const Standard_Integer anIndex) const;
Standard_EXPORT Standard_Boolean IsValidForSelection (const Handle(AIS_InteractiveObject)& anIObj) const;
Standard_Boolean IsValidIndex (const Standard_Integer anIndex) const;
Standard_EXPORT Standard_Boolean ComesFromDecomposition (const Standard_Integer aPickedIndex) const;
Standard_EXPORT Standard_Boolean HasFilters (const TopAbs_ShapeEnum aType) const;
Handle(AIS_InteractiveContext) myCTX;
Standard_Boolean myLoadDisplayed;
Standard_Boolean myAcceptStdMode;
Standard_Boolean myAcceptErase;
Handle(SelectMgr_SelectionManager) mySM;
Handle(StdSelect_ViewerSelector3d) myMainVS;
Handle(PrsMgr_PresentationManager3d) myMainPM;
TCollection_AsciiString mySelName;
Handle(StdSelect_ViewerSelector3d) myCollVS;
AIS_DataMapOfSelStat myActiveObjects;
Handle(SelectMgr_OrFilter) myFilters;
TColStd_ListOfInteger myListOfStandardMode;
Handle(SelectMgr_Filter) myStdFilters[9];
Standard_Boolean myAutoHilight;
Handle(SelectMgr_IndexedMapOfOwner) myMapOfOwner;
Standard_Integer mylastindex;
Standard_Integer mylastgood;
Standard_Integer myCurrentOwner;
TColStd_SequenceOfInteger myDetectedSeq;
Standard_Integer myCurDetected;
AIS_SequenceOfInteractive myAISDetectedSeq;
Standard_Integer myAISCurDetected;
};
#include <AIS_LocalContext.lxx>
#endif // _AIS_LocalContext_HeaderFile
|