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
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
/////////////////////////////////////////////////////////////////////////////// 
// 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_DBDIM_H
#define OD_DBDIM_H
 
#include "TD_PackPush.h"
 
#include "DbEntity.h"
#include "DbMText.h"
#include "Ge/GeScale3d.h"
 
class OdDbDimStyleTableRecord;
 
/** \details
  This template class is a specialization of the OdSmartPtr class for OdDbDimStyleTableRecord object pointers.
*/
typedef OdSmartPtr<OdDbDimStyleTableRecord> OdDbDimStyleTableRecordPtr;
 
/** \details
    This class is the base class for all Dimension classes in an OdDbDatabase instance.
    
    \sa
    TD_Db
 
    <group OdDb_Classes>
*/
class TOOLKIT_EXPORT OdDbDimension : public OdDbEntity
{
public:
  ODDB_DECLARE_MEMBERS(OdDbDimension);
 
  OdDbDimension();
 
  /** \details
    Returns the position of the dimension text for this Dimension entity (DXF 11 as WCS).
 
    \remarks
    This position is the middle center point of the dimension text, which is itself a 
    middle-center justified MText entity.  
  */
  OdGePoint3d textPosition() const;
  
  /** \details
    Sets the position of the dimension text for this Dimension entity (DXF 11 as WCS).
 
    \param textPosition [in]  Text position.  
    
    \remarks
    This position is the middle center point of the dimension text, which is itself a 
    middle-center justified MText entity.  
  */
  void setTextPosition(
    const OdGePoint3d& textPosition);
 
  /** \details
    Returns true if and only if the dimension text for this Dimension entity
    is in the default position (DXF 70, bit 0x80 == 0).
  */
  bool isUsingDefaultTextPosition() const;
 
  /** \details
    Sets the dimension text for this Dimension entity to not use the default position (DXF 70, sets bit 0x80).
  */
  void useSetTextPosition();
 
  /** \details
    Sets the dimension text for this Dimension entity to use the default position (DXF 70, clears bit 0x80).
  */
  void useDefaultTextPosition();
 
  /** \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);
 
  virtual bool isPlanar() const { return true; }
 
  virtual OdResult getPlane(
    OdGePlane& plane, 
    OdDb::Planarity& planarity) const;
 
  /** \details
    Returns the elevation of this entity in the OCS (DXF 30).
    
    \remarks
    The elevation is the distance from the WCS origin to the plane of this entity.
  */
  double elevation() const;
 
  /** \details
    Sets the elevation of this entity in the OCS (DXF 30).
 
    \param elevation [in]  Elevation.    
 
    \remarks
    The elevation is the distance from the WCS origin to the plane of this entity.
  */
  void setElevation(
    double elevation);
 
  /** \details
    Returns the user-supplied dimension text for this Dimension Entity (DXF 1).
 
    \remarks
    * If no text is to appear, "." will be returned.
    * If only the default text is to appear, "" will be returned.
    * The default text is represented as "<>" within the returned text.
  */
  const OdString dimensionText() const;
 
  /** \details
    Sets the user-supplied dimension text for this Dimension Entity (DXF 1).
    
    \param dimensionText [in]  Dimension text.
 
    \remarks
    * If no text is to appear, supply ".".
    * If only the default text is to appear, supply an empty string "".
    * The default text is represented as "<>" within the supplied text.
     
  */
  void setDimensionText(
    const OdString& dimensionText);
    
  /** \details
    Returns the rotation angle for the dimension text for this Dimension entity (DXF 53).
 
    \note
    All angles are expressed in radians.
  */
  double textRotation() const;
 
  /** \details
    Sets the rotation angle for the dimension text for this Dimension entity (DXF 53).
    
    \param textRotation [in]  Text rotation.
    \note
    All angles are expressed in radians.
  */
  void setTextRotation(
    double textRotation);
 
