CFx SDK Documentation  2022 SP0
Public Member Functions | Static Public Member Functions | List of all members
OdDbScale Class Reference

#include <DbScale.h>

Inheritance diagram for OdDbScale:
OdDbObject OdGiDrawable OdRxObject

Public Member Functions

 ODDB_DECLARE_MEMBERS (OdDbScale)
 
 OdDbScale ()
 
class OdString scaleName () const
 
void setScaleName (const OdString &sName)
 
double scale () const
 
double drawingUnits () const
 
void setDrawingUnits (double vUnits)
 
double paperUnits () const
 
void setPaperUnits (double vUnits)
 
bool isTemporaryScale () const
 
void setIsTemporaryScale (bool bStatus)
 
bool isUnitScale () const
 
void setIsUnitScale (bool bStatus)
 
void getXRefMangledName (OdString, OdString &, OdDbDatabase *)
 
virtual OdResult dwgInFields (OdDbDwgFiler *pFiler) ODRX_OVERRIDE
 
virtual void dwgOutFields (OdDbDwgFiler *pFiler) const ODRX_OVERRIDE
 
virtual OdResult dxfInFields (OdDbDxfFiler *pFiler) ODRX_OVERRIDE
 
virtual void dxfOutFields (OdDbDxfFiler *pFiler) const ODRX_OVERRIDE
 
virtual void appendToOwner (OdDbIdPair &idPair, OdDbObject *pOwnerObject, OdDbIdMapping &ownerIdMap) ODRX_OVERRIDE
 
virtual OdResult subErase (bool erasing) ODRX_OVERRIDE
 
virtual void applyPartialUndo (OdDbDwgFiler *pFiler, OdRxClass *pClass) ODRX_OVERRIDE
 
- Public Member Functions inherited from OdDbObject
 ODDB_DECLARE_MEMBERS (OdDbObject)
 
 ~OdDbObject ()
 
void addRef ()
 
void release ()
 
long numRefs () const
 
OdDbObjectId objectId () const
 
OdDbHandle getDbHandle () const
 
OdDbHandle handle () const
 
OdDbObjectId ownerId () const
 
virtual void setOwnerId (OdDbObjectId ownerId)
 
OdDbDatabasedatabase () const
 
void createExtensionDictionary ()
 
OdDbObjectId extensionDictionary () const
 
bool releaseExtensionDictionary ()
 
OdDbXrecordPtr createXrecord (const OdString &xrecordName, OdDb::DuplicateRecordCloning style=OdDb::kDrcIgnore)
 
void upgradeOpen ()
 
void downgradeOpen ()
 
void cancel ()
 
virtual OdResult subOpen (OdDb::OpenMode mode)
 
virtual void subClose ()
 
OdResult erase (bool eraseIt=true)
 
void handOverTo (OdDbObject *pNewObject, bool keepXData=true, bool keepExtDict=true)
 
virtual void subHandOverTo (OdDbObject *pNewObject)
 
void swapIdWith (OdDbObjectId otherId, bool swapXdata=false, bool swapExtDict=false)
 
virtual void subSwapIdWith (const OdDbObjectId &otherId, bool swapXdata=false, bool swapExtDict=false)
 
virtual void audit (OdDbAuditInfo *pAuditInfo)
 
void dwgIn (OdDbDwgFiler *pFiler)
 
void dwgOut (OdDbDwgFiler *pFiler) const
 
virtual OdResult dxfIn (OdDbDxfFiler *pFiler)
 
virtual void dxfOut (OdDbDxfFiler *pFiler) const
 
virtual OdResult dxfInFields_R12 (OdDbDxfFiler *pFiler)
 
virtual void dxfOutFields_R12 (OdDbDxfFiler *pFiler) const
 
virtual OdDb::DuplicateRecordCloning mergeStyle () const
 
virtual OdResBufPtr xData (const OdString &regappName=OdString::kEmpty) const
 
