CFx SDK Documentation  2023 SP0
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);
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 
OdSmartPtr< OdDbDimension > OdDbDimensionPtr
Definition: DbDimension.h:714
OdSmartPtr< OdDbDimensionRecomputePE > OdDbDimensionRecomputePEPtr
Definition: DbDimension.h:788
OdSmartPtr< OdDbDimStyleTableRecord > OdDbDimStyleTableRecordPtr
Definition: DbDimension.h:36
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
unsigned int OdUInt32
unsigned short OdUInt16
#define ODRX_OVERRIDE
OdResult
Definition: OdResult.h:29
bool isConstraintObject() const
void setDimBlockId(const OdDbObjectId &dimBlockId, bool singleReferenced=true)
OdGeMatrix3d dimBlockTransform() const
void setTextLineSpacingStyle(OdDb::LineSpacingStyle lineSpacingStyle)
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm) ODRX_OVERRIDE
double getExtLineFixLen() const
OdGeMatrix3d getEcs() const
bool getDIMTALN() const
void useSetTextPosition()
int inspectionFrame() const
void resetTextDefinedSize()
OdDb::LineSpacingStyle textLineSpacingStyle() const
OdUInt32 subSetAttributes(OdGiDrawableTraits *pTraits) const
void setDynamicDimension(bool bDynamic)
void textDefinedSize(double &width, double &height) const
OdResult isConstraintObject(bool &isConstraintObject, bool &hasExpression, bool &isReferenceConstraint) const
bool inspection() const
bool isDynamicDimension() const
void setHorizontalRotation(double horizontalRotation)
void recomputeDimBlock(bool forceUpdate=true)
void setArrowFirstIsFlipped(bool bIsFlipped)
virtual OdDbObjectPtr subWblockClone(OdDbIdMapping &ownerIdMap, OdDbObject *, bool bPrimary) const ODRX_OVERRIDE
virtual OdResult getPlane(OdGePlane &plane, OdDb::Planarity &planarity) const
virtual OdResult subGetTransformedCopy(const OdGeMatrix3d &xfm, OdDbEntityPtr &pCopy) const ODRX_OVERRIDE
void setExtLineFixLenEnable(bool extLineFixLenEnable)
OdGeScale3d dimBlockScale() const
bool getArrowSecondIsFlipped() const
OdGePoint3d textPosition() const
void setExtLineFixLen(double extLineFixLen)
void setDimensionText(const OdString &dimensionText)
ODDB_DECLARE_MEMBERS(OdDbDimension)
const OdString dimensionText() const
bool isSingleDimBlockReference() const
double elevation() const
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
virtual void dxfOutFields_R12(OdDbDxfFiler *pFiler) const
void setInspectionLabel(const OdString &label)
OdDbObjectId getDimLinetype() const
double textRotation() const
double dimBlockRotation() const
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
void removeTextField()
OdDbObjectId getDimExt2Linetype() const
bool getExtLineFixLenEnable() const
bool shouldParticipateInOPM() const
virtual OdResult subGetCompoundObjectTransform(OdGeMatrix3d &xM) const ODRX_OVERRIDE
OdDbObjectId dimensionStyle() const
void setDimensionStyle(OdDbObjectId objectID)
OdGeVector3d normal() const
void setTextAttachment(OdDbMText::AttachmentPoint attachmentPoint)
void setBgrndTxtColor(const OdCmColor &bgrndTxtColor, OdUInt16 bgrndTxtFlags)
void fieldFromMText(OdDbMTextPtr &pDimMText)
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
OdString inspectionLabel() const
bool isUsingDefaultTextPosition() const
void setTextPosition(const OdGePoint3d &textPosition)
OdResult setConstraintDynamic(bool bDynamic)
double textLineSpacingFactor() const
double horizontalRotation() const
void setDimstyleData(const OdDbDimStyleTableRecord *pDimstyle)
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
void subSetDatabaseDefaults(OdDbDatabase *pDb, bool doSubents)
void setDimExt1Linetype(const OdDbObjectId &linetypeId)
void setArrowSecondIsFlipped(bool bIsFlipped)
void setTextRotation(double textRotation)
void setDIMTALN(bool val)
OdUInt16 getBgrndTxtColor(OdCmColor &bgrndTxtColor) const
OdDbObjectPtr dimBlock(OdDb::OpenMode openMode=OdDb::kForRead)
double measurement()
void setTextLineSpacingFactor(double lineSpacingFactor)
bool getArrowFirstIsFlipped() const
void formatMeasurement(OdString &formattedMeasurement, double measurementValue, const OdString &dimensionText)
OdString inspectionRate() const
bool isConstraintDynamic() const
void setTextDefinedSize(double width, double height)
void setInspectionFrame(int frame)
OdDbObjectId getDimExt1Linetype() const
void setDimBlockRotation(double dimBlockRotation)
void setShouldParticipateInOPM(bool bShouldParticipate)
void setNormal(const OdGeVector3d &normal)
void setInspection(bool val)
void setElevation(double elevation)
void setDimExt2Linetype(const OdDbObjectId &linetypeId)
void setInspectionRate(const OdString &label)
void setDimstyleData(OdDbObjectId dimstyleID)
void fieldToMText(OdDbMTextPtr &pDimMText)
OdDbObjectId dimBlockId() const
void setDimBlockPosition(const OdGePoint3d &dimBlockPosition)
virtual bool isPlanar() const
Definition: DbDimension.h:107
void subViewportDraw(OdGiViewportDraw *pVd) const
void useDefaultTextPosition()
virtual OdResult dxfInFields_R12(OdDbDxfFiler *pFiler)
OdResult subGetClassID(void *pClsid) const
virtual void appendToOwner(OdDbIdPair &idPair, OdDbObject *pOwnerObject, OdDbIdMapping &ownerIdMap) ODRX_OVERRIDE
OdResult explodeGeometry(OdRxObjectPtrArray &entitySet) const
virtual OdResult subExplode(OdRxObjectPtrArray &entitySet) const ODRX_OVERRIDE
double getMeasurement() const
void setDimLinetype(const OdDbObjectId &linetypeId)
void setDimBlockScale(const OdGeScale3d &dimBlockScale)
OdDbMText::AttachmentPoint textAttachment() const
void getDimstyleData(OdDbDimStyleTableRecord *pRecord) const
bool subWorldDraw(OdGiWorldDraw *pWd) const
virtual void modified(const OdDbObject *pObject)
OdGePoint3d dimBlockPosition() const
virtual void recomputeDimBlock(OdDbDimension *pDimension, OdDbDimensionObjectContextData *ctx)=0
virtual void recomputeDimMeasurement(OdDbDimension *pDimension)=0
virtual void formatMeasurement(OdDbDimension *pDimension, OdString &formattedMeasurement, double measurementValue, const OdString &dimensionText)=0
static void resetDimBlockInsertParams(OdDbDimension *pDimension)
ODRX_DECLARE_MEMBERS(OdDbDimensionRecomputePE)
static void setMeasurementValue(OdDbDimension *pDimension, double measurementValue)
AttachmentPoint
Definition: DbMText.h:247
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
GLint GLenum GLsizei GLsizei height
Definition: gles2_ext.h:110
Planarity
Definition: DbEntity.h:74
LineSpacingStyle
Definition: TextDefs.h:53
OpenMode
Definition: DbObjectId.h:54
@ kForRead
Definition: DbObjectId.h:56