  /** \details
    Returns the Object ID of the dimension style (OdDbDimStyleTableRecord) for this Dimension entity (DXF 3).
  */
  OdDbObjectId dimensionStyle() const;
 
  /** \details
    Sets the Object ID of the dimension style (OdDbDimStyleTableRecord) for this Dimension entity (DXF 3).
    \param objectID [in]  Object ID.
  */
  void setDimensionStyle(
    OdDbObjectId objectID);
 
  /** \details
    Returns the dimension text attachment point for this Dimension entity (DXF 71).
  */
  OdDbMText::AttachmentPoint textAttachment() const;
 
  /** \details
    Sets the dimension text attachment point for this Dimension entity (DXF 71).
    \param attachmentPoint [in]  Attachment Point.
  */
  void setTextAttachment(
    OdDbMText::AttachmentPoint attachmentPoint);
 
  /** \details
    Returns the dimension text line spacing style for this Dimension entity (DXF 72).
  */
  OdDb::LineSpacingStyle textLineSpacingStyle() const;
 
  /** \details
    Sets the dimension text line spacing style for this Dimension entity (DXF 72).
    \param lineSpacingStyle [in]  Line spacing style.
  */
  void setTextLineSpacingStyle(
    OdDb::LineSpacingStyle lineSpacingStyle);
 
  /** \details
    Returns the dimension text line spacing factor for this Dimension entity (DXF 41).
    
    \sa
    OdDb::LineSpacingStyle
  */
  double textLineSpacingFactor() const;
 
  /** \details
    Sets the dimension text line spacing factor for this Dimension entity (DXF 41).
    
    \param lineSpacingFactor [in]  Line spacing factor. [0.25 .. 4.0]
    
    \sa
    OdDb::LineSpacingStyle
  */
  void setTextLineSpacingFactor(
    double lineSpacingFactor);
 
  /** \details
    Copies the dimension style settings, including overrides, of this Dimension entity into the specified
    dimension style table record.
    
    \param pRecord [out]  Receives the effective dimension style data associated with entity.
    
    \remarks
    The copied data includes the dimension style data with all applicable overrides. 
  */
  void getDimstyleData(
    OdDbDimStyleTableRecord *pRecord) const;
 
  /** \details
    Copies the dimension style settings, including overrides, from the specified
    dimension style table record to this Dimension entity.
    
    \param pDimstyle [in]  Pointer to a non- database -resident dimension style record.
    \param dimstyleID [in]  Database-resident dimension style record.
 
    \remarks
    The copied data includes the dimension style with all applicable overrides. 
  */
  void setDimstyleData(
    const OdDbDimStyleTableRecord* pDimstyle);
  void setDimstyleData(
    OdDbObjectId dimstyleID);
 
  /** \details
    Returns the horizontal rotation angle for this Dimension entity (DXF 51).
    \note
    All angles are expressed in radians.
  */
  double horizontalRotation() const;
 
  /** \details
    Sets the horizontal rotation angle for this Dimension entity (DXF 51).
    \param horizontalRotation [in]  Horizontal rotation angle.
    \note
    All angles are expressed in radians.
  */
  void setHorizontalRotation(
    double horizontalRotation);
 
 
  /** \details
    Returns the Object ID of the dimension block (OdDbBlockTableRecord) associated with this Dimension entity (DXF 2).
  */
  OdDbObjectId dimBlockId() const;
 
  /** \details
    Sets the Object ID of the dimension block (OdDbBlockTableRecord) associated with this Dimension entity.
   
    \param dimBlockId [in]  Object ID of the OdDbBlockTableRecord.
    \param singleReferenced [in]  True if and only if the dimension block is referenced only by this Dimension entity (DXF 70 bit 0x20).
  */
  void setDimBlockId(
    const OdDbObjectId& dimBlockId, 
    bool singleReferenced = true);
 
  /** \details
    Returns true and only if this Dimension entity has the only reference to its 
    associated OdDbBlockTableRecord (DXF 70 bit 0x20).
  */
  bool isSingleDimBlockReference() const;
 
