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
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
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
/////////////////////////////////////////////////////////////////////////////// 
// 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 _OD_DBARCALIGNEDTEXT_INC_
#define _OD_DBARCALIGNEDTEXT_INC_
 
#include "TD_PackPush.h"
 
#include "DbEntity.h"
 
enum OdArcTextAlignment
{
  kFit    = 1,
  kLeft   = 2,
  kRight  = 3,
  kCenter = 4
};
 
enum OdArcTextPosition
{
  kOnConvexSide = 1,
  kOnConcaveSide = 2
};
 
enum OdArcTextDirection
{
  kOutwardFromCenter = 1,
  kInwardToTheCenter = 2
};
 
/** \details
    This class represents Arc-Aligned Text entities in an OdDbDatabase instance.
 
    Library: TD_Db
 
    <group OdDb_Classes>
*/
class TOOLKIT_EXPORT OdDbArcAlignedText : public OdDbEntity
{
public:
  ODDB_DECLARE_MEMBERS(OdDbArcAlignedText);
 
  OdDbArcAlignedText();
  
  virtual OdResult dwgInFields(OdDbDwgFiler* pFiler);
 
  virtual void dwgOutFields(OdDbDwgFiler* pFiler) const;
 
  virtual OdResult dxfInFields(OdDbDxfFiler* pFiler);
 
  virtual void dxfOutFields(OdDbDxfFiler* pFiler) const;
  
  /** \details
    Returns the text string for this Text entity (DXF 1).
  */
  OdString textString() const;
  
  /** \details
    Sets the text string for this Text entity (DXF 1).
    \param textString [in]  Text string.
    
    \note
    textString cannot exceed 256 characters excluding the null terminator.
  */
  void setTextString(const OdString& textString);
  
  /** \details
    Returns the Object ID of the Arc entity associated with this Text entity (DXF 330).
  */
  OdDbObjectId arcId() const;
 
  /** \details
    Sets the Object ID of the Arc entity associated with this Text entity (DXF 330).
    \param arcId [in]  Arc Object ID.
  */
  void setArcId(OdDbObjectId arcId);
 
  /** \details
    Returns the WCS center of the Arc entity associated with this Text entity (WCS equivalent of DXF 10).
  */
  OdGePoint3d center() const;
 
  /** \details
    Sets the WCS center of the Arc entity associated with this Text entity (WCS equivalent of DXF 10).
    \param center [in]  Center.
  */
  void setCenter(const OdGePoint3d& center);
  
  /** \details
    Returns the radius of the Arc entity associated with this Text entity (DXF 40).
  */
  double radius() const;
 
  /** \details
    Sets the radius of the Arc entity associated with this Text entity (DXF 40).
    \param radius [in]  Radius.
  */
  void setRadius(double radius);
 
  /** \details
    Sets the start angle of the Arc entity associated with this Text entity (DXF 50).
    
    \param startAngle [in]  Start angle.
    
    \remarks
    The angle is measured counterclockwise from the OCS X-axis.
 
    \note
    All angles are expressed in radians.
  */
  void setStartAngle(double startAngle);
 
  /** \details
    Returns the start angle of the Arc entity associated with this Text entity (DXF 50).
 
    \remarks
    The angle is measured counterclockwise from the OCS X-axis.
 
    \note
    All angles are expressed in radians.
  */
  double startAngle() const;
 
  /** \details
    Sets the end angle of the Arc entity associated with this Text entity (DXF 51).
    \param endAngle [in]  End angle.
 
    \remarks
    The angle is measured counterclockwise from the OCS X-axis.
 
    \note
    All angles are expressed in radians.
  */
  void setEndAngle(double endAngle);
 
  /** \details
    Returns the end angle of the Arc entity associated with this Text entity (DXF 51).
 
    \remarks
    The angle is measured counterclockwise from the OCS X-axis.
 
    \note
    All angles are expressed in radians.
  */
  double endAngle() const;
 
  /** \details
    Returns the WCS normal to the plane of this entity (DXF 210).
  */
  OdGeVector3d normal() const;
  
