Macros | Functions
msdgnmodelref.fdf File Reference
#include "mstypes.h"
#include "msmodel.h"
#include "msdgnfileobj.h"
#include <DgnPlatform\ModelAccess.h>

Macros

#define ANY_VIEW   (-1)
 This file contains the public functions that deal with "DgnModelRefP"s. More...
 
#define mdlModelRef_isValid(p)   ((p) != INVALID_MODELREF)
 

Functions

int mdlModelRefList_find (DgnModelRefListP modelRefList, DgnModelRefP entry)
 Gets the index of the specified modelRef in the list. More...
 
bool mdlModelRefList_isFound (DgnModelRefListP modelRefList, DgnModelRefP entry)
 Determines whether the specified modelRef is a member of the list. More...
 
bool mdlModelRef_inMasterFile (DgnModelRefP modelRef)
 Determines whether the specified modelRef is contained in the master file. More...
 
bool mdlModelRef_isActiveModel (DgnModelRefCP modelRef)
 Determines whether the specified modelRef is the active model. More...
 
bool mdlModelRef_isReference (DgnModelRefCP modelRef)
 Determines whether the specified modelRef is a reference model. More...
 
DgnModelRefP mdlModelRef_getParent (DgnModelRefCP modelRef)
 Gets the DgnModelRefP for the model that is the parent of the specified modelRef. More...
 
bool mdlModelRef_isNestedReference (DgnModelRefP modelRef)
 Determines whether the specified reference model is attached to another reference model. More...
 
bool mdlModelRef_isReadOnly (DgnModelRefP modelRef)
 Determines whether a modelRef is read-only. More...
 
bool mdlModelRef_areSame (DgnModelRefP modelRef1, DgnModelRefP modelRef2)
 Determines whether two specified modelRefs are actually the same. More...
 
StatusInt mdlModelRef_getFileName (DgnModelRefP modelRef, WCharP fileName, int fileNameBufSize)
 Gets the name of the file that contains the data for the specified model. More...
 
bool mdlModelRef_isDisplayedInView (DgnModelRefP modelRef, int viewIndex)
 Determines whether the specified DgnPlatform::DgnModelRef is displayed in the specified view. More...
 
int mdlModelRef_getViewMask (DgnModelRefP modelRef)
 Gets a bitmask representing the views that display the specified modelRef. More...
 
StatusInt mdlModelRef_deleteModel (DgnModelRefP modelRef, bool deleteElements)
 Deletes the specified model from the file that contains it. More...
 
StatusInt mdlModelRef_activateAndDisplay (DgnModelRefP newModelRef)
 Activates and displays the specified modelRef. More...
 
StatusInt mdlModelRef_createWorking (DgnModelRefP *dgnModelRefP, DgnFileP dgnFileP, DgnPlatform::ModelId modelID, bool fillCache, bool loadRefs)
 Creates a "working" DgnModelRefP that can be passed to functions that take DgnModelRefP arguments. More...
 
StatusInt mdlModelRef_createCacheSpecificWorking (DgnModelRefP *dgnModelRefP, DgnFileP dgnFileP, DgnPlatform::ModelId modelID, bool fillCache, bool loadRefs, bool includeUndisplayedRefs, DgnPlatform::DgnModelSections sectionsToFill)
 Creates a "working" DgnModelRefP containing the specified cache sections that can be passed to functions that take DgnModelRefP arguments. More...
 
StatusInt mdlModelRef_createWorkingByName (DgnModelRefP *dgnModelRefP, DgnFileP dgnFileP, const WChar *modelNameP, bool fillCache, bool loadRefs)
 Creates a "working" DgnModelRefP that can be passed to functions that take DgnModelRefP arguments. More...
 
StatusInt mdlModelRef_freeWorking (DgnModelRefP modelRef)
 Frees modelRef's created using mdlModelRef_createWorking or mdlModelRef_createWorkingByName. More...
 
void mdlModelRef_setDefaultBackgroundColor (DgnModelRefP modelRefP)
 Sets the model background color to the default value for that model type. More...
 
StatusInt mdlModelRef_getRange (DgnModelRefP modelRef, DRange3dP pRange, int viewIndex, TransformP transformP, bool includeChildren)
 Gets the range for the specified modelRef. More...
 
StatusInt mdlModelRef_getDisplayName (DgnModelRefP modelRef, WCharP displayName, unsigned int maxChars, WCharCP separator)
 Gets the string that MicroStation uses to display the name of the modelRef in its user interface. More...
 
StatusInt mdlModelRef_checkAllRightsIfDisplayed (DgnModelRefP modelRef, UInt32 rights, int view, MessageDestination displayError)
 Check if the specified rights are granted to the current user for the given model and all references that are displayed in the selected view(s). More...
 
StatusInt mdlModelRef_checkAllRights (DgnModelRefP modelRef, UInt32 rights, MessageDestination displayError)
 Check if the specified rights are granted to the current user for the given model and all references. More...
 
StatusInt mdlModelRef_checkAllRightsIncludingProtectedRefs (DgnModelRefP modelRef, UInt32 rights, MessageDestination displayError)
 Check if the specified rights are granted to the current user for the given model and all references, including the references that could not be opened because the user lacked viewing access. More...
 
StatusInt mdlModelRef_copyModel (DgnModelRefP *returnDestModelRef, DgnModelRefP sourceModelRef, DgnFileP destFile, const WChar *pDestModelName, const WChar *pDestModelDescr)
 Copy a model from one location to another. More...
 
DgnModelP mdlModelRef_getDgnModel (DgnModelRefP modelRef)
 Gets a pointer to the DgnModel that holds elements in the model. More...
 
DgnFileP mdlModelRef_getDgnFile (DgnModelRefCP modelRef)
 Gets the DgnFileObj that contains the specified modelRef. More...
 
StatusInt mdlModelRef_getUorScaleBetweenModels (double *pUorFactor, DgnModelRefCP srcModelRef, DgnModelRefCP dstModelRef)
 Gets the scale factor between the UORs of two models. More...
 
StatusInt mdlModelRef_loadReferenceModels (DgnModelRefP modelRef, bool loadCache, bool loadRasterRefs, bool loadUndisplayedRefs)
 Loads the reference models attached to the specified modelRef. More...
 
UInt32 mdlModelRef_getEof (DgnModelRefP modelRef)
 Gets the EOF (end-of-file) file position for the specified model. More...
 
DgnPlatform::ElementId mdlModelRef_getAttachmentID (DgnModelRefCP modelRef)
 Gets the element ID of the Reference Attachment element for the specified modelRef. More...
 
bool mdlModelRef_isEmpty (DgnModelRefP modelRef)
 Determines whether the specified model is empty. More...
 
int mdlModelRef_getChildCount (DgnModelRefCP modelRef, int childTypeMask)
 Gets the count of models of the specified type that are attached to the specified model. More...
 
ElementRefP mdlModelRef_getElementRef (DgnModelRefP modelRef, UInt32 filePos)
 Gets an ElementRefP given a DgnModelRefP and a filePos. More...
 
bool mdlModelRef_is3D (DgnModelRefCP modelRef)
 Determine whether the specified model is three dimensional. More...
 
bool mdlModelRef_isTransient (DgnModelRefP modelRef)
 Determines whether the specified modelRef is the transient model. More...
 
bool mdlModelRef_isSheet (DgnModelRefCP modelRef)
 Determines whether the specified model is a sheet model. More...
 
DgnPlatform::DgnModelType mdlModelRef_getModelType (DgnModelRefCP modelRef)
 Gets the type of a model. More...
 
bool mdlModelRef_isDefault (DgnModelRefCP modelRef)
 Determines whether the specified model is set as the "default" model. More...
 
int mdlModelRefList_create (DgnModelRefListP *modelRefListP)
 Creates a new DgnModelRefListP. More...
 
int mdlModelRefList_free (DgnModelRefListP *modelRefListP)
 Frees a DgnModelRefListP. More...
 
int mdlModelRefList_add (DgnModelRefListP modelRefList, DgnModelRefP entry)
 Adds a modelRef to the specified list . More...
 
void mdlModelRefList_insert (DgnModelRefListP modelRefList, int insertBefore, DgnModelRefP entry)
 Inserts a modelRef in the specified list at the specified index. More...
 
StatusInt mdlModelRefList_remove (DgnModelRefListP modelRefList, DgnModelRefP entry)
 Removes a modelRef from the specified list. More...
 
void mdlModelRefList_empty (DgnModelRefListP modelRefList)
 Removes all modelRefs from the specified list. More...
 
void mdlModelRefList_copyContents (DgnModelRefListP modelRefList, DgnModelRefListP srcModelRefList)
 Copies all modelRefs from one list to another. More...
 
DgnModelRefListP mdlModelRefList_clone (DgnModelRefListP modelRefList)
 Duplicates the specified list. More...
 
int mdlModelRefList_getCount (DgnModelRefListP modelRefListP)
 Gets the number of modelRefs that are in the specified list. More...
 
DgnModelRefP mdlModelRefList_get (DgnModelRefListP modelRefList, int index)
 Gets the modelRef at the specified index in the list. More...
 
bool mdlActiveModel_is3d ()
 
bool mdlActiveModel_isReadonly ()
 
StatusInt mdlModelRefIterator_create (ModelRefIteratorP *mrIteratorP, DgnModelRefCP rootModelRef, int iteratorType, int depth)
 Creates a ModelRefIterator. More...
 
StatusInt mdlModelRefIterator_free (ModelRefIteratorP *mrIteratorP)
 Frees a ModelRefIterator. More...
 
DgnModelRefP mdlModelRefIterator_getFirst (ModelRefIteratorP mrIterator)
 Resets the iterator to the beginning and gets the first modelRef item. More...
 