  /** \details
    Returns the WCS relative position of the block associated with this Dimension entity (DXF 12).
      
    \remarks
    dimBlockPosition is the insertion point of the block with respect to the primary
    definition point (DXF 10) of the dimension block.      
  */
  OdGePoint3d dimBlockPosition() const;
 
  /*!DOM*/
  /** \details
    Sets the relative position of the dimension block referenced by this Dimension entity,
    in WCS (DXF 12). 
    
    \param dimBlockPosition [in] Dimension block position.
    
    \note
    For Teigha internal use only. Dimension update sets it to 0,0,0
  */
  void setDimBlockPosition(
    const OdGePoint3d& dimBlockPosition);
 
 
  /** \details
    Returns the rotation angle of the dimension block referenced by this Dimension entity (DXF 54).
    \note
    All angles are expressed in radians.    
  */
  double dimBlockRotation() const;
 
  /*!DOM*/
  /** \details
    Sets the rotation of the dimension block referenced by this Dimension entity (DXF 54). 
    
    \note
    For Teigha internal use only. Dimension update sets it to 0.
    
    \param dimBlockRotation [in] Dimension block rotation in radians.
  */
  void setDimBlockRotation(
    double dimBlockRotation);
 
  /** \details
    Returns the scale of the dimension block referenced by this Dimension entity.
    
    \note
    This is not saved to a DXF file.
  */
  OdGeScale3d dimBlockScale() const;
 
  /*!DOM*/
  /** \details
    Sets the scale of the dimension block referenced by this Dimension entity.
    
    \note
    For Teigha internal use only. Dimension update sets it to 1,1,1
    
    \param dimBlockScale [in] Dimension block scale.
  */
  void setDimBlockScale(
    const OdGeScale3d& dimBlockScale);
 
  /** \details
    Returns the transformation matrix applied to dimension block referenced by this Dimension entity.
    
    \remarks
    The transformation consists of position, scale, rotation angle and normal.
    It does not include block's base point.
  */
  OdGeMatrix3d dimBlockTransform() const;
  
  /** \details
    Recomputes the dimension block referenced by this Dimension entity.
    
    \remarks
    The OdDbBlockTableRecord of the dimension block is updated to reflect any changes made to this Dimension
    entity since the last time the block table record was updated.
 
    \param forceUpdate [in]  If true, the OdDbBlockTableRecord is updated even if the dimension has not been changed.
  */
  void recomputeDimBlock(
    bool forceUpdate = true);
 
  /** \details
    Returns the measurement (DXF 42) stored in this Dimension entity.
      
    \remarks
    Returns -1.0 if the stored measurement value is invalid. 
 
    Does not recompute the measurement.
 
    This Dimension entity need not be opened for write to call this function.
    
    \sa
    measurement()
  */
  double getMeasurement() const;
 
  /** \details
    Returns the measurement (DXF 42) for this Dimension entity.
    
    \remarks
    Recomputes the measurement if the stored measurement value is invalid (-1.0).
    
    This Dimension entity must be opened for write to call this function.
 
    \sa
    getMeasurement()
  */
  double measurement();
 
 
  // 2005-2006 support
  
  /** \details
    Returns the background text color and flags for this Dimension entity.
    \param bgrndTxtColor [out]  Receives the background text color.
  */
  OdUInt16 getBgrndTxtColor(OdCmColor& bgrndTxtColor) const;
  
  /** \details
    Sets the background text color and flags for this Dimension entity.
    \param bgrndTxtColor [in]  Background text color.
    \param bgrndTxtFlags [in]  Background text flags.
  */
  void setBgrndTxtColor(const OdCmColor& bgrndTxtColor, OdUInt16 bgrndTxtFlags );
 
  /** \details
    Returns the extension line fixed length enable flag for this Dimension entity.
  */
  bool getExtLineFixLenEnable() const;
 
