CFx SDK Documentation  2020SP3
Public Types | Public Member Functions | Static Public Member Functions | List of all members
OdDbRasterImageDef Class Reference

#include <DbRasterImageDef.h>

Inheritance diagram for OdDbRasterImageDef:
OdDbObject OdGiDrawable OdRxObject

Public Types

enum  { kMaxSuggestNameSize = 2049 }
 
typedef OdGiRasterImage::Units Units
 
- 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
}
 

Public Member Functions

 ODDB_DECLARE_MEMBERS (OdDbRasterImageDef)
 
 OdDbRasterImageDef ()
 
OdResult subErase (bool erasing)
 
virtual void subHandOverTo (OdDbObject *pNewObject)
 
void subClose ()
 
OdResult dwgInFields (OdDbDwgFiler *pFiler)
 
void dwgOutFields (OdDbDwgFiler *pFiler) const
 
OdResult dxfInFields (OdDbDxfFiler *pFiler)
 
void dxfOutFields (OdDbDxfFiler *pFiler) const
 
OdResult setSourceFileName (const OdString &pathName)
 
OdString sourceFileName () const
 
virtual OdResult load (bool modifyDatabase=true)
 
virtual void unload (bool modifyDatabase=true)
 
virtual bool isLoaded () const
 
virtual OdGeVector2d size () const
 
virtual OdGeVector2d resolutionMMPerPixel () const
 
virtual OdResult setResolutionMMPerPixel (const OdGeVector2d &)
 
int entityCount (bool *pbLocked=NULL) const
 
void updateEntities () const
 
virtual OdGiRasterImage::Units resolutionUnits () const
 
virtual void setResolutionUnits (enum OdGiRasterImage::Units)
 
virtual OdGiRasterImagePtr image (bool load=true)
 
virtual void setImage (OdGiRasterImage *pImage, bool modifyDatabase=true)
 
OdString activeFileName () const
 
OdResult setActiveFileName (const OdString &pPathName)
 
- 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)
 
OdResult erase (bool eraseIt=true)
 
void handOverTo (OdDbObject *pNewObject, bool keepXData=true, bool keepExtDict=true)
 
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 ()
 
virtual void applyPartialUndo (OdDbDwgFiler *pUndoFiler, OdRxClass *pClassObj)
 
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
 
virtual void appendToOwner (OdDbIdPair &idPair, OdDbObject *pOwnerObject, OdDbIdMapping &ownerIdMap)
 
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 OdDbObjectId createImageDictionary (OdDbDatabase *pDb)
 
static OdDbObjectId imageDictionary (OdDbDatabase *pDb)
 
static OdString suggestName (const OdDbDictionary *pImageDictionary, const OdString &strFilePath, int nMaxLength=kMaxSuggestNameSize)
 
static int classVersion ()
 
- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Additional Inherited Members

- 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

This virtual base class defines raster image definition objects in an OdDbDatabase instance.

See also
TD_Db
Remarks
Raster image definitions (OdDbRasterImageDef objects) work with raster image (OdDbRasterImage) entities in much the same way that block table records (OdDbBlockTableRecord objects) work with block references (OdDbBlockReference entities).

<group OdDb_Classes>

Definition at line 56 of file DbRasterImageDef.h.

Member Typedef Documentation

◆ Units

Definition at line 61 of file DbRasterImageDef.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kMaxSuggestNameSize 

Definition at line 216 of file DbRasterImageDef.h.

Constructor & Destructor Documentation

◆ OdDbRasterImageDef()

OdDbRasterImageDef::OdDbRasterImageDef ( )

Member Function Documentation

◆ activeFileName()

OdString OdDbRasterImageDef::activeFileName ( ) const

Returns the actual file name of the raster image associated with this raster image definition object.

◆ classVersion()

static int OdDbRasterImageDef::classVersion ( )
static

DOM-IGNORE-BEGIN DOM-IGNORE-END

Returns the version of the raster image associated with this raster image definition object.

◆ createImageDictionary()

static OdDbObjectId OdDbRasterImageDef::createImageDictionary ( OdDbDatabase pDb)
static

Creates an image dictionary, if it is not already present, in the specified OdDbDatabase instance.

Parameters
pDb[in] Pointer to the database.
Returns
Returns the object ID of the image dictionary.

◆ dwgInFields()

OdResult OdDbRasterImageDef::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()

void OdDbRasterImageDef::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()

OdResult OdDbRasterImageDef::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()

void OdDbRasterImageDef::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.

◆ entityCount()

int OdDbRasterImageDef::entityCount ( bool *  pbLocked = NULL) const

Returns the number of raster images associated with this raster image definition object.

Parameters
pbLocked[in] If this value is not NULL, the value 'true' will be set at the pointer.

◆ image()

virtual OdGiRasterImagePtr OdDbRasterImageDef::image ( bool  load = true)
virtual

Returns the OdGiRasterImage object associated with this RasterImageDef object.

◆ imageDictionary()

static OdDbObjectId OdDbRasterImageDef::imageDictionary ( OdDbDatabase pDb)
static

Returns the object ID of the image dictionary in the specified OdDbDatabase instance.

Parameters
pDb[in] Pointer to the database.

◆ isLoaded()

virtual bool OdDbRasterImageDef::isLoaded ( ) const
virtual

Returns true if and only if the image file for this raster image definition object is loaded (DXF 280).

◆ load()

virtual OdResult OdDbRasterImageDef::load ( bool  modifyDatabase = true)
virtual

Loads the source image file for this raster image definition object.

Parameters
modifyDatabase[in] If and only if true, an undo recording will be done for this object.
Remarks
This function calls searchForActivePath() to determine the active path.

If the image file is currently loaded, the file will not be read.

"Lazy loading" implies that the image file will not be loaded until it is required.

◆ ODDB_DECLARE_MEMBERS()

OdDbRasterImageDef::ODDB_DECLARE_MEMBERS ( OdDbRasterImageDef  )

◆ resolutionMMPerPixel()

virtual OdGeVector2d OdDbRasterImageDef::resolutionMMPerPixel ( ) const
virtual

Returns the default physical pixel size, in mm/pixel, of the image for this raster image definition object (DXF 10).

Remarks
If the image has no default pixel size, this function returns 1.0/(image width in pixels) for XY resolutions.

◆ resolutionUnits()

virtual OdGiRasterImage::Units OdDbRasterImageDef::resolutionUnits ( ) const
virtual

Returns the resolution units for the image for this raster image definition object (DXF 281).

◆ setActiveFileName()

OdResult OdDbRasterImageDef::setActiveFileName ( const OdString pPathName)

Sets the actual file name of the raster image associated with this raster image definition object.

Parameters
pPathName[in] Input actual file name.

◆ setImage()

virtual void OdDbRasterImageDef::setImage ( OdGiRasterImage pImage,
bool  modifyDatabase = true 
)
virtual

Creates an image from the specified OdGiRasterImage object.

Parameters
pImage[in] Pointer to the RasterImage object.
modifyDatabase[in] If and only if true, marks the associated OdDbDatabase instance as modified.
Remarks
isLoaded() returns false if pImage is NULL. Otherwise, it returns true.

◆ setResolutionMMPerPixel()

virtual OdResult OdDbRasterImageDef::setResolutionMMPerPixel ( const OdGeVector2d )
virtual

Sets the default physical pixel size, in mm/pixel, of the image for this raster image definition object (DXF 10).

Remarks
Loading the actual image file resets this value if the image has a default pixel size.

◆ setResolutionUnits()

virtual void OdDbRasterImageDef::setResolutionUnits ( enum OdGiRasterImage::Units  )
virtual

Sets the resolution units for the image for this raster image definition object (DXF 281).

Remarks
Loading the actual image file resets this value.

◆ setSourceFileName()

OdResult OdDbRasterImageDef::setSourceFileName ( const OdString pathName)

Sets the name of the source file containing the raster image for this raster image definition object (DXF 1).

Parameters
pathName[in] Path name.

◆ size()

virtual OdGeVector2d OdDbRasterImageDef::size ( ) const
virtual

Returns the XY pixel size of the image for this raster image definition (DXF 10).

◆ sourceFileName()

OdString OdDbRasterImageDef::sourceFileName ( ) const

Returns the name of the source file containing the raster image for this raster image definition object (DXF 1).

Remarks
This function calls searchForActivePath() to determine the active path.
This RasterImageDef object must be open for reading.

◆ subClose()

void OdDbRasterImageDef::subClose ( )
virtual

Called as the first operation as this object is being closed, for database -resident objects only.

Remarks
This function is notified just before the current open operation is to be closed, giving this function the ability to perform necessary operatons.

When overriding this function:

1) If the OdDbObject's state is incorrect, throw exception.

2) Call parent class's subClose().

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

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

Reimplemented from OdDbObject.

◆ subErase()

OdResult OdDbRasterImageDef::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.

◆ subHandOverTo()

virtual void OdDbRasterImageDef::subHandOverTo ( OdDbObject pNewObject)
virtual

Called as the first operation of the handOverTo function.

Parameters
pNewObject[in] Pointer to the object with which to replace this object in the database.
Remarks
This function allows custom classes to populate the new object.
Overriding this function in a child class allows a child instance to be notified each time an object is handed over.

This function is notified just before an object is to be handed over; giving this function the ability to cancel the handover.

When overriding this function:

1) If the OdDbObject's state is incorrect, throw exception.

2) Call parent class's subHandover().

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

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

Reimplemented from OdDbObject.

◆ suggestName()

static OdString OdDbRasterImageDef::suggestName ( const OdDbDictionary pImageDictionary,
const OdString strFilePath,
int  nMaxLength = kMaxSuggestNameSize 
)
static

Modifies the original image filename to return a new image name suitable for an image dictionary.

Parameters
pImageDictionary[in] Pointer to the image dictionary.
strFilePath[in] New image file name.
nMaxLength[in] Max length of the name returned.

◆ unload()

virtual void OdDbRasterImageDef::unload ( bool  modifyDatabase = true)
virtual

Unloads the image for this raster image definition object.

Parameters
modifyDatabase[in] If and only if true, an undo recording will be done for this object.
Remarks
This RasterImageDef object must be open for writing.

◆ updateEntities()

void OdDbRasterImageDef::updateEntities ( ) const

Causes all raster images associated with this raster image definition object to be redrawn.

Remarks
Associated raster images will be redrawn after any modifications to this raster image definition object (e.g., load, unload, etc.).

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