Public Types | Static Public Member Functions | List of all members
AssociativePoint Struct Reference

#include <AssociativePoint.h>

Public Types

enum  CreateOptions { CREATE_ASSOC_Normal = 0, CREATE_ASSOC_DisallowFarElm = (1 << 0), CREATE_ASSOC_DisallowCustom = (1 << 1), CREATE_ASSOC_AllowAdjustedPoints = (1 << 2) }
 
enum  CreateMask {
  CREATE_ASSOC_MASK_DIMENSION = (1 << 0), CREATE_ASSOC_MASK_MLINE = (1 << 1), CREATE_ASSOC_MASK_CELLS = (1 << 2), CREATE_ASSOC_MASK_LINEAR = (1 << 3),
  CREATE_ASSOC_MASK_NOTE = (1 << 4), CREATE_ASSOC_MASK_TEXT = (1 << 5)
}
 
enum  ArcLocation { ARC_ANGLE = 0, ARC_CENTER = 1, ARC_START = 2, ARC_END = 3 }
 

Static Public Member Functions

static DGNPLATFORM_EXPORT
BentleyStatus 
IsValid (AssocPoint &assocPoint, DgnModelRefP pathRoot, DgnModelRefP parentModel)
 Test if the associative point evaluates to a valid location. More...
 
static DGNPLATFORM_EXPORT
BentleyStatus 
SetRoot (AssocPoint &assocPoint, ElementId elemId, ElementId refAttId, int rootIndex=0)
 Complete setup of a new associative point by setting the target/root element for the dependency by a pair of element ids. More...
 
static DGNPLATFORM_EXPORT
BentleyStatus 
SetRoot (AssocPoint &assocPoint, DisplayPathCP path, DgnModelRefP parentModel, bool allowFarElm, int rootIndex=0)
 Complete setup of a new associative point by setting the target/root element for the dependency from a DisplayPath. More...
 
static DGNPLATFORM_EXPORT
BentleyStatus 
GetRoot (DisplayPathP path, int *nRootsP, AssocPoint const &assocPoint, DgnModelRefP modelRef, int rootIndex=0)
 Populate a seed DisplayPath for a root of an associative point dependency. More...
 
static DGNPLATFORM_EXPORT void InitKeypoint (AssocPoint &assocPoint, UShort vertex, UShort nVertex, UShort numerator, UShort divisor)
 Initialize the data in the associative point for an association that represents a point on a linear element. More...
 
static DGNPLATFORM_EXPORT void InitOrigin (AssocPoint &assocPoint, UShort option)
 Initialize the data in the associative point for an association that represents the origin of an element. More...
 
static DGNPLATFORM_EXPORT void InitArc (AssocPoint &assocPoint, ArcLocation keyPoint, double angle=0.0)
 Initialize the data in the associative point for an association that represents a point on an arc or ellipse element. More...
 
static DGNPLATFORM_EXPORT void InitProjection (AssocPoint &assocPoint, UShort vertex, UShort nVertex, double ratio)
 Initialize the data in the associative point for an association that represents a point on a linear element. More...
 
static DGNPLATFORM_EXPORT void InitMline (AssocPoint &assocPoint, UShort vertex, UShort nVertex, UShort lineNo, double offset, bool joint)
 Initialize the data in the associative point for an association that represents a point on a multiline element. More...
 
static DGNPLATFORM_EXPORT void InitBCurve (AssocPoint &assocPoint, double uParam)
 Initialize the data in the associative point for an association that represents a point on a bspline curve. More...
 
static DGNPLATFORM_EXPORT void InitBSurface (AssocPoint &assocPoint, double uParam, double vParam)
 Initialize the data in the associative point for an association that represents a point on a bspline surface. More...
 
static DGNPLATFORM_EXPORT void InitMeshEdge (AssocPoint &assocPoint, int edgeIndex, int nEdge, double uParam)
 Initialize the data in the associative point for an association that represents a point on a mesh edge. More...
 
static DGNPLATFORM_EXPORT void InitMeshVertex (AssocPoint &assocPoint, int vertexIndex, int nVertex)
 Initialize the data in the associative point for an association that represents a mesh vertex. More...
 
static DGNPLATFORM_EXPORT void InitIntersection (AssocPoint &assocPoint, byte index, UShort seg1, UShort seg2, int nSeg1, int nSeg2)
 Initialize the data in the associative point for an association that represents the intersection of 2 curve paths. More...
 