  /** \details
    Controls the extension line fixed length enable flag for this Dimension entity.
    \param extLineFixLenEnable [in]  Extension line fixed length flag.
  */
  void setExtLineFixLenEnable(bool extLineFixLenEnable);
 
  /** \details
    Returns the extension line fixed length for this Dimension entity.
  */
  double getExtLineFixLen() const;
 
  /** \details
    Sets the extension line fixed length for this Dimension entity.
    \param extLineFixLen [in]  Extension line fixed length.
  */
  void setExtLineFixLen(double extLineFixLen);
 
  /** \details
    Returns the Object ID of the dimension line linetype for this Dimension entity.
  */
  OdDbObjectId getDimLinetype() const;
 
  /** \details
    Sets the Object ID of the dimension line linetype for this Dimension entity.
 
    \param linetypeId [in]  Dimension line linetype Object ID.
  */
  void setDimLinetype(const OdDbObjectId& linetypeId);
 
  /** \details
    Returns the Object ID of the first extension line linetype for this Dimension entity.
  */
  OdDbObjectId getDimExt1Linetype() const;
 
  /** \details
    Sets the Object ID of the first extension line linetype for this Dimension entity.
    
    \param linetypeId [in]  First extension line linetype Object ID.
  */
  void setDimExt1Linetype(const OdDbObjectId& linetypeId);
 
  /** \details
    Returns the Object ID of the second extension line linetype for this Dimension entity.
  */
  OdDbObjectId getDimExt2Linetype() const;
 
  /** \details
    Sets the Object ID of the second extension line linetype for this Dimension entity.
    
    \param linetypeId [in]  Second extension line linetype Object ID.
  */
  void setDimExt2Linetype(const OdDbObjectId& linetypeId);
 
  /** \details
    Returns the flip flag of the first arrowhead for this Dimension entity.
  */
  bool getArrowFirstIsFlipped() const;
 
  /** \details
    Returns the flip flag of the second arrowhead for this Dimension entity.
  */
  bool getArrowSecondIsFlipped() const;
  
  /** \details
    Sets the flip flag of the first arrowhead for this Dimension entity.
 
    \param bIsFlipped [in]  Flip flag value.
  */
  void setArrowFirstIsFlipped(bool bIsFlipped);
 
  /** \details
    Sets the flip flag of the second arrowhead for this Dimension entity.
 
    \param bIsFlipped [in]  Flip flag value.
  */
  void setArrowSecondIsFlipped(bool bIsFlipped);
 
  enum DimInspect 
  {
    kShapeRemove  = 0x00,     // No inspection label displays.
    kShapeRound   = 0x01,     // Inspection label displays with a rounded end (this is the default).
    kShapeAngular = 0x02,     // Inspection label displays with an angular end.
    kShapeNone    = 0x04,     // Inspection label displays without a bounding shape.
    kShapeLabel   = 0x10,     // Inspection label displays with a prefix, including a separator and alpha field.
    kShapeRate    = 0x20      // Inspection label displays at a specified frequency.
  };
 
  bool inspection() const;
  void setInspection(bool val);
 
  int inspectionFrame() const;
  void setInspectionFrame(int frame);
 
  OdString inspectionLabel() const;
  void setInspectionLabel(const OdString& label);
 
  OdString inspectionRate() const;
  void setInspectionRate(const OdString& label);
 
/**DOM-IGNORE-BEGIN*/
#define VAR_DEF(type, name, dxf, def_value, metric_def_value, reserve1, reserve2)\
  /** Description: Returns the DIM##NAME value of this Dimension entity.  \
    Remarks: ##remarks \
    \
    Remarks: \
    The value from the dimension style of this Dimension entity will be returned unless \
    that value has been overridden, in which case, the override value will be returned. \
    \
    Notes: ##notes \
    See Also: ##see_also \
  */ \
  virtual type dim##name() const; \
\
  /** Description: Sets the DIM##NAME override for this Dimension entity. \
    Arguments: val (I) New value for DIM##NAME.  ##RANGE \
    Remarks: ##remarks \
    Notes: ##notes \
    See Also: ##see_also \
  */ \
virtual void setDim##name(type val);
/**DOM-IGNORE-END*/
 
#include "DimVarDefs.h"
#undef  VAR_DEF
 
