zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
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
/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
 
 
#ifndef _DbSweepOptions_h_Included_
#define _DbSweepOptions_h_Included_
 
#include "TD_PackPush.h"
#include "DbEntity.h"
 
 
class OdDbSweepOptionsImpl;
 
/** \details
Class for setting options used for creating swept surfaces and swept solids (by calling OdDbSweptSurface::createSweptSurface() or OdDb3dSolid::createSweptSolid() methods).
Sweep options are used to control the shape of the resulting surface or solid object.
 
<group OdDb_Classes>
*/
class TOOLKIT_EXPORT OdDbSweepOptions
{
public:
  /** \details 
  Creates an instance of sweep options. 
  */
  OdDbSweepOptions ();
  
  /** \details 
  Destroys the instance of sweep options. 
  */  
  ~OdDbSweepOptions ();
  
  /** \details 
  Creates a copy of another instance of swept entity options (copy constructor).
  
  \param src [in] An instance of swept entity options to be copied.
  */
  OdDbSweepOptions ( const OdDbSweepOptions& src );
  
  /** \details 
  Assigning operator for swept entity options.
  
  \param src [in] An instance of swept entity options to be assigned to this instance.
  */
  OdDbSweepOptions& operator = ( const OdDbSweepOptions& src );
 
  /** \details
  Alignment options enumerator for swept entities.
  */
  enum AlignOption 
  {
    kNoAlignment                = 0, // 
    kAlignSweepEntityToPath     = 1, // 
    kTranslateSweepEntityToPath = 2, // 
    kTranslatePathToSweepEntity = 3 // 
  };
 
  /** \details
  Miter options enumerator for swept entities.
  */
  enum MiterOption 
  {
    kDefaultMiter = 0,
    kOldMiter     = 1,
    kNewMiter     = 2,
    kCrimpMiter   = 3,
    kBendMiter    = 4
  };
 
  /** \details
  Returns the draft angle (in radians).
  The draft angle is the angle by which the profile will taper as it is swept. 
  The default value is equal to 0.0. 
  */
  double  draftAngle () const;
 
  /** \details
  Sets the draft angle.
  
  The draft angle is the angle by which the profile will taper as it is swept. 
  The default value is equal to 0.0. 
 
  \param ang [in] A new draft angle (in radians).
  */
  void  setDraftAngle ( double ang );
 
  /** \details
  Returns the start draft distance.
  The default value is equal to 0.0. 
  */
  double  startDraftDist () const;
 
  /** \details
  Sets the start draft distance.
    The default value is equal to 0.0. 
  
  \param val [in] A new value of the start draft distance.
  */
  void  setStartDraftDist ( double val );
 
  /** \details
  Returns the end draft distance. 
  The default value is equal to 0.0. 
  */
  double  endDraftDist () const;
 
  /** \details
  Sets the start draft distance.
  The default value is equal to 0.0.       
  
  \param val [in] A new value of the end draft distance.
  */
  void  setEndDraftDist ( double val );
 
  /** \details
  Returns the twist angle in radians.
  Twist angle is the angle by which the profile will be twisted as it is swept.
  The default value is equal to 0.0. 
  */
  double  twistAngle () const;
 
  /** \details
  Sets the twist angle.
  
  Twist angle is the angle by which the profile will be twisted as it is swept.
  The default value is equal to 0.0.       
  
  \param ang [in] A new twist angle (in radians).
  */
  void  setTwistAngle ( double ang );
 
  /** \details
  Returns the scale factor.
  */
  double  scaleFactor () const;
 
  /** \details
  Sets the scale factor.
      
    \param val [in] A new value of the scale factor.
  */
  void  setScaleFactor ( double val );
 
  /** \details
  Returns the align angle.
  */
  double  alignAngle () const;
 
  /** \details
  Sets the align angle.
      
  \param ang [in] A new value of the align angle.
  */
  void  setAlignAngle ( double ang );
 
  /** \details
  Returns the align option.
  */
  OdDbSweepOptions::AlignOption  align () const;
 
  /** \details
  Sets the align option.
      
  \param val [in] A new value for the align option.
  */
  void  setAlign ( OdDbSweepOptions::AlignOption val );
 
  /** \details
  Returns the miter option.
  */
  OdDbSweepOptions::MiterOption  miterOption () const;
 
  /** \details
  Sets the miter option.
      
  \param val [in]  A new value for the miter option.
  */
  void  setMiterOption ( OdDbSweepOptions::MiterOption val );
 
  /** \details
  Returns the align to start option.
 
  If the option value is equal to true, alignment to the start of the curve is applied.
  If the option value is equal to false, alignment to the end of the curve is applied.
  */
  bool  alignStart () const;
 
  /** \details
  Sets the align to start option.
 
  If the option value is equal to true, alignment to the start of the curve is applied.
    If the option value is equal to false, alignment to the end of the curve is applied.
  
  \param val [in] A new value of the align to start option.
  */
  void  setAlignStart ( bool val );
 
  /** \details
  Returns the base point for alignment.
  */
  OdGePoint3d  basePoint () const;
 