virtual void setXData (const OdResBuf *pRb)
 
bool isEraseStatusToggled () const
 
bool isErased () const
 
bool isReadEnabled () const
 
bool isWriteEnabled () const
 
bool isNotifyEnabled () const
 
bool isModified () const
 
bool isModifiedXData () const
 
bool isModifiedGraphics () const
 
bool isNewObject () const
 
bool isNotifying () const
 
bool isUndoing () const
 
bool isReallyClosing () const
 
bool isDBRO () const
 
void assertReadEnabled () const
 
void assertWriteEnabled (bool autoUndo=true, bool recordModified=true)
 
void assertNotifyEnabled () const
 
void disableUndoRecording (bool disable)
 
bool isUndoRecordingDisabled () const
 
OdDbDwgFilerundoFiler ()
 
void addReactor (OdDbObjectReactor *pReactor) const
 
void removeReactor (OdDbObjectReactor *pReactor) const
 
virtual void addPersistentReactor (const OdDbObjectId &objId)
 
virtual void removePersistentReactor (const OdDbObjectId &objId)
 
bool hasPersistentReactor (const OdDbObjectId &objId) const
 
OdDbObjectIdArray getPersistentReactors () const
 
OdDbObjectReactorArray getTransientReactors () const
 
virtual void recvPropagateModify (const OdDbObject *pSubObj)
 
virtual void xmitPropagateModify () const
 
ODRX_SEALED_VIRTUAL OdDbObjectPtr deepClone (OdDbIdMapping &ownerIdMap, OdDbObject *pOwner, bool bPrimary=true) const ODRX_SEALED
 
ODRX_SEALED_VIRTUAL OdDbObjectPtr wblockClone (OdDbIdMapping &ownerIdMap, OdDbObject *pOwner, bool bPrimary=true) const ODRX_SEALED
 
void setOdDbObjectIdsInFlux ()
 
bool isOdDbObjectIdsInFlux () const
 
virtual void copied (const OdDbObject *pObject, const OdDbObject *pNewObject)
 
virtual void erased (const OdDbObject *pObject, bool erasing=true)
 
virtual void goodbye (const OdDbObject *pObject)
 
virtual void openedForModify (const OdDbObject *pObject)
 
virtual void modified (const OdDbObject *pObject)
 
virtual void subObjModified (const OdDbObject *pObject, const OdDbObject *pSubObj)
 
virtual void modifyUndone (const OdDbObject *pObject)
 
virtual void modifiedXData (const OdDbObject *pObject)
 
virtual void unappended (const OdDbObject *pObject)
 
virtual void reappended (const OdDbObject *pObject)
 
bool isAProxy () const
 
virtual void objectClosed (const OdDbObjectId &objectId)
 
virtual void modifiedGraphics (const OdDbObject *pObject)
 
virtual void copyFrom (const OdRxObject *pSource)
 
bool hasSaveVersionOverride () const
 
void setHasSaveVersionOverride (bool hasSaveVersionOverride)
 
virtual OdDb::DwgVersion getObjectSaveVersion (const OdDbFiler *pFiler, OdDb::MaintReleaseVer *pMaintVer=0) const
 
virtual OdDbObjectPtr decomposeForSave (OdDb::DwgVersion ver, OdDbObjectId &replaceId, bool &exchangeXData)
 
virtual OdDbObjectPtr decomposeForSave (OdDb::SaveType format, OdDb::DwgVersion ver, OdDbObjectId &replaceId, bool &exchangeXData)
 
void convertForSave (OdDb::DwgVersion ver)
 
virtual void composeForLoad (OdDb::SaveType format, OdDb::DwgVersion version, OdDbAuditInfo *pAuditInfo)
 
virtual OdGiDrawabledrawable ()
 
virtual OdUInt32 subSetAttributes (OdGiDrawableTraits *pTraits) const
 
virtual bool subWorldDraw (OdGiWorldDraw *pWd) const
 