  virtual OdResult dwgInFields(
    OdDbDwgFiler* pFiler);
 
  virtual void dwgOutFields(
    OdDbDwgFiler* pFiler) const;
 
  virtual OdResult dxfInFields(
    OdDbDxfFiler* pFiler);
 
  virtual void dxfOutFields(
    OdDbDxfFiler* pFiler) const;
 
  virtual OdResult dxfInFields_R12(
    OdDbDxfFiler* pFiler);
 
  virtual void dxfOutFields_R12(
    OdDbDxfFiler* pFiler) const;
 
  OdResult subGetClassID(void* pClsid) const;
 
  OdUInt32 subSetAttributes(
    OdGiDrawableTraits* pTraits) const;
 
  bool subWorldDraw(
    OdGiWorldDraw* pWd) const;
 
  void subViewportDraw(
    OdGiViewportDraw* pVd) const;
 
  /* Replace OdRxObjectPtrArray */
  
  virtual OdResult subExplode(
    OdRxObjectPtrArray& entitySet) const ODRX_OVERRIDE; 
 
  void subClose();
 
  virtual void modified (
    const OdDbObject* pObject);
 
  virtual OdResult subTransformBy(
    const OdGeMatrix3d& xfm) ODRX_OVERRIDE;
  
  virtual OdResult subGetTransformedCopy(
    const OdGeMatrix3d& xfm, 
    OdDbEntityPtr& pCopy) const ODRX_OVERRIDE;
 
  /** \note
     This function is an override for OdDbEntity::subSetDatabaseDefaults() to set 
     the dimension style of this entity to the current style for the specified database.
  */
  void subSetDatabaseDefaults(
    OdDbDatabase *pDb,
    bool doSubents);
 
  virtual void appendToOwner(
    OdDbIdPair& idPair, 
    OdDbObject* pOwnerObject, 
    OdDbIdMapping& ownerIdMap) ODRX_OVERRIDE;
 
  virtual OdDbObjectPtr subWblockClone(OdDbIdMapping& ownerIdMap, OdDbObject*, bool bPrimary) const ODRX_OVERRIDE;
 
  /** \details
    Returns the formatted measurement value.
    
    \param formattedMeasurement [out]  Receives the formatted measurement.
    \param measurementValue [in]  Measurement value to be formatted.
    \param dimensionText [in]  Dimension text for formatting
    
    \remarks
    measurementValue is formatted per the specified dimension text and the 
    effective dimension style.
  */
  void formatMeasurement(
    OdString& formattedMeasurement, 
    double measurementValue, 
    const OdString& dimensionText);
 
  OdResult explodeGeometry(OdRxObjectPtrArray& entitySet) const;
 
  OdDbObjectPtr dimBlock(OdDb::OpenMode openMode = OdDb::kForRead);
 
  /*
      void generateLayout();
      void getOsnapPoints(OdDb::OsnapMode osnapMode, const OdDbFullSubentPath& subentId,
                          const OdGePoint3d& pickPoint, const OdGePoint3d& lastPoint,
                          const OdGeMatrix3d& viewXform, OdGePoint3dArray& snapPoints,
                          OdDbIntArray& geomIds ) const;
  */
 
  virtual OdResult subGetCompoundObjectTransform(OdGeMatrix3d & xM) const ODRX_OVERRIDE;
 
  // Dynamic dimensions support
  // (The methods are NOT related to constraint support)
  
  bool isDynamicDimension() const;
  void setDynamicDimension(
    bool bDynamic);
 
  // Dimensional constraint support
 
  bool isConstraintObject() const;
  OdResult isConstraintObject(
    bool& isConstraintObject,
    bool& hasExpression,
    bool& isReferenceConstraint) const;
 
