CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DbDimension.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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
53{
54public:
55 //DOM-IGNORE-BEGIN
57 //DOM-IGNORE-END
58
63
72
82 const OdGePoint3d& textPosition);
83
89
94
99
104
111 const OdGeVector3d& normal);
112
117 virtual bool isPlanar() const { return true; }
118
127 OdGePlane& plane,
128 OdDb::Planarity& planarity) const;
129
136 double elevation() const;
137
146 double elevation);
147
156 const OdString dimensionText() const;
157
169 const OdString& dimensionText);
170
177 double textRotation() const;
178
187 double textRotation);
188
193
199 OdDbObjectId objectID);
200
205
211 OdDbMText::AttachmentPoint attachmentPoint);
212
220
229 OdDb::LineSpacingStyle lineSpacingStyle);
230
237 double textLineSpacingFactor() const;
238
247 double lineSpacingFactor);
248
258 OdDbDimStyleTableRecord *pRecord) const;
259
269 const OdDbDimStyleTableRecord* pDimstyle);
270
280 OdDbObjectId dimstyleID);
281
287 double horizontalRotation() const;
288
296 double horizontalRotation);
297
298
303
311 const OdDbObjectId& dimBlockId,
312 bool singleReferenced = true);
313
319
328
339 const OdGePoint3d& dimBlockPosition);
340
341
348 double dimBlockRotation() const;
349
359 double dimBlockRotation);
360
368
378 const OdGeScale3d& dimBlockScale);
379
388
398 bool forceUpdate = true);
399
412 double getMeasurement() const;
413
425 double measurement();
426
427
428 // 2005-2006 support
429
450 OdUInt16 getBgrndTxtColor(OdCmColor& bgrndTxtColor) const;
451
471 void setBgrndTxtColor(const OdCmColor& bgrndTxtColor, OdUInt16 bgrndTxtFlags );
472
477
483 void setExtLineFixLenEnable(bool extLineFixLenEnable);
484
488 double getExtLineFixLen() const;
489
495 void setExtLineFixLen(double extLineFixLen);
496
501
507 void setDimLinetype(const OdDbObjectId& linetypeId);
508
513
519 void setDimExt1Linetype(const OdDbObjectId& linetypeId);
520
525
531 void setDimExt2Linetype(const OdDbObjectId& linetypeId);
532
537
542
548 void setArrowFirstIsFlipped(bool bIsFlipped);
549
555 void setArrowSecondIsFlipped(bool bIsFlipped);
556
561 {
563 kShapeRemove = 0x00,
564
566 kShapeRound = 0x01,
567
569 kShapeAngular = 0x02,
570
572 kShapeNone = 0x04,
573
575 kShapeLabel = 0x10,
576
578 kShapeRate = 0x20
579 };
580
586 bool inspection() const;
587
593 void setInspection(bool val);
594
598 int inspectionFrame() const;
599
605 void setInspectionFrame(int frame);
606
611
617 void setInspectionLabel(const OdString& label);
618
623
629 void setInspectionRate(const OdString& label);
630
632#define VAR_DEF(type, name, dxf, def_value, metric_def_value, reserve1, reserve2)\
633 \
643 virtual type dim##name() const; \
644\
645 \
651virtual void setDim##name(type val);
654#include "DimVarDefs.h"
655#undef VAR_DEF
656
658 OdDbDwgFiler* pFiler);
659
660 virtual void dwgOutFields(
661 OdDbDwgFiler* pFiler) const;
662
664 OdDbDxfFiler* pFiler);
665
666 virtual void dxfOutFields(
667 OdDbDxfFiler* pFiler) const;
668
670 OdDbDxfFiler* pFiler);
671
672 virtual void dxfOutFields_R12(
673 OdDbDxfFiler* pFiler) const;
674
675 OdResult subGetClassID(void* pClsid) const;
676
678 OdGiDrawableTraits* pTraits) const;
679
681 OdGiWorldDraw* pWd) const;
682
684 OdGiViewportDraw* pVd) const;
685
686 /* Replace OdRxObjectPtrArray */
687
689 OdRxObjectPtrArray& entitySet) const ODRX_OVERRIDE;
690
691 void subClose();
692
693 virtual void modified (
694 const OdDbObject* pObject);
695
705 const OdGeMatrix3d& xfm) ODRX_OVERRIDE;
706
715 const OdGeMatrix3d& xfm,
716 OdDbEntityPtr& pCopy) const ODRX_OVERRIDE;
717
736 OdDbDatabase *pDb,
737 bool doSubents);
738
739 virtual void appendToOwner(
740 OdDbIdPair& idPair,
741 OdDbObject* pOwnerObject,
742 OdDbIdMapping& ownerIdMap) ODRX_OVERRIDE;
743
744 virtual OdDbObjectPtr subWblockClone(OdDbIdMapping& ownerIdMap, OdDbObject*, bool bPrimary) const ODRX_OVERRIDE;
745
758 OdString& formattedMeasurement,
759 double measurementValue,
760 const OdString& dimensionText);
761
769
776
777 /*
778 void generateLayout();
779 void getOsnapPoints(OdDb::OsnapMode osnapMode, const OdDbFullSubentPath& subentId,
780 const OdGePoint3d& pickPoint, const OdGePoint3d& lastPoint,
781 const OdGeMatrix3d& viewXform, OdGePoint3dArray& snapPoints,
782 OdDbIntArray& geomIds ) const;
783 */
784
786
787 // Dynamic dimensions support
788 // (The methods are NOT related to constraint support)
789
795 bool isDynamicDimension() const;
796
803 bool bDynamic);
804
805 // Dimensional constraint support
806
812 virtual bool isConstraintObject() const;
813
818 bool& isConstraintObject,
819 bool& hasExpression,
820 bool& isReferenceConstraint) const;
821
828
836 bool bDynamic);
837
844
851 bool bShouldParticipate);
852
860 void setDIMTALN(bool val);
861
869 bool getDIMTALN() const;
870
875
881 void fieldToMText(OdDbMTextPtr& pDimMText);
882
888 void fieldFromMText(OdDbMTextPtr& pDimMText);
889
894
899
907 double width,
908 double height);
909
917 double& width,
918 double& height) const;
919
927};
928
933
935
943{
944public:
951 static void setMeasurementValue(OdDbDimension* pDimension, double measurementValue);
962 static void resetDimBlockInsertParams(OdDbDimension* pDimension);
963
964 //DOM-IGNORE-BEGIN
966 //DOM-IGNORE-END
967
973 virtual void recomputeDimMeasurement(OdDbDimension* pDimension) = 0;
974
985
986
999 virtual void formatMeasurement(OdDbDimension* pDimension, OdString& formattedMeasurement,
1000 double measurementValue, const OdString& dimensionText ) = 0;
1001};
1002
1007
1008#include "TD_PackPop.h"
1009
1010#endif
1011
OdSmartPtr< OdDbDimension > OdDbDimensionPtr
Definition: DbDimension.h:932
OdSmartPtr< OdDbDimensionRecomputePE > OdDbDimensionRecomputePEPtr
Definition: DbDimension.h:1006
OdSmartPtr< OdDbDimStyleTableRecord > OdDbDimStyleTableRecordPtr
Definition: DbDimension.h:41
#define DBDIM_EXPORT
Definition: DbExport.h:72
unsigned int OdUInt32
unsigned short OdUInt16
#define ODRX_OVERRIDE
OdResult
Definition: OdResult.h:29
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)
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)
virtual bool isConstraintObject() const
OdResult subGetGeomExtents(OdGeExtents3d &extents) const
void setDimstyleData(OdDbObjectId dimstyleID)
void fieldToMText(OdDbMTextPtr &pDimMText)
OdDbObjectId dimBlockId() const
void setDimBlockPosition(const OdGePoint3d &dimBlockPosition)
DWGMAP_DECLARE_MEMBERS(OdDbDimension)
virtual bool isPlanar() const
Definition: DbDimension.h:117
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:250
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