virtual void subViewportDraw (OdGiViewportDraw *pVd) const
 
virtual bool isPersistent () const
 
virtual OdDbStub * id () const
 
ODRX_SEALED_VIRTUAL OdResult getClassID (void *pClsid) const ODRX_SEALED
 
void setGsNode (OdGsCache *pNode)
 
OdGsCachegsNode () const
 
void xDataTransformBy (const OdGeMatrix3d &xfm)
 
bool hasFields () const
 
OdDbObjectId getField (const OdString &fieldName) const
 
OdDbObjectPtr getField (const OdString &fieldName, OdDb::OpenMode mode) const
 
virtual OdDbObjectId setField (const OdString &fieldName, OdDbField *pField)
 
virtual OdResult removeField (OdDbObjectId fieldId)
 
virtual OdDbObjectId removeField (const OdString &fieldName)
 
OdDbObjectId getFieldDictionary () const
 
OdDbObjectPtr getFieldDictionary (OdDb::OpenMode mode) const
 
virtual OdRxClasssaveAsClass (OdRxClass *pClass) const
 
- Public Member Functions inherited from OdGiDrawable
 ODRX_DECLARE_MEMBERS (OdGiDrawable)
 
virtual DrawableType drawableType () const
 
ODRX_SEALED_VIRTUAL OdUInt32 setAttributes (OdGiDrawableTraits *pTraits) const ODRX_SEALED
 
ODRX_SEALED_VIRTUAL bool worldDraw (OdGiWorldDraw *pWd) const ODRX_SEALED
 
ODRX_SEALED_VIRTUAL void viewportDraw (OdGiViewportDraw *pVd) const ODRX_SEALED
 
ODRX_SEALED_VIRTUAL OdUInt32 viewportDrawLogicalFlags (OdGiViewportDraw *pVd) const ODRX_SEALED
 
virtual OdResult getGeomExtents (OdGeExtents3d &extents) const
 
ODRX_SEALED_VIRTUAL OdUInt32 regenSupportFlags () const ODRX_SEALED
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Static Public Member Functions

static bool nameExists (const OdString &, OdString *, OdDbDatabase *)
 
- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Additional Inherited Members

- Public Types inherited from OdGiDrawable
enum  SetAttributesFlags {
  kDrawableNone = 0 , kDrawableIsAnEntity = 1 , kDrawableUsesNesting = 2 , kDrawableIsCompoundObject = 4 ,
  kDrawableViewIndependentViewportDraw = 8 , kDrawableIsInvisible = 16 , kDrawableHasAttributes = 32 , kDrawableRegenTypeDependantGeometry = 64 ,
  kDrawableIsDimension = (kDrawableIsAnEntity + kDrawableIsCompoundObject + 128) , kDrawableRegenDraw = 256 , kDrawableStandardDisplaySingleLOD = 512 , kDrawableShadedDisplaySingleLOD = 1024 ,
  kDrawableViewDependentViewportDraw = 2048 , kDrawableBlockDependentViewportDraw = 4096 , kDrawableIsExternalReference = 8192 , kDrawableNotPlottable = 16384 ,
  kLastFlag = kDrawableNotPlottable
}
 
enum  DrawableType {
  kGeometry = 0 , kDistantLight = 1 , kPointLight = 2 , kSpotLight = 3 ,
  kAmbientLight , kSolidBackground , kGradientBackground , kImageBackground ,
  kGroundPlaneBackground , kViewport , kWebLight , kSkyBackground ,
  kImageBasedLightingBackground
}
 
- Protected Member Functions inherited from OdDbObject
 OdDbObject ()
 
virtual OdResult subGetClassID (void *pClsid) const
 
virtual OdDbObjectPtr subDeepClone (OdDbIdMapping &ownerIdMap, OdDbObject *pOwner, bool bPrimary) const
 