  /** \details
    Sets the WCS normal to the plane of this entity (DXF 210).
    \param normal [in]  Normal.
  */
  void setNormal(const OdGeVector3d& normal);
 
  /** \details
    Returns the offset from the Arc entity associated with this Text entity (DXF 44).  
  */
  double offsetFromArc() const;
  
  /** \details
    Sets the offset from the Arc entity associated with this Text entity (DXF 44).
    \param offsetFromArc [in]  Offset from arc.  
  */
  void setOffsetFromArc(double offsetFromArc);
  
  /** \details
    Returns the right offset for this Text entity (DXF 45).  
  */
  double rightOffset() const;
  
  /** \details
    Sets the right offset for this Text entity (DXF 45).  
    \param rightOffset [in]  Right offset.  
  */
  void setRightOffset(double rightOffset);
  
  /** \details
    Returns the left offset for this Text entity (DXF 46).  
  */
  double leftOffset() const;
  
  /** \details
    Sets the left offset for this Text entity (DXF 46).  
    \param leftOffset [in]  Left offset.  
  */
  void setLeftOffset(double leftOffset);
  
  /** \details
    Returns the text size for this Text entity (DXF 42).    
  */
  double textSize() const;
  
  /** \details
    Sets the text size for this Text entity (DXF 42).
    \param textSize [in]  Text size.    
  */
  void setTextSize(double textSize);
  
  /** \details
    Returns the X-scale (width) factor for this Text entity (DXF 41).
  */
  double xScale() const;
  
  /** \details
    Sets the X-scale (width) factor for this Text entity (DXF 41).
    
    \param xScale [in]  X-scale factor.
  */
  void setXScale(double xScale);
  
  /** \details
    Returns the character spacing for this Text entity (DXF 43).  
  */
  double charSpacing() const;
  
  /** \details
    Sets the character spacing for this Text entity (DXF 43).
    \param charSpacing [in]  Character spacing.  
  */
  void setCharSpacing(double charSpacing);
 
  /** \details
    Returns true if and only if the character order is reversed for this Text entity (DXF 70).
  */
  bool isReversedCharOrder() const;
  
  /** \details
    Controls the reversal of character order for this Text entity (DXF 70).
    \param reverse [in]  Controls the reversal.
  */
  void reverseCharOrder(bool reverse);
 
  /** \details
    Returns the wizard flag for this Text entity (DXF 280).  
  */
  bool wizardFlag() const;
  
  /** \details
    Controls the wizard flag for this Text entity (DXF 280).  
    \param wizardFlag [in]  Controls the wizard flag.
  */
  void setWizardFlag(bool wizardFlag);
 
  /** \details
    Returns the alignment for this Text entity (DXF 72).
    
    \remarks
    alignment() returns one of the following:
    
    <table>
    Name      Value
    kFit      1
    kLeft     2
    kRight    3
    kCenter   4
    </table>
  */
  OdArcTextAlignment alignment() const;
  
  /** \details
    Sets the alignment for this Text entity (DXF 72).
    
    \remarks
    alignment must be one of the following:
    
    <table>
    Name      Value
    kFit      1
    kLeft     2
    kRight    3
    kCenter   4
    </table>
  */
  void setAlignment(OdArcTextAlignment alignment);
 
  /** \details
    Returns the text position of this Text entity.
    \remarks
    textPosition() returns one of the following:
    
    <table>
    Name            Value
    kOnConvexSide   1
    kOnConcaveSide  2
    </table>
 
  */
  OdArcTextPosition textPosition() const;
  
  /** \details
    Sets the text position of this Text entity.
 
    \param textPosition [in]  Text position.
    \remarks
    textPosition must be one of the following:
    
    <table>
    Name            Value
    kOnConvexSide   1
    kOnConcaveSide  2
    </table>
  */
  void setTextPosition(OdArcTextPosition textPosition);
 
  /** \details
    Returns the text direction for this Text entity (DXF 71).
    
    \remarks
    textDirection() returns one of the following:
    
    <table>
    Name                 Value    
    kOutwardFromCenter   1
    kInwardToTheCenter   2
    </table>
  */
  OdArcTextDirection textDirection() const;
  
