Functions
Element Clipping

Functions

int mdlClip_element (MSElementDescrH insideEdPP, MSElementDescrH outsideEdPP, MSElementDescrP inputEdP, DgnModelRefP modelRef, ClipVectorCP clip, int view)
 Clips the specified element to a specified region and view. More...
 
StatusInt mdlClip_fromElement (ClipVectorPtr &clipPP, MSElementDescrCP pElement, bool outside, int view)
 Gets the clipping descriptor describing an element. More...
 
int mdlClip_getRefBoundary (ClipVectorPtr &clipPP, DgnModelRefP modelRef, int view)
 Gets a clipping descriptor that describes a reference file boundary. More...
 
bool mdlClip_isElemInside (bool *overlap, MSElementDescrP edP, ClipVectorCP clipP, int view, bool allowOverlap)
 Determines whether the specifed element is within a clipping descriptor. More...
 

Detailed Description

Function Documentation

int mdlClip_element ( MSElementDescrH  insideEdPP,
MSElementDescrH  outsideEdPP,
MSElementDescrP  inputEdP,
DgnModelRefP  modelRef,
ClipVectorCP  clip,
int  view 
)

Clips the specified element to a specified region and view.

Parameters
[out]insideEdPPThe portion of the element that is inside the clipping descriptor is returned in insideEdPP. If the element is totally inside, *insideEdPP is set to inputEdP (the element is not duplicated). If the element is totally outside, *insideEdPP is set to NULL.
[out]outsideEdPPThe portion of the element that is outside the clipping descriptor
[in]inputEdPinput element descriptor
[in]modelRefsource modelRef for input element descriptor
[in]clipclipping descriptor. Should be a pointer to a clipping descriptor retrieved by one of the mdlClip_get... routines.
[in]viewview number
Remarks
If the element overlaps the clipping descriptor, and outsideEdPP is not NULL, the portion of the element that is outside the descriptor is returned in *outsideEdPP. If the portion of overlapping elements that is outside the clipping descriptor is not required, NULL should be passed for outsideEdPP.
Returns
mdlClip_element returns SUCCESS if the element is successfully processed.
See also
mdlClip_getFence mdlClip_getRefBoundary mdlClip_free mdlClip_isElemInside
Remarks
Required Library: mdlbltin.lib
StatusInt mdlClip_fromElement ( ClipVectorPtr clipPP,
MSElementDescrCP  pElement,
bool  outside,
int  view 
)

Gets the clipping descriptor describing an element.

The element can be any closed, planar element or a surface or solid of projection. If a planar element is selected then the clip volume consists of the volume produced by sweeping the element along its normal.

Parameters
[out]clipPPclipping descriptor
[in]pElementThe clipping element.
[in]outsideif true then the clipping area consists of the volume outside the element.
[in]viewThe view is used for to determine the stroke tolerance for curved elements. If -1 then an appropriate calculated based on the element size.
Returns
SUCCESS if the element is valid for clipping and a clip descriptor is created.
See also
mdlClip_free mdlClip_getRefBoundary mdlClip_element mdlClip_isElemInside
Remarks
Required Library: mdlbltin.lib
int mdlClip_getRefBoundary ( ClipVectorPtr clipPP,
DgnModelRefP  modelRef,
int  view 
)

Gets a clipping descriptor that describes a reference file boundary.

The clipping descriptor can be passed to either mdlClip_element or mdlClip_isElemInside to clip elements to the reference file boundary or determine whether an element is within the boundary. The clipping descriptor should be freed with mdlClip_free when it is no longer required.

Parameters
[in]clipPPclipping descriptor
[in]modelRefthe modelRef for the reference file. As reference boundaries can differ for views with different orientations, view is required to determine the correct orientation.
[in]viewview number
Returns
SUCCESS if the clipping descriptor is returned correctly, and an appropriate error status otherwise.
See also
mdlClip_getFence mdlClip_free mdlClip_element mdlClip_isElemInside
Remarks
Required Library: mdlbltin.lib
bool mdlClip_isElemInside ( bool *  overlap,
MSElementDescrP  edP,
ClipVectorCP  clipP,
int  view,
bool  allowOverlap 
)

Determines whether the specifed element is within a clipping descriptor.

If allowOverlap is non-zero, overlapping elements are accepted as inside and overlap is set to true if an element overlaps the clipping boundary.

Parameters
[out]overlaptrue if overlap
[in]edPelement to test
[in]clipPclip descriptor
[in]viewview number
[in]allowOverlaptrue to allow overlaps
Remarks
Note that "inside" can be relative, as the clipping descriptor may represent a fence void and, in this case, the clipping region would actually be the area outside the fence, rather than inside.
Returns
a non-zero value if the element is inside the clipping descriptor and zero otherwise.
See also
mdlClip_getFence mdlClip_getRefBoundary mdlClip_free mdlClip_element
Remarks
Required Library: mdlbltin.lib

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