summaryrefslogtreecommitdiff
path: root/inc/Visual3d_TransientManager.hxx
blob: c84b48738fea6126c2a82ed2ae41c61a79175198 (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
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
// 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 _Visual3d_TransientManager_HeaderFile
#define _Visual3d_TransientManager_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_Visual3d_TransientManager_HeaderFile
#include <Handle_Visual3d_TransientManager.hxx>
#endif

#ifndef _MMgt_TShared_HeaderFile
#include <MMgt_TShared.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_Visual3d_View_HeaderFile
#include <Handle_Visual3d_View.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Quantity_PlaneAngle_HeaderFile
#include <Quantity_PlaneAngle.hxx>
#endif
#ifndef _Graphic3d_TextPath_HeaderFile
#include <Graphic3d_TextPath.hxx>
#endif
#ifndef _Graphic3d_HorizontalTextAlignment_HeaderFile
#include <Graphic3d_HorizontalTextAlignment.hxx>
#endif
#ifndef _Graphic3d_VerticalTextAlignment_HeaderFile
#include <Graphic3d_VerticalTextAlignment.hxx>
#endif
#ifndef _Handle_Graphic3d_Structure_HeaderFile
#include <Handle_Graphic3d_Structure.hxx>
#endif
#ifndef _Handle_Graphic3d_AspectLine3d_HeaderFile
#include <Handle_Graphic3d_AspectLine3d.hxx>
#endif
#ifndef _Handle_Graphic3d_AspectFillArea3d_HeaderFile
#include <Handle_Graphic3d_AspectFillArea3d.hxx>
#endif
#ifndef _Handle_Graphic3d_AspectText3d_HeaderFile
#include <Handle_Graphic3d_AspectText3d.hxx>
#endif
#ifndef _Handle_Graphic3d_AspectMarker3d_HeaderFile
#include <Handle_Graphic3d_AspectMarker3d.hxx>
#endif
#ifndef _Graphic3d_TypeOfComposition_HeaderFile
#include <Graphic3d_TypeOfComposition.hxx>
#endif
class Visual3d_TransientDefinitionError;
class Graphic3d_TransformError;
class Visual3d_View;
class TCollection_ExtendedString;
class Graphic3d_Structure;
class Graphic3d_AspectLine3d;
class Graphic3d_AspectFillArea3d;
class Graphic3d_AspectText3d;
class Graphic3d_AspectMarker3d;
class TColStd_Array2OfReal;


//! This class allows to manage transient graphics <br>
//!      above one View. <br>
//!      A simple way to drawn something very quicly above <br>
//!      a complex scene (Hilighting,Sketching,...) <br>
//!      All transient graphics will be drawn with <br>
//!      the projection defined by the view with the current <br>
//!      attributes depending of the primitive type : <br>
//!      Lines,Markers,Polygons,Texts <br>
//!      All transient graphics will be erased at the next <br>
//!      View::BeginDraw(). <br>
//!      If RetainMode is active, <br>
//!      All transient graphics will be kept at the <br>
//!      next View::Update(),Redraw(). The transient graphics <br>
//!      is stored by this object and graphic library, the <br>
//!      graphic managed itself exposure,resizing,... <br>
//!      The method View::ClearDraw() is necessary to erase <br>
//!      all transient graphics. <br>
//!      If RetainMode is deactivate, <br>
//!      All transient graphics will be erased at the <br>
//!      next View::Update(),Redraw(). <br>
//!      Remember that nothing is stored by this object and <br>
//!      graphic library,the application must managed itself <br>
//!      exposure,resizing,... <br>
//!      If double_buffering is activate, <br>
//!      all graphics are drawn in the back buffer and flushed <br>
//!      in the front buffer at the end of drawing but nothing <br>
//!      is done for to separate transient from structured <br>
//!      graphics,the only way to regenerate the structured <br>
//!      view is to Redraw() the view. <br>
//!      If double_buffering is deactivate, <br>
//!      the back buffer is preserved and used for restoring <br>
//!      the front buffer at begin drawing time.I recommend <br>
//!      to use the second way (without DB) if you want <br>
//!      to preserve the graphics and the performances! <br>
class Visual3d_TransientManager : public MMgt_TShared {

public:

  //! Creates a TransientManager <aView>. <br>
  Standard_EXPORT   Visual3d_TransientManager();
  //! Suppress the TransientManager <me>. <br>
  Standard_EXPORT     void Destroy() ;
~Visual3d_TransientManager()
{
  Destroy();
}
  //! Begins any graphics in the view <aView> <br>
//!      Redraw any structured graphics in the back buffer before <br>
//!      if <DoubleBuffer> is TRUE. <br>
//!          Restore the front buffer from the back before <br>
//!      if <DoubleBuffer> is FALSE. <br>
//!      if <RetainMode> is TRUE. <br>
//!          the graphic managed itself exposure,resizing ... <br>
//!      if <RetainMode> is FALSE. <br>
//!          the application must managed itself exposure,resizing ... <br>
//! <br>
//!  Warning: Returns TRUE if transient drawing is enabled in <br>
//!     the associated view. <br>
//!          Returns FALSE ,if nothing works because something <br>
//!     is wrong for the transient principle : <br>
//!     Immediat mode is not implemented depending of the <br>
//!     graphic library used. <br>
//!         MBX,PIXMAP double buffering don't works depending of <br>
//!         the graphic board and the visual of the window supporting <br>
//!         the view. <br>
//!  Warning: No default attributes <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if   Drawing is already opened. <br>
//! or   the associated view is not mapped on a window. <br>
  Standard_EXPORT   static  Standard_Boolean BeginDraw(const Handle(Visual3d_View)& aView,const Standard_Boolean DoubleBuffer = Standard_False,const Standard_Boolean RetainMode = Standard_False) ;
  //! Flush all graphics to the front buffer. <br>
//!  Synchronize graphics to the screen if <Synchronize> is <br>
//!  TRUE (make becarefull to the performances!). <br>
//!  Raises TransientDefinitionError from Visual3d; <br>
//! if   Drawing is not opened. <br>
  Standard_EXPORT   static  void EndDraw(const Standard_Boolean Synchronize = Standard_False) ;
  //! Clear all transient graphics in the view <aView> <br>
//!         updates a scene if <aFlush> = true <br>
//!  Raises TransientDefinitionError from Visual3d; <br>
//! if   Drawing is already opened. <br>
//! or   the associated view is not mapped on a window. <br>
  Standard_EXPORT   static  void ClearDraw(const Handle(Visual3d_View)& aView,const Standard_Boolean aFlush = Standard_True) ;
  //! Begins any add graphics in the view <aView> <br>
//!          the application must managed itself exposure,resizing ... <br>
//! <br>
//!  Warning: Returns TRUE if transient drawing is enabled in <br>
//!     the associated view. <br>
//!          Returns FALSE ,if nothing works because something <br>
//!     is wrong for the transient principle : <br>
//!     Immediat mode is not implemented depending of the <br>
//!     graphic library used. <br>
//!         MBX,PIXMAP double buffering don't works depending of <br>
//!         the graphic board and the visual of the window supporting <br>
//!         the view. <br>
//!  Warning: No default attributes <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if   Drawing is already opened. <br>
//! or   the associated view is not mapped on a window. <br>
  Standard_EXPORT   static  Standard_Boolean BeginAddDraw(const Handle(Visual3d_View)& aView) ;
  //! Flush all add graphics to the front buffer. <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if   Drawing is not opened. <br>
  Standard_EXPORT   static  void EndAddDraw() ;
  //! After this call, <me> is ready to receive <br>
//!      a definition of a polyline with AddVertex(). <br>
//!  Raises TransientDefinitionError from Visual3d; <br>
//! if a Begin... primitive is already opened, <br>
//! or   Drawing is not opened. <br>
  Standard_EXPORT   static  void BeginPolyline() ;
  //! After this call, <me> is ready to receive <br>
//!      a definition of a polygon with AddVertex(). <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if a Begin... primitive is already opened, <br>
//! or   Drawing is not opened. <br>
  Standard_EXPORT   static  void BeginPolygon() ;
  //! After this call, <me> is ready to receive <br>
//!      a definition of a triangle mesh with AddVertex(). <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if a Begin... primitive is already opened, <br>
//! or   Drawing is not opened. <br>
  Standard_EXPORT   static  void BeginTriangleMesh() ;
  //! After this call, <me> is ready to receive <br>
//!      a definition of a marker with AddVertex(). <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if a Begin... primitive is already opened, <br>
//! or   Drawing is not opened. <br>
  Standard_EXPORT   static  void BeginMarker() ;
  //! After this call, <me> is ready to receive <br>
//!      a definition of a curve with AddVertex(). <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if a Begin... primitive is already opened, <br>
//! or   Drawing is not opened. <br>
  Standard_EXPORT   static  void BeginBezier() ;
  //! Puts <X, Y, Z> as a new point in the current primitive. <br>
//!      If <AFlag> then it is a draw between last point and <br>
//!      this point else it is a move between last point and <br>
//!      this point. <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if a Begin... primitive is not opened, <br>
//! or   Drawing is not opened. <br>
  Standard_EXPORT   static  void AddVertex(const Standard_Real X,const Standard_Real Y,const Standard_Real Z,const Standard_Boolean AFlag = Standard_True) ;
  //! Puts <X, Y, Z, W> as a new point coordinates and <br>
//!      weight in the current primitive. <br>
//!      If <AFlag> then it is a draw between last point and <br>
//!      this point else it is a move between last point and <br>
//!      this point. <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if a Begin... primitive is not opened, <br>
//! or   Drawing is not opened. <br>
  Standard_EXPORT   static  void AddVertex(const Standard_Real X,const Standard_Real Y,const Standard_Real Z,const Standard_Real W,const Standard_Boolean AFlag = Standard_True) ;
  //! Puts <X, Y, Z> as a new point in the current primitive. <br>
//!          Puts <NX, NY, NZ> as a new normal in the current <br>
//!      primitive. <br>
//!      If <AFlag> then it is a draw between last point and <br>
//!      this point else it is a move between last point and <br>
//!      this point. <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if a Begin... primitive is not opened, <br>
//! or   Drawing is not opened. <br>
  Standard_EXPORT   static  void AddVertex(const Standard_Real X,const Standard_Real Y,const Standard_Real Z,const Standard_Real NX,const Standard_Real NY,const Standard_Real NZ,const Standard_Boolean AFlag = Standard_True) ;
  //! After this call, <me> stops the reception of <br>
//!      a definition of a Begin... primitive. <br>
//!  Raises TransientDefinitionError from Visual3d; <br>
//! if a Begin... primitive is not opened, <br>
//! or   Drawing is not opened. <br>
  Standard_EXPORT   static  void ClosePrimitive() ;
  //! Drawn the string <AText> at position <X,Y,Z>. <br>
//!     The 3D point of attachment is projected. The text is <br>
//!          written in the plane of projection. <br>
//!  The attributes are given with respect to the plane of <br>
//!          projection. <br>
//!          AHeight     : Height of text. <br>
//!             (Relative to the Normalized Projection <br>
//!                          Coordinates (NPC) Space). <br>
//!          AAngle      : Orientation of the text <br>
//!                  (with respect to the horizontal). <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if   Drawing is not opened. <br>
  Standard_EXPORT   static  void DrawText(const TCollection_ExtendedString& AText,const Standard_Real X,const Standard_Real Y,const Standard_Real Z,const Standard_Real AHeight,const Quantity_PlaneAngle AAngle = 0.0,const Graphic3d_TextPath ATp = Graphic3d_TP_RIGHT,const Graphic3d_HorizontalTextAlignment AHta = Graphic3d_HTA_LEFT,const Graphic3d_VerticalTextAlignment AVta = Graphic3d_VTA_BOTTOM) ;
  //! Drawn the structure <AStructure>. <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if   Drawing is not opened. <br>
  Standard_EXPORT   static  void DrawStructure(const Handle(Graphic3d_Structure)& AStructure) ;
  //! Modifies the current lines attributes. <br>
//!  Warning: No default attributes <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if   Drawing is not opened. <br>
  Standard_EXPORT   static  void SetPrimitivesAspect(const Handle(Graphic3d_AspectLine3d)& CTX) ;
  //! Modifies the current faces attributes <br>
//!  Warning: No default attributes <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if   Drawing is not opened. <br>
  Standard_EXPORT   static  void SetPrimitivesAspect(const Handle(Graphic3d_AspectFillArea3d)& CTX) ;
  //! Modifies the current texts attributes <br>
//!  Warning: No default attributes <br>
//!    Raises TransientDefinitionError from Visual3d; <br>
//! if   Drawing is not opened. <br>
  Standard_EXPORT   static  void SetPrimitivesAspect(const Handle(Graphic3d_AspectText3d)& CTX) ;
  //! Modifies the current markers attributes <br>
//!  Warning: No default attributes <br>
//! Raises TransientDefinitionError from Visual3d; <br>
//! if   Drawing is not opened. <br>
  Standard_EXPORT   static  void SetPrimitivesAspect(const Handle(Graphic3d_AspectMarker3d)& CTX) ;
  //! Returns the coordinates of the boundary box <br>
//!      of the Transient graphics actually drawn <br>
//!      since BeginDraw() has been call. <br>
//!  Warning: If nothing has been drawn then : <br>
//!      XMin = YMin = ZMin = RealFirst (). <br>
//!      XMax = YMax = ZMax = RealLast (). <br>
  Standard_EXPORT   static  void MinMaxValues(Standard_Real& XMin,Standard_Real& YMin,Standard_Real& ZMin,Standard_Real& XMax,Standard_Real& YMax,Standard_Real& ZMax) ;
  //! Returns the coordinates of the boundary box projection <br>
//!      of the Transient graphics actually drawn <br>
//!      since BeginDraw() has been call. <br>
//!  Warning: If nothing has been drawn then : <br>
//!      XMin = YMin = ZMin = RealFirst (). <br>
//!      XMax = YMax = ZMax = RealLast (). <br>
  Standard_EXPORT   static  void MinMaxValues(Standard_Real& UMin,Standard_Real& VMin,Standard_Real& UMax,Standard_Real& VMax) ;
  //! Modifies the current local modelling transformation <br>
//!      of the transient graphics. <br>
  Standard_EXPORT   static  void SetTransform(const TColStd_Array2OfReal& AMatrix,const Graphic3d_TypeOfComposition AType = Graphic3d_TOC_REPLACE) ;



  DEFINE_STANDARD_RTTI(Visual3d_TransientManager)

protected:




private: 




};





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


#endif