virtual OdDbObjectPtr subWblockClone (OdDbIdMapping &ownerIdMap, OdDbObject *pOwner, bool bPrimary) const
 
- Protected Member Functions inherited from OdGiDrawable
 OdGiDrawable ()
 
virtual OdUInt32 subViewportDrawLogicalFlags (OdGiViewportDraw *vd) const
 
virtual OdUInt32 subRegenSupportFlags () const
 
- Protected Attributes inherited from OdDbObject
OdDbObjectImplm_pImpl
 

Detailed Description

<group OdDb_Classes>

This class implements the scale object that stores information about an annotation scale as an element of the database container. The database stores the scale instances in the dictionary and associates the object ID with an each scale instance. The scale dictionary is accessed from the database object using the getScaleListDictionaryId() method. The root drawing dictionary, associates the "ACAD_SCALELIST" name with the scale dictionary.

Remarks
This class is intended for stand-alone applications only. TXSDK developers cannot use it.
See also
TD_Db
<link db_scale_sample_object.html, Example of Working with the Scale Object>

<link db_scale_sample_dictionary.html, Example of Working with the Scale Dictionary Object>

See also
<link db_scale.html, Working with Scales>

OdDbAnnotationScale class

Definition at line 54 of file DbScale.h.

Constructor & Destructor Documentation

◆ OdDbScale()

OdDbScale::OdDbScale ( )

Builds an instance of the scale object.

Remarks
Use the static pseudo-constructor instead it. See: <link db_scale_manipulate.html, Manipulating Objects of the Scale Dictionary>

Member Function Documentation

◆ appendToOwner()

virtual void OdDbScale::appendToOwner ( OdDbIdPair idPair,
OdDbObject pOwnerObject,
OdDbIdMapping ownerIdMap 
)
virtual

This function appends this object to the specified owner object.

Parameters
idPair[in] ID pair to append.
pOwnerObject[in] Pointer to the owner object.
ownerIdMap[in/out] Owner's ID map.
Remarks
Adds a record to the specified ID map.

This function is used internally to subDeepClone() and subWblockClone().

Throws:

Cause eInvalidOwnerObject !pOwnerObject->get()

Reimplemented from OdDbObject.

◆ applyPartialUndo()

virtual void OdDbScale::applyPartialUndo ( OdDbDwgFiler pUndoFiler,
OdRxClass pClassObj 
)
virtual

Notification function called each time an Undo operation is performed this object is using partial Undo.

Parameters
pUndoFiler[in] A pointer to the undo filer with the partial undo information.
pClassObj[in] A pointer to the OdRxClass object for the class that will handle the Undo.
Remarks
An object indicates it's using the partial undo mechanism, if and only if it has set autoUndo false in all calls to assertWriteEnabled().

This member function must know which types of fields to scan, and must stop after reading what it it needs.

If the class type specified by pClassObj does not matches the class of this object, this member function must call the parent class's applyPartialUndo() and return whatever it returns.

If it does match the class of this object, this member function must use pUndoFiler to read the undo data, then typically use this object's set() method.

Throws:

Cause eNotThatKindOfClass pClassObj != OdDbObject::desc()

Reimplemented from OdDbObject.

◆ drawingUnits()

double OdDbScale::drawingUnits ( ) const

Returns the number of drawing units as a positive Double value.

See also
<link db_scale_sample_object.html, Example of Working with the Scale Object>
<link db_scale.html, Working with Scales>

OdDbScale::setDrawingUnits(), OdDbScale::paperUnits(), OdDbScale::scale() methods

◆ dwgInFields()

virtual OdResult OdDbScale::dwgInFields ( OdDbDwgFiler pFiler)
virtual

Reads the .dwg file data of this object.

Parameters
pFiler[in] Filer object from which data are read.
Returns
Returns the filer status.

This function is called by dwgIn() to allow the object to read its data.

When overriding this function:

1) Call assertWriteEnabled(). 2) Call the parent class's dwgInFields(pFiler). 3) If it returns eOK, continue; otherwise return whatever the parent's dwgInFields(pFiler) returned. 4) Call the OdDbDwgFiler(pFiler) methods to read each of the object's data items in the order they were written. 5) Return pFiler->filerStatus().

Reimplemented from OdDbObject.

◆ dwgOutFields()

virtual void OdDbScale::dwgOutFields ( OdDbDwgFiler pFiler) const
virtual

Writes the .dwg file data of this object.

Parameters
pFiler[in] Pointer to the filer to which data are written.
Remarks

This function is called by dwgIn() to allow the object to write its data.

When overriding this function:

1) Call assertReadEnabled(). 2) Call the parent class's dwgOutFields(pFiler). 3) Call the OdDbDwgFiler(pFiler) methods to write each of the object's data items in the order they were written.

Reimplemented from OdDbObject.

◆ dxfInFields()

virtual OdResult OdDbScale::dxfInFields ( OdDbDxfFiler pFiler)
virtual

Reads the DXF data of this object.

Parameters
pFiler[in] Pointer to the filer from which data are read.
Returns
Returns the filer status.

This function is called by dxfIn() to allow the object to read its data.

When overriding this function:

1) Call assertWriteEnabled(). 2) Call the parent class's dwgInFields(pFiler). 3) If it returns eOK, continue; otherwise return whatever the parent's dxfInFields(pFiler) returned. 4) Call the OdDbDxfFiler(pFiler) methods to read each of the object's data items in the order they were written. 5) Return pFiler->filerStatus().

Reimplemented from OdDbObject.

◆ dxfOutFields()

virtual void OdDbScale::dxfOutFields ( OdDbDxfFiler pFiler) const
virtual

Writes the DXF data of this object.

Parameters
pFiler[in] Pointer to the filer to which data are to be written.
Remarks

This function is called by dxfOut() to allow the object to write its data.

When overriding this function:

1) Call assertReadEnabled(). 2) Call the parent class's dxfOutFields(pFiler). 4) Use pFiler to call the OdDbDxfFiler methods to write each of the object's data items in the order they were written.

Reimplemented from OdDbObject.

◆ getXRefMangledName()

void OdDbScale::getXRefMangledName ( OdString  ,
OdString ,
OdDbDatabase  
)

DOM

For internal use only.

◆ isTemporaryScale()

bool OdDbScale::isTemporaryScale ( ) const

Determines whether the scale object is temporary stored in the database and returns True if the
scale is temporary or False if the scale is fixed.

Remarks
The temporary scale typically exists because attached XREF objects in the drawing have dependencies on scales that are not directly referenced by other objects in the drawing.
See also
<link db_scale_sample_object.html, Example of Working with the Scale Object>
<link db_scale.html, Working with Scales>

OdDbScale::setIsTemporaryScale() method

◆ isUnitScale()

bool OdDbScale::isUnitScale ( ) const

Determines whether the scale object is selected as one-to-one (1:1) by default and returns True if the scale is selected (1:1) by default or False if the scale is not the default.

See also
<link db_scale_sample_object.html, Example of Working with the Scale Object>
<link db_scale.html, Working with Scales>

OdDbScale::setIsUnitScale() method

◆ nameExists()

static bool OdDbScale::nameExists ( const OdString ,
OdString ,
OdDbDatabase  
)
static

DOM

For internal use only.

◆ ODDB_DECLARE_MEMBERS()

OdDbScale::ODDB_DECLARE_MEMBERS ( OdDbScale  )

◆ paperUnits()

double OdDbScale::paperUnits ( ) const

Returns the number of paper units as a positive Double value.

See also
<link db_scale_sample_object.html, Example of Working with the Scale Object>
<link db_scale.html, Working with Scales>

OdDbScale::setPaperUnits(), OdDbScale::drawingUnits(), OdDbScale::scale() methods

◆ scale()

double OdDbScale::scale ( ) const

