CFx SDK Documentation  2020SP3
DbDimension.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 
26 
27 #ifndef OD_DBDIM_H
28 #define OD_DBDIM_H
29 
30 #include "TD_PackPush.h"
31 
32 #include "DbEntity.h"
33 #include "DbMText.h"
34 #include "Ge/GeScale3d.h"
35 
37 
42 
52 {
53 public:
55 
57 
66 
77  const OdGePoint3d& textPosition);
78 
84 
89 
94 
99 
104  void setNormal(
105  const OdGeVector3d& normal);
106 
107  virtual bool isPlanar() const { return true; }
108 
110  OdGePlane& plane,
111  OdDb::Planarity& planarity) const;
112 
119  double elevation() const;
120 
130  double elevation);
131 
140  const OdString dimensionText() const;
141 
154  const OdString& dimensionText);
155 
162  double textRotation() const;
163 
172  double textRotation);
173 
178 
184  OdDbObjectId objectID);
185 
190 
196  OdDbMText::AttachmentPoint attachmentPoint);
197 
202 
208  OdDb::LineSpacingStyle lineSpacingStyle);
209 
216  double textLineSpacingFactor() const;
217 
227  double lineSpacingFactor);
228 
239  OdDbDimStyleTableRecord *pRecord) const;
240 
251  const OdDbDimStyleTableRecord* pDimstyle);
252 
263  OdDbObjectId dimstyleID);
264 
270  double horizontalRotation() const;
271 
279  double horizontalRotation);
280 
281 
286 
294  const OdDbObjectId& dimBlockId,
295  bool singleReferenced = true);
296 
302 
311 
323  const OdGePoint3d& dimBlockPosition);
324 
325 
331  double dimBlockRotation() const;
332 
343  double dimBlockRotation);
344 
352 
363  const OdGeScale3d& dimBlockScale);
364 
373 
384  bool forceUpdate = true);
385 
399  double getMeasurement() const;
400 
412  double measurement();
413 
414 
415  // 2005-2006 support
416 
421  OdUInt16 getBgrndTxtColor(OdCmColor& bgrndTxtColor) const;
422 
428  void setBgrndTxtColor(const OdCmColor& bgrndTxtColor, OdUInt16 bgrndTxtFlags );
429 
434 
439  void setExtLineFixLenEnable(bool extLineFixLenEnable);
440 
444  double getExtLineFixLen() const;
445 
450  void setExtLineFixLen(double extLineFixLen);
451 
456 
462  void setDimLinetype(const OdDbObjectId& linetypeId);
463 
468 
474  void setDimExt1Linetype(const OdDbObjectId& linetypeId);
475 
480 
486  void setDimExt2Linetype(const OdDbObjectId& linetypeId);
487 
492 
497 
503  void setArrowFirstIsFlipped(bool bIsFlipped);
504 
510  void setArrowSecondIsFlipped(bool bIsFlipped);
511 
513  {
514  kShapeRemove = 0x00, // No inspection label displays.
515  kShapeRound = 0x01, // Inspection label displays with a rounded end (this is the default).
516  kShapeAngular = 0x02, // Inspection label displays with an angular end.
517  kShapeNone = 0x04, // Inspection label displays without a bounding shape.
518  kShapeLabel = 0x10, // Inspection label displays with a prefix, including a separator and alpha field.
519  kShapeRate = 0x20 // Inspection label displays at a specified frequency.
520  };
521 
522  bool inspection() const;
523  void setInspection(bool val);
524 
525  int inspectionFrame() const;
526  void setInspectionFrame(int frame);
527 
529  void setInspectionLabel(const OdString& label);
530 
532  void setInspectionRate(const OdString& label);
533 
535 #define VAR_DEF(type, name, dxf, def_value, metric_def_value, reserve1, reserve2)\
536  \
546  virtual type dim##name() const; \
547 \
548  \
554 virtual void setDim##name(type val);
555 
557 #include "DimVarDefs.h"
558 #undef VAR_DEF
559 
561  OdDbDwgFiler* pFiler);
562 
563  virtual void dwgOutFields(
564  OdDbDwgFiler* pFiler) const;
565 
567  OdDbDxfFiler* pFiler);
568 
569  virtual void dxfOutFields(
570  OdDbDxfFiler* pFiler) const;
571 
573  OdDbDxfFiler* pFiler);
574 
575  virtual void dxfOutFields_R12(
576  OdDbDxfFiler* pFiler) const;
577 
578  OdResult subGetClassID(void* pClsid) const;
579 
581  OdGiDrawableTraits* pTraits) const;
582 
584  OdGiWorldDraw* pWd) const;
585 
587  OdGiViewportDraw* pVd) const;
588 
589  /* Replace OdRxObjectPtrArray */
590 
592  OdRxObjectPtrArray& entitySet) const ODRX_OVERRIDE;
593 
594  void subClose();
595 
596  virtual void modified (
597  const OdDbObject* pObject);
598 
600  const OdGeMatrix3d& xfm) ODRX_OVERRIDE;
601 
603  const OdGeMatrix3d& xfm,
604  OdDbEntityPtr& pCopy) const ODRX_OVERRIDE;
605 
611  OdDbDatabase *pDb,
612  bool doSubents);
613 
614  virtual void appendToOwner(
615  OdDbIdPair& idPair,
616  OdDbObject* pOwnerObject,
617  OdDbIdMapping& ownerIdMap) ODRX_OVERRIDE;
618 
619  virtual OdDbObjectPtr subWblockClone(OdDbIdMapping& ownerIdMap, OdDbObject*, bool bPrimary) const ODRX_OVERRIDE;
620 
633  OdString& formattedMeasurement,
634  double measurementValue,
635  const OdString& dimensionText);
636 
638 
640 
641  /*
642  void generateLayout();
643  void getOsnapPoints(OdDb::OsnapMode osnapMode, const OdDbFullSubentPath& subentId,
644  const OdGePoint3d& pickPoint, const OdGePoint3d& lastPoint,
645  const OdGeMatrix3d& viewXform, OdGePoint3dArray& snapPoints,
646  OdDbIntArray& geomIds ) const;
647  */
648 
650 
651  // Dynamic dimensions support
652  // (The methods are NOT related to constraint support)
653 
654  bool isDynamicDimension() const;
656  bool bDynamic);
657 
658  // Dimensional constraint support
659 
660  bool isConstraintObject() const;
662  bool& isConstraintObject,
663  bool& hasExpression,
664  bool& isReferenceConstraint) const;
665 
666  bool isConstraintDynamic() const;
668  bool bDynamic);
669 
672  bool bShouldParticipate);
673 
674  void setDIMTALN(bool val);
675  bool getDIMTALN() const;
676 
678  void fieldToMText(OdDbMTextPtr& pDimMText);
679  void fieldFromMText(OdDbMTextPtr& pDimMText);
680 
682 
688 
696  double width,
697  double height);
698 
706  double& width,
707  double& height) const;
708 
709 };
710 
715 
717 
727 {
728 public:
735  static void setMeasurementValue(OdDbDimension* pDimension, double measurementValue);
746  static void resetDimBlockInsertParams(OdDbDimension* pDimension);
747 
749 
755  virtual void recomputeDimMeasurement(OdDbDimension* pDimension) = 0;
756 
767 
768 
781  virtual void formatMeasurement(OdDbDimension* pDimension, OdString& formattedMeasurement,
782  double measurementValue, const OdString& dimensionText ) = 0;
783 };
784 
789 
790 #include "TD_PackPop.h"
791 
792 #endif
793 
OdDbDimension::setTextDefinedSize
void setTextDefinedSize(double width, double height)
OdResult
OdResult
Definition: OdResult.h:29
OdDbDimension::isPlanar
virtual bool isPlanar() const
Definition: DbDimension.h:107
OdGePlane
Definition: GePlane.h:45
OdGeVector3d
Definition: GeVector3d.h:54
OdString
Definition: OdString.h:95
OdDbDimension::dwgInFields
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
OdDbDatabase
Definition: DbDatabase.h:421
OdDbDimension::setTextLineSpacingFactor
void setTextLineSpacingFactor(double lineSpacingFactor)
OdDbDimension::getArrowSecondIsFlipped
bool getArrowSecondIsFlipped() const
OdDbDimStyleTableRecord
Definition: DbDimStyleTableRecord.h:316
OdDbDimension::inspectionFrame
int inspectionFrame() const
OdDbDimension::measurement
double measurement()
OdDbDimension::inspection
bool inspection() const
OdDbDimension::dimBlock
OdDbObjectPtr dimBlock(OdDb::OpenMode openMode=OdDb::kForRead)
OdDb::Planarity
Planarity
Definition: DbEntity.h:74
OdDbDimension::getDimExt1Linetype
OdDbObjectId getDimExt1Linetype() const
OdDbDimension::setDimBlockRotation
void setDimBlockRotation(double dimBlockRotation)
OdDbDimension::horizontalRotation
double horizontalRotation() const
OdDbDimension::explodeGeometry
OdResult explodeGeometry(OdRxObjectPtrArray &entitySet) const
OdDbDimension::isConstraintObject
OdResult isConstraintObject(bool &isConstraintObject, bool &hasExpression, bool &isReferenceConstraint) const
OdDbDimensionObjectContextData
Definition: DbObjectContextData.h:292
OdDbDimension::textAttachment
OdDbMText::AttachmentPoint textAttachment() const
OdDbDimension::dxfOutFields
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
GeScale3d.h
OdDbDimension::textDefinedSize
void textDefinedSize(double &width, double &height) const
OdDbDimension::setTextLineSpacingStyle
void setTextLineSpacingStyle(OdDb::LineSpacingStyle lineSpacingStyle)
OdRxObject
Definition: RxObject.h:564
OdDbObjectId
Definition: DbObjectId.h:99
OdDbDimension::setDIMTALN
void setDIMTALN(bool val)
OdGeScale3d
Definition: GeScale3d.h:47
OdDbDimension::subClose
void subClose()
OdDbIdPair
Definition: DbIdMapping.h:60
OdDbDimension::dxfOutFields_R12
virtual void dxfOutFields_R12(OdDbDxfFiler *pFiler) const
OdDbDimension::getDIMTALN
bool getDIMTALN() const
OdDbDimension::setInspection
void setInspection(bool val)
OdDbDimension::subWorldDraw
bool subWorldDraw(OdGiWorldDraw *pWd) const
OdDbDimension::setTextRotation
void setTextRotation(double textRotation)
OdDbDimension::getDimstyleData
void getDimstyleData(OdDbDimStyleTableRecord *pRecord) const
OdDbDimension::inspectionLabel
OdString inspectionLabel() const
OdArray< OdRxObjectPtr >
OdDbDimension::setDimLinetype
void setDimLinetype(const OdDbObjectId &linetypeId)
OdDbDimension::setNormal
void setNormal(const OdGeVector3d &normal)
TD_PackPop.h
OdDbDimension::dxfInFields
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
OdUInt16
unsigned short OdUInt16
Definition: OdPlatformSettings.h:760
OdDbDimension::dimBlockTransform
OdGeMatrix3d dimBlockTransform() const
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdDbDimension::setTextAttachment
void setTextAttachment(OdDbMText::AttachmentPoint attachmentPoint)
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdDbDimension::setDimstyleData
void setDimstyleData(OdDbObjectId dimstyleID)
OdDbDimension::OdDbDimension
OdDbDimension()
OdDbDimension::textLineSpacingStyle
OdDb::LineSpacingStyle textLineSpacingStyle() const
OdDbDimension::setHorizontalRotation
void setHorizontalRotation(double horizontalRotation)
OdDbDimension::isConstraintObject
bool isConstraintObject() const
OdDbDimension::setElevation
void setElevation(double elevation)
OdDb::kForRead
@ kForRead
Definition: DbObjectId.h:56
DbMText.h
OdDbDimension::isDynamicDimension
bool isDynamicDimension() const
OdDbDimension::ODDB_DECLARE_MEMBERS
ODDB_DECLARE_MEMBERS(OdDbDimension)
OdDbDimension::setInspectionLabel
void setInspectionLabel(const OdString &label)
OdDbDimension::setDimBlockPosition
void setDimBlockPosition(const OdGePoint3d &dimBlockPosition)
OdDbDimension::textRotation
double textRotation() const
OdDbDimension::recomputeDimBlock
void recomputeDimBlock(bool forceUpdate=true)
OdDbDimension::setShouldParticipateInOPM
void setShouldParticipateInOPM(bool bShouldParticipate)
OdDbDimension
Definition: DbDimension.h:52
OdDbDimension::dimBlockId
OdDbObjectId dimBlockId() const
OdDbDimension::setDimBlockScale
void setDimBlockScale(const OdGeScale3d &dimBlockScale)
OdDbDimension::setConstraintDynamic
OdResult setConstraintDynamic(bool bDynamic)
OdDbDimension::setTextPosition
void setTextPosition(const OdGePoint3d &textPosition)
OdDbDimension::isUsingDefaultTextPosition
bool isUsingDefaultTextPosition() const
OdDbDimension::dimensionText
const OdString dimensionText() const
OdSmartPtr
Definition: SmartPtr.h:58
OdDbDimension::subSetDatabaseDefaults
void subSetDatabaseDefaults(OdDbDatabase *pDb, bool doSubents)
OdGePoint3d
Definition: GePoint3d.h:55
DbEntity.h
OdDbDimension::fieldFromMText
void fieldFromMText(OdDbMTextPtr &pDimMText)
OdDbDimension::getArrowFirstIsFlipped
bool getArrowFirstIsFlipped() const
OdDbDimension::inspectionRate
OdString inspectionRate() const
OdDbDimension::getExtLineFixLenEnable
bool getExtLineFixLenEnable() const
OdDbDimension::subWblockClone
virtual OdDbObjectPtr subWblockClone(OdDbIdMapping &ownerIdMap, OdDbObject *, bool bPrimary) const ODRX_OVERRIDE
OdDbDimension::isSingleDimBlockReference
bool isSingleDimBlockReference() const
OdDbDimension::setDimExt2Linetype
void setDimExt2Linetype(const OdDbObjectId &linetypeId)
OdDbDimension::subSetAttributes
OdUInt32 subSetAttributes(OdGiDrawableTraits *pTraits) const
OdDbDimension::subViewportDraw
void subViewportDraw(OdGiViewportDraw *pVd) const
OdDbDimension::setInspectionRate
void setInspectionRate(const OdString &label)
OdDbDimension::normal
OdGeVector3d normal() const
OdDbDimension::formatMeasurement
void formatMeasurement(OdString &formattedMeasurement, double measurementValue, const OdString &dimensionText)
OdDbDimensionRecomputePE::formatMeasurement
virtual void formatMeasurement(OdDbDimension *pDimension, OdString &formattedMeasurement, double measurementValue, const OdString &dimensionText)=0
OdDbDimension::subExplode
virtual OdResult subExplode(OdRxObjectPtrArray &entitySet) const ODRX_OVERRIDE
height
GLint GLenum GLsizei GLsizei height
Definition: gles2_ext.h:110
OdDbDimensionRecomputePEPtr
OdSmartPtr< OdDbDimensionRecomputePE > OdDbDimensionRecomputePEPtr
Definition: DbDimension.h:788
width
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
OdDbDxfFiler
Definition: DbFiler.h:194
OdDbDimensionPtr
OdSmartPtr< OdDbDimension > OdDbDimensionPtr
Definition: DbDimension.h:714
OdDbDimension::modified
virtual void modified(const OdDbObject *pObject)
OdDbDimension::subGetCompoundObjectTransform
virtual OdResult subGetCompoundObjectTransform(OdGeMatrix3d &xM) const ODRX_OVERRIDE
OdDbDimension::getMeasurement
double getMeasurement() const
OdDbDimension::elevation
double elevation() const
TD_PackPush.h
OdDbDimension::subGetTransformedCopy
virtual OdResult subGetTransformedCopy(const OdGeMatrix3d &xfm, OdDbEntityPtr &pCopy) const ODRX_OVERRIDE
OdDbDimension::isConstraintDynamic
bool isConstraintDynamic() const
OdDbDimension::setExtLineFixLenEnable
void setExtLineFixLenEnable(bool extLineFixLenEnable)
OdDbDimension::resetTextDefinedSize
void resetTextDefinedSize()
OdDbDimension::dimBlockRotation
double dimBlockRotation() const
OdDbDimension::setDimBlockId
void setDimBlockId(const OdDbObjectId &dimBlockId, bool singleReferenced=true)
OdDbDimension::fieldToMText
void fieldToMText(OdDbMTextPtr &pDimMText)
DimVarDefs.h
OdDbDimension::getPlane
virtual OdResult getPlane(OdGePlane &plane, OdDb::Planarity &planarity) const
OdGiWorldDraw
Definition: GiWorldDraw.h:44
OdDbDimension::setDimensionStyle
void setDimensionStyle(OdDbObjectId objectID)
OdDbDimension::appendToOwner
virtual void appendToOwner(OdDbIdPair &idPair, OdDbObject *pOwnerObject, OdDbIdMapping &ownerIdMap) ODRX_OVERRIDE
OdDbEntity
Definition: DbEntity.h:90
OdDbDimensionRecomputePE::recomputeDimMeasurement
virtual void recomputeDimMeasurement(OdDbDimension *pDimension)=0
OdDb::OpenMode
OpenMode
Definition: DbObjectId.h:54
OdDbDimension::DimInspect
DimInspect
Definition: DbDimension.h:513
OdDbDimension::subGetClassID
OdResult subGetClassID(void *pClsid) const
OdDbDimension::textPosition
OdGePoint3d textPosition() const
OdDbDimension::textLineSpacingFactor
double textLineSpacingFactor() const
OdDbDimension::dwgOutFields
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
OdDbDimension::useDefaultTextPosition
void useDefaultTextPosition()
OdDbDimension::getDimLinetype
OdDbObjectId getDimLinetype() const
OdGiDrawableTraits
Definition: Gi.h:71
OdDbDimension::setInspectionFrame
void setInspectionFrame(int frame)
OdDbDimension::setDynamicDimension
void setDynamicDimension(bool bDynamic)
OdDbDimension::getExtLineFixLen
double getExtLineFixLen() const
OdDbDimension::removeTextField
void removeTextField()
OdDbDimensionRecomputePE::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdDbDimensionRecomputePE)
OdDbDimension::setDimExt1Linetype
void setDimExt1Linetype(const OdDbObjectId &linetypeId)
OdDbDimension::getEcs
OdGeMatrix3d getEcs() const
OdDbDimension::setArrowSecondIsFlipped
void setArrowSecondIsFlipped(bool bIsFlipped)
OdDbDimension::setArrowFirstIsFlipped
void setArrowFirstIsFlipped(bool bIsFlipped)
OdDbDimensionRecomputePE::setMeasurementValue
static void setMeasurementValue(OdDbDimension *pDimension, double measurementValue)
OdDbDimension::shouldParticipateInOPM
bool shouldParticipateInOPM() const
TOOLKIT_EXPORT
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
ODRX_OVERRIDE
#define ODRX_OVERRIDE
Definition: OdPlatformSettings.h:114
OdDbDimension::getDimExt2Linetype
OdDbObjectId getDimExt2Linetype() const
OdDbMText::AttachmentPoint
AttachmentPoint
Definition: DbMText.h:247
OdDbDimension::setExtLineFixLen
void setExtLineFixLen(double extLineFixLen)
OdDbDimension::setBgrndTxtColor
void setBgrndTxtColor(const OdCmColor &bgrndTxtColor, OdUInt16 bgrndTxtFlags)
OdDbDimension::dimensionStyle
OdDbObjectId dimensionStyle() const
OdDbDimension::setDimstyleData
void setDimstyleData(const OdDbDimStyleTableRecord *pDimstyle)
OdDbDimension::dimBlockPosition
OdGePoint3d dimBlockPosition() const
OdDb::LineSpacingStyle
LineSpacingStyle
Definition: TextDefs.h:53
OdDbDimensionRecomputePE::recomputeDimBlock
virtual void recomputeDimBlock(OdDbDimension *pDimension, OdDbDimensionObjectContextData *ctx)=0
OdCmColor
Definition: CmColor.h:59
OdDbDimension::setDimensionText
void setDimensionText(const OdString &dimensionText)
OdDbDimensionRecomputePE::resetDimBlockInsertParams
static void resetDimBlockInsertParams(OdDbDimension *pDimension)
OdDbDimStyleTableRecordPtr
OdSmartPtr< OdDbDimStyleTableRecord > OdDbDimStyleTableRecordPtr
Definition: DbDimension.h:36
OdDbIdMapping
Definition: DbIdMapping.h:238
OdDbObject
Definition: DbObject.h:211
OdDbDimension::useSetTextPosition
void useSetTextPosition()
OdDbDwgFiler
Definition: DbFiler.h:1031
OdGiViewportDraw
Definition: GiViewportDraw.h:50
OdDbDimension::getBgrndTxtColor
OdUInt16 getBgrndTxtColor(OdCmColor &bgrndTxtColor) const
OdDbDimension::subTransformBy
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm) ODRX_OVERRIDE
OdDbDimension::dimBlockScale
OdGeScale3d dimBlockScale() const
OdDbDimension::dxfInFields_R12
virtual OdResult dxfInFields_R12(OdDbDxfFiler *pFiler)
OdDbDimensionRecomputePE
Definition: DbDimension.h:727