  /** \details
    Sets the text direction for this Text entity (DXF 71).
    
    \param textDirection [in]  Text direction.
    
    \remarks
    textDirection must be one of the following:
    
    <table>
    Name                 Value    
    kOutwardFromCenter   1
    kInwardToTheCenter   2
    </table>
  */
  void setTextDirection(OdArcTextDirection textDir);
 
  /** \details
    Returns true if and only if this Text entity is underlined (DXF 76).  
  */
  bool isUnderlined() const;
  
  /** \details
    Controls the underlining of this Text entity (DXF 76).
    \param underlined [in]  Controls underlining.  
  */
  void setUnderlined(bool underlined);
 
  /** \details
    Returns the Object ID of the text style of this Text entity (DXF 7).
  */
  OdDbObjectId textStyle() const;
  
  /** \details
    Sets the Object ID of the text style of this Text entity (DXF 7).
    \param textStyleId [in]  Text style Object ID.
  */
  void setTextStyle(const OdDbObjectId &textStyleId);
  
  /** \param styleName [in]  Style name.
  */
  void setTextStyle(const OdString& styleName);
 
  /** \details
    Returns the name of the font file associated with this Text entity (DXF 3).
  */
  OdString fileName() const;
  
  /** \details
    Sets the name of the font file associated with this Text entity (DXF 3).
 
    \param filename [in]  Font filename.
  */
  void setFileName(const OdString& filename);
  
  /** \details
    Returns the name of the BigFont file associated with this Text entity (DXF 4).
  */
  OdString bigFontFileName() const;
  
  /** \details
    Sets the name of the BigFont file associated with this Text entity (DXF 4).
    
    \param bigFontFileName [in]  BigFont filename.
  */
  void setBigFontFileName(const OdString& bigFontFileName);
 
  /** \details
    Sets this Text entity to use the specified Windows font characteristics.
 
    \param typeface [in]  Typeface name of the font.
    \param bold [in]  Bold if and only if true.
    \param italic [in]  Italic if and only if true.
    \param charset [in]  Windows character set identifier.
    \param pitchAndFamily [in]  Windows pitch and character family identifier.
    
    \remarks
    If typeface is null, the Windows font information is removed from this text style.
  */
  void setFont(
    const OdString& typeface,
        bool bold,
        bool italic,
        int charset,
        int pitchAndFamily);
 
 
  /** \details
    Returns the Windows font characteristics for this Text entity.
 
    \param typeface [out]  Typeface name of the font.
    \param bold [out]  True if and only if bold.
    \param italic [out]  True if and only if italic.
    \param charset [out]  Windows character set identifier.
    \param pitchAndFamily [out]  Windows pitch and character family identifier.
  */
  void font(
    OdString& typeface,
        bool& bold,
        bool& italic,
        int& charset,
        int& pitchAndFamily) const;
 
  /** \details
    Returns true if and only if this Text entity uses an SHX font (DXF 79).
  */
  bool isShxFont() const;
 
  virtual bool subWorldDraw(OdGiWorldDraw* pWd) const ODRX_OVERRIDE;
 
  virtual OdResult subTransformBy(const OdGeMatrix3d& xfm) ODRX_OVERRIDE;
 
  /* Replace OdRxObjectPtrArray */
 
  virtual OdResult subExplode(OdRxObjectPtrArray& entitySet) const ODRX_OVERRIDE; 
  
 
  virtual void subClose() ODRX_OVERRIDE;
 
  /** \details
      Support for persistent reactor to arc.
  */
  
  void modified(const OdDbObject* pObject);
  void erased(const OdDbObject* pObject, bool erasing);
};
/** \details
    This template class is a specialization of the OdSmartPtr class for OdDbArcAlignedText object pointers.
*/
typedef OdSmartPtr<OdDbArcAlignedText> OdDbArcAlignedTextPtr;
 
#include "TD_PackPop.h"
 
#endif