Returns the scale factor as a positive Double value. This factor defines the ratio in which units of model space correlate to the units of paper space and indicates how many paper units fit to one drawing unit.

See also
<link db_scale_sample_object.html, Example of Working with the Scale Object>
<link db_scale.html, Working with Scales>

OdDbScale::paperUnits(), OdDbScale::drawingUnits() methods

◆ scaleName()

class OdString OdDbScale::scaleName ( ) const

Returns the internal scale name as a String value. This name is used as a comment for the ratio of paper units to drawing units when the scale object is displayed in a list.

See also
<link db_scale_sample_object.html, Example of Working with the Scale Object>
<link db_scale.html, Working with Scales>

OdDbScale::setScaleName() method

◆ setDrawingUnits()

void OdDbScale::setDrawingUnits ( double  vUnits)

Sets the number of drawing units as a positive Double value. The initial value is 1.0 by default.

Parameters
vUnits[in] value of drawing units.
See also
<link db_scale_sample_object.html, Example of Working with the Scale Object>
<link db_scale.html, Working with Scales>

OdDbScale::drawingUnits(), OdDbScale::setPaperUnits(), OdDbScale::scale() methods

◆ setIsTemporaryScale()

void OdDbScale::setIsTemporaryScale ( bool  bStatus)

Sets the scale temporary status as a Boolean value. The initial value is False by default.

Remarks
The temporary scale typically exists because attached XREF objects in the drawing have
dependencies on scales that are not directly referenced by other objects in the drawing.
Parameters
bStatus[in] True if the scale is temporary or False if the scale is fixed.
See also
<link db_scale_sample_object.html, Example of Working with the Scale Object>
<link db_scale.html, Working with Scales>

OdDbScale::isTemporaryScale() method

◆ setIsUnitScale()

void OdDbScale::setIsUnitScale ( bool  bStatus)

Sets the scale default status as a Boolean value. The initial value is False by default.

Parameters
bStatus[in] True if the scale is selected (1:1) by default or False if the scale is not the default.
See also
<link db_scale_sample_object.html, Example of Working with the Scale Object>
<link db_scale.html, Working with Scales>

OdDbScale::isUnitScale() method

◆ setPaperUnits()

void OdDbScale::setPaperUnits ( double  vUnits)

Sets the number of paper units as a positive Double value. The initial value is 1.0 by default.

Parameters
vUnits[in] value of paper units.
See also
<link db_scale_sample_object.html, Example of Working with the Scale Object>
<link db_scale.html, Working with Scales>

OdDbScale::paperUnits(), OdDbScale::setDrawingUnits(), OdDbScale::scale() methods

◆ setScaleName()

void OdDbScale::setScaleName ( const OdString sName)

Sets the internal scale name as a String value. This name is used as a comment for the ratio of paper units to drawing units when the scale object is displayed in a list. The initial value is an empty string by default.

Parameters
sName[in] Scale name as non-empty string.
See also
<link db_scale_sample_object.html, Example of Working with the Scale Object>
<link db_scale.html, Working with Scales>

OdDbScale::scaleName() method

◆ subErase()

virtual OdResult OdDbScale::subErase ( bool  erasing)
virtual

Called as the first operation as this object is being erased or unerased.

Parameters
erasing[in] A copy of the erasing argument passed to erase().
Remarks
This function is notified just before the current object is to be erased, giving this function the ability to cancel the erase.

Returns eOk if and only if erase() is to continue.

When overriding this function:

1) If the OdDbObject's state is incorrect, return something other than eOk.

2) If the parent class's subErase() returns anything other than eOk, immediately return it.

3) If other actions are required before erase, do them.

4) Return eOk.

If you must make changes to this object's state, either make them after step 2, or roll them back if step 2 returns other than eOk.

The default implementation of this function does nothing but return eOk. This function can be overridden in custom classes.

Reimplemented from OdDbObject.


The documentation for this class was generated from the following file: