An MSElementDescr holds a copy of a (potentially complex) MicroStation element. More...
Classes | |
struct | MSElementDescr |
Functions | |
static DGNPLATFORM_EXPORT MSElementDescrP | Allocate (MSElementCR element, DgnModelRefP modelRef=0, MSElementDescrP myHeader=0) |
Allocate a new MSElementDescr holding a copy of the supplied MSElement. More... | |
static DGNPLATFORM_EXPORT MSElementDescrP | Allocate (ElementRefP elemRef, DgnModelRefP modelRef=0, MSElementDescrP myHeader=0) |
Allocate a new MSElementDescr holding a copy of the element data from the supplied ElementRef. More... | |
DGNPLATFORM_EXPORT UInt32 | AddRef () |
Add a reference to this MSElementDescr. More... | |
DGNPLATFORM_EXPORT void | Release () |
Decrement the use count for this MSElementDescr. The last reference frees the MSElementDescr. More... | |
DGNPLATFORM_EXPORT StatusInt | Duplicate (MSElementDescrH newDscr, bool copyScheduledXaChanges=true, bool loadPersistentXasAsChanges=false) const |
Allocates and returns a copy of this MSElementDescr. More... | |
DGNPLATFORM_EXPORT StatusInt | DuplicateSingle (MSElementDescrH newDscr, bool copyScheduledXaChanges=true, bool loadPersistentXasAsChanges=false) const |
Allocates and returns a copy of this MSElementDescr without copying h.next. More... | |
DGNPLATFORM_EXPORT MSElementDescrP | ReplaceElement (MSElementCR element) |
Replace the element held by this MSElementDescr with a new element. More... | |
DGNPLATFORM_EXPORT MSElementDescrP | ReplaceDescr (MSElementDescrR newDscr) |
Replace this MSElementDescr, and all of its children, with a new MSElementDescr. More... | |
DGNPLATFORM_EXPORT MSElementDescrP | AppendElement (MSElementCR element) |
Allocates a new element descriptor from an existing element and append to the end of an existing element descriptor. More... | |
DGNPLATFORM_EXPORT StatusInt | AppendDescr (MSElementDescrP newDscr) |
Adds newDscr to the end of this msElementDescr. More... | |
DGNPLATFORM_EXPORT MSElementDescrP | RemoveElement () |
Removes this element from an element descriptor chain. More... | |
DGNPLATFORM_EXPORT void | Validate (DgnModelRefP modelRef, bool ignoreIsValid=false) |
Updates complex header element information based on current components. More... | |
DGNPLATFORM_EXPORT void | ClearElementIds () |
Set the ElementIDs of this MSElementDescr, and all of its children, to zero. More... | |
DGNPLATFORM_EXPORT void | SetModelRef (DgnModelRefP modelRef) |
DGNPLATFORM_EXPORT BentleyStatus | CopyXAttributesTo (MSElementDescrR sink, bool copyChildXAttributes) const |
DGNPLATFORM_EXPORT XAttributeChangeSetP | GetXAttributeChangeSet () const |
DGNPLATFORM_EXPORT XAttributeChangeSetP | QueryXAttributeChangeSet () const |
DGNPLATFORM_EXPORT void | AddToChain (MSElementDescrP newElem) |
Add newElem to the end of this msElementDescr. More... | |
static DGNPLATFORM_EXPORT void | InitOrAddToChainWithTail (MSElementDescrH ppChainHeadDescr, MSElementDescrH ppChainTailDescr, MSElementDescrP pNewDescr) |
Append a descriptor to a growing chain, maintaining both head and tail pointers within the chain so that subsequent calls can access the tail directly without walking the chain. More... | |
int | mdlElement_maxLineStringPoints () |
Gets the maximum number of points allowed in a line string. More... | |
UInt32 | mdlElmdscr_add (MSElementDescrP elemDescr) |
Adds the new element(s) contained in the element descriptor pointed to by elemDescr to the design file. More... | |
int | mdlElmdscr_addFill (MSElementDescrH edPP) |
Adds an attribute linkage to a closed element that causes the element to be displayed filled. More... | |
void | mdlElmdscr_initOrAddToChainWithTail (MSElementDescrH ppHeadDescr, MSElementDescrH ppTailDescr, MSElementDescrP pDescr) |
Append a descriptor to a growing chain, maintaining both head and tail pointers within the chain so that subsequent calls can access the tail directly without walking the chain. More... | |
int | mdlElmdscr_assembleChains (MSElementDescrH edPP, double closureTolerance, DgnModelRefP modelRef) |
Takes an unconnected, unordered chain of open elements (line, arc, * linestring, curve etc.) and combines them into complex chains or shapes if their endpoints are within closureTolerance of each other. More... | |
UInt32 | mdlElmdscr_append (MSElementDescrP elemDescrP) |
Adds the modified element(s) contained in the element descriptor pointed to by elemDscr to the design file. More... | |
StatusInt | mdlElmdscr_appendByModelRef (MSElementDescrP elemDescr, DgnModelRefP modelRef) |
This function is identical to @ref mdlElmdscr_append except for the addition of a modelRef argument that allows elements to be appended to models other than the active model. More... | |
void | mdlElmdscr_appendAttributes (MSElementDescrH elDscrPP, int length, UInt16 *attributes) |
Appends the attribute information contained in the attributes buffer to the end of any existing attributes attached to the elements in the descriptor elDscr. More... | |
int | mdlElmdscr_convertTo2D (MSElementDescrH newDscrPP, MSElementDescrP oldDscrP, int view, TransformP transP, DgnModelRefP sourceModelRef, DgnModelRefP destModelRef, bool preserveZRange) |
Converts the 3D element descriptor pointed to by oldDscrP to a 2D element descriptor. More... | |
int | mdlElmdscr_convertTo3D (MSElementDescrH newDscrPP, MSElementDescrP oldDscrP, int eType, double elevation, TransformP transP, DgnModelRefP sourceModelRef, DgnModelRefP destModelRef) |
Converts the 2D element descriptor pointed to by oldDscrP to a 3D element descriptor. More... | |
int | mdlElmdscr_copyParallel (MSElementDescrH outDscrPP, MSElementDescrP inDscr, Dpoint3d *point, double distance, Dpoint3d *normal) |
Creates a copy of the element descriptor outDscr specified by inDscr that is offset parallel from the original element. More... | |
int | mdlElmdscr_signedOffset (MSElementDescrH outDscrPP, MSElementDescrCP curveDescrP, double distance, DVec3dP normal) |
Creates an offset of a curve element. More... | |
void | mdlElmdscr_display (MSElementDescrCP elemDescr, DgnModelRefP modelRef, int drawMode) |
Displays the element descriptor pointed to by elemDscrP in all active views. More... | |
void | mdlElmdscr_displayAllReferences (MSElementDescrP elemDescr, int drawMode, DgnModelRefP activeModel, int viewMask) |
Displays the element descriptor pointed to by elemDscrP in the views specified by viewMask if the descriptors modelRef can be reached from the root modelRef of the view. More... | |
void | mdlElmdscr_displayInView (MSElementDescrP edP, DgnModelRefP modelRef, DgnPlatform::DgnDrawMode drawMode, MSWindow *gwP) |
Used to display the contents of the specified element descriptor in the specified view window using the given drawing mode. More... | |
void | mdlElmdscr_displaySingle (MSElementDescrP elemDescr, DgnModelRefP modelRef, int drawMode) |
This function is identical to mdlElmdscr_display except that it displays a single element descriptor and will not display the elements pointed to by elemDescr->next. More... | |
int | mdlElmdscr_displayFromFile (UInt32 filePos, DgnModelRefP modelRef, MSElementP el, int drawMode) |
This function is similar to mdlElmDscr_display, but operates on elements in the design file rather than from an element descriptor supplied by the application. More... | |
int | mdlElmdscr_displayToWindow (MSWindow *windowP, BSIRect const *rectP, DgnPlatform::ViewFlags const *viewFlags, MSElementDescrCP elmDP, RotMatrixCP rotMatrixP, Dpoint3d const *originP, Dpoint3d const *rangeP, int threeD, int menuColor) |
Used to display the graphics element designated by edP in the window designated by windowP. More... | |
int | mdlElmdscr_extendedDisplayToWindow (MSWindow *windowP, BSIRect const *rectP, DgnPlatform::ViewFlags const *viewFlags, MSElementDescrCP elmDP, RotMatrixCP rotMatrixP, Dpoint3d const *originP, Dpoint3d const *rangeP, int threeD, int menuColor, void const *colormap, bool clearFirst, byte const *backgroundImageP) |
Provides some extensions to the mdlElmdscr_displayToWindow function that allow the display of rendered images within a window. More... | |
int | mdlElmdscr_distanceAtPoint (double *distance, Dpoint3d *position, Dpoint3d *tangent, MSElementDescrP edP, Dpoint3d *inputPoint, double inputTolerance) |
Returns the distance along an element from the beginning of the element to the projection of inputPoint on the element. More... | |
void | mdlElmdscr_extractAttributes (int *length, UInt16 *attributes, MSElementDescrP elDscr) |
Extracts the attribute information from the first element contained in the element descriptor elmdscrP. More... | |
int | mdlElmdscr_extractNormal (Dpoint3d *normal, Dpoint3d *point, MSElementDescrCP edP, Dpoint3d *inputDefaultNormal) |
Used to find the normal vector of an element, using the incredibly coarse classic IGDS/Microstation tolerance of 100 UORS. More... | |
int | mdlElmdscr_extractNormalTight (Dpoint3d *normal, Dpoint3d *point, MSElementDescrCP edP, Dpoint3d *inputDefaultNormal) |
Used to find the normal vector of an element, with tight tolerance for planarity test. More... | |
int | mdlElmdscr_extractNormalWithTolerance (Dpoint3d *normal, Dpoint3d *point, MSElementDescrCP edP, Dpoint3d *inputDefaultNormal, double absTol, double localRelTol, double globalRelTol) |
Used to find the normal vector of an element, with user-defined tolerance for planarity test. More... | |
StatusInt | mdlElmdscr_evaluateCurveSpace (MSElementDescrCP pDescr, DPoint3dP pOrigin, RotMatrixP pMatrix, int *pTangentDimensions) |
Determine the dimensionality of a curve – line, plane, or space. More... | |
StatusInt | mdlElmdscr_orientationExt (TransformP pTransform, MSElementDescrCP pSourceDescr, DgnModelRefP modelRef) |
return a natural coordinate frame for the element. More... | |
int | mdlElmdscr_operation (MSElementDescrP elemDescr, PFElemOperation elemFunc, CallbackArgP params, int opFlags) |
Sets a user call-back function to recursively iterate through all component elements in a complex element descriptor. More... | |
int | mdlElmdscr_partialDelete (MSElementDescrH outEdPP1, MSElementDescrH outEdPP2, MSElementDescrP inEdP, Dpoint3d *point1, Dpoint3d *point2, Dpoint3d *point3, int view) |
Returns the portions of inEdP that are not between the projection of point1 and point3 on the element. More... | |
int | mdlElmdscr_pointAtDistance (Dpoint3d *position, Dpoint3d *tangent, double inputDistance, MSElementDescrP edP, double inputTolerance) |
Returns the point and tangent vector at distance along the element. More... | |
UInt32 | mdlElmdscr_read (MSElementDescrH elemDescrPP, UInt32 filePos, DgnModelRefP modelRef, int expandSharedCells, UInt32 *readFilePos) |
Reads the element at the position filePos from the element cache for model modelRef and creates a new element descriptor. More... | |
UInt32 | mdlElmdscr_getByElemRef (MSElementDescrH elemDescrPP, ElementRefP elemRef, DgnModelRefP modelRef, int expandSharedCells, UInt32 *readFilePos) |
Get an element descriptor given an ElementRefP. More... | |
MSElementDescrP | mdlElmdscr_getThicknessEdP (MSElementDescrP edP, DgnModelRefP modelRef) |
Get a surface or solid element that represents a planar element with thickness. More... | |
UInt32 | mdlElmdscr_readToMaster (MSElementDescrH elemDescrPP, UInt32 filePos, DgnModelRefP modelRef, int expandSharedCells, UInt32 *startFilePos) |
Reads the element at the position filePos from the element cache for model modelRef and creates a new element descriptor. More... | |
UInt32 | mdlElmdscr_readComponentToMaster (MSElementDescrH edPP, DisplayPathCP pathP, int elementNumber, int expandSharedCells, bool returnNonCellHeader, bool allowGroupHoles, UInt32 *startFilePosP) |
Used to read an element from the specified design file and add it to the master design file. More... | |
UInt32 | mdlElmdscr_rewrite (MSElementDescrP newElemDscr, MSElementDescrP oldElemDscr, UInt32 filePos) |
Overwrites the existing MicroStation element(s) pointed to by oldElemDscrP with the new element(s) pointed to by newElemDscrP at file position filePos. More... | |
void | mdlElmdscr_stripAttributes (MSElementDescrH elDscrPP) |
Removes all of the attribute data on the elements contained in descriptor elmdscrPP. More... | |
int | mdlElmdscr_stripFill (MSElementDescrH edPP) |
Removes the fill attribute linkage from an element. More... | |
int | mdlElmdscr_stroke (Dpoint3d **points, int *nPoints, MSElementDescrP edP, double tol) |
Strokes the element descriptor pointed to by elmDscrP into vectors in an array pointed to by points. More... | |
int | mdlElmdscr_transform (MSElementDescrH edPP, TransformCP userTrans) |
Transforms the element descriptor by the supplied transformation matrix. More... | |
void | mdlElmdscr_transformAllowModification (MSElementDescrH edPP, TransformCP userTrans, DgnModelRefP sourceModelRef, DgnModelRefP destModelRef, const UInt32 options) |
Transforms the element descriptor by the supplied transformation matrix. More... | |
int | mdlElmdscr_undoableDelete (MSElementDescrP elemDescrP, UInt32 filePos, bool display) |
Deletes the element(s) pointed to by elemDscrP at file position filePos. More... | |
int | mdlElmdscr_deleteByModelRef (MSElementDescrP elemDescr, UInt32 filePos, DgnModelRefP modelRef, bool display) |
Deletes the element(s) pointed to by elemDscrP at file position filePos in the model specified by modelRef. More... | |
int | mdlElmdscr_displayFromFileViews (UInt32 filePos, DgnModelRefP modelRef, MSElementP elP, int drawMode, int viewMask) |
This function is identical to mdlElmdscr_displayFromFile, except that the viewMask argument determines the views in which element descriptor is displayed (see mdlElement_displayInSelectedViews for a discussion of viewMask). More... | |
void | mdlElmdscr_displayInSelectedViews (MSElementDescrCP elemDescr, DgnModelRefP modelRef, int drawMode, int viewMask) |
This function is identical to mdlElmdscr_display, except that the viewMask argument determines the views in which element descriptor is displayed (see mdlElement_displayInSelectedViews for a discussion of viewMask). More... | |
int | mdlElmdscr_generatePartial (MSElementDescrH outEdPP, MSElementDescrCP elmDescrP, double t1, double t2, bool splineParameters) |
Generates the portion of the element descriptor elmDescr that is between t1 and t2 and returns this portion in outEdPP. More... | |
int | mdlElmdscr_reverse (MSElementDescrH outEdPP, MSElementDescrCP inEdP, DgnModelRefP modelRef) |
Reverses the direction of inEdP and returns the reversed element in outEdPP. More... | |
int | mdlElmdscr_reverseNormal (MSElementDescrH outEdPP, MSElementDescrCP inEdP, DgnModelRefP modelRef) |
Reverses the normal direction for a surface, solid or closed element. More... | |
int | mdlElmdscr_extractEndPoints (DPoint3dP startP, DPoint3dP startTangentP, DPoint3dP endP, DPoint3dP endTangentP, MSElementDescrCP edP, DgnModelRefP modelRef) |
Returns the start and end points (in start and end) for the open element, edP. More... | |
int | mdlElmdscr_fromCompoundElement (MSElementDescrH edPP, MSElementP elemP, DgnModelRefP modelRef, UInt32 graphicGroup, bool transformToWorld, bool expandNested) |
Converts a compound element (multi-line, dimension, shared cell) to a set of simple (pre-MicroStation 4.0 compatible) elements. More... | |
bool | mdlElmdscr_isClosed (MSElementDescrCP edP) |
Queries if an element descriptor is a closed element; i.e., a shape, complex shape, ellipse or closed B-spline curve. More... | |
bool | mdlElmdscr_isOpen (MSElementDescrCP edP) |
Queries if an element descriptor is an open element; i.e., a line, line string, curve, open B-Spline curve or complex chain. More... | |
bool | mdlElmdscr_isGroupedHole (MSElementDescrCP groupEdP) |
Queries if an element descriptor is a grouped hole element; i.e., an element that has a hole punched in it (such as can be created with mdlElmdscr_createShapeWithHoles). More... | |
bool | mdlElmdscr_hasLineStyle (MSElementDescrCP lineStyleEdP) |
Queries if an element descriptor has line style. More... | |
int | mdlElmdscr_createShapeWithHoles (MSElementDescrH outEdPP, MSElementDescrP solidEdP, MSElementDescrP holeEdP) |
Creates an orphan cell entity, outEdPP, that associates the solid element, solidEdP with the hole entity(s) in holeEdP. More... | |
int | mdlElmdscr_close (MSElementDescrH outEdPP, MSElementDescrP inEdP, DgnModelRefP modelRef) |
Converts the open element inEdP to a closed element, outEdPP. More... | |
int | mdlElmdscr_open (MSElementDescrH outEdPP, MSElementDescrP inEdP, DgnModelRefP modelRef) |
Converts the closed element inEdP to an open element, outEdPP. More... | |
int | mdlElmdscr_show (MSElementDescrP edP, WCharCP currentIndent) |
Used to print information from the element descriptor header in a formatted fashion. More... | |
int | mdlElmdscr_fromSelectionSet (MSElementDescrH edPP) |
Used to create an element descriptor chain from the set of elements that are currently in the selection set. More... | |
int | mdlElmdscr_fillet (MSElementP fillet, MSElementP pTemplate, MSElementDescrP in0EdP, MSElementDescrP in1EdP, double inputRadius, Dpoint3d *inputPoint, RotMatrixP inputRotMatrix) |
Used to create a two dimensional circular fillet between the specified elements. More... | |
int | mdlElmdscr_spaceFillet (MSElementDescrH ppFilletChain, MSElementP pTemplate, MSElementDescrCP pCurveA, MSElementDescrCP pCurveB, double radius, DPoint3dP pCenterSelect) |
Compute circular arc fillets between two elements. More... | |
void | mdlElmdscr_setProperties (MSElementDescrH edPP, DgnPlatform::LevelId const *level, UInt32 const *ggNum, DgnPlatform::DgnElementClass const *elementClass, bool const *locked, bool const *newElm, bool const *modified, bool const *viewIndepend, bool const *solidHole) |
Changes the level, element class, graphic group, and other properties in the element desciptor pointed to by edPP to the values specified. More... | |
void | mdlElmdscr_setSymbology (MSElementDescrH edPP, UInt32 *color, Int32 *style, UInt32 *weight, UInt32 *fillColor) |
Changes the color, weight, and style in the element desciptor pointed to by edPP to the values specified. More... | |
int | mdlElmdscr_createFromVertices (MSElementDescrH edPP, MSElementP templateElmP, Dpoint3d *pointP, size_t numPoints, bool closed, int fillMode) |
Creates a line string or complex chain if closed is zero and a shape or complex shape if closed is non-zero. More... | |
MSElementDescrP | mdlElmdscr_findElementId (MSElementDescrP edP, DgnPlatform::ElementId reqId) |
Get a pointer to the component element descriptor having the specified ElementId in the supplied complex element descriptor. More... | |
MSElementDescrP | mdlElmdscr_atOffset (MSElementDescrP edP, int offset, DgnModelRefP modelRef) |
Used to get the element descriptor at the specified offset from the start of an element descriptor chain. More... | |
UInt32 | mdlElmdscr_componentOffset (MSElementDescrP headerEdP, MSElementDescrP componentEdP, DgnModelRefP modelRef) |
Used to get the offset value of a component element in the specified element descriptor chain. More... | |
int | mdlElmdscr_fromCone (MSElementDescrH edPP, MSElementP coneP, TransformP transP) |
Used to create an element descriptor chain from the specified cone element. More... | |
int | mdlElmdscr_close2 (MSElementDescrH outEdPP, MSElementDescrP inEdP, DgnModelRefP modelRef) |
Used to create a closed element from an element that is not closed. More... | |
int | mdlElmdscr_extractNormal2 (Dpoint3d *normalP, Dpoint3d *pointP, MSElementDescrP edP, Dpoint3d *inputDefaultNormal, bool applyCurrTrans, bool cleanupNormal) |
Used to find the normal vector of an element. More... | |
int | mdlElmdscr_isSphere (double *radiusP, Dpoint3d *centerP, RotMatrixP rotMatrixP, MSElementDescrP edP) |
Used to determine whether the specified element is spherical. More... | |
int | mdlElmdscr_extractCellTMatrix (TransformP forwardP, TransformP inverseP, MSElementP cellP, DgnModelRefP modelRef) |
Used to get a transformation matrix from a cell element. More... | |
StatusInt | mdlElmdscr_simplifyComplexChainOrShape (MSElementDescrH edPP, DgnModelRefP modelRef) |
Used to simplify a complex element, if possible, by concatenating consecutive linear segments into linestrings. More... | |
bool | mdlElmdscr_isRule (MSElementDescrCP edP) |
Used to determine whether the specified element descriptor contains an element of either the DgnElementClass::PrimaryRule or the DgnElementClass::ConstructionRule. More... | |
UInt32 | mdlElmdscr_rewriteByModelRef (MSElementDescrP newEdP, MSElementDescrP oldEdP, UInt32 filePosition, DgnModelRefP modelRef) |
Replaces the specified element descriptor in the given file position, with a new element descriptor from the given modelRef. More... | |
UInt32 | mdlElmdscr_addByModelRef (MSElementDescrP edP, DgnModelRefP modelRef) |
This function is identical to mdlElmdscr_add except for the addition of a modelRef argument that allows elements to be added to models other than the active model. More... | |
int | mdlElmdscr_numElementsSingle (MSElementDescrCP edP) |
Used to find the number of child elements within an element descriptor chain. More... | |
void | mdlElmdscr_setVisible (MSElementDescrP edP, bool visible) |
Used to set the visibility flag of the contents of the specified element descriptor. More... | |
bool | mdlElmdscr_isAssociativeRegionChild (MSElementDescrH regionEdPP, MSElementDescrP edP) |
Used to determine whether the element contained by the specified element descriptor is a child element of an associative region. More... | |
bool | mdlElmdscr_isAssociativeRegion (MSElementDescrCP edP) |
Used to determine whether the specified element descriptor contains an element that is an associative region. More... | |
StatusInt | mdlElmdscr_addClip (MSElementDescrH ppElementDescr, RotMatrixP pRMatrix, DPoint3dP pOrigin, bool frontClipOn, double zFront, bool backClipOn, double zBack, UInt32 nPoints, DPoint2d *pPoints) |
Used to add a clip boundary linkage to the specified element. More... | |
StatusInt | mdlElmdscr_deleteClip (MSElementDescrH ppElementDescr) |
Used to remove any clip boundary linkage from the specified element. More... | |
void | mdlElmdscr_computeRange (Dpoint3d *minP, Dpoint3d *maxP, MSElementDescrCP edP, RotMatrixCP rotMatrixP) |
Computes the range of the element(s) in the specified element descriptor. More... | |
int | mdlElmdscr_getUsedLevels (BitMaskP pBitMaskOut, MSElementDescrP pElemDscrIn) |
Get a bit-mask which represents the set of the levels used by an element. More... | |
bool | mdlElmdscr_areTwoIdentical (MSElementDescrP edP1, MSElementDescrP edP2) |
Returns whether two element descriptors are exactly identical. More... | |
bool | mdlElmdscr_areIdenticalToTolerance (MSElementDescrCP edP1, MSElementDescrCP edP2, UInt32 comparisonFlags, double distanceTolerance, double directionTolerance) |
Returns whether two element descriptors are identical to a given tolerance and optionally ignoring certain characteristics. More... | |
int | mdlElmdscr_copy (MSElementDescrH elDscrPP, DgnModelRefP sourceModelRef, DgnModelRefP destModelRef, ElementCopyContextP copyContextP) |
Copies an element descriptor and adds it to the destination. More... | |
void | mdlCopyContext_setView (ElementCopyContextP ccP, int view) |
Sets the view that will be used to flatten the elements if the source model is 3D and the destination model is 2D. More... | |
ElementCopyContextP | mdlCopyContext_create (void) |
Used to allocate memory for and create a copy context structure. More... | |
void | mdlCopyContext_free (ElementCopyContextP *ccP) |
Used to dispose of a copy context structure and all of its related data after it has been used. More... | |
void | mdlCopyContext_setViewport (ElementCopyContextP ccP, ViewportP vp) |
Sets the view that will be used to flatten the elements if the source model is 3D and the destination model is 2D. More... | |
void | mdlCopyContext_setNewGGs (ElementCopyContextP ccP, bool assignNewGGs) |
Defines whether copied elements should maintain their current graphic group or should be assigned to a new group. More... | |
void | mdlCopyContext_setNewNodes (ElementCopyContextP ccP, bool assignNewNodes) |
Defines whether copied elements should maintain their current text node numbers or should be assigned a new number. More... | |
void | mdlCopyContext_setScaleToDestination (ElementCopyContextP ccP, bool transformToDestination) |
Defines whether copied elements should be scaled to match the units in the destination model. More... | |
void | mdlCopyContext_setModelFromElmdscr (ElementCopyContextP ccP, bool useElmdscr) |
Set the copy context so that the model ref from the element descriptor is used as the source model ref for the copy, unless it is NULL in which case the source model ref is used. More... | |
void | mdlCopyContext_setMatchDimToDestination (ElementCopyContextP ccP, bool changeDimension) |
Setting this option to false in the copy context will cause the element descriptor passed in not to take on the dimensionality (2D/3D) of the destination model ref. More... | |
void | mdlCopyContext_setWriteElements (ElementCopyContextP ccP, bool writeAllElements) |
Set the copy context value that determines whether the element descriptor passed to mdlElmdscr_copy will get written to the destination model ref. More... | |
void | mdlCopyContext_setLevelHandling (ElementCopyContextP ccP, DgnPlatform::CopyContextLevelOption levelOption) |
Determine the way in which levels are brought from the source model ref to the destination model ref. More... | |
void | mdlCopyContext_setRedirectInternalRefs (ElementCopyContextP ccP, bool redirectRefs) |
Set the copy context value that determines how to handle internal reference attachments. More... | |
void | mdlCopyContext_setRedirectExternalRefs (ElementCopyContextP ccP, bool redirectRefs) |
Set the copy context value that determines how to handle external reference attachments. More... | |
int | mdlProject_perpendicular (DPoint3dP position, DPoint3dP tangent, DPoint3dP perpendicular, MSElementDescrP edP, DgnModelRefP modelRef, DPoint3dP inputPoint, RotMatrixP inputRotMatrix, double inputTolerance) |
Projects a point to an element on a perpendicular from the element. More... | |
int | mdlProject_tangent (DPoint3dP position, DPoint3dP tangent, DPoint3dP perpendicular, MSElementDescrP edP, DgnModelRefP modelRef, DPoint3dP point, RotMatrixP rotMatrix, DPoint3dP closestPoint, double tolerance) |
Projects a point to an element along a tangent from the element. More... | |
An MSElementDescr holds a copy of a (potentially complex) MicroStation element.
MSElementDescr's are necessary and intended for creating new elements and making changes to existing elements. MSElementDescr's can also hold an XAttributeChangeSet.
DGNPLATFORM_EXPORT UInt32 AddRef | ( | ) |
Add a reference to this MSElementDescr.
DGNPLATFORM_EXPORT void AddToChain | ( | MSElementDescrP | newElem | ) |
Add newElem
to the end of this
msElementDescr.
This method can create a chain of non-complex elements in chainElem, but that technique is strongly discouraged. Instead, use an ElementAgenda.
[in] | newElem | The MSElementDescr to add. |
newElem
should not be referenced after either of these functions is called. (Thus, it should not be freed).
|
static |
Allocate a new MSElementDescr holding a copy of the supplied MSElement.
[in] | element | The existing element. |
[in] | modelRef | The value for the dgnModelRef member of the new MSElementDescr. |
[in] | myHeader | The parent MSElementDescr to which the new MSElementDescr is attached. This method sets the myHeader field in the new MSElementDescr to this value. Generally this should be NULL unless AppendDescr cannot be used. |
element
is not a valid MicroStation element.
|
static |
Allocate a new MSElementDescr holding a copy of the element data from the supplied ElementRef.
[in] | elemRef | The value for the elementRef member of the new MSElementDescr as well as the source of the element data. |
[in] | modelRef | The value for the dgnModelRef member of the new MSElementDescr. |
[in] | myHeader | The parent MSElementDescr to which the new MSElementDescr is attached. This method sets the myHeader field in the new MSElementDescr to this value. Generally this should be NULL unless AppendDescr cannot be used. |
element
is not a valid MicroStation element. DGNPLATFORM_EXPORT StatusInt AppendDescr | ( | MSElementDescrP | newDscr | ) |
Adds newDscr
to the end of this msElementDescr.
[in] | newDscr | The MSElementDescr to add. |
DGNPLATFORM_EXPORT MSElementDescrP AppendElement | ( | MSElementCR | element | ) |
Allocates a new element descriptor from an existing element and append to the end of an existing element descriptor.
[in] | element | Element to append. |
DGNPLATFORM_EXPORT void ClearElementIds | ( | ) |
Set the ElementIDs of this MSElementDescr, and all of its children, to zero.
DGNPLATFORM_EXPORT BentleyStatus CopyXAttributesTo | ( | MSElementDescrR | sink, |
bool | copyChildXAttributes | ||
) | const |
DGNPLATFORM_EXPORT StatusInt Duplicate | ( | MSElementDescrH | newDscr, |
bool | copyScheduledXaChanges = true , |
||
bool | loadPersistentXasAsChanges = false |
||
) | const |
Allocates and returns a copy of this MSElementDescr.
DGNPLATFORM_EXPORT StatusInt DuplicateSingle | ( | MSElementDescrH | newDscr, |
bool | copyScheduledXaChanges = true , |
||
bool | loadPersistentXasAsChanges = false |
||
) | const |
Allocates and returns a copy of this MSElementDescr without copying h.next.
DGNPLATFORM_EXPORT XAttributeChangeSetP GetXAttributeChangeSet | ( | ) | const |
|
static |
Append a descriptor to a growing chain, maintaining both head and tail pointers within the chain so that subsequent calls can access the tail directly without walking the chain.
Before starting the chain construction, caller initializes both the head and tail pointers to NULL.
ppChainHeadDescr | IN OUT pointer to head of chain. |
ppChainTailDescr | IN OUT pointer to tail of chain. |
pNewDescr | IN descriptor to add at tail. |
ElementCopyContextP mdlCopyContext_create | ( | void | ) |
Used to allocate memory for and create a
copy context structure.
The caller is responsible for freeing the copy context after use by calling mdlCopyContext_free. The copy context is initialized to set new graphic groups and set new text nodes but not to scale the elements.
void mdlCopyContext_free | ( | ElementCopyContextP * | ccP | ) |
Used to dispose of a copy context
structure and all of its related data after it has been used.
[in] | ccP | the copy context which is to be disposed of. |
void mdlCopyContext_setLevelHandling | ( | ElementCopyContextP | ccP, |
DgnPlatform::CopyContextLevelOption | levelOption | ||
) |
Determine the way in which levels are brought from the source model ref to the destination model ref.
[in] | ccP | is the copy context to modify. |
[in] | levelOption | determines how the levels are handled during a copy. See ~!tCopyContextLevelOption. |
void mdlCopyContext_setMatchDimToDestination | ( | ElementCopyContextP | ccP, |
bool | changeDimension | ||
) |
Setting this option to false in the copy context will cause the element descriptor passed in not to take on the dimensionality (2D/3D) of the destination model ref.
The value will always be treated as true if the elements are being written to the file (see mdlCopyContext_setWriteElements).
[in] | ccP | is the copy context to modify. |
[in] | changeDimension | true to allow elements to be converted to the same dimensionality as the destination model ref; false to keep the elements as they are. |
void mdlCopyContext_setModelFromElmdscr | ( | ElementCopyContextP | ccP, |
bool | useElmdscr | ||
) |
Set the copy context so that the model ref from the element descriptor is used as the source model ref for the copy, unless it is NULL in which case the source model ref is used.
The primary reason to use this option is for cells that may be from multiple model refs.
[in] | ccP | is the copy context to modify. |
[in] | useElmdscr | true to use the model refs on the element descriptors; false to use the source model ref passed to mdlElmdscr_copy. |
void mdlCopyContext_setNewGGs | ( | ElementCopyContextP | ccP, |
bool | assignNewGGs | ||
) |
Defines whether copied elements should
maintain their current graphic group or should be assigned to a new group.
Note that all elements with the same graphic group number will be remapped to the same new number as long as the same context is used.
[in] | ccP | the copy context to modify. |
[in] | assignNewGGs | defines whether to assign new graphic groups or maintain the current values. |
void mdlCopyContext_setNewNodes | ( | ElementCopyContextP | ccP, |
bool | assignNewNodes | ||
) |
Defines whether copied elements should
maintain their current text node numbers or should be assigned a new number.
[in] | ccP | the copy context to modify. |
[in] | assignNewNodes | defines whether to assign new text node numbers or maintain the current values. |
void mdlCopyContext_setRedirectExternalRefs | ( | ElementCopyContextP | ccP, |
bool | redirectRefs | ||
) |
Set the copy context value that determines how to handle external reference attachments.
An external reference is an attachment that targets a model that is not within the same file as its parent model. If this value is set to "true", when an external reference is copied into the same file as its target, then the attacement will be "internalized" so that it continues to target the same model. Note that it will now be an internal reference.
[in] | ccP | is the copy context to modify. |
[in] | redirectRefs | true to redirect external refs; false to leave external refs unchanged. |
void mdlCopyContext_setRedirectInternalRefs | ( | ElementCopyContextP | ccP, |
bool | redirectRefs | ||
) |
Set the copy context value that determines how to handle internal reference attachments.
An internal reference is an attachment that targets a model within the same file as its parent model. If this value is set to "true", when an internal reference is copied to into a new file that does not contain its target, then the attachment will be "externalized" so that it will continue to reference the same model in the original file. Note that it will no longer be an internal reference.
[in] | ccP | is the copy context to modify. |
[in] | redirectRefs | true to redirect internal refs; false to leave internal refs unchanged. |
void mdlCopyContext_setScaleToDestination | ( | ElementCopyContextP | ccP, |
bool | transformToDestination | ||
) |
Defines whether copied elements should
be scaled to match the units in the destination model.
[in] | ccP | the copy context to modify. |
[in] | transformToDestination | defines whether to scale the elements by the difference in units between the models. |
void mdlCopyContext_setView | ( | ElementCopyContextP | ccP, |
int | view | ||
) |
Sets the view that will be used to flatten the elements if the source model is 3D and the destination model is 2D.
[in] | ccP | is the copy context to modify. |
[in] | view | defines the view to use for flattening if necessary. |
void mdlCopyContext_setViewport | ( | ElementCopyContextP | ccP, |
ViewportP | vp | ||
) |
Sets the view that will be used to flatten the elements if the source model is 3D and the destination model is 2D.
[in] | ccP | is the copy context to modify. |
[in] | vp | defines the view to use for flattening if necessary. |
void mdlCopyContext_setWriteElements | ( | ElementCopyContextP | ccP, |
bool | writeAllElements | ||
) |
Set the copy context value that determines whether the element descriptor passed to mdlElmdscr_copy will get written to the destination model ref.
Regardless of the value passed in, the additional necessary information (styles, levels, etc.) will be copied to the destination model ref.
[in] | ccP | is the copy context to modify. |
[in] | writeAllElements | true to copy all elements to the destination model ref; false to just copy necessary additional elements. |
int mdlElement_maxLineStringPoints | ( | ) |
Gets the maximum number of points allowed in a line string.
UInt32 mdlElmdscr_add | ( | MSElementDescrP | elemDescr | ) |
Adds the new element(s) contained in
the element descriptor pointed to by elemDescr to the design file.
You should use mdlElmdscr_add when creating new elements. Before writing the element to the file, mdlElmdscr_add sets the properties bits in the element header to not locked, new element, and not modified.
[in] | elemDescr | added to file |
UInt32 mdlElmdscr_addByModelRef | ( | MSElementDescrP | edP, |
DgnModelRefP | modelRef | ||
) |
This function is identical to mdlElmdscr_add except for the addition of a modelRef argument that allows elements to be added to models other than the active model.
If the model specified is the active model then the two functions are identical. If the element is from the active design file the various asynch hooks are called and the element is recorded in the undo buffer. The supplied modelRef must be open for write access.
[in] | edP | element to be added to file. |
[in] | modelRef | the model to add to. |
StatusInt mdlElmdscr_addClip | ( | MSElementDescrH | ppElementDescr, |
RotMatrixP | pRMatrix, | ||
DPoint3dP | pOrigin, | ||
bool | frontClipOn, | ||
double | zFront, | ||
bool | backClipOn, | ||
double | zBack, | ||
UInt32 | nPoints, | ||
DPoint2d * | pPoints | ||
) |
Used to add a clip boundary linkage to the specified element.
[in,out] | ppElementDescr | is the element descriptor to receive the clip boundary linkage. |
[in] | pRMatrix | is the rotation matrix of the clipping boundary. |
[in] | pOrigin | is the origin point of the clipping boundary. |
[in] | frontClipOn | indicates whether the front clipping plane is turned on or off. |
[in] | zFront | is the distance along the z-axis from the element to the front clipping plane. |
[in] | backClipOn | indicates whether the back clipping plane is turned on or off. |
[in] | zBack | is the distance along the z-axis from the element to the back clipping plane. |
[in] | nPoints | is the number of points in the clipping boundary. |
[in] | pPoints | is the array of points that comprises the clipping boundary. |
int mdlElmdscr_addFill | ( | MSElementDescrH | edPP | ) |
Adds an attribute linkage to a
closed element that causes the element to be displayed filled.
The fill color is set to the same color as the elements color, but can be changed with the mdlElement_setFillColor function.
[in,out] | edPP | points to the address of the element descriptor to be modified. This must be a closed element (shape, complex shape, ellipse, grouped hole orphan cell or closed B-spline curve). |
UInt32 mdlElmdscr_append | ( | MSElementDescrP | elemDescrP | ) |
Adds the modified element(s)
contained in the element descriptor pointed to by elemDscr to the design file.
You should use mdlElmdscr_append if you are modifying an element and changing its size. The mdlElmdscr_rewrite function is also useful for this purpose, but requires that the old file position be known.
[in] | elemDescrP | appended to file |
void mdlElmdscr_appendAttributes | ( | MSElementDescrH | elDscrPP, |
int | length, | ||
UInt16 * | attributes | ||
) |
Appends the attribute
information contained in the attributes buffer to the end of any existing attributes attached to the elements in the descriptor elDscr.
[in,out] | elDscrPP | element descriptor to receive attributes. |
[in] | length | specifies the size of the attribute data in words. If complex elements are present in the element descriptor elDscr, only the header of the complex element receives the attributes. |
[in] | attributes | attribute data to be appended. |
StatusInt mdlElmdscr_appendByModelRef | ( | MSElementDescrP | elemDescr, |
DgnModelRefP | modelRef | ||
) |
This function is identical to @ref mdlElmdscr_append
except for the addition of a modelRef argument that allows elements to be appended to models other than the active model.
If the model specified is the active model then the two functions are identical. If the element is from the active design file the various asynch hooks are called and the element is recorded in the undo buffer. The supplied modelRef must be open for write access.
[in] | elemDescr | appended to file |
[in] | modelRef | the model to append to. |
bool mdlElmdscr_areIdenticalToTolerance | ( | MSElementDescrCP | edP1, |
MSElementDescrCP | edP2, | ||
UInt32 | comparisonFlags, | ||
double | distanceTolerance, | ||
double | directionTolerance | ||
) |
Returns whether two element descriptors are identical to a given tolerance and optionally ignoring certain characteristics.
[in] | edP1 | the first element to test |
[in] | edP2 | the second element to test. |
[in] | comparisonFlags | flags controlling parameter to ignore during the comparison. See COMPAREOPT_ definitions above. |
[in] | distanceTolerance | tolerance in UORs for comparing distance values |
[in] | directionTolerance | tolerance in radians for comparing angular values. A value of 1.0E-8 is appropriate for this comparison. |
bool mdlElmdscr_areTwoIdentical | ( | MSElementDescrP | edP1, |
MSElementDescrP | edP2 | ||
) |
Returns whether two element descriptors are exactly identical.
[in] | edP1 | the first element to test |
[in] | edP2 | the second element to test. |
int mdlElmdscr_assembleChains | ( | MSElementDescrH | edPP, |
double | closureTolerance, | ||
DgnModelRefP | modelRef | ||
) |
Takes an unconnected, unordered chain of open elements
(line, arc, * linestring, curve etc.) and combines them into complex chains or shapes if their endpoints are within closureTolerance of each other.
[in,out] | edPP | the element descriptor chain |
[in] | closureTolerance | the tolerance for testing closure |
[in] | modelRef | the model containing the elements |
MSElementDescrP mdlElmdscr_atOffset | ( | MSElementDescrP | edP, |
int | offset, | ||
DgnModelRefP | modelRef | ||
) |
Used to get the element
descriptor at the specified offset from the start of an element descriptor chain.
[in] | edP | is a pointer to the first element descriptor in the chain. |
[in] | offset | indicates the offset of the target element within the chain. |
[in] | modelRef | indicates the design model containing the element descriptor chain. |
int mdlElmdscr_close | ( | MSElementDescrH | outEdPP, |
MSElementDescrP | inEdP, | ||
DgnModelRefP | modelRef | ||
) |
Converts the open element inEdP to a closed element, outEdPP.
If the beginning and endpoints of the element are not identical, a segment connecting them is inserted. This function will convert a complex chain into a complex shape, a linestring into a shape, etc.
[out] | outEdPP | closed element descriptor |
[in] | inEdP | element descriptor to close |
[in] | modelRef | is used only to resolve associative points, in most cases MASTERFILE can be passed for this parameter. |
int mdlElmdscr_close2 | ( | MSElementDescrH | outEdPP, |
MSElementDescrP | inEdP, | ||
DgnModelRefP | modelRef | ||
) |
Used to create a closed element
from an element that is not closed.
The method used to close the element is determined by the type of the initial open element.
[out] | outEdPP | is the closed element created from the open element. |
[in] | inEdP | is the initial open element. |
[in] | modelRef | indicates the design model containing the open element, and where the new closed element will be stored. |
UInt32 mdlElmdscr_componentOffset | ( | MSElementDescrP | headerEdP, |
MSElementDescrP | componentEdP, | ||
DgnModelRefP | modelRef | ||
) |
Used to get the offset value of a component element in the specified element descriptor chain.
[in] | headerEdP | is a pointer to the start of the element descriptor chain. |
[in] | componentEdP | is a pointer to the component element descriptor. |
[in] | modelRef | indicates the design model containing the element descriptor chain. |
void mdlElmdscr_computeRange | ( | Dpoint3d * | minP, |
Dpoint3d * | maxP, | ||
MSElementDescrCP | edP, | ||
RotMatrixCP | rotMatrixP | ||
) |
Computes the range of the element(s) in the specified element descriptor.
[out] | minP | contains the minimum X Y and Z range values |
[out] | maxP | contains the maximum X Y and Z range values |
[in] | edP | the element descriptor containing the element(s) to compute the range of. |
[in] | rotMatrixP | the rotation matrix to apply to the range values, or NULL if no rotation is needed. |
int mdlElmdscr_convertTo2D | ( | MSElementDescrH | newDscrPP, |
MSElementDescrP | oldDscrP, | ||
int | view, | ||
TransformP | transP, | ||
DgnModelRefP | sourceModelRef, | ||
DgnModelRefP | destModelRef, | ||
bool | preserveZRange | ||
) |
Converts the 3D element descriptor pointed to by oldDscrP to a 2D element descriptor.
A pointer to the new 2D element descriptor is returned in newDscrPP.
[out] | newDscrPP | new element description. |
[in] | oldDscrP | original element description. |
[in] | view | defines which view (0 to 7, where 0 = view 1, and 1 = view 2) establishes the final orientation of the converted elements. A value of -1 indicates that the top view is used. |
[in] | transP | allows an additional transformation to be applied to the element descriptor before the transformation defined by the chosen view parameter is applied. If NULL, no additional transformation is applied. chosen view parameter is applied. A value of INVALID_MODELREF means to use the model refs from the element descriptors. |
[in] | sourceModelRef | Source model ref. |
[in] | destModelRef | Destination model ref - can be the same as the source. |
[in] | preserveZRange | if true, copy the Z range from oldDscrP to newDscrPP |
int mdlElmdscr_convertTo3D | ( | MSElementDescrH | newDscrPP, |
MSElementDescrP | oldDscrP, | ||
int | eType, | ||
double | elevation, | ||
TransformP | transP, | ||
DgnModelRefP | sourceModelRef, | ||
DgnModelRefP | destModelRef | ||
) |
Converts the 2D element descriptor pointed to by oldDscrP to a 3D element descriptor.
A pointer to the new 3D element descriptor is returned in newDscrPP.
[out] | newDscrPP | new element descriptor |
[in] | oldDscrP | original element descriptor |
[in] | eType | The element depth (Z value) in the resulting 3D design plane is defined by the eType and elevation parameters. |
[in] | elevation | Elevation value if eType is FIXEDDEPTH. |
[in] | transP | A transformation to be applied to the element descriptor before each element is converted from 2D to 3D. If NULL, no transformation is applied. |
[in] | sourceModelRef | Source model ref - can be the same as the destination. A value of INVALID_MODELREF means to use the model refs from the element descriptors. |
[in] | destModelRef | Destination model ref - can be the same as the source. |
Value | Description |
---|---|
FIXEDDEPTH | All elements have the fixed Z depth specified by the elevation parameter. |
ELEMHIGH | Each element has the Z depth defined by the high value of the Z range in the element definition. |
ELEMLOW | Each element has the Z depth defined by the low value of the Z range in the element definition. |
int mdlElmdscr_copy | ( | MSElementDescrH | elDscrPP, |
DgnModelRefP | sourceModelRef, | ||
DgnModelRefP | destModelRef, | ||
ElementCopyContextP | copyContextP | ||
) |
Copies an element descriptor and adds it to the destination.
It is important to use this function when copying between two models because it copies all necessary additional data, such as text styles,levels, etc. along with the elements. It is also useful to call this function within a single model because it tries to maintain dependencies between elements.
Styles and levels are resolved by name, so if a style with the same name exists in both the source and destination models, the element will be remapped to the style in the destination.
If you need to make multiple calls to this function for a related group of elements, you should create a ElementCopyContextP using mdlCopyContext_create to pass into each of the calls and then free the context after the calls are completed. For example,
[in,out] | elDscrPP | Element descriptor to copy to the destModelRef. It may be modified by this function. The returned value will be the element descriptor as written to the destination. |
[in] | sourceModelRef | The model ref that the element was read from. |
[in] | destModelRef | The model ref that the element should be written to. NULL means to use the sourceModelRef. |
[in] | copyContextP | The copy context derived from a call to mdlCopyContext_create. This parameter can be NULL; if so, a default copy context is created, which means that graphic groups and text nodes will be renumbered but no units scaling will occur. |
int mdlElmdscr_copyParallel | ( | MSElementDescrH | outDscrPP, |
MSElementDescrP | inDscr, | ||
Dpoint3d * | point, | ||
double | distance, | ||
Dpoint3d * | normal | ||
) |
Creates a copy of the element descriptor
outDscr specified by inDscr that is offset parallel from the original element.
This is the same result as obtained by the MicroStation COPY PARALLEL... key-ins. If distance is zero, the offset distance and direction is obtained from point. If distance is non-zero, it specifies the offset distance and the direction only is obtained from point.
[out] | outDscrPP | output geometry |
[in] | inDscr | input geometry |
[in] | point | direction/distance point |
[in] | distance | distance to offset |
[in] | normal | defines the plane in which the geometry will be offset. If it is set to NULL the unit vector in the z direction will be used. To obtain an offset in a particular view, supply the third row of the view rotation matrix. |
int mdlElmdscr_createFromVertices | ( | MSElementDescrH | edPP, |
MSElementP | templateElmP, | ||
Dpoint3d * | pointP, | ||
size_t | numPoints, | ||
bool | closed, | ||
int | fillMode | ||
) |
Creates a line string
or complex chain if closed is zero and a shape or complex shape if closed is non-zero.
A linestring or shape is created if numPoints is less than 5000, otherwise the appropriate complex element is created.
[out] | edPP | points to the address of an element descriptor containing the created element. |
[in] | templateElmP | If in is NULL, the display parameters for the created element are taken from the active MicroStation parameters when the function is called. Otherwise the display parameter from in are used. All attribute information from in is retained in out. |
[in] | pointP | points to an array of numPoints vertices. |
[in] | closed | If closed is non-zero, fillMode determines whether the created shape is filled. See mdlShape_create for possible values for fillMode. |
[in] | numPoints | number of vertices |
[in] | fillMode | fill mode (if closed) |
int mdlElmdscr_createShapeWithHoles | ( | MSElementDescrH | outEdPP, |
MSElementDescrP | solidEdP, | ||
MSElementDescrP | holeEdP | ||
) |
Creates an orphan
cell entity, outEdPP, that associates the solid element, solidEdP with the hole entity(s) in holeEdP.
[out] | outEdPP | shapes with holes |
[in] | solidEdP | outer shape (included in outEdPP) |
[in] | holeEdP | hole element descriptor (chain) |
int mdlElmdscr_deleteByModelRef | ( | MSElementDescrP | elemDescr, |
UInt32 | filePos, | ||
DgnModelRefP | modelRef, | ||
bool | display | ||
) |
Deletes the element(s)
pointed to by elemDscrP at file position filePos in the model specified by modelRef.
The deletion will be undoable if the model is in the current master file. If it is, MicroStation needs the element(s) to save in the undo buffer. If the element descriptor does not exist, pass NULL for elemDscrP and MicroStation will re-read the elements from the cache. Doing so adds some overhead, so always pass the element descriptor if it exists.
[in] | elemDescr | element descr to delete |
[in] | filePos | file position |
[in] | modelRef | the model containing the element(s) |
[in] | display | If display is true, MicroStation erases the elements from the screen as it deletes them. Otherwise, it does not erase them. |
StatusInt mdlElmdscr_deleteClip | ( | MSElementDescrH | ppElementDescr | ) |
Used to remove any clip boundary linkage from the specified element.
[in,out] | ppElementDescr | is the element descriptor representing the element with the clip boundary to be removed. |
void mdlElmdscr_display | ( | MSElementDescrCP | elemDescr, |
DgnModelRefP | modelRef, | ||
int | drawMode | ||
) |
Displays the element descriptor
pointed to by elemDscrP in all active views.
[in] | elemDescr | elements to display |
[in] | modelRef | determines the display transformation and clipping to be applied to the element(s) as they are drawn. |
[in] | drawMode | determines how MicroStation displays the element(s). |
drawMode | drawMode field meaning |
---|---|
DRAW_MODE_Normal | Draw the element(s) in its normal color. |
ERASE | Erase the element(s). |
HILITE | Draw the element(s) in the current highlight color. |
void mdlElmdscr_displayAllReferences | ( | MSElementDescrP | elemDescr, |
int | drawMode, | ||
DgnModelRefP | activeModel, | ||
int | viewMask | ||
) |
Displays the element descriptor
pointed to by elemDscrP in the views specified by viewMask if the descriptors modelRef can be reached from the root modelRef of the view.
Useful for displaying changes in dependency callbacks.
[in] | elemDescr | elements to display |
[in] | drawMode | determines how MicroStation displays the element(s). |
[in] | activeModel | determines the display transformation and clipping to be applied to the element(s) as they are drawn. |
[in] | viewMask | which views to display in |
drawMode | drawMode field meaning |
---|---|
DRAW_MODE_Normal | Draw the element(s) in its normal color. |
ERASE | Erase the element(s). |
HILITE | Draw the element(s) in the current highlight color. |
int mdlElmdscr_displayFromFile | ( | UInt32 | filePos, |
DgnModelRefP | modelRef, | ||
MSElementP | el, | ||
int | drawMode | ||
) |
This function is similar to
mdlElmDscr_display, but operates on elements in the design file rather than from an element descriptor supplied by the application.
el is an optional parameter that points to the element at position filePos from modelRef. If the element does not exist, pass NULL.
[in] | filePos | file position |
[in] | modelRef | element source |
[in] | el | element (or NULL) |
[in] | drawMode | determines how MicroStation displays the element(s). |
drawMode | drawMode field meaning |
---|---|
DRAW_MODE_Normal | Draw the element(s) in its normal color. |
ERASE | Erase the element(s). |
HILITE | Draw the element(s) in the current highlight color. |
int mdlElmdscr_displayFromFileViews | ( | UInt32 | filePos, |
DgnModelRefP | modelRef, | ||
MSElementP | elP, | ||
int | drawMode, | ||
int | viewMask | ||
) |
This function is identical to
mdlElmdscr_displayFromFile, except that the viewMask argument determines the views in which element descriptor is displayed (see mdlElement_displayInSelectedViews for a discussion of viewMask).
[in] | filePos | file position of element |
[in] | modelRef | element source |
[in] | elP | optional |
[in] | drawMode | drawing mode |
[in] | viewMask | one bit per view |
void mdlElmdscr_displayInSelectedViews | ( | MSElementDescrCP | elemDescr, |
DgnModelRefP | modelRef, | ||
int | drawMode, | ||
int | viewMask | ||
) |
This function is identical to
mdlElmdscr_display, except that the viewMask argument determines the views in which element descriptor is displayed (see mdlElement_displayInSelectedViews for a discussion of viewMask).
[in] | elemDescr | pointer to elemDscr displayed |
[in] | modelRef | element source |
[in] | drawMode | drawing mode |
[in] | viewMask | one bit per view |
void mdlElmdscr_displayInView | ( | MSElementDescrP | edP, |
DgnModelRefP | modelRef, | ||
DgnPlatform::DgnDrawMode | drawMode, | ||
MSWindow * | gwP | ||
) |
Used to display the
contents of the specified element descriptor in the specified view window using the given drawing mode.
[in] | edP | is the element descriptor indicating the element to draw in the given view. |
[in] | modelRef | indicates the model containing the element. |
[in] | drawMode | is one of the drawing mode values. |
drawMode | drawMode field meaning |
---|---|
DRAW_MODE_Normal | Draw the element(s) in its normal color. |
ERASE | Erase the element(s). |
HILITE | Draw the element(s) in the current highlight color. |
[in] | gwP | window to display element in |
void mdlElmdscr_displaySingle | ( | MSElementDescrP | elemDescr, |
DgnModelRefP | modelRef, | ||
int | drawMode | ||
) |
This function is identical to
mdlElmdscr_display except that it displays a single element descriptor and will not display the elements pointed to by elemDescr->next.
[in] | elemDescr | element to display |
[in] | modelRef | element source |
[in] | drawMode | display mode |
drawMode | drawMode field meaning |
---|---|
DRAW_MODE_Normal | Draw the element(s) in its normal color. |
ERASE | Erase the element(s). |
HILITE | Draw the element(s) in the current highlight color. |
int mdlElmdscr_displayToWindow | ( | MSWindow * | windowP, |
BSIRect const * | rectP, | ||
DgnPlatform::ViewFlags const * | viewFlags, | ||
MSElementDescrCP | elmDP, | ||
RotMatrixCP | rotMatrixP, | ||
Dpoint3d const * | originP, | ||
Dpoint3d const * | rangeP, | ||
int | threeD, | ||
int | menuColor | ||
) |
Used to display the graphics element
designated by edP in the window designated by windowP.
[in] | windowP | window |
[in] | rectP | rectangle in window (local coordinates) |
[in] | viewFlags | is used to determine the element display mode. The typedef for the viewFlags structure is included in mstypes.h. The display of line weights, fast curve display etc., are controlled by the bitfields within this structure. If NULL is passed, edP is displayed with slow curves and text, and line weight, pattern, text node and, enter data field display is enabled. |
[in] | elmDP | element descriptor |
[in] | rotMatrixP | rotation matrix |
[in] | originP | origin in element coordinates |
[in] | rangeP | range in element coordinates |
[in] | threeD | true if it's a 3D transform/element |
Scale to screen coordinates
[in] | menuColor | If menuColor is non-negative, it designates the menu color index for all of the elements. For example, if BLACK_INDEX is used, all elements are displayed in black. If a negative menuColor is used, the elements are displayed in their normal MicroStation colors. |
int mdlElmdscr_distanceAtPoint | ( | double * | distance, |
Dpoint3d * | position, | ||
Dpoint3d * | tangent, | ||
MSElementDescrP | edP, | ||
Dpoint3d * | inputPoint, | ||
double | inputTolerance | ||
) |
Returns the distance along
an element from the beginning of the element to the projection of inputPoint on the element.
The position and tangent vector are also returned. The mdlElmdscr_pointAtDistance function returns the point and tangent vector at distance along the element. All input parameters are specified in the current coordinate system.
[out] | distance | distance along elm |
[out] | position | point on element |
[out] | tangent | tangent direction |
[in] | edP | element descriptor |
[in] | inputPoint | input point |
[in] | inputTolerance | stroking tolerance |
StatusInt mdlElmdscr_evaluateCurveSpace | ( | MSElementDescrCP | pDescr, |
DPoint3dP | pOrigin, | ||
RotMatrixP | pMatrix, | ||
int * | pTangentDimensions | ||
) |
Determine the dimensionality of a curve – line, plane, or space.
[in] | pDescr | element to inspect. |
[out] | pOrigin | origin of curve. |
[out] | pMatrix | orientation matrix. For planar curves, the xy columns are inplane. For lines, the x column is the line tangent. |
[out] | pTangentDimensions | 1 if the geometry is a line, either explicitly or as a bspline that is only a line; 2 if this is a plane curve; 3 if this is a space curve. |
int mdlElmdscr_extendedDisplayToWindow | ( | MSWindow * | windowP, |
BSIRect const * | rectP, | ||
DgnPlatform::ViewFlags const * | viewFlags, | ||
MSElementDescrCP | elmDP, | ||
RotMatrixCP | rotMatrixP, | ||
Dpoint3d const * | originP, | ||
Dpoint3d const * | rangeP, | ||
int | threeD, | ||
int | menuColor, | ||
void const * | colormap, | ||
bool | clearFirst, | ||
byte const * | backgroundImageP | ||
) |
Provides some
extensions to the mdlElmdscr_displayToWindow function that allow the display of rendered images within a window.
See the mdlElmdscr_displayToWindow function for information on the first nine common arguments.
[in] | windowP | window |
[in] | rectP | rectangle in window (local coordinates) |
[in] | viewFlags | view flags to use |
[in] | elmDP | element descriptor |
[in] | rotMatrixP | rotation matrix |
[in] | originP | origin in element coordinates |
[in] | rangeP | range in element coordinates |
[in] | threeD | true if it's a 3D transform/element |
[in] | menuColor | Menu Index or -1 for element colors |
[in] | colormap | colormap is a pointer to an array of 256 bytes that contain the mapping from element colors to display indices. If NULL is passed, the master design file color map is used. |
[in] | clearFirst | clear window/zBuffer first. If clearFirst is non-zero, the background is cleared before displaying the element.byte |
[in] | backgroundImageP | is a pointer to an RGB image buffer (IMAGEFORMAT_RGB). If NULL is passed, no background image is displayed. The size of the image must match rectP. |
void mdlElmdscr_extractAttributes | ( | int * | length, |
UInt16 * | attributes, | ||
MSElementDescrP | elDscr | ||
) |
Extracts the attribute
information from the first element contained in the element descriptor elmdscrP.
The attributes are copied into the attributes buffer and length is set to the size of the attribute data in words.
[out] | length | length (words) of attribute data |
[out] | attributes | attribute data extracted |
[in] | elDscr | element descriptor to process |
int mdlElmdscr_extractCellTMatrix | ( | TransformP | forwardP, |
TransformP | inverseP, | ||
MSElementP | cellP, | ||
DgnModelRefP | modelRef | ||
) |
Used to get a transformation matrix from a cell element.
[out] | forwardP | is the forward transform extracted from the cell element. |
[out] | inverseP | is the inverse transform extracted from the cell element. |
[in] | cellP | is the cell element from which the transformation matrix is extracted. |
[in] | modelRef | indicates the model containing the cell element. |
int mdlElmdscr_extractEndPoints | ( | DPoint3dP | startP, |
DPoint3dP | startTangentP, | ||
DPoint3dP | endP, | ||
DPoint3dP | endTangentP, | ||
MSElementDescrCP | edP, | ||
DgnModelRefP | modelRef | ||
) |
Returns the start and end points
(in start and end) for the open element, edP.
Valid element types include lines, linestrings, arcs, curves, B-spline curves, multilines, complex chains and complex shapes.
[out] | startP | the starting point for the curve; pass NULL for argument if you do not need or want this value. |
[out] | startTangentP | start tangent |
[out] | endP | the ending point for the curve; pass NULL for argument if you do not need or want this value. |
[out] | endTangentP | end tangent |
[in] | edP | element descriptor |
[in] | modelRef | is used only if the input element is a multiline. |
int mdlElmdscr_extractNormal | ( | Dpoint3d * | normal, |
Dpoint3d * | point, | ||
MSElementDescrCP | edP, | ||
Dpoint3d * | inputDefaultNormal | ||
) |
Used to find the normal vector of an element, using the incredibly coarse classic IGDS/Microstation tolerance of 100 UORS.
Use mdlElmdscr_extractNormalTight to get a tighter tolerance.
[out] | normal | is a vector normal to the element. |
[out] | point | is a point on the element. |
[in] | edP | is the element to which the normal will be found. |
[in] | inputDefaultNormal | is a reference vector used only if the element normal is ambiguous, as is the case for a line element. In this case, inputDefaultNormal is a default vector in the plane of the line and the returned normal. |
int mdlElmdscr_extractNormal2 | ( | Dpoint3d * | normalP, |
Dpoint3d * | pointP, | ||
MSElementDescrP | edP, | ||
Dpoint3d * | inputDefaultNormal, | ||
bool | applyCurrTrans, | ||
bool | cleanupNormal | ||
) |
Used to find the normal vector of an element.
[out] | normalP | is a vector normal to the element. |
[out] | pointP | is a point on the element. |
[in] | edP | is the element to which the normal will be found. |
[in] | inputDefaultNormal | is a reference vector used only if the element normal is ambiguous, as is the case for a line element. In this case, inputDefaultNormal is a default vector in the plane of the line and the returned normal. |
[in] | applyCurrTrans | determines whether the inverse current transform is applied to pointP before it is returned. |
[in] | cleanupNormal | indicates whether the normal vector is cleaned up before it is returned so that coordinates near -1, 0 or 1 are set to those exact values. |
int mdlElmdscr_extractNormalTight | ( | Dpoint3d * | normal, |
Dpoint3d * | point, | ||
MSElementDescrCP | edP, | ||
Dpoint3d * | inputDefaultNormal | ||
) |
Used to find the normal vector of an element, with tight tolerance for planarity test.
[out] | normal | is a vector normal to the element. |
[out] | point | is a point on the element. |
[in] | edP | is the element to which the normal will be found. |
[in] | inputDefaultNormal | is a reference vector used only if the element normal is ambiguous, as is the case for a line element. In this case, inputDefaultNormal is a default vector in the plane of the line and the returned normal. |
int mdlElmdscr_extractNormalWithTolerance | ( | Dpoint3d * | normal, |
Dpoint3d * | point, | ||
MSElementDescrCP | edP, | ||
Dpoint3d * | inputDefaultNormal, | ||
double | absTol, | ||
double | localRelTol, | ||
double | globalRelTol | ||
) |
Used to find the normal vector of an element, with user-defined tolerance for planarity test.
[out] | normal | is a vector normal to the element. |
[out] | point | is a point on the element. |
[in] | edP | is the element to which the normal will be found. |
[in] | inputDefaultNormal | is a reference vector used only if the element normal is ambiguous, as is the case for a line element. In this case, inputDefaultNormal is a default vector in the plane of the line and the returned normal. |
[in] | absTol | is a user-defined absTol tolerance. |
[in] | localRelTol | is a user-defined local tolerance. |
[in] | globalRelTol | is a user-defined global tolerance. |
int mdlElmdscr_fillet | ( | MSElementP | fillet, |
MSElementP | pTemplate, | ||
MSElementDescrP | in0EdP, | ||
MSElementDescrP | in1EdP, | ||
double | inputRadius, | ||
Dpoint3d * | inputPoint, | ||
RotMatrixP | inputRotMatrix | ||
) |
Used to create a two dimensional
circular fillet between the specified elements.
Optionally, a template element can be specified from which the symbology settings are copied.
[out] | fillet | is the element descriptor for the fillet arc element after it is created. |
[in] | pTemplate | is an element from which the symbology settings are copied to the fillet arc. |
[in] | in0EdP | is the first element to fillet. |
[in] | in1EdP | is the second element to fillet. |
[in] | inputRadius | is the desired fillet arc radius. |
[in] | inputPoint | indicates which fillet is desired by proximity. For example, if the elements to fillet include two intersecting lines, there are four possible fillets that could be created (assuming the radius value does not preclude any of the four). The fillet closest to the given point is the fillet that is selected and created. |
[in] | inputRotMatrix | is the rotation matrix to apply to the fillet. This may be NULL. |
MSElementDescrP mdlElmdscr_findElementId | ( | MSElementDescrP | edP, |
DgnPlatform::ElementId | reqId | ||
) |
Get a pointer to the component element descriptor having the specified ElementId in the supplied complex element descriptor.
[in] | edP | is a pointer to the header element descriptor of a complex element. |
[in] | reqId | indicates the ElementId of the target element within the complex element. |
int mdlElmdscr_fromCompoundElement | ( | MSElementDescrH | edPP, |
MSElementP | elemP, | ||
DgnModelRefP | modelRef, | ||
UInt32 | graphicGroup, | ||
bool | transformToWorld, | ||
bool | expandNested | ||
) |
Converts a compound element
(multi-line, dimension, shared cell) to a set of simple (pre-MicroStation 4.0 compatible) elements.
[out] | edPP | points to the address of an element descriptor that contains the simple elements representing the compound element, elemP. |
[in] | elemP | input compound element |
[in] | modelRef | is the model reference for elemP. It is used to resolve associative points. |
[in] | graphicGroup | is a graphic group number for the output elements. If this is nonzero, the elements will all receive this graphic group number and therefore will be a part of the same graphic group. |
[in] | transformToWorld | for shared cell instances |
[in] | expandNested | expand nested shared cells |
int mdlElmdscr_fromCone | ( | MSElementDescrH | edPP, |
MSElementP | coneP, | ||
TransformP | transP | ||
) |
Used to create an element descriptor chain from the specified cone element.
[out] | edPP | is a pointer to the start of the element descriptor chain created from the cone. |
[in] | coneP | is a pointer to the cone element. |
[in] | transP | is a transform to be applied to the element descriptor chain. This transform is not applied to the cone element. |
int mdlElmdscr_fromSelectionSet | ( | MSElementDescrH | edPP | ) |
Used to create an
element descriptor chain from the set of elements that are currently in the selection set.
[out] | edPP | is the element descriptor chain that includes all of the elements in the selection set. |
int mdlElmdscr_generatePartial | ( | MSElementDescrH | outEdPP, |
MSElementDescrCP | elmDescrP, | ||
double | t1, | ||
double | t2, | ||
bool | splineParameters | ||
) |
Generates the portion
of the element descriptor elmDescr that is between t1 and t2 and returns this portion in outEdPP.
The parameters correspond to the parameterization of the element after conversion to a B-spline curve entity with the mdlBspline_convertToCurve function. The splineParameters argument should always be set to true.
[out] | outEdPP | output (partial) element |
[in] | elmDescrP | input element |
[in] | t1 | start parameter |
[in] | t2 | end parameter |
[in] | splineParameters | t1 and t2 are b-spline params |
UInt32 mdlElmdscr_getByElemRef | ( | MSElementDescrH | elemDescrPP, |
ElementRefP | elemRef, | ||
DgnModelRefP | modelRef, | ||
int | expandSharedCells, | ||
UInt32 * | readFilePos | ||
) |
Get an element descriptor given an ElementRefP.
[out] | elemDescrPP | The element descriptor created from elemRef |
[in] | elemRef | The ElementRefP for which the element descriptor is created |
[in] | modelRef | Points to the model containing the element. This parameter is only used to fill in the el->h.dgnModelRef field in the descriptor. It can be NULL. |
[in] | expandSharedCells | Unsupported option, must be 0 or read fails. |
[in] | readFilePos | The actual file position. |
MSElementDescrP mdlElmdscr_getThicknessEdP | ( | MSElementDescrP | edP, |
DgnModelRefP | modelRef | ||
) |
Get a surface or solid element that represents a planar element with thickness.
Element thickness is a new concept introduced in V8. The presence of a thickness linkage on a planar element implies that the element is extruded by the thickness distance. The mdlElmdscr_getThicknessEdP function will return a solid or surface element that represents an element with thickness
[in] | edP | a planar element with a non-zero thickness. |
[in] | modelRef | the modelRef for the element. |
int mdlElmdscr_getUsedLevels | ( | BitMaskP | pBitMaskOut, |
MSElementDescrP | pElemDscrIn | ||
) |
Get a bit-mask which represents the set of the levels used by an element.
[out] | pBitMaskOut | computed bitmask (must be initialized before calling this function) |
[in] | pElemDscrIn | element descriptor whose used levels are to be got |
bool mdlElmdscr_hasLineStyle | ( | MSElementDescrCP | lineStyleEdP | ) |
Queries if an element descriptor has line style.
[in] | lineStyleEdP | is the element descriptor to query. |
void mdlElmdscr_initOrAddToChainWithTail | ( | MSElementDescrH | ppHeadDescr, |
MSElementDescrH | ppTailDescr, | ||
MSElementDescrP | pDescr | ||
) |
Append a descriptor to a growing chain, maintaining both head and tail pointers within the chain so that subsequent calls can access the tail directly without walking the chain.
Before starting the chain construction, caller initializes both the head and tail pointers to NULL.
[in,out] | ppHeadDescr | pointer to head of chain. |
[in,out] | ppTailDescr | pointer to tail of chain. |
[in] | pDescr | descriptor to add at tail. |
bool mdlElmdscr_isAssociativeRegion | ( | MSElementDescrCP | edP | ) |
Used to determine whether the specified element descriptor contains an element that is an associative region.
[in] | edP | is the element descriptor to test. |
bool mdlElmdscr_isAssociativeRegionChild | ( | MSElementDescrH | regionEdPP, |
MSElementDescrP | edP | ||
) |
Used to determine whether the element contained by the specified element descriptor is a
child element of an associative region.
Optionally, a pointer to the parent associative region can be obtained from this function as well.
[out] | regionEdPP | if not NULL, is set to point to the associative region parent of the element contained by edP, if it is a child of an associative region. |
[in] | edP | is the element descriptor to be tested. |
bool mdlElmdscr_isClosed | ( | MSElementDescrCP | edP | ) |
Queries if an element descriptor is a closed element; i.e., a shape, complex shape, ellipse or closed B-spline curve.
[in] | edP | is the element descriptor to query. |
bool mdlElmdscr_isGroupedHole | ( | MSElementDescrCP | groupEdP | ) |
Queries if an element descriptor is
a grouped hole element; i.e., an element that has a hole punched in it (such as can be created with mdlElmdscr_createShapeWithHoles).
[in] | groupEdP | is the element descriptor to query. |
bool mdlElmdscr_isOpen | ( | MSElementDescrCP | edP | ) |
Queries if an element descriptor is an open
element; i.e., a line, line string, curve, open B-Spline curve or complex chain.
[in] | edP | is the element descriptor to query. |
bool mdlElmdscr_isRule | ( | MSElementDescrCP | edP | ) |
Used to determine whether the specified element descriptor contains an
element of either the DgnElementClass::PrimaryRule or the DgnElementClass::ConstructionRule.
See mselems.h for these definitions.
[in] | edP | is the element descriptor to test. |
int mdlElmdscr_isSphere | ( | double * | radiusP, |
Dpoint3d * | centerP, | ||
RotMatrixP | rotMatrixP, | ||
MSElementDescrP | edP | ||
) |
Used to determine whether the
specified element is spherical.
For this to be true, the element must be a surface or solid, have an arc as its profile element with the center of the arc on the axis of revolution and the arc and axis must be in the same plane. If all of these conditions are true, then the element is at least a partial sphere.
[out] | radiusP | is the radius value of the sphere. |
[out] | centerP | is the center point of the sphere. |
[out] | rotMatrixP | is the rotation matrix of the sphere. |
[in] | edP | is the element to test. |
int mdlElmdscr_numElementsSingle | ( | MSElementDescrCP | edP | ) |
Used to find the number of child elements within an element descriptor chain.
[in] | edP | is a pointer to the start of the element descriptor chain. |
int mdlElmdscr_open | ( | MSElementDescrH | outEdPP, |
MSElementDescrP | inEdP, | ||
DgnModelRefP | modelRef | ||
) |
Converts the closed element inEdP
to an open element, outEdPP.
This function will convert a shape to a line string, an ellipse to an arc, a complex shape to a complex chain etc.
[out] | outEdPP | open element descriptor |
[in] | inEdP | element descriptor to open |
[in] | modelRef | is used only to resolve associative points, in most cases MASTERFILE can be passed for this parameter. |
int mdlElmdscr_operation | ( | MSElementDescrP | elemDescr, |
PFElemOperation | elemFunc, | ||
CallbackArgP | params, | ||
int | opFlags | ||
) |
Sets a user call-back function to recursively iterate through all
component elements in a complex element descriptor.
[in] | elemDescr | element descriptor |
[in] | elemFunc | function to call |
[in] | params | user defined |
[in] | opFlags | determines the times at which elmFunc is called for the various elements in an element descriptor. The following values are possible: |
opFlag | Meaning |
---|---|
ELMD_PRE_HDR | For outermost header elements, call elmFunc for this element before it is called for component elements. |
ELMD_PRE_NESTEDHDR | For nested header elements, call elmFunc for this element before it is called for component elements. |
ELMD_POST_HDR | For outermost header elements call elmFunc for this element after it is called for all component elements. |
ELMD_POST_NESTEDHDR | For nested header elements, call elmFunc for this element after it is called for all component elements. |
ELMD_ELEMENT | Call elmFunc for component elements. |
ELMD_ALL_ONCE | Call elmFunc only once for each element. (defined as (ELMD_ELEMENT | ELMD_PRE_HDR | ELMD_PRE_NESTEDHDR)). |
ELMD_HDRS_ONCE | Call elmFunc once for header elements only (defined as (ELMD_PRE_HDR | ELMD_PRE_NESTEDHDR)). |
StatusInt mdlElmdscr_orientationExt | ( | TransformP | pTransform, |
MSElementDescrCP | pSourceDescr, | ||
DgnModelRefP | modelRef | ||
) |
return a natural coordinate frame for the element.
[out] | pTransform | coordinate frame. |
[in] | pSourceDescr | source element |
[in] | modelRef | source model ref. |
int mdlElmdscr_partialDelete | ( | MSElementDescrH | outEdPP1, |
MSElementDescrH | outEdPP2, | ||
MSElementDescrP | inEdP, | ||
Dpoint3d * | point1, | ||
Dpoint3d * | point2, | ||
Dpoint3d * | point3, | ||
int | view | ||
) |
Returns the portions of inEdP that are not between the projection of point1 and point3 on the element.
This is the same process performed by MicroStation's DELETE PARTIAL command. If inEdP is closed, point2 is used to determine the portion of the element to be deleted. For closed elements, or open elements where the deleted portion includes the beginning or end of inEdP, only a single element is returned and outEdPP2 is set to NULL. If the entire input element is deleted, outEdPP1 is set to NULL as well.
[out] | outEdPP1 | 1st partial elm (or NULL) |
[out] | outEdPP2 | 2nd partial elm (or NULL) |
[in] | inEdP | input element |
[in] | point1 | first point |
[in] | point2 | 2nd point (or NULL) |
[in] | point3 | 3rd point |
[in] | view | view is used to perform the projection of the input points to the element. |
int mdlElmdscr_pointAtDistance | ( | Dpoint3d * | position, |
Dpoint3d * | tangent, | ||
double | inputDistance, | ||
MSElementDescrP | edP, | ||
double | inputTolerance | ||
) |
Returns the point and tangent vector at distance along the element.
All input parameters are specified in the current coordinate system.
[out] | position | point on element |
[out] | tangent | tangent direction |
[in] | inputDistance | distance along elm |
[in] | edP | element |
[in] | inputTolerance | stroking tolerance |
UInt32 mdlElmdscr_read | ( | MSElementDescrH | elemDescrPP, |
UInt32 | filePos, | ||
DgnModelRefP | modelRef, | ||
int | expandSharedCells, | ||
UInt32 * | readFilePos | ||
) |
Reads the element at the position filePos from
the element cache for model modelRef and creates a new element descriptor.
A pointer to the element descriptor is returned in elemDscrPP. mdlElmdscr_readToMaster is similar, but also transforms the elements in the element descriptor to the master file coordinate system if modelRef indicates a reference file. If the element is from the master file, mdlElmdscr_readToMaster is equivalent to mdlElmdscr_read.
[out] | elemDescrPP | element descriptor |
[in] | filePos | file position to read from |
[in] | modelRef | element source |
[in] | expandSharedCells | Unsupported option, must be 0 or read fails. |
[out] | readFilePos | actual file position |
UInt32 mdlElmdscr_readComponentToMaster | ( | MSElementDescrH | edPP, |
DisplayPathCP | pathP, | ||
int | elementNumber, | ||
int | expandSharedCells, | ||
bool | returnNonCellHeader, | ||
bool | allowGroupHoles, | ||
UInt32 * | startFilePosP | ||
) |
Used to read an element from the specified design file and add it to the master design file.
If the desired element is part of a compound element, it can be further specified by its index within the compound element.
[out] | edPP | is the element descriptor created for the element after it is added to the master design file. |
[in] | pathP | is the display to get the component element from. |
[in] | elementNumber | Unsupported option, value is ignore. |
[in] | expandSharedCells | If pathP is to a component of s shared cell definition this option controls whether to return the component (with the path transform applied) or to stop at the shared cell instance. |
[in] | returnNonCellHeader | if true will return the complex header for the component element in the display path. |
[in] | allowGroupHoles | when returnNonCellHeader is true, whether group hole cells should be returned. |
[in] | startFilePosP | is the starting file position to read elements from. |
UInt32 mdlElmdscr_readToMaster | ( | MSElementDescrH | elemDescrPP, |
UInt32 | filePos, | ||
DgnModelRefP | modelRef, | ||
int | expandSharedCells, | ||
UInt32 * | startFilePos | ||
) |
Reads the element at the position filePos from the element cache for model
modelRef and creates a new element descriptor.
A pointer to the element descriptor is returned in elemDescr. mdlElmdscr_readToMaster is similar, but also transforms the elements in the element descriptor to the master file coordinate system if modelRef indicates a reference file. If the element is from the master file, mdlElmdscr_readToMaster is equivalent to mdlElmdscr_read.
[out] | elemDescrPP | element descriptor |
[in] | filePos | file position to read from |
[in] | modelRef | element source |
[in] | expandSharedCells | Unsupported option, must be 0 or read fails. |
[out] | startFilePos | actual file pos |
int mdlElmdscr_reverse | ( | MSElementDescrH | outEdPP, |
MSElementDescrCP | inEdP, | ||
DgnModelRefP | modelRef | ||
) |
Reverses the direction of inEdP
and returns the reversed element in outEdPP.
Valid element types include lines, line strings, shapes, arcs, curves, B-spline curves, complex chains and complex shapes.
[out] | outEdPP | reversed element |
[in] | inEdP | element to be reversed |
[in] | modelRef | is the model reference for the element. This is used only to resolve point associations and in most cases MASTERFILE can be used for this parameter. |
int mdlElmdscr_reverseNormal | ( | MSElementDescrH | outEdPP, |
MSElementDescrCP | inEdP, | ||
DgnModelRefP | modelRef | ||
) |
Reverses the normal
direction for a surface, solid or closed element.
[out] | outEdPP | points to the address of the reversed element. |
[in] | inEdP | is the address of the input element descriptor. |
[in] | modelRef | is the model reference for the element. This is used only to resolve point associations and in most cases MASTERFILE can be used for this parameter. |
UInt32 mdlElmdscr_rewrite | ( | MSElementDescrP | newElemDscr, |
MSElementDescrP | oldElemDscr, | ||
UInt32 | filePos | ||
) |
Overwrites the existing MicroStation
element(s) pointed to by oldElemDscrP with the new element(s) pointed to by newElemDscrP at file position filePos.
[in] | newElemDscr | new elements |
[in] | oldElemDscr | for compatibility with previous releases. Ignored, just pass NULL! |
[in] | filePos | file position |
UInt32 mdlElmdscr_rewriteByModelRef | ( | MSElementDescrP | newEdP, |
MSElementDescrP | oldEdP, | ||
UInt32 | filePosition, | ||
DgnModelRefP | modelRef | ||
) |
Replaces the specified element descriptor in the given file position, with a new element descriptor from the given modelRef.
[in] | newEdP | the new element descriptor that is written to the file |
[in] | oldEdP | for compatibility with previous releases. Ignored, pass NULL! |
[in] | filePosition | the file position of the old element descriptor |
[in] | modelRef | the model that is the source of the new element descriptor |
void mdlElmdscr_setProperties | ( | MSElementDescrH | edPP, |
DgnPlatform::LevelId const * | level, | ||
UInt32 const * | ggNum, | ||
DgnPlatform::DgnElementClass const * | elementClass, | ||
bool const * | locked, | ||
bool const * | newElm, | ||
bool const * | modified, | ||
bool const * | viewIndepend, | ||
bool const * | solidHole | ||
) |
Changes the level, element class, graphic group, and other properties in the element desciptor pointed to by edPP to the values specified.
Pass NULL for parameters where you want to preserve the existing element value.
[in,out] | edPP | element to set properties |
[in] | level | level (or NULL) |
[in] | ggNum | graphic group (or NULL) |
[in] | elementClass | class (or NULL) |
[in] | locked | locked (or NULL) |
[in] | newElm | new (or NULL) |
[in] | modified | modified (or NULL) |
[in] | viewIndepend | view independent (or NULL) |
[in] | solidHole | solid/hole (or NULL) |
void mdlElmdscr_setSymbology | ( | MSElementDescrH | edPP, |
UInt32 * | color, | ||
Int32 * | style, | ||
UInt32 * | weight, | ||
UInt32 * | fillColor | ||
) |
Changes the color, weight, and style in the element desciptor pointed to by edPP to the values specified.
Pass NULL for parameters where you want to preserve the existing element value.
[in,out] | edPP | element descriptor |
[in] | color | color (or NULL) |
[in] | style | style (or NULL) |
[in] | weight | weight (or NULL) |
[in] | fillColor | color (or NULL |
void mdlElmdscr_setVisible | ( | MSElementDescrP | edP, |
bool | visible | ||
) |
Used to set the visibility flag of the contents of the specified element descriptor.
[in] | edP | is the element descriptor containing the element to set. |
[in] | visible | determines whether the element is set visible or invisible. Set this value to true to display the element, or false to make the element invisible. |
int mdlElmdscr_show | ( | MSElementDescrP | edP, |
WCharCP | currentIndent | ||
) |
Used to print information from the
element descriptor header in a formatted fashion.
The printed values include the element type, its complex status, its 3d status, and if it is a graphic element the symbology values for color, weight, style, level, graphic group number and class. If the element is not a graphic element only its level will be printed.
[in] | edP | is the element descriptor to get the information from to print. |
[in] | currentIndent | is the number of character spaces to indent the information before printing. |
int mdlElmdscr_signedOffset | ( | MSElementDescrH | outDscrPP, |
MSElementDescrCP | curveDescrP, | ||
double | distance, | ||
DVec3dP | normal | ||
) |
Creates an offset of a curve element.
[out] | outDscrPP | output geometry |
[in] | curveDescrP | input geometry |
[in] | distance | distance to offset |
[in] | normal | vector to resolve directions in cases where the element does not clearly define a plane. For LINES, the offset direction is the cross product of the line direction and this vector. |
StatusInt mdlElmdscr_simplifyComplexChainOrShape | ( | MSElementDescrH | edPP, |
DgnModelRefP | modelRef | ||
) |
Used to simplify a complex element, if possible, by concatenating consecutive linear
segments into linestrings.
[in] | edPP | is the complex element to be simplified. |
[in] | modelRef | indicates the model that contains the element. |
int mdlElmdscr_spaceFillet | ( | MSElementDescrH | ppFilletChain, |
MSElementP | pTemplate, | ||
MSElementDescrCP | pCurveA, | ||
MSElementDescrCP | pCurveB, | ||
double | radius, | ||
DPoint3dP | pCenterSelect | ||
) |
Compute circular arc fillets between two elements.
[out] | ppFilletChain | computed arc or arcs. If selection point is given, only the arc with center closest to the selector is returned. If selection point is not given, all arcs are returned in a chain |
[in] | pTemplate | is an element from which the symbology settings are copied to the fillet arcs. |
[in] | pCurveA | is the first element to fillet. |
[in] | pCurveB | is the second element to fillet. |
[in] | radius | is the desired fillet arc radius. |
[in] | pCenterSelect | optional point to identify preferred center. |
void mdlElmdscr_stripAttributes | ( | MSElementDescrH | elDscrPP | ) |
Removes all of the attribute
data on the elements contained in descriptor elmdscrPP.
If there are complex elements contained in the element descriptor, only the headers of the complex elements are processed.
[in,out] | elDscrPP | element descriptor to process |
int mdlElmdscr_stripFill | ( | MSElementDescrH | edPP | ) |
Removes the fill attribute linkage
from an element.
[in,out] | edPP | points to the address of the element descriptor to be modified. This must be a closed element (shape, complex shape, ellipse, grouped hole orphan cell or closed B-spline curve). |
int mdlElmdscr_stroke | ( | Dpoint3d ** | points, |
int * | nPoints, | ||
MSElementDescrP | edP, | ||
double | tol | ||
) |
Strokes the element descriptor pointed
to by elmDscrP into vectors in an array pointed to by points.
(This array should be the address of a pointer to a Dpoint3d). MicroStation allocates memory for the vectors and returns the starting address in points.
[out] | points | vectors for edP |
[out] | nPoints | The number of points in the array is returned in numPoints. |
[in] | edP | elements |
[in] | tol | is the maximum distance (in master units) between the actual curve and the approximating vectors for curved elements. |
int mdlElmdscr_transform | ( | MSElementDescrH | edPP, |
TransformCP | userTrans | ||
) |
Transforms the element descriptor by the supplied transformation matrix.
The transformation matrix relates to the current coordinate system if one exists.
[in,out] | edPP | element descriptor |
[in] | userTrans | transformation matrix |
void mdlElmdscr_transformAllowModification | ( | MSElementDescrH | edPP, |
TransformCP | userTrans, | ||
DgnModelRefP | sourceModelRef, | ||
DgnModelRefP | destModelRef, | ||
const UInt32 | options | ||
) |
Transforms the element descriptor by the supplied transformation matrix.
The transformation matrix relates to the current coordinate system if one exists. Some important information regarding this function:
[in,out] | edPP | Element descriptor to transform. |
[in] | userTrans | Transformation matrix to apply |
[in] | sourceModelRef | Model ref where the elements were read or created. Used when (*edPP)->h.modelRef is NULL. Can be the same as destination. |
[in] | destModelRef | Model ref where the elements will be written. Can be the same as source. |
[in] | options | Additional options. See TransformOptionValues for TRANSFORM_OPTIONS_ mask values. |
int mdlElmdscr_undoableDelete | ( | MSElementDescrP | elemDescrP, |
UInt32 | filePos, | ||
bool | display | ||
) |
Deletes the element(s)
pointed to by elemDscrP at file position filePos.
MicroStation needs the element(s) to save in the undo buffer. If the element descriptor does not exist, pass NULL for elemDscrP and MicroStation will re-read the elements from the cache. Doing so adds some overhead to mdlElmdscr_undoableDelete, so always pass the element descriptor if it exists.
[in] | elemDescrP | element descr to delete |
[in] | filePos | file position |
[in] | display | If display is true, MicroStation erases the elements from the screen as it deletes them. Otherwise, it does not erase them. |
int mdlProject_perpendicular | ( | DPoint3dP | position, |
DPoint3dP | tangent, | ||
DPoint3dP | perpendicular, | ||
MSElementDescrP | edP, | ||
DgnModelRefP | modelRef, | ||
DPoint3dP | inputPoint, | ||
RotMatrixP | inputRotMatrix, | ||
double | inputTolerance | ||
) |
Projects a point to an element on a perpendicular from the element.
The position of the perpendicular endpoint, direction, and the element perpendicular are returned.
[out] | position | position of perpendicular end |
[out] | tangent | tangent direction |
[out] | perpendicular | perpendicular direction |
[in] | edP | element |
[in] | modelRef | (for compounds elements only) |
[in] | inputPoint | point to project |
[in] | inputRotMatrix | rotation matrix |
[in] | inputTolerance | tolerance |
int mdlProject_tangent | ( | DPoint3dP | position, |
DPoint3dP | tangent, | ||
DPoint3dP | perpendicular, | ||
MSElementDescrP | edP, | ||
DgnModelRefP | modelRef, | ||
DPoint3dP | point, | ||
RotMatrixP | rotMatrix, | ||
DPoint3dP | closestPoint, | ||
double | tolerance | ||
) |
Projects a point to an element along a tangent from the element.
[out] | position | position of tangent end |
[out] | tangent | tangent direction |
[out] | perpendicular | perpendicular direction |
[in] | edP | element |
[in] | modelRef | (for compounds elements only) |
[in] | point | input point |
[in] | rotMatrix | rotation matrix |
[in] | closestPoint | closest point to tangent |
[in] | tolerance | tolerance |
DGNPLATFORM_EXPORT XAttributeChangeSetP QueryXAttributeChangeSet | ( | ) | const |
DGNPLATFORM_EXPORT void Release | ( | ) |
Decrement the use count for this MSElementDescr. The last reference frees the MSElementDescr.
DGNPLATFORM_EXPORT MSElementDescrP RemoveElement | ( | ) |
Removes this element from an element descriptor chain.
It frees the memory allocated for this element and returns a pointer to the next element descriptor in the chain.
DGNPLATFORM_EXPORT MSElementDescrP ReplaceDescr | ( | MSElementDescrR | newDscr | ) |
Replace this MSElementDescr, and all of its children, with a new MSElementDescr.
If this MSElementDescr is a component of a complex element, its previous/next/etc. pointers are spliced to point to newDscr
.
[in] | newDscr | The new MSElementDescr to replace this one. |
newDscr
manually by the caller or it will be lost. DGNPLATFORM_EXPORT MSElementDescrP ReplaceElement | ( | MSElementCR | element | ) |
Replace the element held by this MSElementDescr with a new element.
If the new element is the same size or smaller (in bytes) as the current element, it is overwritten in place. If thew new element is larger than the current one, a new MSElementDescr is allocated and returned, and this MSElementDescr is Released. If this MSElementDescr is a component of a complex element, the previous/next/etc. pointers are spliced to the MSElementDescr returned by this method.
[in] | element | The new element to be held by a (potentially) new MSElementDescr. |
element
. This may either point to this MSElementDescr or a new one. DGNPLATFORM_EXPORT void SetModelRef | ( | DgnModelRefP | modelRef | ) |
DGNPLATFORM_EXPORT void Validate | ( | DgnModelRefP | modelRef, |
bool | ignoreIsValid = false |
||
) |
Updates complex header element information based on current components.
[in] | modelRef | Element source. |
[in] | ignoreIsValid | Perform validation even if h.isValid is true. (ex. Application modifies component elements directly) |