  bool  isConstraintDynamic() const;
  OdResult setConstraintDynamic(
    bool bDynamic);
 
  bool  shouldParticipateInOPM() const;
  void  setShouldParticipateInOPM(
    bool bShouldParticipate);
  
  void setDIMTALN(bool val);
  bool getDIMTALN() const;
 
  void removeTextField();
  void fieldToMText(OdDbMTextPtr& pDimMText);
  void fieldFromMText(OdDbMTextPtr& pDimMText);
 
  OdGeMatrix3d getEcs( ) const;
  
  /** \details
  Resets defined width and defined height for MText
 
  */
  void resetTextDefinedSize();
 
  /** \details
    Sets defined width and defined height for MText
 
    \param width [in]  MText width
    \param height [in]  MText height
  */
  void setTextDefinedSize(
    double width,
    double height);
 
  /** \details
    Gets defined width and defined height for MText
 
    \param width [out]  MText width
    \param height [out]  MText height
  */
  void textDefinedSize(
    double& width,
    double& height) const;
 
};
 
/** \details
  This template class is a specialization of the OdSmartPtr class for OdDbDimension object pointers.
*/
typedef OdSmartPtr<OdDbDimension> OdDbDimensionPtr;
 
class OdDbDimensionObjectContextData;
 
  /** \details
    This class is the Dimension Recompute Protocol Extension class.
   
    \sa
    TD_Db
 
    <group OdDb_Classes>
  */
class TOOLKIT_EXPORT OdDbDimensionRecomputePE : public OdRxObject
{
public:
  /** \details
    Sets the measurement value for the specified Dimension entity.
    
    \param pDimension [in]  Pointer to the dimension entity.
    \param measurementValue [in]  Measurement value.
  */
  static void setMeasurementValue(OdDbDimension* pDimension, double measurementValue);
  /** \details
    Resets the dimension block insertion parameters for the specified Dimension entity.
    
    \param pDimension [in]  Pointer to the dimension entity.
 
    \remarks
    * The insertion point is set to (0,0).
    * The X-, Y- and Z-scale factors are set 1.0.
    * The rotation angle is set to 0.0. 
  */
  static void resetDimBlockInsertParams(OdDbDimension* pDimension);
 
  ODRX_DECLARE_MEMBERS(OdDbDimensionRecomputePE);
 
  /** \details
    Recomputes the dimension measurement for the specified Dimension entity.
    
    \param pDimension [in]  Pointer to the dimension entity.
  */
  virtual void recomputeDimMeasurement(OdDbDimension* pDimension) = 0;
 
  /** \details
    Recomputes the dimension block referenced by the specified Dimension entity.
    
    \remarks
    The OdDbBlockTableRecord of the dimension block is updated to reflect any changes made to this Dimension
    entity since the last time the block table record was updated.
 
    \param pDimension [in]  Pointer to the dimension entity.
  */
  virtual void recomputeDimBlock(OdDbDimension* pDimension, OdDbDimensionObjectContextData* ctx) = 0;
 
 
  /** \details
    Returns the formatted measurement value.
    
    \param pDimension [in]  Pointer to the dimension entity.
    \param formattedMeasurement [out]  Receives the formatted measurement.
    \param measurementValue [in]  Measurement value to be formatted.
    \param dimensionText [in]  Dimension text for formatting
    
    \remarks
    measurementValue is formatted per the specified dimension text and the 
    effective dimension style.
  */
  virtual void formatMeasurement(OdDbDimension* pDimension, OdString& formattedMeasurement, 
     double measurementValue, const OdString& dimensionText ) = 0;
};
 
/** \details
    This template class is a specialization of the OdSmartPtr class for OdDbDimensionRecomputePE object pointers.
*/
typedef OdSmartPtr<OdDbDimensionRecomputePE> OdDbDimensionRecomputePEPtr;
 
#include "TD_PackPop.h"
 
#endif