  /** \details
  Sets the base point for alignment.
      
  \param pnt [in] A new base point for alignment.
  */
  void  setBasePoint ( const OdGePoint3d& pnt );
 
  /** \details
  Returns the bank flag.
  */
  bool  bank () const;
 
  /** \details
  Sets the bank flag.
      
  \param val [in]  A new value for the bank flag.
  */
  void  setBank ( bool val );
 
  /** \details
  Returns the check self-intersections flag.
  If this flag is disabled, a self-intersecting surface may be created.
  */
  bool  checkIntersections () const;
 
  /** \details
  Sets the check self-intersections flag.
  
    If this flag is disabled, a self-intersecting surface may be created.  
  
  \param val [in]  A new value of the check self-intersections flag.
  */
  void  setCheckIntersections ( bool val );
 
  /** \details
  Returns the twist vector.
  */
  OdGeVector3d  twistRefVec () const;
 
  /** \details
  Sets the twist vector.
      
  \param vec [in]  A new twist vector.
  */
  void  setTwistRefVec ( const OdGeVector3d& vec );
 
  /** \details
  Returns the transformation associated with this entity.
      
  \param mat [out] A passed-in parameter for returning the transformation matrix.
  */
  bool  getSweepEntityTransform ( OdGeMatrix3d& mat )const;
 
  /** \details
  Sets the transformation associated with this entity.
      
  \param mat [in] A new transformation to be associated with the entity.
  */
  void  setSweepEntityTransform ( const OdGeMatrix3d& mat ); 
  
  /** \details
  Sets the coordinate system transformation matrix to be applied to the sweep entity, using the sweep entity geometry for calculating the transformation matrix. 
 
  \param sweepEntities        [out] Sweep entity geometry to be used for calculation of the sweep entity transformation matrix.
  \param displayErrorMessages [in] Indicates whether error messages are displayed. Default value is false.
  
  \returns Returns eOk if transformation was successfully done.
  */
  OdResult  setSweepEntityTransform ( OdDbEntityPtrArray& sweepEntities,  bool displayErrorMessages = false );
 
  /** \details
  Returns the transformation associated with the start and end of the path curve.
  
  \param mat [in] A passed-in parameter for returning the transformation matrix of the path curve.
      
  \returns Returns true if the transformation matrix was successfully returned, otherwise returns false.  
  */
  bool  getPathEntityTransform ( OdGeMatrix3d& mat )const;
 
  /** \details
  Sets the transformation associated with the start and end of the path curve.
      
  \param mat [in] A new transformation matrix to be applied.
  */
  void  setPathEntityTransform ( const OdGeMatrix3d& mat ); 
 
  /** \details
  Sets the transformation associated with the start and end of the path curve.
 
  \param pPathEnt             [in] A pointer to the new transformation matrix to be applied.
  \param displayErrorMessages [in] Indicates whether error messages are displayed. Default value is false.
  
  \remarks
  Before calling the method, setSweepEntityTranform() method must be called.
  */
  OdResult  setPathEntityTransform ( OdDbEntity *pPathEnt,  bool displayErrorMessages = false );
 
  /** \details
  Determines if the specified sweep entity is valid and returns the planarity of the sweep entity.
 
  \param pSweepEnt            [in]  A pointer to the curve, region, or planar surface to be swept.
  \param planarity            [out] A passed-in parameter for returning the planarity flag of the entity.
  \param pnt                  [out] A passed-in parameter for returning the point on the sweep entity if planarity is kPlanar, or a point on the line if planarity is kLinear.
  \param vec                  [out] A passed-in parameter for returning the normal vector of the entity if planarity is kPlanar, or the line direction if planarity is kLinear.
  \param closed               [out] A passed-in parameter for returning the closed flag determining whether an entity to be swept is a closed entity.
  \param approxArcLen         [out] A passed-in parameter for returning the approximate arc length.
  \param displayErrorMessages [in]  Indicates whether error messages are displayed. Default value is false.
  
  \returns If kPlanar is returned, then pnt and vec will specify the normal plane
  of the entity. If kLinear is returned, then pnt and vec will specify
  a defining point and direction of the sweep entity.
  */
  OdResult  checkSweepCurve ( OdDbEntity *pSweepEnt,
    OdDb::Planarity& planarity, OdGePoint3d& pnt, OdGeVector3d& vec,
    bool& closed, double& approxArcLen, bool displayErrorMessages = false );
 
  /** \details
  Determines if the passed-in path curve is valid.
 
  \param pPathEnt             [in] A pointer to the path curve.
  \param displayErrorMessages [in] Indicates whether error messages are displayed. Default value is false.
  
  \returns Returns eOk if curve is valid or eInvalidInput otherwise. 
  */
  OdResult  checkPathCurve ( OdDbEntity *pPathEnt,    bool displayErrorMessages = false );
 
private:
  friend class OdDbSweepOptionsImpl;
  OdDbSweepOptionsImpl *m_pImpl;
};
 
#include "TD_PackPop.h"
#endif //_DbSweepOptions_h_Included_