static DGNPLATFORM_EXPORT StatusInt ExtractPoint (AssocPoint &assocPoint, ElementHandleCR element, int pointNum, int maxPoints)
 Extracts the association information from the specified point on the given element. More...
 
static DGNPLATFORM_EXPORT StatusInt InsertPoint (EditElementHandleR element, AssocPoint const &assocPoint, int pointNum, int maxPoints)
 Insert an association point to the specified element. More...
 
static DGNPLATFORM_EXPORT
BentleyStatus 
GetPoint (DPoint3dP outPoint, AssocPoint const &assocPoint, DgnModelRefP modelRef)
 Uses the information in assocPoint to create a 3D data point that is returned in outPoint. More...
 
static DGNPLATFORM_EXPORT StatusInt RemovePoint (EditElementHandleR element, int pointNum, int maxPoints)
 Remove a single associative point from an element. More...
 
static DGNPLATFORM_EXPORT StatusInt RemoveAllAssociations (EditElementHandleR element)
 Removes all association points from an element. More...
 
static DGNPLATFORM_EXPORT StatusInt CreateFromSnap (AssocPoint &assocPoint, SnapPathCP pathIn, int modifierMask, DgnModelRefP parentModel, CreateOptions options)
 Initialize an associative point from a snap path. More...
 
static DGNPLATFORM_EXPORT void RegisterExtensions ()
 Register roots changed extension for known handlers. More...
 

Member Enumeration Documentation

Enumerator
ARC_ANGLE 
ARC_CENTER 
ARC_START 
ARC_END 
enum CreateMask
Enumerator
CREATE_ASSOC_MASK_DIMENSION 
CREATE_ASSOC_MASK_MLINE 
CREATE_ASSOC_MASK_CELLS 
CREATE_ASSOC_MASK_LINEAR 
CREATE_ASSOC_MASK_NOTE 
CREATE_ASSOC_MASK_TEXT 
Enumerator
CREATE_ASSOC_Normal 
CREATE_ASSOC_DisallowFarElm 

Allow far associations and custom associations.

CREATE_ASSOC_DisallowCustom 

Disallow the creation of far associations.

CREATE_ASSOC_AllowAdjustedPoints 

Disallow the creation of custom associations.

Member Function Documentation

static DGNPLATFORM_EXPORT StatusInt CreateFromSnap ( AssocPoint assocPoint,
SnapPathCP  pathIn,
int  modifierMask,
DgnModelRefP  parentModel,
CreateOptions  options 
)
static

Initialize an associative point from a snap path.

Parameters
assocPointOUT The associative point to setup.
pathInIN The snap path.
modifierMaskIN Mask of allowed associative point types.
parentModelIN The model that contains the associative point dependent element.
optionsIN Create options for associative point.
Returns
SUCCESS if associative point was setup
static DGNPLATFORM_EXPORT StatusInt ExtractPoint ( AssocPoint assocPoint,
ElementHandleCR  element,
int  pointNum,
int  maxPoints 
)
static

Extracts the association information from the specified point on the given element.

Parameters
assocPointOUT The associative point to query.
elementIN The element to extract the point from.
pointNumIN The index of point to extract.
maxPointsIN The maximum number of associative points on the element.
Returns
SUCCESS if associative point was extracted.
static DGNPLATFORM_EXPORT BentleyStatus GetPoint ( DPoint3dP  outPoint,
AssocPoint const &  assocPoint,
DgnModelRefP  modelRef 
)
static

Uses the information in assocPoint to create a 3D data point that is returned in outPoint.

Parameters
outPointOUT The point location of the evaluated associative point.
assocPointIN The associative point to query.
modelRefIN The model that contains the associative point dependent element.
Returns
SUCCESS if associative point was extracted.
static DGNPLATFORM_EXPORT BentleyStatus GetRoot ( DisplayPathP  path,
int *  nRootsP,
AssocPoint const &  assocPoint,
DgnModelRefP  modelRef,
int  rootIndex = 0 
)
static

Populate a seed DisplayPath for a root of an associative point dependency.

Parameters
pathIN OUT The seed DisplayPath that is to be populated.
nRootsPOUT The number of roots for this associative point, an intersection association will return 2, all other types return 1.
assocPointIN The associative point to query.
modelRefIN The model that contains the associative point dependent element.
rootIndexIN Which root to get, an intersection association has 2 roots.
Returns
A DisplayPath to associative point root or NULL. Caller needs to call Release on path.
static DGNPLATFORM_EXPORT void InitArc ( AssocPoint assocPoint,
ArcLocation  keyPoint,
double  angle = 0.0 
)
static

