A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile. More...
#include <DgnModelRef.h>
Public Member Functions | |
StatusInt | CreateDgnAttachment (DgnAttachmentP &attachment, DgnDocumentMonikerR moniker, WCharCP modelName, bool loadCache=true) |
Attach the specified model in the specified file to this model. More... | |
StatusInt | DeleteDgnAttachment (DgnAttachmentP &attachment) |
Remove the specified attachment from this model. More... | |
DgnAttachmentArrayP | GetDgnAttachmentsP () const |
Get the attachments contained in this model. More... | |
DgnAttachmentArrayCP | GetDgnAttachmentsCP () const |
Get the attachments contained in this model. More... | |
ReachableModelRefCollection | GetReachableModelRefs (ReachableModelRefOptionsP=0) |
Get an iterable collection of modelRefs that includes 'this' modelRef, its attachments and all nested attachments. More... | |
ReachableElementCollection | GetReachableElements (ReachableElementOptionsP=0) |
Get an iterable collection of elements reachable from this modelRef. More... | |
DgnAttachmentP | FindDgnAttachmentByElementId (ElementId attachmentID) |
Gets the Bentley::DgnPlatform::DgnAttachment structure that for a reference given the element ID of its attachment element. More... | |
StatusInt | ReadAndLoadDgnAttachments (DgnAttachmentLoadOptions const &) |
Detects attachments in this model, creates a Bentley::DgnPlatform::DgnAttachment for each, and then loads the attached models. More... | |
DgnModelRefP | GetParentModelRefP () const |
Query the parent of an attachment, if any. More... | |
DgnModelP | GetDgnModelP () const |
Get the model that is the target of this reference. More... | |
DgnFileP | GetDgnFileP () const |
Get the file that this references. More... | |
ModelInfoCP | GetModelInfoCP () const |
Get information about this model that this references. More... | |
bool | IsDgnAttachment () const |
Query if this is a Bentley::DgnPlatform::DgnAttachment. This function is equivalent to testing the result of AsDgnAttachmentCP. More... | |
bool | IsDirectDgnAttachment () const |
Query if this is a Bentley::DgnPlatform::DgnAttachment that is itself a direct attachment. More... | |
bool | IsNestedDgnAttachment () const |
Query if this is a Bentley::DgnPlatform::DgnAttachment that is itself an attachment owned by another DgnAttachment. More... | |
bool | IsDwgStyleAttachment () const |
Query if this is a Bentley::DgnPlatform::DgnAttachment that is a DWG style attachment. More... | |
bool | IsDefault () const |
Query if this references the default model in its file. More... | |
DgnModelRefType | GetModelRefType () const |
Query if this model is an attachment and if so what type of attachment. More... | |
DgnModelCP | AsDgnModelCP () const |
Cast this to a DgnModel. More... | |
DgnModelP | AsDgnModelP () |
Cast this to a DgnModel. More... | |
DgnAttachmentCP | AsDgnAttachmentCP () const |
Cast this to a Bentley::DgnPlatform::DgnAttachment. More... | |
DgnAttachmentP | AsDgnAttachmentP () |
Cast this to a Bentley::DgnPlatform::DgnAttachment. More... | |
LevelCacheR | GetLevelCacheR () |
Get the level cache for this model reference. More... | |
LevelCacheCR | GetLevelCache () const |
Get the level cache for this model reference. More... | |
FileLevelCacheP | GetFileLevelCacheP () |
Get the level cache for the file containing this model. More... | |
FileLevelCacheCP | GetFileLevelCacheCP () const |
Get the level cache for the file containing this model. More... | |
bool | Is3d () const |
Query if this is a 3D model. More... | |
bool | TreatAs3d () const |
Query if this model should be treated as a 3D model for user interface purposes. It is true if the model is 3D and not a sheet model. More... | |
DgnFileP | GetSymbologySourceDgnFileP () const |
Get the source file for this modelRef. This is the same as GetDgnFile unless the modelRef is a DgnAttachment that is being displayed by proxy (CVE) - in this case the symbology source will be the root. More... | |
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
A DgnModelRef may be a direct reference to a model (a DgnModel) or an indirect reference to a model (a Bentley::DgnPlatform::DgnAttachment). This base class defines functions that are common to both models and attachments.
GetDgnAttachmentsP returns an iterable collection of directly attached Bentley::DgnPlatform::DgnAttachment objects. GetReachableModelRefs returns an iterable collection of modelRefs that include 'this' modelRef, its attachments, their attachments, etc.
DgnAttachmentCP AsDgnAttachmentCP | ( | ) | const |
Cast this to a Bentley::DgnPlatform::DgnAttachment.
DgnAttachmentP AsDgnAttachmentP | ( | ) |
Cast this to a Bentley::DgnPlatform::DgnAttachment.
This function differs from AsDgnAttachmentCP in that it returns a non-const pointer.
DgnModelCP AsDgnModelCP | ( | ) | const |
Cast this to a DgnModel.
DgnModelP AsDgnModelP | ( | ) |
StatusInt CreateDgnAttachment | ( | DgnAttachmentP & | attachment, |
DgnDocumentMonikerR | moniker, | ||
WCharCP | modelName, | ||
bool | loadCache = true |
||
) |
Attach the specified model in the specified file to this model.
This creates a new Bentley::DgnPlatform::DgnAttachment.
[out] | attachment | newly created attachment |
[in] | moniker | Identifies the document to be referenced |
[in] | modelName | The model within the target file to be referenced |
[in] | loadCache | True to load the dgnModel. |
StatusInt DeleteDgnAttachment | ( | DgnAttachmentP & | attachment | ) |
Remove the specified attachment from this model.
This deletes the Bentley::DgnPlatform::DgnAttachment.
[in,out] | attachment | The attachment to be removed. Freed and set to NULL. |
DgnAttachmentP FindDgnAttachmentByElementId | ( | ElementId | attachmentID | ) |
Gets the Bentley::DgnPlatform::DgnAttachment structure that for a reference given the element ID of its attachment element.
[in] | attachmentID | The element id of the attachment element |
DgnAttachmentArrayCP GetDgnAttachmentsCP | ( | ) | const |
Get the attachments contained in this model.
DgnAttachmentArrayP GetDgnAttachmentsP | ( | ) | const |
Get the attachments contained in this model.
DgnFileP GetDgnFileP | ( | ) | const |
Get the file that this references.
Referenced by DgnFontManager::GetDgnFontMapP(), DgnFontManager::GetFontByNumber(), and DgnFontManager::ResolveFontNum().
DgnModelP GetDgnModelP | ( | ) | const |
Get the model that is the target of this reference.
FileLevelCacheCP GetFileLevelCacheCP | ( | ) | const |
Get the level cache for the file containing this model.
FileLevelCacheP GetFileLevelCacheP | ( | ) |
Get the level cache for the file containing this model.
LevelCacheCR GetLevelCache | ( | ) | const |
Get the level cache for this model reference.
LevelCacheR GetLevelCacheR | ( | ) |
Get the level cache for this model reference.
ModelInfoCP GetModelInfoCP | ( | ) | const |
Get information about this model that this references.
DgnModelRefType GetModelRefType | ( | ) | const |
Query if this model is an attachment and if so what type of attachment.
DgnModelRefP GetParentModelRefP | ( | ) | const |
Query the parent of an attachment, if any.
ReachableElementCollection GetReachableElements | ( | ReachableElementOptionsP | = 0 | ) |
Get an iterable collection of elements reachable from this modelRef.
The reachable set includes all elements in this model as well as all elements in models attached to this model, including nested attachments.
ReachableModelRefCollection GetReachableModelRefs | ( | ReachableModelRefOptionsP | = 0 | ) |
Get an iterable collection of modelRefs that includes 'this' modelRef, its attachments and all nested attachments.
The returned modelRefs can refer to missing attachments, so a NULL check is required to determine if each modelRef refers to an actual model.
DgnFileP GetSymbologySourceDgnFileP | ( | ) | const |
Get the source file for this modelRef. This is the same as GetDgnFile unless the modelRef is a DgnAttachment that is being displayed by proxy (CVE) - in this case the symbology source will be the root.
bool Is3d | ( | ) | const |
Query if this is a 3D model.
bool IsDefault | ( | ) | const |
Query if this references the default model in its file.
bool IsDgnAttachment | ( | ) | const |
Query if this is a Bentley::DgnPlatform::DgnAttachment. This function is equivalent to testing the result of AsDgnAttachmentCP.
bool IsDirectDgnAttachment | ( | ) | const |
Query if this is a Bentley::DgnPlatform::DgnAttachment that is itself a direct attachment.
bool IsDwgStyleAttachment | ( | ) | const |
Query if this is a Bentley::DgnPlatform::DgnAttachment that is a DWG style attachment.
bool IsNestedDgnAttachment | ( | ) | const |
Query if this is a Bentley::DgnPlatform::DgnAttachment that is itself an attachment owned by another DgnAttachment.
StatusInt ReadAndLoadDgnAttachments | ( | DgnAttachmentLoadOptions const & | ) |
Detects attachments in this model, creates a Bentley::DgnPlatform::DgnAttachment for each, and then loads the attached models.
This operation is then applied recursively to attachments of the attached models. This function returns immediately if the attachments of this model have already been loaded. Loads Dgn attachments
bool TreatAs3d | ( | ) | const |
Query if this model should be treated as a 3D model for user interface purposes. It is true if the model is 3D and not a sheet model.