20 #ifdef __CONSTRAINT2DCORE_BUILD__
22 #define CONSTRAINT2DCORE_EXPORT __declspec(dllexport)
24 #define CONSTRAINT2DCORE_EXPORT __declspec(dllimport)
27 #define BEGIN_CONSTRAINT2D_NAMESPACE BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE namespace Constraint2d {
28 #define END_CONSTRAINT2D_NAMESPACE }}}
29 #define USING_NAMESPACE_CONSTRAINT2D using namespace Bentley::DgnPlatform::Constraint2d;
31 #define CONSTRAINT2D_CORE_TYPEDEFS(t) \
32 BEGIN_CONSTRAINT2D_NAMESPACE struct t; END_CONSTRAINT2D_NAMESPACE \
33 ADD_BENTLEY_TYPEDEFS (DgnPlatform::Constraint2d,t);
47 BEGIN_CONSTRAINT2D_NAMESPACE
110 Equal_Parameter = 17,
112 Equal_Direction = 19,
113 Equal_Curvature = 20,
114 Equal_First_Derivative = 21,
115 Equal_Second_Derivative = 22,
118 Simple_Dependence = 24,
124 Pattern_2d_value_1 = 28,
125 Pattern_2d_value_2 = 29,
126 Equal_Relative_Transform = 30,
210 size_t m_subEdgeIndex;
213 UInt32 m_segmentsInCurveVector;
216 mutable bool m_fixed;
217 mutable bool m_hosted;
241 CONSTRAINT2DCORE_EXPORT
bool operator == (CurveEntityIdentifierCR rhs)
const;
246 CONSTRAINT2DCORE_EXPORT
bool operator < (CurveEntityIdentifierCR rhs)
const;
250 CONSTRAINT2DCORE_EXPORT
bool IsValid ()
const;
284 CONSTRAINT2DCORE_EXPORT
void SetPointIndex (
size_t pointIndex);
291 typedef bvector<CurveEntityIdentifier> T_CurveEntityIdArray;
292 typedef bset<CurveEntityIdentifier> T_CurveEntityIdSet;
306 T_CurveEntityIdArray m_curveIds;
308 mutable bool m_filtered;
314 virtual void _Store (DataExternalizer& sink)
const;
327 CONSTRAINT2DCORE_EXPORT Constraint2dData&
operator = (Constraint2dData
const& c2);
359 double m_dimensionValue;
364 UInt32 m_angleSectorIndex;
371 bvector<DVec2d> m_leaderLines;
372 UInt32 m_dimensionOptions;
382 CONSTRAINT2DCORE_EXPORT Dimension2dData&
operator = (Dimension2dData
const& d2);
417 CONSTRAINT2DCORE_EXPORT
bool operator == (Dimension2dDataCR rhs)
const;
430 typedef bset <Constraint2dData> T_Constraint2dDataSet;
431 typedef bvector<Constraint2dData> T_Constraint2dDataArray;
433 typedef bset <Dimension2dData> T_Dimension2dDataSet;
434 typedef bvector<Dimension2dData> T_Dimension2dDataArray;
481 CONSTRAINT2DCORE_EXPORT
double GetRadius ()
const;
484 CONSTRAINT2DCORE_EXPORT
void SetRadius (
double radius);
485 CONSTRAINT2DCORE_EXPORT
void Clear ();
489 typedef bvector<Drag2dInfo> Drag2dInfoArray;
490 typedef bvector<Drag2dInfo>& Drag2dInfoArrayR;
499 struct D2dSolver* m_solverImp;
503 CONSTRAINT2DCORE_EXPORT
Constraint2dSolver (
double localToWorldScale,
bool isAutoConstraining =
false);
512 CONSTRAINT2DCORE_EXPORT
bool SetData (Constraint2dSolverDataCR data,
double uorPerMaster = 1.0);
516 CONSTRAINT2DCORE_EXPORT
void GetData (Constraint2dSolverDataR data);
555 CONSTRAINT2DCORE_EXPORT
bool IsResolved ()
const;
558 CONSTRAINT2DCORE_EXPORT
bool IsComplete ()
const;
573 CONSTRAINT2DCORE_EXPORT
size_t CollateByElement (bvector<Constraint2dSolverData>& childGroups)
const;
576 void RemoveDuplicates ();
598 CONSTRAINT2DCORE_EXPORT
bool IsCurvePlaneFixed (CurveEntityIdentifierCR curveId)
const;
605 END_CONSTRAINT2D_NAMESPACE
DragTransformType
The possible drag transform types.
Definition: Constraint2dCoreAPI.h:169
planar face (planar distance constraints only).
CONSTRAINT2DCORE_EXPORT double GetDimensionHeight() const
align constraint dimension value in -X direction;
Start point of major axis of an ellipse.
Indicates it is a point in an arc.
Distance dimensional constraint.
CONSTRAINT2DCORE_EXPORT bool RemoveElementRef(ElementRefP elementRef)
Remove all constraint data which are correlated to the the given element.
CONSTRAINT2DCORE_EXPORT Drag2dInfo()
A blank constructor.
VertexType
Enumerates for curve (segment) identifier type.
Definition: Constraint2dCoreAPI.h:54
The specified position is relative to the end of the file.
CONSTRAINT2DCORE_EXPORT void RemoveInvalidConstraints(size_t &invalidCount, ElementRefP elementRef)
Remove all invalid constraint data which are correlated to the the given element. ...
Fix constraint which has different meanings per entity type:
Definition: Constraint2dCoreAPI.h:356
given dimension value is inconsistent due to other causes
CONSTRAINT2DCORE_EXPORT DragTransformType GetDraggingTransform() const
Get dragging transform type.
CONSTRAINT2DCORE_EXPORT void SetDimensionValue(double value)
Set a new dimension value.
The default file attribute.
T_Dimension2dDataArray m_dimensions
Definition: Constraint2dCoreAPI.h:537
CONSTRAINT2DCORE_EXPORT void SetEdgeId(CurvePrimitiveIdP edgeId)
Set the edge id.
Definition: Constraint2dCoreAPI.h:301
CONSTRAINT2DCORE_EXPORT bool IsComplete() const
Determine if it is complete, i.e., its actual topology is identical to the datum description used...
Equal distance dimensional constraint.
CONSTRAINT2DCORE_EXPORT Dimension2dData()
A blank constructor.
struct Bentley::WString const & WStringCR
Definition: Bentley.h:239
Major radius dimensional constraint which is effective on ellipse.
dimension value is satisfied by solution
CONSTRAINT2DCORE_EXPORT void RemoveUnresolvedElementRefs()
Remove all constraint data whose target elements are not resolved.
CONSTRAINT2DCORE_EXPORT void SetHalfSpace1(DimensionHalfSpace halfSpace)
given dimension not changed
static CONSTRAINT2DCORE_EXPORT StatusInt ElementToCurveVector(CurveVectorPtr &curveVector, ElementHandleCR eh)
Get an editable curve vector of a given element.
given dimension value is inconsistent due to a bad dimensioning scheme
CONSTRAINT2DCORE_EXPORT Constraint2dSolverData & operator=(Constraint2dSolverData const &rhs)
Assignment constructor.
CONSTRAINT2DCORE_EXPORT void SetDimensionHeight(double value)
face pair for solid topology references.
Definition: GeomApi.r.h:69
CONSTRAINT2DCORE_EXPORT T_CurveEntityIdArray const & GetCurveIdentifiers() const
Get the curve identifiers.
CONSTRAINT2DCORE_EXPORT CurvePrimitiveIdCP GetEdgeId() const
Get the edge id.
align constraint dimension value in -Y direction;
Start point of minor axis of an ellipse.
the measured angle is rotating line1 to line2 by anticlockwise, and the two lines are antiparallel; ...
Constraint2dStatus
Enumerates for constraint statuses.
Definition: Constraint2dCoreAPI.h:152
virtual CONSTRAINT2DCORE_EXPORT ~Constraint2dData()
Definition: Constraint2dCoreAPI.h:324
CONSTRAINT2DCORE_EXPORT size_t CollateByElement(bvector< Constraint2dSolverData > &childGroups) const
Check and divide this constraint model into child per links among elements.
Coincident logical constraint.
CONSTRAINT2DCORE_EXPORT bool SetData(Constraint2dSolverDataCR data, double uorPerMaster=1.0)
Initialize model.
typedefBEGIN_BENTLEY_GEOMETRY_NAMESPACE struct CurvePrimitiveId * CurvePrimitiveIdP
Definition: CurvePrimitiveId.h:13
Area dimensional constraint.
Equal radius dimensional constraint.
CONSTRAINT2DCORE_EXPORT Constraint2dType GetConstraintType() const
Get the constraint type.
CONSTRAINT2DCORE_EXPORT void SetPointIndex(size_t pointIndex)
Set the point index in linestring.
Tangent logical constraint.
CONSTRAINT2DCORE_EXPORT bool IsValid() const
Test the CurveEntityIdentifier is valid or not.
Vector with x,y components.
Definition: dvec2d.h:25
T_Constraint2dDataArray m_constraints
Definition: Constraint2dCoreAPI.h:536
CONSTRAINT2DCORE_EXPORT double GetDimensionXOffset() const
the measured angle is rotating line1 to line2 by clockwise, and the two lines are antiparallel; ...
dimension value inconsistent and there is insufficient information available to determine the cause ...
CONSTRAINT2DCORE_EXPORT VertexType GetVertexType() const
Get the vertex type.
Definition: Constraint2dCoreAPI.h:534
uint32_t UInt32
Definition: Bentley.r.h:128
#define NULL
Definition: Bentley.h:157
CONSTRAINT2DCORE_EXPORT DimensionHalfSpace GetHalfSpace2() const
Definition: Constraint2dCoreAPI.h:496
DimensionHalfSpace
Definition: Constraint2dCoreAPI.h:179
End point of major axis of an ellipse.
CONSTRAINT2DCORE_EXPORT void SetSectorAngleType(SectorAngleType type)
CONSTRAINT2DCORE_EXPORT void SetSubEdgeIndex(size_t subEdgeIndex)
Set the sub edge index.
CONSTRAINT2DCORE_EXPORT void SetRadius(double radius)
Set radius.
CONSTRAINT2DCORE_EXPORT double GetDimensionValue() const
Get dimension value.
Parallel logical constraint.
CONSTRAINT2DCORE_EXPORT Dimension2dData & operator=(Dimension2dData const &d2)
CONSTRAINT2DCORE_EXPORT void SetDimensionAlignmentType(DimensionAlignmentType type)
the measured angle is rotating line1 to line2 by clockwise, and the two lines are parallel; ...
CONSTRAINT2DCORE_EXPORT void SetConstraintType(Constraint2dType type)
Set the constraint type.
dimension not solved as it is between members of the same set
CONSTRAINT2DCORE_EXPORT size_t GetPointIndex() const
Get the point index.
CONSTRAINT2DCORE_EXPORT Constraint2dData & operator=(Constraint2dData const &c2)
CONSTRAINT2DCORE_EXPORT void SetConstraintStatus(Constraint2dStatus status)
Set the constraint status.
CONSTRAINT2DCORE_EXPORT ~Constraint2dSolver()
Destructor.
given dimension value is inconsistent
CONSTRAINT2DCORE_EXPORT bool IsCurvePlaneFixed(CurveEntityIdentifierCR curveId) const
A curve plane is considered to be fixed if any portion of the curve is fixed.
Radius dimensional constraint.
SectorAngleType
Enumerates for the ways an angle is calculated.
Definition: Constraint2dCoreAPI.h:73
A zero-based index of point array.
CONSTRAINT2DCORE_EXPORT DVec3dCR GetMoveValue() const
Get moving value.
CONSTRAINT2DCORE_EXPORT Constraint2dSolverData()
A blank constructor.
Definition: Constraint2dCoreAPI.h:541
CONSTRAINT2DCORE_EXPORT bool operator==(Dimension2dDataCR rhs) const
CONSTRAINT2DCORE_EXPORT CurveEntityIdentifierCR GetCurveEntityIdentifier() const
Get curve identifier.
dimension can only be solved non-algebraically
CONSTRAINT2DCORE_EXPORT SectorAngleType GetSectorAngleType() const
BentleyStatus
Definition: Bentley.h:208
CONSTRAINT2DCORE_EXPORT BentleyStatus GetResultCurveVector(CurveVectorPtr &resultCurve, ElementRefP elementRef)
Get results for the given element.
Definition: Constraint2dCoreAPI.h:202
CONSTRAINT2DCORE_EXPORT void Clear()
DimensionAlignmentType
Enumerates for drawing dimension alignment.
Definition: Constraint2dCoreAPI.h:187
CONSTRAINT2DCORE_EXPORT void SetVertexType(VertexType vertexType)
Set new vertex type.
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
CONSTRAINT2DCORE_EXPORT double GetDimensionFraction() const
Constraint2dType
Enumerates for constraint types.
Definition: Constraint2dCoreAPI.h:83
CONSTRAINT2DCORE_EXPORT void AddCurveIdentifier(CurveEntityIdentifierCR id)
Add curve identifier.
Base class to make a class non-copyable.
Definition: NonCopyableClass.h:23
CONSTRAINT2DCORE_EXPORT CurveEntityIdentifier()
A blank constructor.
Definition: Constraint2dCoreAPI.h:442
CONSTRAINT2DCORE_EXPORT void Clear()
Clear all data and set to empty.
Definition: Constraint2dCoreAPI.h:548
The whole curve (segment)
CONSTRAINT2DCORE_EXPORT Constraint2dSolver(double localToWorldScale, bool isAutoConstraining=false)
Constructor.
CONSTRAINT2DCORE_EXPORT Constraint2dStatus GetConstraintStatus() const
Get the constraint status.
the measured angle is rotating line1 to line2 by anticlockwise, and the two lines are parallel; ...
CONSTRAINT2DCORE_EXPORT void SetVariableName(WStringCR name)
Set variable name.
dimension not solved as it is either not satisfied or connected to geometries with a NOT_CHANGED stat...
Horizontal constraint which is always parallel to local X-axis.
CONSTRAINT2DCORE_EXPORT bool IsEmpty() const
Determine if it is empty.
Definition: Constraint2dCoreAPI.h:552
Determined by the parameter value, typically within [0,1].
CONSTRAINT2DCORE_EXPORT void SetCurveEntityIdentifier(CurveEntityIdentifierCR identifer)
Set curve identifier.
CONSTRAINT2DCORE_EXPORT void SetDimensionXOffset(double value)
int StatusInt
Definition: Bentley.h:222
struct CurvePrimitiveId const * CurvePrimitiveIdCP
Definition: CurvePrimitiveId.h:16
End point of minor axis of an ellipse.
Perpendicular logical constraint.
struct CurveLocationDetail const & CurveLocationDetailCR
Definition: msgeomstructs_typedefs.h:167
Perimeter dimensional constraint.
Minor radius dimensional constraint which is effective on ellipse.
CONSTRAINT2DCORE_EXPORT bool IsResolved() const
Determine if it is resolved, i.e., all member elements are available.
The Angle class has static methods for typical angle computations.
Definition: Angle.h:14
CONSTRAINT2DCORE_EXPORT void SetDraggingTransform(DragTransformType transformType)
Set dragging transform type.
CONSTRAINT2DCORE_EXPORT void SetAngleSectorIndex(UInt32 sectorIndex)
CONSTRAINT2DCORE_EXPORT Constraint2dData()
A blank constructor.
Curve's middle point or arc's center.
CONSTRAINT2DCORE_EXPORT DimensionHalfSpace GetHalfSpace1() const
CONSTRAINT2DCORE_EXPORT void SetMoveValue(DVec3dCR value)
Set moving value.
CONSTRAINT2DCORE_EXPORT UInt32 GetAngleSectorIndex() const
CONSTRAINT2DCORE_EXPORT void SetDimensionFraction(double value)
dimension not solved as it is between fixed or frozen geometries
Planar distance constraint which applys on distance between two parallel planes.
struct DgnPlatform::ElementHandle const & ElementHandleCR
Definition: DgnPlatform.h:260
CONSTRAINT2DCORE_EXPORT bool IsCurvePlaneConstrained(CurveEntityIdentifierCR curveId) const
A curve plane is constrained if is by a plane distance dimension.
CONSTRAINT2DCORE_EXPORT WStringCR GetVariableName() const
Get variable name.
Concentric logical constraint.
struct DVec3d const & DVec3dCR
Definition: msgeomstructs_typedefs.h:89
struct CurveVector const * CurveVectorCP
Definition: msgeomstructs_typedefs.h:172
CONSTRAINT2DCORE_EXPORT BentleyStatus Evaluate(Drag2dInfoArray const &dragInfos, bool isDynamic)
Perform a evaluation.
CONSTRAINT2DCORE_EXPORT size_t GetElementRefs(T_StdElementRefSet &elementRefs) const
Query all member elements.
align constraint dimension value in Y direction;
Major axis of an ellipse.
CONSTRAINT2DCORE_EXPORT void Replace(ElementRefP oldElementRef, ElementRefP newElementRef)
CONSTRAINT2DCORE_EXPORT UInt32 GetDiaType() const
CONSTRAINT2DCORE_EXPORT bool operator<(CurveEntityIdentifierCR rhs) const
Test the CurveEntityIdentifier is less than rhs or not.
dimension specification is over-defined
Vector with x,y,z components.
Definition: dvec3d.h:110
Vertical constraint which is always parallel to local Y-axis.
CONSTRAINT2DCORE_EXPORT double GetRadius() const
Get radius.
CONSTRAINT2DCORE_EXPORT void SetHalfSpace2(DimensionHalfSpace halfSpace)
align constraint dimension value in X direction;
CONSTRAINT2DCORE_EXPORT DimensionAlignmentType GetDimensionAlignmentType() const
CONSTRAINT2DCORE_EXPORT bool Merge(Constraint2dSolverData const &rhs)
Merge another constraint model into this one.
CONSTRAINT2DCORE_EXPORT size_t GetSubEdgeIndex() const
Get the sub edge index.
CONSTRAINT2DCORE_EXPORT bool Reverse(ElementRefP elementRef, CurveVectorCP curveVector=NULL)
Update constraint data assuming the curve's direction was reversed.
CONSTRAINT2DCORE_EXPORT void SetDiaType(UInt32 value)
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
A CurveVector is a collection of curve primitives.
Definition: CurveVector.h:78
CONSTRAINT2DCORE_EXPORT void GetData(Constraint2dSolverDataR data)
Initialize model.
CONSTRAINT2DCORE_EXPORT bool operator==(CurveEntityIdentifierCR rhs) const
Perform a comarsion.
unknown status (newly added to system)