DgnModelRefP mdlModelRefIterator_getCurrent (ModelRefIteratorP mrIterator)
 Gets the current modelRef included in the specified iterator. More...
 
DgnModelRefP mdlModelRefIterator_getNext (ModelRefIteratorP mrIterator)
 Advances the position of the iterator to the next modelRef and returns the modelRef from that position. More...
 
DgnModelRefP mdlModelRef_getTransient ()
 Gets the transient modelRef. More...
 

Macro Definition Documentation

#define mdlModelRef_isValid (   p)    ((p) != INVALID_MODELREF)

Function Documentation

DgnPlatform::DgnModelType mdlModelRef_getModelType ( DgnModelRefCP  modelRef)

Gets the type of a model.

Parameters
[in]modelRefGet the property of the model referenced by this. See ~mmdlModelRef_setModelType for a list of values.
Returns
the model type or < 0 for ERROR. " "
int mdlModelRefList_add ( DgnModelRefListP  modelRefList,
DgnModelRefP  entry 
)

Adds a modelRef to the specified list .

Parameters
[in]modelRefListThe list to add the model to.
[in]entryThe model to add to the end of the list. If this is NULL the active model is added.
Returns
If successful, returns the index of the new newly added item in the list. Otherwise, ERROR (-1) is returned. " "
DgnModelRefListP mdlModelRefList_clone ( DgnModelRefListP  modelRefList)

Duplicates the specified list.

Parameters
[in]modelRefListThe modelRefList to duplicate.
Remarks
A list created with this function must be freed using ~mmdlModelRefList_free.
Returns
the duplicate modelRefList, unless the source modelRefList is invalid, then NULL. " "
void mdlModelRefList_copyContents ( DgnModelRefListP  modelRefList,
DgnModelRefListP  srcModelRefList 
)

Copies all modelRefs from one list to another.

The original modelRefs in the destination list are removed before the copy.

Parameters
[in,out]modelRefListThe destination list copied from srcModelRefList.
[in]srcModelRefListThe source list " "
int mdlModelRefList_create ( DgnModelRefListP *  modelRefListP)

Creates a new DgnModelRefListP.

Parameters
[out]modelRefListPA pointer to the list created.
Returns
SUCCESS
Remarks
For every call to this function, there should be a subsequent call to ~mmdlModelRefList_free to free the memory used. " "
void mdlModelRefList_empty ( DgnModelRefListP  modelRefList)

Removes all modelRefs from the specified list.

Parameters
[in]modelRefListThe list to empty.
See also
usmthmdlModelRefList_removeC " "
int mdlModelRefList_find ( DgnModelRefListP  modelRefList,
DgnModelRefP  entry 
)

Gets the index of the specified modelRef in the list.

Parameters
[in]modelRefListthe list to search for the modelRef.
[in]entrythe model to find in the list.
Returns
The index of the modelRef in the list if it is found; the value -1 if the entry isn't found.
See also
mdlModelRefList_getCount mdlModelRefList_get mdlModelRefList_isFound
int mdlModelRefList_free ( DgnModelRefListP *  modelRefListP)

Frees a DgnModelRefListP.

Parameters
[in]modelRefListPA pointer to the DgnModelRefListP to free. The contents of the pointer will be set to NULL by the function.
Returns
SUCCESS " "
DgnModelRefP mdlModelRefList_get ( DgnModelRefListP  modelRefList,
int  index 
)

Gets the modelRef at the specified index in the list.

Parameters
[in]modelRefListThe list to get the modelRef from.
[in]indexThe entry desired.
Returns
The modelRef at the given index, or NULL if the index is out of range. " "
int mdlModelRefList_getCount ( DgnModelRefListP  modelRefListP)

Gets the number of modelRefs that are in the specified list.

Parameters
[in]modelRefListPThe list to query.
Returns
The number of entries in the list. " "
void mdlModelRefList_insert ( DgnModelRefListP  modelRefList,
int  insertBefore,
DgnModelRefP  entry 
)

Inserts a modelRef in the specified list at the specified index.

Parameters
[in]modelRefListThe list to add the model to.
[in]insertBeforeThe index where entry should be inserted.
[in]entryThe model to insert into the list. If this is NULL, the active model is inserted. " "
bool mdlModelRefList_isFound ( DgnModelRefListP  modelRefList,
DgnModelRefP  entry 
)

Determines whether the specified modelRef is a member of the list.

Parameters
[in]modelRefListthe list to search.
[in]entrythe modelRef to find in the list.
Returns
true if the specified entry is found in the list.
See also
mdlModelRefList_find
StatusInt mdlModelRefList_remove ( DgnModelRefListP  modelRefList,
DgnModelRefP  entry 
)

Removes a modelRef from the specified list.

Parameters
[in]modelRefListThe list to remove the model from.
[in]entryThe model to remove from the list. If this is NULL the active model is removed.
Returns
SUCCESS if the entry was found in the list and removed successfully; otherwise, ERROR. " "

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.