summaryrefslogtreecommitdiff
path: root/inc/AIS2D_InteractiveObject.hxx
blob: 3644be15ac8ba877e0d897d806055826671fa0c6 (plain)
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
// 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 _AIS2D_InteractiveObject_HeaderFile
#define _AIS2D_InteractiveObject_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_AIS2D_InteractiveObject_HeaderFile
#include <Handle_AIS2D_InteractiveObject.hxx>
#endif

#ifndef _Handle_AIS2D_InteractiveContext_HeaderFile
#include <Handle_AIS2D_InteractiveContext.hxx>
#endif
#ifndef _Handle_Prs2d_Drawer_HeaderFile
#include <Handle_Prs2d_Drawer.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _AIS2D_TypeOfDetection_HeaderFile
#include <AIS2D_TypeOfDetection.hxx>
#endif
#ifndef _AIS2D_DataMapOfPrimAspects_HeaderFile
#include <AIS2D_DataMapOfPrimAspects.hxx>
#endif
#ifndef _Handle_AIS2D_HSequenceOfPrimArchit_HeaderFile
#include <Handle_AIS2D_HSequenceOfPrimArchit.hxx>
#endif
#ifndef _Graphic2d_GraphicObject_HeaderFile
#include <Graphic2d_GraphicObject.hxx>
#endif
#ifndef _Handle_Prs2d_AspectRoot_HeaderFile
#include <Handle_Prs2d_AspectRoot.hxx>
#endif
#ifndef _Handle_Graphic2d_Primitive_HeaderFile
#include <Handle_Graphic2d_Primitive.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Prs2d_AspectName_HeaderFile
#include <Prs2d_AspectName.hxx>
#endif
#ifndef _Aspect_FStream_HeaderFile
#include <Aspect_FStream.hxx>
#endif
#ifndef _Aspect_IFStream_HeaderFile
#include <Aspect_IFStream.hxx>
#endif
class AIS2D_InteractiveContext;
class Prs2d_Drawer;
class AIS2D_HSequenceOfPrimArchit;
class Prs2d_AspectRoot;
class Graphic2d_Primitive;


//! Class Interactive Object defines a class of objects <br>
//!          with display and selection services. <br>
//! Using visualization and selection machanisms, <br>
//! interactive objects are used to display datum, curves, <br>
//! shapes, markers, dimensions, etc. Interactive objects <br>
//! also provide links to the interactive context. <br>
class AIS2D_InteractiveObject : public Graphic2d_GraphicObject {

public:

  //! Initialize the Interactive Object <br>
  Standard_EXPORT   AIS2D_InteractiveObject();
  //! Returns the attributes settings <br>
        Handle_Prs2d_Drawer Attributes() const;
  //! Initializes the drawing tool <aDrawer> <br>
  Standard_EXPORT   virtual  void SetAttributes(const Handle(Prs2d_Drawer)& aDrawer) ;
  //! Clears settings provided by the drawing tool <aDrawer> <br>
  Standard_EXPORT   virtual  void UnsetAttributes() ;
  //! Sets the attributes from Aspect <anAspect> <br>
//!          to all primitives appropriate this Aspect. <br>
  Standard_EXPORT     void SetAspect(const Handle(Prs2d_AspectRoot)& anAspect) ;
  //! Sets the attributes from Aspect <anAspect> <br>
//!          to primitive <aPrimitive> <br>
//!          Method works only for objects are linked <br>
//!          with InteractiveContext <br>
  Standard_EXPORT     void SetAspect(const Handle(Prs2d_AspectRoot)& anAspect,const Handle(Graphic2d_Primitive)& aPrimitive) ;
  //! Returns Aspect for primitive <aPrimitive> <br>
//!          Method works only for objects are linked <br>
//!          with InteractiveContext <br>
  Standard_EXPORT     Handle_Prs2d_AspectRoot GetAspect(const Handle(Graphic2d_Primitive)& aPrimitive) const;
  //! Returns true if primitive <aPrimitive> <br>
//!          is linked with an aspect <br>
  Standard_EXPORT     Standard_Boolean HasAspect(const Handle(Graphic2d_Primitive)& aPrimitive) const;
  //! Indicates whether the Interactive Object has a pointer <br>
//!          to an interactive context. <br>
  Standard_EXPORT     Standard_Boolean HasInteractiveContext() const;
  //! Returns the context pointer to the interactive context. <br>
  Standard_EXPORT     Handle_AIS2D_InteractiveContext GetContext() const;
  //! Places a link to <aCnTx>. The drawer of AIS2D_InteractiveObject <br>
//!          is connected to the Default Drawer Of <aCntx>. <br>
//!          That Means that this method has to be redefined if <br>
//!          computations depend on drawer values. <br>
  Standard_EXPORT   virtual  void SetContext(const Handle(AIS2D_InteractiveContext)& aCntx) ;
  //! Indicates the display mode of the Interactive Object <br>
        Standard_Integer DisplayMode() const;
  //! Returns True if the Interactive Object has <br>
//!          a display mode setting. Otherwise, it is <br>
//!          displayed in Neutral Point. <br>
        Standard_Boolean HasDisplayMode() const;
  //! Allows to provide a setting <aMode> for an <br>
//!          Interactive Object's display mode. <br>
        void SetDisplayMode(const Standard_Integer aMode) ;
  //! Removes display mode settings from the Interactive object <br>
        void UnsetDisplayMode() ;
  //! Returns the default display mode. This method is to be <br>
//!          implemented when the main mode is not mode 0. <br>
      virtual  Standard_Integer DefaultDisplayMode() const;
  //! Returns true if the class of objects accepts the display mode <aMode> <br>
      virtual  Standard_Boolean AcceptDisplayMode(const Standard_Integer aMode) const;
  //! Returns the setting for highlight mode. <br>
        AIS2D_TypeOfDetection HighlightMode() const;
  //! Returns true if the Interactive Object is in highlight mode <br>
        Standard_Boolean HasHighlightMode() const;
  //! Allows to provide settings for highlight mode. <br>
        void SetHighlightMode(const AIS2D_TypeOfDetection aMode) ;
  //! Removes settings for highlight mode <br>
        void UnsetHighlightMode() ;
  //! Returns the default highlight mode <br>
      virtual  AIS2D_TypeOfDetection DefaultHighlightMode() const;
  //! Indicates the selection mode of the Interactive Object <br>
        Standard_Integer SelectionMode() const;
  //! Allows you to change the selection mode of an Interactive Object <br>
        Standard_Boolean HasSelectionMode() const;
  //! Allows to provide a setting <aMode> for an <br>
//!          Interactive Object's selection mode. <br>
        void SetSelectionMode(const Standard_Integer aMode) ;
  //! Removes settings for selection mode <br>
        void UnsetSelectionMode() ;
  //! Returns the default selection mode <br>
      virtual  Standard_Integer DefaultSelectionMode() const;
  
        Standard_Integer State() const;
  
        void SetState(const Standard_Integer aState) ;
  //!  Selects primitive  with  index( TOD_PRIMITIVE  mode  only  ) <br>
  Standard_EXPORT     void SelectPrimitive(const Standard_Integer anIndex,const Standard_Boolean append) ;
  
  Standard_EXPORT   virtual  void Save(Aspect_FStream& aFStream) const;
  
  Standard_EXPORT   virtual  void Retrieve(Aspect_IFStream& anIFStream) const;


friend class AIS2D_InteractiveContext;


  DEFINE_STANDARD_RTTI(AIS2D_InteractiveObject)

protected:


Handle_Prs2d_Drawer myDrawer;
AIS2D_TypeOfDetection myHighlightMode;


private: 

  
  Standard_EXPORT     Standard_Boolean PrimitiveExist(const Prs2d_AspectName aName) const;
  
  Standard_EXPORT     void AddDetectPrim(const Handle(Graphic2d_Primitive)& aPrim,const Standard_Integer anInd) ;
  
  Standard_EXPORT     void AddSelectPrim(const Handle(Graphic2d_Primitive)& aPrim,const Standard_Integer anInd) ;
  
  Standard_EXPORT     void RemoveSelectPrim(const Handle(Graphic2d_Primitive)& aPrim,const Standard_Integer anInd) ;
  
  Standard_EXPORT     void SetSelSeqPrim(const Handle(AIS2D_HSequenceOfPrimArchit)& aSeq) ;
  
  Standard_EXPORT     void ClearSeqDetPrim() ;
  
  Standard_EXPORT     void ClearSeqSelPrim() ;
  
  Standard_EXPORT     Handle_AIS2D_HSequenceOfPrimArchit GetDetectSeqPrim() const;
  
  Standard_EXPORT     Handle_AIS2D_HSequenceOfPrimArchit GetSelectedSeqPrim() const;

Handle_AIS2D_InteractiveContext myICTX;
Standard_Integer myDisplayMode;
Standard_Integer mySelectionMode;
AIS2D_DataMapOfPrimAspects myAspects;
Standard_Integer myState;
Handle_AIS2D_HSequenceOfPrimArchit myDetectedPrimSeq;
Handle_AIS2D_HSequenceOfPrimArchit mySelectedPrimSeq;


};


#include <AIS2D_InteractiveObject.lxx>



// other Inline functions and methods (like "C++: function call" methods)


#endif