Initialize the data in the associative point for an association that represents a point on an arc or ellipse element.

Parameters
assocPointOUT The associative point to setup.
keyPointIN The location on the arc to create the association to.
  • ARC_ANGLE angle radians from the primary axis
  • ARC_CENTER center of the arc or ellipse
  • ARC_START arc start point
  • ARC_END arc end point
angleIN The angle (radians) from the primary axis of the arc or ellipse to the association point. This argument is used only when the value of keyPoint is
ARC_ANGLE
.
static DGNPLATFORM_EXPORT void InitBCurve ( AssocPoint assocPoint,
double  uParam 
)
static

Initialize the data in the associative point for an association that represents a point on a bspline curve.

Parameters
assocPointOUT The associative point to setup.
uParamIN The parameter along the B-spline curve representing the associative point.
static DGNPLATFORM_EXPORT void InitBSurface ( AssocPoint assocPoint,
double  uParam,
double  vParam 
)
static

Initialize the data in the associative point for an association that represents a point on a bspline surface.

Parameters
assocPointOUT The associative point to setup.
uParamIN The u parameter along the B-spline surface representing the associative point.
vParamIN The v parameter along the B-spline surface representing the associative point.
static DGNPLATFORM_EXPORT void InitIntersection ( AssocPoint assocPoint,
byte  index,
UShort  seg1,
UShort  seg2,
int  nSeg1,
int  nSeg2 
)
static

Initialize the data in the associative point for an association that represents the intersection of 2 curve paths.

Parameters
assocPointOUT The associative point to setup.
indexIN The index of the intersection between the two elements where the association will be created. The number of intersections between two elements can be found via the mdlIntersect_allBetweenElms function.
seg1IN The index of the segment of element 1 where the intersection occurs.
seg2IN The index of the segment of element 2 where the intersection occurs.
nSeg1IN The number of vertices of element 1. This parameter is optional, you can pass zero. If non-zero this value is used to avoid the association jumping as vertices are inserted/deleted.
nSeg2IN The number of vertices of element 2. This parameter is optional, you can pass zero. If non-zero this value is used to avoid the association jumping as vertices are inserted/deleted.
static DGNPLATFORM_EXPORT void InitKeypoint ( AssocPoint assocPoint,
UShort  vertex,
UShort  nVertex,
UShort  numerator,
UShort  divisor 
)
static

Initialize the data in the associative point for an association that represents a point on a linear element.

Parameters
assocPointOUT The associative point to setup.
vertexIN The index of the vertex directly preceding the association point.
nVertexIN The total number of vertices of the linear element. This is optional, but if supplied the association can be adjusted for insert/delete vertex on the root/target.
numeratorIN The distance from vertex number vertex in units of divisor as described below. Its range must be between 0 and 32767.
divisorIN The number of units (segments) to be considered between the points at vertex and vertex+1. The values of numerator and divisor are used together as the fraction of the distance between the points at vertex and vertex+1, where the association point will be located. The denominator must be between 1 and 32767.
static DGNPLATFORM_EXPORT void InitMeshEdge ( AssocPoint assocPoint,
int  edgeIndex,
int  nEdge,
double  uParam 
)
static

Initialize the data in the associative point for an association that represents a point on a mesh edge.

Parameters
assocPointOUT The associative point to setup.
edgeIndexIN The index of the edge for the association point.
nEdgeIN The total number of edges of the mesh element.
uParamIN The parameter along the mesh edge representing the associative point.
static DGNPLATFORM_EXPORT void InitMeshVertex ( AssocPoint assocPoint,
int  vertexIndex,
int  nVertex 
)
static

Initialize the data in the associative point for an association that represents a mesh vertex.

Parameters
assocPointOUT The associative point to setup.
vertexIndexIN he index of the vertex for the association point.
nVertexIN The total number of vertices of the mesh element.
static DGNPLATFORM_EXPORT void InitMline ( AssocPoint assocPoint,
UShort  vertex,
UShort  nVertex,
UShort  lineNo,
double  offset,
bool  joint 
)
static

Initialize the data in the associative point for an association that represents a point on a multiline element.

Parameters
assocPointOUT The associative point to setup.
vertexIN The index of the vertex directly preceding the association point.
nVertexIN The total number of vertices of the multiline element. This is optional, but if supplied the association can be adjusted for insert/delete vertex on the root/target multiline.
lineNoIN Indicates which profile line in the multiline the association is to.
offsetIN The distance from the specified vertex to the association point, measured along the work line and divided by the work line length. Not used if joint is true.
jointIN If true, the association point is at the intersection of the line specified by lineNo and the joint bvector at vertex. In other words, the association point will always be on the joint.
static DGNPLATFORM_EXPORT void InitOrigin ( AssocPoint assocPoint,
UShort  option 
)
static

Initialize the data in the associative point for an association that represents the origin of an element.

Parameters
assocPointOUT The associative point to setup.
optionIN Origin association option flag.
See also
DisplayHandler::GetSnapOrigin
static DGNPLATFORM_EXPORT void InitProjection ( AssocPoint assocPoint,
UShort  vertex,
UShort  nVertex,
double  ratio 
)
static

Initialize the data in the associative point for an association that represents a point on a linear element.

Parameters
assocPointOUT The associative point to setup.
vertexIN The index of the vertex directly preceding the association point.
nVertexIN The total number of vertices of the linear element. This is optional, but if supplied the association can be adjusted for insert/delete vertex on the root/target.
ratioIN Fraction parameter along segment defined by vertex number.
static DGNPLATFORM_EXPORT StatusInt InsertPoint ( EditElementHandleR  element,
AssocPoint const &  assocPoint,
int  pointNum,
int  maxPoints 
)
static

Insert an association point to the specified element.

Parameters
elementIN The element to add the associative point to.
assocPointIN The associative point to insert.
pointNumIN The index of point to insert.
maxPointsIN The maximum number of associative points on the element.
Returns
SUCCESS if associative point was inserted.
Note
An element that supports associative points has a dependency callback that is responsible for updating the element when the root elements change.
static DGNPLATFORM_EXPORT BentleyStatus IsValid ( AssocPoint assocPoint,
DgnModelRefP  pathRoot,
DgnModelRefP  parentModel 
)
static

Test if the associative point evaluates to a valid location.

Parameters
assocPointIN The associative point to check.
pathRootIN The model that contains an associative point root element (can use either root for intersection).
parentModelIN The model that contains the associative point dependent element.
Returns
SUCCESS if assoc point data and roots are valid.
static DGNPLATFORM_EXPORT void RegisterExtensions ( )
static

Register roots changed extension for known handlers.

static DGNPLATFORM_EXPORT StatusInt RemoveAllAssociations ( EditElementHandleR  element)
static

Removes all association points from an element.

Parameters
elementIN The element to remove the associative points on.
Returns
SUCCESS if associative points were removed.
static DGNPLATFORM_EXPORT StatusInt RemovePoint ( EditElementHandleR  element,
int  pointNum,
int  maxPoints 
)
static

Remove a single associative point from an element.

Parameters
elementIN The element to remove the associative point on.
pointNumIN The point number to remove.
maxPointsIN The total number of points on element.
Returns
SUCCESS if associative point was removed.
static DGNPLATFORM_EXPORT BentleyStatus SetRoot ( AssocPoint assocPoint,
ElementId  elemId,
ElementId  refAttId,
int  rootIndex = 0 
)
static

Complete setup of a new associative point by setting the target/root element for the dependency by a pair of element ids.

Parameters
assocPointIN The associative point being created.
elemIdIN ElementId of the target/root of the associative point dependency.
refAttIdIN ElementId of a top-level reference, an un-nested shared cell instance, far path element, or 0. Only needed if elemId is a component of a shared cell definition or in a reference, if elemId is from the same model as the element the association is being added to pass 0.
rootIndexIN Which root to set, an intersection association requires 2 roots.
Returns
SUCCESS if assoc point root can be set.
Note
Must call one of the various Init methods before setting roots, ex. InitKeypoint.
static DGNPLATFORM_EXPORT BentleyStatus SetRoot ( AssocPoint assocPoint,
DisplayPathCP  path,
DgnModelRefP  parentModel,
bool  allowFarElm,
int  rootIndex = 0 
)
static

Complete setup of a new associative point by setting the target/root element for the dependency from a DisplayPath.

Parameters
assocPointIN The associative point being created.
pathIN A DisplayPath to the target/root element to use for the associative point dependency.
parentModelIN The model that contains the associative point dependent element.
allowFarElmIN Allow the creation of associative points to nested references and nested shared cells.
rootIndexIN Which root to set, an intersection association requires 2 roots.
Returns
SUCCESS if assoc point root can be set.
Note
Must call one of the various Init methods before setting roots, ex. InitKeypoint.
See also
DisplayPath::GetHitElem

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

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