C3D Kernel  104598
Classes | Defines | Typedefs | Enumerations | Functions | Variables
Solver Interface
Geometric Constraint Solver in Two-Dimensional Space
Collaboration diagram for Solver Interface:

Classes

struct  GcPrecision
 Fixed tolerances of two-dimensional parametrization problems solving and other constants. More...
struct  GCE_vec2d
 Vector coordinates. More...
struct  GCE_vecNd
 Coordinates of n-dimensional vector. More...
struct  GCE_point
 Coordinates of a point on plane. More...
struct  GCE_point_dof
 Degree of freedom of a point. More...
struct  GCE_line
 Coordinate of a line on the plane. More...
struct  GCE_circle
 Coordinates of a circle. More...
struct  GCE_ellipse
 Coordinates of a ellipse. More...
struct  GCE_spline
 Coordinates and characteristics of a spline. More...
struct  GCE_dim_pars
 Parameters of dimensional constraint. More...
struct  GCE_adim_pars
 Parameters of angular dimensional constraint. More...
struct  GCE_ldim_pars
 Parameters of distance constraint. More...
struct  GCE_dragging_point
 Control point of the dragging. More...
struct  GCE_diagnostic_pars
 Diagnostic characteristics of constraint system. More...

Defines

#define FB_NULL_GEOM   0

Typedefs

typedef int8 sign_t
 Definitions.
typedef void * GCE_system
 Geometric constraints system.
typedef size_t geom_item
 Descriptor of geometrical object registered in the solver context.
typedef size_t constraint_item
 Descriptor of a constraint registered in the solver.
typedef size_t var_item
 Descriptor of a variable registered in the solver.
typedef query_geom_type point_type
 Type of the requested point (used as subset of values query_geom_type).
typedef coord_name coord_type

Enumerations

enum  GcConstraintStatus { tcs_Unknown = 0, tcs_WellConstrained = 1, tcs_UnderConstrained, tcs_OverConstrained }
 State of geometric constraints system. More...
enum  GcConState {
  cst_None = 0, cst_Satisfied, cst_Redundant, cst_Overconstraining,
  cst_Not_Satisfied, cst_Unsolvable
}
 State of the separate constraint solving. More...
enum  geom_type {
  GCE_ANY_GEOM, GCE_POINT, GCE_LINE, GCE_CIRCLE,
  GCE_ELLIPSE, GCE_SPLINE, GCE_PARAMETRIC_CURVE, GCE_BOUNDED_CURVE,
  GCE_LINE_SEGMENT, GCE_SET
}
 Dictionary of geometric primitives types. More...
enum  query_geom_type {
  GCE_FIRST_PTYPE = 0, GCE_IMPROPER_POINT = 0, GCE_FIRST_END, GCE_SECOND_END,
  GCE_CENTRE, GCE_PROPER_POINT, GCE_Q1, GCE_Q2,
  GCE_Q3, GCE_Q4, GCE_LOCATION_POINT, GCE_LAST_PTYPE,
  GCE_DIRECTION, GCE_ORIENTATION
}
 Variants of control point requested from a geometric object. More...
enum  coord_name {
  GCE_X, GCE_Y, GCE_ACRD, GCE_DCRD,
  GCE_RADIUS, GCE_MAJOR_RADIUS, GCE_MINOR_RADIUS, GCE_NULL_CRD
}
 Enumeration of geom's coordinates. More...
enum  constraint_type {
  GCE_FIX_GEOM, GCE_HORIZONTAL, GCE_VERTICAL, GCE_LENGTH,
  GCE_COINCIDENT, GCE_EQUAL_LENGTH, GCE_EQUAL_RADIUS, GCE_PARALLEL,
  GCE_PERPENDICULAR, GCE_TANGENT, GCE_COLINEAR, GCE_ALIGN_2P,
  GCE_CURVATURE_EQUALITY, GCE_ANGLE_BISECTOR, GCE_MIDDLE_POINT, GCE_COLINEAR_3P,
  GCE_SYMMETRIC, GCE_DISTANCE, GCE_RADIUS_DIM, GCE_DIAMETER,
  GCE_ANGLE, GCE_ANGLE_OX, GCE_CONSTRAINTS_COUNT, GCE_UNKNOWN_CON = GCE_CONSTRAINTS_COUNT
}
 Identifier of 2D constraint type. More...
enum  GCE_result {
  GCE_RESULT_None = 0, GCE_RESULT_Ok = 1, GCE_RESULT_Satisfied = 1, GCE_RESULT_Not_Satisfied = 2,
  GCE_RESULT_Overconstrained = 3, GCE_RESULT_InvalidGeometry = 4, GCE_RESULT_MovingOfFixedGeom = 5, GCE_RESULT_Unregistered = 6,
  GCE_RESULT_SystemError = 7, GCE_RESULT_NullSystem = 8, GCE_RESULT_CircleCantStretched = 9, GCE_RESULT_SingularMatrix = 10,
  GCE_RESULT_DegenerateScalingFactor = 11, GCE_RESULT_InvalidDimensionTransform = 12
}
 Diagnostic codes of the geometric solver functions execution. More...
enum  GCE_bisec_variant { GCE_BISEC_CLOSEST = 0, GCE_BISEC_MINUS = 1, GCE_BISEC_PLUS = 2 }
 Variant of a bisector for two lines. More...

Functions

bool GCE_CollectLinearDependedConstrains (GCE_system, SArray< constraint_item > &ldepCons)
 Collect linearly dependent and redundant constraints.
bool GCE_CheckPointSatisfaction (GCE_system gSys, geom_item pnt, point_type cp, double px, double py)
 Check: Whether the system remains satisfied if the point coordinates are changed.
GcConState GCE_GetConstraintState (GCE_system, constraint_item gc_item)
 Get the state of constraint.
GcConstraintStatus GCE_GetConstraintStatus (GCE_system gSys)
 Get constraint system state.
GCE_result GCE_CheckSatisfaction (GCE_system gSys, VERSION c3dVer)
 To check the satisfaction of constraints.
bool GCE_GetOutVarCoordinates (GCE_system gcContext, const SArray< var_item > &in_coords, const SArray< constraint_item > &drvCons, SArray< var_item > &outCoords)
constraint_item GCE_FixCoordinate (GCE_system gSys, geom_item g, coord_name crd)
 Specify fixation of a parametric object coordinate.
constraint_item GCE_FormCirDimension (GCE_system gcContext, geom_item cir, GCE_dim_pars dPars, bool diam)
 Specify "Radial dimension" constraint.
void GCE_ResetMovingMode (GCE_system)
 Cancel dragging mode.
GCE_system GCE_CreateSystem ()
 Create a simple constraint system.
void GCE_ClearSystem (GCE_system gSys)
 Make the constraint system empty.
void GCE_RemoveSystem (GCE_system gSys)
 Delete system of constraints.
geom_item GCE_AddPoint (GCE_system gSys, GCE_point pVal)
 Add point to the constraint system.
geom_item GCE_AddLine (GCE_system gSys, const GCE_line &lVal)
 Add line to the constraint system.
geom_item GCE_AddLineSeg (GCE_system gSys, geom_item p[2])
 Add a line segment specified by pair of end points to the constraint system.
geom_item GCE_AddCircle (GCE_system gSys, const GCE_circle &cVal)
 Add circle to the constraint system.
geom_item GCE_AddEllipse (GCE_system gSys, const GCE_ellipse &eVal)
 Add ellipse to the constraint system.
geom_item GCE_AddSpline (GCE_system gSys, const GCE_spline &spl)
 Add spline (NURBS) to the constraint system.
geom_item GCE_AddParametricCurve (GCE_system gSys, const MbCurve &crv)
 Add parametric curve to the constraint system.
geom_item GCE_AddBoundedCurve (GCE_system gSys, geom_item curve, geom_item p[2])
 Add a curve bounded by a pair of points to the constraint system.
geom_item GCE_AddRigidSet (GCE_system gSys, const std::vector< geom_item > &geoms)
 Add a rigid set of geometric objects to the system.
var_item GCE_AddVariable (GCE_system gSys, double val)
 Add a variable to the constraint system.
geom_type GCE_GeomType (GCE_system gSys, geom_item g)
 A type of geometric object.
geom_type GCE_BaseCurveType (GCE_system gSys, geom_item crv)
 A type of geometric curve.
bool GCE_RemoveVariable (GCE_system gSys, var_item var)
 Delete variable from the constraint system.
bool GCE_RemoveGeom (GCE_system gSys, geom_item g)
 Delete geometric object from the constraint system.
bool GCE_RemoveConstraint (GCE_system gSys, constraint_item con)
 Delete a constraint from the system.
geom_item GCE_PointOf (GCE_system gSys, geom_item g, point_type pnt)
 Request of the object control point descriptor.
geom_item GCE_SplinePoint (GCE_system gSys, geom_item spl, size_t pntIdx)
 Descriptor of spline control point by index.
GCE_vec2d GCE_GetVectorValue (GCE_system gSys, geom_item g, query_geom_type vType)
 Get the current coordinates of vector.
GCE_point GCE_GetPointXY (GCE_system gSys, geom_item g, point_type pName=GCE_PROPER_POINT)
 Get the current coordinates of point.
double GCE_GetCoordValue (GCE_system gSys, geom_item g, coord_name cName)
 Get the current value of geometric object's coordinate.
double GCE_GetVarValue (GCE_system gSys, var_item var)
 Get the current value of variable.
bool GCE_SetPointXY (GCE_system gSys, geom_item g, point_type pName, GCE_point xyVal)
 Set the current coordinates of point.
bool GCE_SetCoordValue (GCE_system gSys, geom_item g, coord_name cName, double crdVal)
 Set the current value of geometric object's coordinate.
bool GCE_SetVarValue (GCE_system gSys, var_item var, double val)
 Set the current value of variable.
bool GCE_FreezeGeom (GCE_system gSys, geom_item g)
 Freeze geometric object.
bool GCE_IsConstrainedGeom (GCE_system gSys, geom_item g)
 The function answers the question: Is geometric object connected with constraints?
bool GCE_IsSatisfied (GCE_system gSys, constraint_item cItem)
 Perform a check that a constraint is satisfied.
std::vector< geom_itemGCE_DiagnoseGeometry (GCE_system gcSys)
ptrdiff_t GCE_GetPointDOF (GCE_system gSys, geom_item g, point_type cp, double &dofDir)
 Calculate point's degree of freedom.
GCE_point_dof GCE_PointDOF (GCE_system gSys, geom_item pnt)
 Calculate point's degree of freedom.
int GCE_CoordDOF (GCE_system gSys, geom_item g, coord_name cName)
 Get the degree of freedom of geometric coordinate.
constraint_item GCE_AddUnaryConstraint (GCE_system gSys, constraint_type cType, geom_item geom)
 Set a constraint on single object (unary constraint).
constraint_item GCE_AddCoincidence (GCE_system gSys, geom_item g[2])
 Set the constraint "Coincidence".
constraint_item GCE_AddPointOnPercent (GCE_system gSys, geom_item curve, geom_item pnt[3], double k)
 The constraint "Point on a piece of a curve by the coefficient of its parametric range".
constraint_item GCE_AddPointByMetricPercent (GCE_system gSys, geom_item curve, geom_item pnt[3], double k)
 The constraint "Point on a piece of a curve by the coefficient of its length".
constraint_item GCE_AddFixCurvePoint (GCE_system gSys, geom_item curve, geom_item pnt)
 Set the constraint "Fixation of location of the point lying on a curve".
constraint_item GCE_AddPointOnParEllipse (GCE_system gSys, geom_item pnt, geom_item ellipse, double t)
 Set the constraint "Point on parametric ellipse".
constraint_item GCE_AddParPointOnCurve (GCE_system gSys, geom_item pnt, geom_item curve, var_item t)
 Specify a constraint "Point on curve at a given parameter".
constraint_item GCE_AddAlignPoints (GCE_system gSys, geom_item p[2], double ang)
 Set the constraint "Alignment of points along the given direction".
constraint_item GCE_AddAngle (GCE_system gSys, geom_item l1, geom_item l2, const GCE_adim_pars &dPars)
 Set the constraint "Angular dimension between two lines".
constraint_item GCE_AddAngleBisector (GCE_system gSys, geom_item l1, geom_item l2, geom_item bl, GCE_bisec_variant variant)
 Set the constraint "Bisector of angle".
constraint_item GCE_AddAngle4P (GCE_system gSys, geom_item fPair[2], geom_item sPair[2], const GCE_adim_pars &dPars)
 Specify angular dimension for four points.
constraint_item GCE_AddColinear (GCE_system gSys, geom_item g[2])
 Set the constraint "Colinearity".
constraint_item GCE_AddColinear3Points (GCE_system gcSys, geom_item pnt[3])
 Set the constraint "Colinearity of three points".
constraint_item GCE_AddEqualLength (GCE_system gSys, geom_item ls1, geom_item ls2)
 Set the constraint "Equality of lengths" for segments.
constraint_item GCE_AddEqualRadius (GCE_system gSys, geom_item c1, geom_item c2)
 Set the constraint "Equality of radii" for two circles (arcs)
constraint_item GCE_AddEqualCurvature (GCE_system gSys, geom_item curves[2], var_item tPars[2])
 Specify a constraint "Equality of curvature of two curves at given points".
constraint_item GCE_AddRadiusDimension (GCE_system gSys, geom_item cir, GCE_dim_pars dPar)
 Specify a "Radius dimension" constraint.
constraint_item GCE_AddDiameter (GCE_system gSys, geom_item cir, GCE_dim_pars dPar)
 Specify a "Diameter dimension" constraint.
constraint_item GCE_FixVariable (GCE_system gSys, var_item var)
 Set the constraint "Driving parameter" or "Fixation of variable".
constraint_item GCE_FixGeom (GCE_system gSys, geom_item g)
 Set the constraint "Fixation of geom".
constraint_item GCE_FixLength (GCE_system gSys, geom_item ls)
 Set the constraint "Fixation of segment length".
constraint_item GCE_FixRadius (GCE_system gSys, geom_item circ, coord_name cName=GCE_RADIUS)
 Set the constraint "Fixation of radius".
constraint_item GCE_FixSplineDerivative (GCE_system gSys, geom_item spline, double par, uint derOrder, GCE_vec2d *fixVal=NULL)
 Set the constraint "Fixation of derivative vector of the spline at a given point".
constraint_item GCE_AddMiddlePoint (GCE_system gcSys, geom_item pnt[3])
 Set the constraint "Middle point".
constraint_item GCE_AddParallel (GCE_system gSys, geom_item g[2])
 Set the constraint "Bisector of angle".
constraint_item GCE_AddPerpendicular (GCE_system gSys, geom_item g[2])
 Set the constraint "Perpendicularity".
constraint_item GCE_AddSymmetry (GCE_system gSys, geom_item g[2], geom_item lObj)
 Set the constraint "Symmetry relative to the linear object".
constraint_item GCE_AddTangent (GCE_system gSys, geom_item g[2], var_item tPar[2])
 Set the constraint "Tangency of two curves".
constraint_item GCE_AddDistance (GCE_system gSys, geom_item g[2], const GCE_ldim_pars &dPars)
 Set the dimensional constraint "Distance between objects".
constraint_item GCE_AddDistance2P (GCE_system gSys, geom_item p[2], const GCE_dim_pars &dPars)
 Set the constraint "Distance between points".
constraint_item GCE_AddDistancePLs (GCE_system gSys, geom_item p[3], const GCE_dim_pars &dPars)
 Set the constraint "Distance from a point to a segment".
constraint_item GCE_AddDirectedDistance (GCE_system gSys, geom_item p[2], const GCE_ldim_pars &dPars)
 Set the constraint "Directed distance between points".
constraint_item GCE_AddLinearEquation (GCE_system gSys, const double *a, const var_item *v, size_t n, double c)
 Set the linear equation.
GCE_result GCE_ChangeDrivingDimension (GCE_system gSys, constraint_item dItem, double dVal)
 Change the value of driving dimension.
GCE_result GCE_DeviateDimension (GCE_system gSys, constraint_item dItem, double delta)
 Deviate the constraint from the point of solution.
GCE_result GCE_DeviationTest (GCE_system gSys, constraint_item dItem, double delta)
 Test for redundancy of constraint based on the deviation the constraint from the point of solution.
double GCE_DimensionParameter (GCE_system gSys, constraint_item dItem)
 A current value of the dimension parameter.
GCE_result GCE_Evaluate (GCE_system gSys)
 Calculate the constraint system.
GCE_result GCE_PrepareMovingOfPoint (GCE_system gSys, geom_item obj, point_type pntId, GCE_point curXY)
 Initialize the dragging mode of the object control point.
GCE_result GCE_PrepareDraggingPoint (GCE_system gSys, GCE_dragging_point drgPnt, GCE_point curXY)
 Initialize the dragging mode of the object control point.
GCE_result GCE_PrepareDraggingPoint (GCE_system gSys, const std::vector< GCE_dragging_point > &cPntArr, GCE_point curXY)
 Initialize the dragging mode of the control point of object set.
GCE_result GCE_PrepareMovingGeoms (GCE_system gSys, std::vector< geom_item > &geoms, GCE_point curXY)
 Initialize mode of moving a set of objects.
GCE_result GCE_MovePoint (GCE_system gcSys, GCE_point curXY)
 Move a dragging point.
GCE_result GCE_Transform (GCE_system gSys, const MbMatrix &mat)
bool GCE_SetJournal (GCE_system gSys, const char *fName)
 Switch on the journalling and specify the file for recording a journal of GCE API calls.
bool GCE_DeviateDimension (GCE_system gSys, constraint_item dItem, double delta, GCE_result &errCode)
 An obsolete function. The call will be removed in one of the next versions. It's recommended to use new version of this function: GCE_DeviateDimension( GCE_system gSys, constraint_item dItem, double delta )
bool GCE_DeviationTest (GCE_system gSys, constraint_item dItem, double delta, GCE_result &errCode)
 An obsolete function. The call will be removed in one of the next versions. It's recommended to use new version of this function: GCE_DeviationTest( GCE_system gSys, constraint_item dItem, double delta )
geom_item GCE_AddSpline (GCE_system gSys, const MbPolyCurve &crv)
geom_item GCE_AddPoint (GCE_system gSys, GCE_point pVal, int)
GCE_system GCE_CreateSystem (void *)
constraint_item GCE_AddDirectedDistance2P (GCE_system gSys, geom_item p[2], const GCE_ldim_pars &dPars)
constraint_item GCE_AddAlignPoints (GCE_system gSys, geom_item p[2], bool hor)
constraint_item GCE_AddFixedLength (GCE_system, geom_item)
constraint_item GCE_AddFixVariable (GCE_system, var_item)
constraint_item GCE_AddIncidence (GCE_system, geom_item, geom_item)
 Set the constraint "Point on curve".
GCE_result GCE_PrepareMovingOfPoint (GCE_system gSys, const std::vector< geom_point > &cPntArr, GCE_point curXY)
constraint_item GCE_AddEquation (GCE_system gSys, ItAlgebraicConstraint &iEqu, size_t varsCount, const var_item *varsVector)
 Specify a constraint implemented by the user.
bool GCE_IsAdjacentConstraint (GCE_system gSys, geom_item g, constraint_item c)
 Determine whether the constraint and the geometric object are adjacent.
MbCartPoint GCE_GetPoint (GCE_system gSys, geom_item g, point_type pName=GCE_PROPER_POINT)
 Get the current coordinates of point.
bool OK (GCE_result resCode)
 Return true, if the result code is successful.

Variables

const size_t GCE_NULL = SYS_MAX_T
 Undefined value of descriptor or an empty object.
const geom_item GCE_NULL_G = GCE_NULL
 Undefined value of geom_item type.
const var_item GCE_NULL_V = GCE_NULL
 Undefined value of var_item type.
const constraint_item GCE_NULL_C = GCE_NULL
 Undefined value of constraint_item type.
const double GCE_UNDEFINED_DBL = UNDEFINED_DBL
 An undefined value of double.

Typedef Documentation

typedef int8 sign_t

a number from discrete set {-1,0,1}

typedef void* GCE_system

GCE_system is data type which denotes a system of constraints created by call GCE_CreateSystem. Actually this type is a pointer to an internal data structure with a system of constraints and various working data determining its internal state. Lifetime of the constraint system finishes only when a call of API GCE_RemoveSystem is applied to it, thereafter the value of GCE_system becomes invalid.


Enumeration Type Documentation

Enumerator:
tcs_Unknown 

State is unknown.

tcs_WellConstrained 

Well-constrained system - does not have degrees of freedom.

tcs_UnderConstrained 

Underconstrained system - there are degrees of freedom.

tcs_OverConstrained 

Overconstrained system - the system of constraints is inconsistent (there are contradictions).

enum GcConState

cst_None - No data. The code usually shows that solving of this constraint is not started or it is necessary to solve it again after constraint system modification.
cst_Satisfied - The constraint is solved. Means that the constraint was solved and currently it is satisfied, even though other constraints of the system can be not solved.
cst_Redundant - Redundant constraint. The constraint is not involved in calculations although it is satisfied, - it is redundant, i.e. deletion of such constraint from the system will not change the set of its solutions and its presence does not contradict the solution.
cst_Overconstraining - The constraint makes the system overconstrained. The constraint makes the system of equations inconsistent, i.e. having an empty set of solutions. This constraint is to be removed to make the system solvable.
cst_Not_Satisfied - The constraint was not solved. Reason of an error is unknown. For example, solution of the system exists but the solver did not manage to find it.
cst_Unsolvable - The constraint is unsolvable. Such situation appears if the constraint exceeded the acceptable region. For example, linear dimension of zero size, nondifferentiable. The solver cannot find a solution where this constraint could be satisfied or such solution does not exist.

Attention:
DO NOT CHANGE IDENTIFIERS!!! Values of identifiers can be written to a file.
Enumerator:
cst_None 

No data.

cst_Satisfied 

Constraint is solved.

cst_Redundant 

Constraint is solved but redundant.

cst_Overconstraining 

Constraint is not solved and redundant.

cst_Not_Satisfied 

Constraint is not solved (for unknown reasons)

cst_Unsolvable 

Constraint is unsolvable.

enum geom_type
Enumerator:
GCE_ANY_GEOM 

Unknown type.

GCE_POINT 

Point on plane.

GCE_LINE 

Line on plane.

GCE_CIRCLE 

Circle on plane.

GCE_ELLIPSE 

Ellipse on plane.

GCE_SPLINE 

Spline on plane.

GCE_PARAMETRIC_CURVE 

Parametric curve on plane.

GCE_BOUNDED_CURVE 

Curve bounded by two points.

GCE_LINE_SEGMENT 

Line segment.

GCE_SET 

Subset of geometric objects.

This enum is used to request a descriptor of control point of an object, such as center of circle, bounding point of a curve etc...

See also:
GCE_PointOf
Enumerator:
GCE_FIRST_PTYPE 

The value of beginning of the sequence.

GCE_IMPROPER_POINT 

Point not belonging to the object.

GCE_FIRST_END 

The first end of bounded curve.

GCE_SECOND_END 

The second end of bounded curve.

GCE_CENTRE 

Center of circle (arc) or ellipse.

GCE_PROPER_POINT 

Proper point.

GCE_Q1 

Quadrant point of ellipse (3 o'clock).

GCE_Q2 

Quadrant point of ellipse (12 o'clock).

GCE_Q3 

Quadrant point of ellipse (6 o'clock).

GCE_Q4 

Quadrant point of ellipse (9 o'clock).

GCE_LOCATION_POINT 

Location point of geometric object.

GCE_LAST_PTYPE 

The value of variants completes the sequence.

GCE_DIRECTION 

Vector of ellipse direction (direction of "major" semiaxis).

Unit vector of orientation: Normal of a line, direction of "major" semiaxis of ellipse.

enum coord_name
Enumerator:
GCE_Y 

Coordinates of a point or a vector.

GCE_ACRD 

Angle of line normal, slope angle of ellipse.

GCE_DCRD 

Coordinate of line shift, distance from CS origin to line.

GCE_RADIUS 

Circle radius.

GCE_MAJOR_RADIUS 

"Major" semiaxis of ellipse.

GCE_MINOR_RADIUS 

"Minor" semiaxis of ellipse.

GCE_NULL_CRD 

Empty (nonexistent) coordinate.

Attention:
Actually, the solver provides more constraint types than is given in the enum. See the API calls in 'gce_api.h'
Enumerator:
GCE_HORIZONTAL 

Horizontality of a linear object.

GCE_VERTICAL 

Verticality of a linear object.

GCE_LENGTH 

Fixation of length of a line segment.

GCE_COINCIDENT 

Coincidence of a pair of geometric objects.

GCE_EQUAL_LENGTH 

Equality of two segments lengths.

GCE_EQUAL_RADIUS 

Equality of two circles lengths.

GCE_PARALLEL 

Parallelism of two lines or segments.

GCE_PERPENDICULAR 

Perpendicularity of two lines or segments.

GCE_TANGENT 

Tangency of two curves.

GCE_COLINEAR 

Collinearity of a pair of lines or segments.

GCE_ALIGN_2P 

Alignment of a pair of points along the direction.

GCE_CURVATURE_EQUALITY 

Equality of curves curvature in given points.

GCE_ANGLE_BISECTOR 

Bisector of angle.

GCE_MIDDLE_POINT 

Middle point.

GCE_COLINEAR_3P 

Collinearity of a point triple.

GCE_SYMMETRIC 

Symmetry.

GCE_CONSTRAINTS_COUNT 

Number of types.

GCE_UNKNOWN_CON 

Unknown constraint type.

enum GCE_result
Enumerator:
GCE_RESULT_None 

No result (empty message).

GCE_RESULT_Ok 

Successful result.

GCE_RESULT_Satisfied 

The constraint is satisfied.

GCE_RESULT_Not_Satisfied 

The system of constraints is not solved.

GCE_RESULT_Overconstrained 

Overdetermined (inconsistent) system of constraints.

GCE_RESULT_InvalidGeometry 

Solution leaded to violation of geometry.

GCE_RESULT_MovingOfFixedGeom 

Attempt of a fixed object translation.

GCE_RESULT_Unregistered 

Access to invalid object.

GCE_RESULT_SystemError 

Internal system error.

GCE_RESULT_NullSystem 

Access to invalid system of constraints.

GCE_RESULT_CircleCantStretched 

The circle can't be scaled with different scaling factors for each axis (stretching).

GCE_RESULT_SingularMatrix 

A singular transform matrix was received.

GCE_RESULT_DegenerateScalingFactor 

Degenerate scaling factor.

GCE_RESULT_InvalidDimensionTransform 

Invalid dimension transformation.

Enumerator:
GCE_BISEC_CLOSEST 

Undefined direction (nearest solution).

GCE_BISEC_MINUS 

Bisector along the difference of directions of lines/segments.

GCE_BISEC_PLUS 

Bisector along sum of directions of lines/segments.


Function Documentation

bool GCE_CheckPointSatisfaction ( GCE_system  gSys,
geom_item  pnt,
point_type  cp,
double  px,
double  py 
)

The function works correctly if the system is in resolved state, during the check a test resolving of the system is not performed, only satisfaction of adjacent constraints with a new parameter (px,py) is estimated. The function can be applied for estimation of domain (neighborhood of some tolerance) of the point in which the system remains satisfied.

GcConState GCE_GetConstraintState ( GCE_system  ,
constraint_item  gc_item 
)
Parameters:
gc_item- user constraint
Returns:
State of constraint
Note:
Correct result is guaranteed only after system is resolved. When the function returns overconstraint for the specific constraint, then it does not mean that this constraint is problem. Overdetermination always involve a set of constraints, the solver "randomly" chooses one of them as problem.
GcConstraintStatus GCE_GetConstraintStatus ( GCE_system  gSys)
Parameters:
gSysSolver state
Returns:
State of constraint
Note:
Function complexity is equivalent to requests GCE_GetCoordinateDOF(), GCE_GetPointDOF()
GCE_result GCE_CheckSatisfaction ( GCE_system  gSys,
VERSION  c3dVer 
)

For internal use only!

Parameters:
gSys- Solver state.
c3dVer- Mathematical kernel version.
Returns:
Calculation result code.
bool GCE_GetOutVarCoordinates ( GCE_system  gcContext,
const SArray< var_item > &  in_coords,
const SArray< constraint_item > &  drvCons,
SArray< var_item > &  outCoords 
)

Get coordinates of variables of geometric models which do not depend on changes of input variables in_coords;

constraint_item GCE_FormCirDimension ( GCE_system  gcContext,
geom_item  cir,
GCE_dim_pars  dPars,
bool  diam 
)
Parameters:
cir- a circle or an arc
diam- flag of diametral dimension
GCE_system GCE_CreateSystem ( )

The call creates a simple constraint system. Besides, inside the memory there are created internal data structures of geometric solver maintaining the system of constraints. The functions returns a special descriptor by which the constraint system is available for various manipulations: addition and deletion of geometric objects, constraints, variation of sizes, dragging underconstrained objects etc.

Returns:
Descriptor of constraint system.
void GCE_ClearSystem ( GCE_system  gSys)

This method makes the constraint system empty while the descriptor gSys remains valid, i.e. it is possible to perform the further work with the constraint system.

Parameters:
[in]gSys- System of constraints.
See also:
GCE_RemoveSystem
void GCE_RemoveSystem ( GCE_system  gSys)

This method makes the constraint system invalid. Deallocation of RAM from the internal data structures maintaining the system of constraints is performed.

Parameters:
[in]gSys- System of constraints.
See also:
GCE_ClearSystem
geom_item GCE_AddPoint ( GCE_system  gSys,
GCE_point  pVal 
)
Parameters:
[in]gSys- System of constraints.
[in]pVal- Point coordinates.
Returns:
Descriptor of registered point.
geom_item GCE_AddLine ( GCE_system  gSys,
const GCE_line lVal 
)
Parameters:
[in]gSys- System of constraints.
[in]lVal- Line coordinates.
Returns:
Descriptor of registered line.
geom_item GCE_AddLineSeg ( GCE_system  gSys,
geom_item  p[2] 
)
Parameters:
[in]gSys- System of constraints.
[in]p- Descriptors of end points of the line segment.
Returns:
Descriptor of registered segment.

All types of constraints which are applicable to the line created by GCE_AddLine are valid for the segment created by this call.

geom_item GCE_AddCircle ( GCE_system  gSys,
const GCE_circle cVal 
)
Parameters:
[in]gSys- System of constraints.
[in]cVal- Coordinates of a circle.
Returns:
Descriptor of the registered circle.
geom_item GCE_AddEllipse ( GCE_system  gSys,
const GCE_ellipse eVal 
)
Parameters:
[in]gSysSystem of constraints.
[in]eValEllipse coordinates.
Returns:
Descriptor of registered ellipse.
geom_item GCE_AddSpline ( GCE_system  gSys,
const GCE_spline spl 
)
Parameters:
[in]gSys- System of constraints.
[in]spl- Spline coordinates.
Returns:
Descriptor of registered spline.
geom_item GCE_AddParametricCurve ( GCE_system  gSys,
const MbCurve crv 
)
Parameters:
[in]gSys- System of constraints.
[in]crv- Mathematical description of parametric curve.
Returns:
Descriptor of registered parametric curve.
Attention:
The lifetime of the instance of the class 'crv' is based on the reference counter, i.e. the solver increases it when adding a parametric curve and decreases when deleting a curve from the solver.
geom_item GCE_AddBoundedCurve ( GCE_system  gSys,
geom_item  curve,
geom_item  p[2] 
)
Parameters:
[in]gSys- System of constraints.
[in]crv- Descriptor of base geometric curve. Base curve may be only one curve from the following types: line, circle, ellipse, spline or parametric curve.
[in]p- A pair of descriptors of the beginning and ending points of curve piece.
Returns:
Descriptor of registered bounded curve.
geom_item GCE_AddRigidSet ( GCE_system  gSys,
const std::vector< geom_item > &  geoms 
)

A rigid set is an array of geometric objects which are fixed relative to each other. It is considered as a geometric object and hence all the functionality for working with geometric objects is available for it. For example, it's possible to request its type (GCE_GeomType -> GCE_SET) or get its position invoking GCE_GetPoint and GCE_GetCoordValue to get the origin and the direction of the OX axis of the LCS of the rigid set. To remove a rigid set it's necessary to call the function GCE_RemoveGeom. Geometric objects (geoms) are not deleted together with a rigid set and can be used in the solver after it will be deleted. With geometric objects that have been included in a rigid set it is necessary to continue to work just as before adding them to a rigid set. For instance, to specify a constraint between an element of a rigid set and any other geometric object, it is necessary to specify as the constraint argument not the descriptor of the rigid set to which the object belongs but the descriptor of the geometric object from the geoms array on which the constraint is specified.

Parameters:
[in]gSys- System of constraints.
[in]geoms-
Returns:
Descriptor of registered bounded curve.
var_item GCE_AddVariable ( GCE_system  gSys,
double  val 
)
Parameters:
[in]gSys- System of constraints.
[in]val- A start value of the variable.
Returns:
Descriptor of registered variable.
geom_type GCE_GeomType ( GCE_system  gSys,
geom_item  g 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of geometric object
Returns:
A type of geometric object.
geom_type GCE_BaseCurveType ( GCE_system  gSys,
geom_item  crv 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of curve
Returns:
A type of geometric object.

Функция вернет геометрический тип кривой 'crv' либо тип базовой кривой, если 'crv' имеет тип GCE_BOUNDED_CURVE.

bool GCE_RemoveVariable ( GCE_system  gSys,
var_item  var 
)
Parameters:
[in]gSys- System of constraints.
[in]var- Descriptor of variable.
Returns:
it equals true if the variable var is actually deleted.
bool GCE_RemoveGeom ( GCE_system  gSys,
geom_item  g 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of geometric object
Returns:
it equals true if the geometric object g is actually deleted.
bool GCE_RemoveConstraint ( GCE_system  gSys,
constraint_item  con 
)
Parameters:
[in]gSys- System of constraints.
[in]con- Descriptor of constraint.
Returns:
it equals true if the constraint con is actually deleted.
geom_item GCE_PointOf ( GCE_system  gSys,
geom_item  g,
point_type  pnt 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of object.
[in]pnt- Name of the object control point.
Returns:
Descriptor of the object control point.

Descriptor obtained by the value of this function, it has automatical lifetime, i.e. there is no reason to call the method GCE_RemoveGeom for it.

geom_item GCE_SplinePoint ( GCE_system  gSys,
geom_item  spl,
size_t  pntIdx 
)
Parameters:
[in]gSys- System of constraints.
[in]spl- Descriptor of spline.
[in]pntIdx- A control point index.
Returns:
Descriptor of spline control point.

Descriptor obtained by the value of this function, it has automatical lifetime, i.e. there is no reason to call the method GCE_RemoveGeom for it.

GCE_vec2d GCE_GetVectorValue ( GCE_system  gSys,
geom_item  g,
query_geom_type  vType 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of vector or other geometric object.
[in]vType- Identifier of vector belonging to the object (currently it equals GCE_DIRECTION or GCE_ORIENTATION). In case of GCE_DIRECTION function returns direction vector for line, line segment or ellipse major axis.
Returns:
Vector coordinates.
GCE_point GCE_GetPointXY ( GCE_system  gSys,
geom_item  g,
point_type  pName = GCE_PROPER_POINT 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of point or other geometric object.
[in]pName- Identifier of a point belonging to the object.
Returns:
Point coordinates
double GCE_GetCoordValue ( GCE_system  gSys,
geom_item  g,
coord_name  cName 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of object.
[in]cName- Denotation of object parameter.
Returns:
Point coordinates

Get the current value of geometric object's coordinate. For example, by using this function one can find the current value of the major or the minor semi-axis of ellipse, circle radius etc.

double GCE_GetVarValue ( GCE_system  gSys,
var_item  var 
)
Parameters:
[in]gSys- System of constraints.
[in]var- Descriptor of variable.
Returns:
A value of variable.
bool GCE_SetPointXY ( GCE_system  gSys,
geom_item  g,
point_type  pName,
GCE_point  xyVal 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of point or other geometric object.
[in]pName- Identifier of a point belonging to the object.
[in]xyVal- New value of point coordinates.
Returns:
true if operation succeeded.

The method assigns to the point or the control point of the object g with the attribute pName a new state of coordinates (the parameter xyVal). It should be taken into account that the call of GCE_SetPointXY doesn't solve the constraint system but only changes the state of geometric object. At the same time the constraint system may become unsatisfied. The state of a point assigned by the call of GCE_SetPointXY should not be saved after the call of GCE_Evaluate if the point is not fixed or not frozen.

bool GCE_SetCoordValue ( GCE_system  gSys,
geom_item  g,
coord_name  cName,
double  crdVal 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of object.
[in]cName- Denotation of object parameter.
[in]crdVal- New value of coordinate.
Returns:
true if operation succeeded.

The method assigns a new value to the coordinate of the object g with the attribute cName. It should be taken into account that the call of GCE_SetCoordValue doesn't solve the constraint system but only changes the state of geometric object. At the same time the constraint system may become unsatisfied. The state of coordinate assigned by this method should not be saved after the call of GCE_Evaluate if the point is not fixed or not frozen.

bool GCE_SetVarValue ( GCE_system  gSys,
var_item  var,
double  val 
)
Parameters:
[in]gSys- System of constraints.
[in]var- Descriptor of variable.
[in]val- New value of variable.
Returns:
true if operation succeeded.
bool GCE_FreezeGeom ( GCE_system  gSys,
geom_item  g 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Geometric object.
Returns:
true if operation succeeded.

The function deprives the object of all degrees of freedom. Note that the function GCE_IsConstrainedGeom returns false for the frozen object if the object was not connected with other constraints. I.e. the freezing is not considered as a constraint.
The solver cannot change the frozen geometry but the user application can change it with the methods GCE_SetCoordValue or GCE_SetPointXY. Frozen objects should be considered as independent input parameters of constraint system.

Note:
In the CAD system KOMPAS-3D this command is used only for fixation of projection geometry in associative drawings or sketches with projections of three-dimensional objects.
bool GCE_IsConstrainedGeom ( GCE_system  gSys,
geom_item  g 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of geometric object.
Returns:
true if at least one constraint is set for the object g.
See also:
GCE_RemoveGeom, GCE_RemoveConstraint
bool GCE_IsSatisfied ( GCE_system  gSys,
constraint_item  cItem 
)
Parameters:
[in]gSys- System of constraints.
[in]cItem- Descriptor of constraint.
Returns:
true if a constraint is satisfied.
std::vector<geom_item> GCE_DiagnoseGeometry ( GCE_system  gcSys)

brief Diagnose geometry.

If some geometrical objects are degenerate in the course of solving the system of constraints (function GCE_Evaluate returns GCE_RESULT_InvalidGeometry ), this function returns an array of indices by which these geometric objects are registered in the solver. If geometrical objects do not degenerate, then the function returns an empty array.

Parameters:
[in]gcSys- System of constraints.
Returns:
Vector of indices of objects with invalid geometry.
ptrdiff_t GCE_GetPointDOF ( GCE_system  gSys,
geom_item  g,
point_type  cp,
double &  dofDir 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of geometric object
[in]cp- The code of control point of the object g.
[out]dofDir-Angular direction of point moving freedom in radians.
Returns:
The function returns degree of freedom of the point; If a negative value is returned, then it is failed to calculate the degree of freedom.

This function returns the point's degree of freedom and may take one of the following values:
(-1) - It means that the function didn't determine the degree of freedom;
0 - It means that the point is fixed in constraint system. 1 - It means that the point has a freedom of movement along some trajectory, besides the direction of point movement tangent vector is returned via the parameter dotDir;
2 - It means that the point has a movement freedom inside some two-dimensional region.
If the direction of movement was not determined, then dotDir takes a negative value.

GCE_point_dof GCE_PointDOF ( GCE_system  gSys,
geom_item  pnt 
)
Parameters:
[in]gSys- System of constraints.
[in]pnt- Descriptor of point
[out]dofDir-Angular direction of point moving freedom in radians.
Returns:
The function returns a structure GCE_point_dof, which describes degree of freedom of the point, namely its integral value (dof) and direction vector of point moving freedom (dir). If a negative value (dof) is returned, then it is failed to calculate the degree of freedom.

This function returns the point's degree of freedom and may take one of the following values:
dof = (-1) - It means that the function didn't determine the degree of freedom;
dof = 0 - It means that the point is fixed in constraint system. dof = 1 - It means that the point has a freedom of movement along some trajectory, besides the direction of point movement tangent vector is returned via the parameter "dir" of data structure GCE_point_dof;
dof = 2 - It means that the point has a movement freedom inside some two-dimensional region.
If the direction of movement was not determined, then "dof" takes a negative value.

int GCE_CoordDOF ( GCE_system  gSys,
geom_item  g,
coord_name  cName 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of a geometric object.
[in]cName- Denotation of geometric coordinate.
Returns:
Degree of freedom: 1 for underdefined coordinate, 0 for well-defined coordinate.

The function returns degree of freedom of the coordinate, namely one of the possible values: 1, 0 and -1. If a negative value is returned, then it is failed to calculate the degree of freedom.

constraint_item GCE_AddUnaryConstraint ( GCE_system  gSys,
constraint_type  cType,
geom_item  geom 
)
Parameters:
[in]gSys- System of constraints.
[in]cType- The value of one of the following types of constraints: GCE_FIX_GEOM; GCE_VERTICAL; GCE_HORIZONTAL; GCE_ANGLE_OX; GCE_LENGTH.
[in]g- Descriptor of geometric object
Returns:
Descriptor of a new constraint.

The function specifies an unary constraint, namely constraint which has one of types that are valid for single geometric object.

constraint_item GCE_AddCoincidence ( GCE_system  gSys,
geom_item  g[2] 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptors of geom objects pair.

If a coincident constraint is defined between a point and a curve then this implies that the point lies on the curve. A coincident constraint defined between two geometries of the same type implies that they are equal.

Returns:
Descriptor of a new constraint.
Attention:
In the current version of solver using of this constraint is possible only for two points either for a point and a curve. It is planned to extend its application area for other types.
constraint_item GCE_AddPointOnPercent ( GCE_system  gSys,
geom_item  curve,
geom_item  pnt[3],
double  k 
)
Parameters:
[in]gSys- System of constraints.
[in]curve- Descriptor of a curve.
[in]pnt- Descriptors of points: two boundary points of a piece and a point between.
[in]k- Coefficient for a part of parametric range of piece.
Returns:
Descriptor of a new constraint.

It is assumed that for the curve 'curve' and the points pnt[0], pnt[1] an incidence is provided with the other constraints registered in solver or these points a priori belong to a curve. An incidence between pnt[2] and 'curve' is not required because this constraint already provides an incidence. If pnt[0] = pnt[1] = GCE_NULL_G, then the piece of a curve for which the percentage k is calculated coincides with the whole parametric region of a curve. For example, in a case of circle the parametric range is equal to the interval [-PI ... PI]. The range of values of k from the interval from 0 to 1 is mapped to the parametric region of curve's piece, k = 0 attaches the point pnt[2] to the beginning of the piece and k = 1.0 - to the end of the piece.

constraint_item GCE_AddPointByMetricPercent ( GCE_system  gSys,
geom_item  curve,
geom_item  pnt[3],
double  k 
)
Parameters:
[in]gSys- System of constraints.
[in]curve- Descriptor of a curve.
[in]pnt- Descriptors of points: two boundary points and a point between them.
[in]k- Value of a part (proportion) of the arc length between the two points.
Returns:
Descriptor of a new constraint.

The method creates a constraint specifying the point location on a piece of a curve which is set by the coefficient (proportional) of its arc length. It is assumed that for the curve 'curve' and the points pnt[0], pnt[1] an incidence is provided with the other constraints registered in the solver or these points belong to the curve a priori. If pnt[0] = pnt[1] = GCE_NULL_G, then the piece of a curve for which the percentage k is calculated coincides with the whole parametric region of a curve. For example, in a case of circle the parametric range is equal to the interval [-PI ... PI]. If k = 0, then the constraint attaches the point pnt[2] to the beginning of the piece, if k = 1.0, then the constraint attaches the point pnt[2] to the end of the piece.

constraint_item GCE_AddFixCurvePoint ( GCE_system  gSys,
geom_item  curve,
geom_item  pnt 
)
Parameters:
[in]gSys- System of constraints.
[in]curve- Descriptor of a curve.
[in]pnt- Descriptors of a point.
Returns:
Descriptor of a new constraint.

This function creates a constraint attaching a point to the curve in the current location. The point is localized according to the parametric representation of a curve with a help of parameter along a curve where it is located. It is required that at the moment when the function is called the point is lying on the curve, and coincidence between the point and the curve should be provided by other constraints or this point should belong to the curve a priori.

Attention:
In CAD system KOMPAS this function is used only for fixation of ends of a piece ('bounded curve') of a parametric curve obtained by projecting from 3D model. It is recommended to apply the more native function GCE_AddMiddlePoint for such constraints as "middle point".
constraint_item GCE_AddPointOnParEllipse ( GCE_system  gSys,
geom_item  pnt,
geom_item  ellipse,
double  t 
)
Parameters:
[in]gSys- System of constraints.
[in]pnt- Descriptor of a point.
[in]ellipse- Descriptor of ellipse.
[in]tThe value of parameter on ellipse from the region [-PI,PI].
Returns:
Descriptor of a new constraint.

This function is valid only for curves of the type "ellipse", the function creates a constraint which provides coincidence between the point pnt and the ellipse point set by the parameter t from the ellipse parametric region which is equal to the interval [-PI,PI].

constraint_item GCE_AddParPointOnCurve ( GCE_system  gSys,
geom_item  pnt,
geom_item  curve,
var_item  t 
)
Parameters:
[in]gSys- System of constraints.
[in]pnt- Descriptor of a point.
[in]curve- Descriptor of a curve.
[in]t- Descriptor of a curve parameter.
Returns:
Descriptor of a new constraint.

This function differs from GCE_AddCoincidence in that it allows to link a point with a parametric curve through a parameter value and control its position on the curve through this parameter. The constraint is available for the following curve types: GCE_ELLIPSE, GCE_SPLINE, GCE_PARAMETRIC_CURVE and GCE_BOUNDED_CURVE, based on the curve of one of the listed types.

constraint_item GCE_AddAlignPoints ( GCE_system  gSys,
geom_item  p[2],
double  ang 
)
Parameters:
[in]gSys- System of constraints.
[in]p- Descriptors of point pair.
[in]ang- An angle specifying alignment direction, in radians.
Returns:
Descriptor of a new constraint.
constraint_item GCE_AddAngle ( GCE_system  gSys,
geom_item  l1,
geom_item  l2,
const GCE_adim_pars dPars 
)
Parameters:
[in]gSys- System of constraints.
[in]l1- Descriptor of the first linear geometric object.
[in]l2- Descriptor of the second linear geometric object.
[in]dPars- Parameters of angular dimension (see GCE_adim_pars).
Returns:
Descriptor of a new constraint.

Angular dimension for a pair of linear geometric objects. Arguments of constraint are objects of the following types: "line", "segment" or "Bounded curve" based on line.

constraint_item GCE_AddAngleBisector ( GCE_system  gSys,
geom_item  l1,
geom_item  l2,
geom_item  bl,
GCE_bisec_variant  variant 
)
Parameters:
[in]gSysSystem of constraints.
[in]bla segment, bisector of angle between two lines.
[in]l1,l2lines or segments a bisector of angle is set between.
[in]variantvariant of solution for bisector of angle.
Returns:
descriptor of new constraint.
constraint_item GCE_AddAngle4P ( GCE_system  gSys,
geom_item  fPair[2],
geom_item  sPair[2],
const GCE_adim_pars dPars 
)

Angular dimension is constructed for two segments with points p1-p2, p3-p4.

Parameters:
[in]gSys- System of constraints.
[in]sPair- First pair of points (first segment). \param[in] sPair - Second pair of points (second segment).
[in]dPars- Parameters of angular dimension (see GCE_adim_pars).
Returns:
Descriptor of a new constraint.
constraint_item GCE_AddColinear ( GCE_system  gSys,
geom_item  g[2] 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptors of a pair of linear objects.
Returns:
Descriptor of a new constraint.

Constraint makes a pair of objects belonging to the common line, it is used for lines or segments.

constraint_item GCE_AddColinear3Points ( GCE_system  gcSys,
geom_item  pnt[3] 
)

Set such a constraint for three points that points should lie on the same line.

Parameters:
[in]gSys- System of constraints.
[in]pnt- A triplet of points lying on the same line.
Returns:
Descriptor of a new constraint.
constraint_item GCE_AddEqualLength ( GCE_system  gSys,
geom_item  ls1,
geom_item  ls2 
)
Parameters:
[in]gSys- System of constraints.
[in]ls1- Descriptor of the first segment.
[in]ls2- Descriptor of the second segment.
Returns:
Descriptor of a new constraint.

The constraint is applicable for segments or line pieces created by the function GCE_AddBoundedCurve or GCE_AddLineSeg.

constraint_item GCE_AddEqualRadius ( GCE_system  gSys,
geom_item  c1,
geom_item  c2 
)
Parameters:
[in]gSys- System of constraints.
[in]c1- Descriptor of the first circle.
[in]c2- Descriptor of the second circle.
Returns:
Descriptor of a new constraint.
constraint_item GCE_AddEqualCurvature ( GCE_system  gSys,
geom_item  curves[2],
var_item  tPars[2] 
)
Parameters:
[in]gSys- System of constraints.
[in]curves- Descriptors of a pair of curves.
[in]tPars- Descriptors of parameters of parametric curves in which the equality of curvature must be satisfied.
Returns:
Descriptor of a new constraint.
Note:
If curve has a type GCE_CIRCLE or GCE_BOUNDED_CURVE which is based on circle then the corresponding value of tPars[i] may be equal to GCE_NULL_V because the curvature of circle is the same in all its points.
constraint_item GCE_AddRadiusDimension ( GCE_system  gSys,
geom_item  cir,
GCE_dim_pars  dPar 
)
Parameters:
[in]gSys- System of constraints.
[in]cir- Descriptor of circle.
[in]dPar- Parameters of linear dimension (see GCE_dim_pars).
Returns:
Descriptor of radius constraint.
constraint_item GCE_AddDiameter ( GCE_system  gSys,
geom_item  cir,
GCE_dim_pars  dPar 
)
Parameters:
[in]gSys- System of constraints.
[in]cir- Descriptor of circle.
[in]dPar- Parameters of linear dimension (see GCE_dim_pars).
Returns:
Descriptor of diameter constraint.
constraint_item GCE_FixVariable ( GCE_system  gSys,
var_item  var 
)
Parameters:
[in]gSys- System of constraints.
[in]var- Descriptor of variable.
Returns:
Descriptor of a new constraint.
Note:
A constraint created with this function can be driven via the call of GCE_ChangeDrivingDimension.
constraint_item GCE_FixGeom ( GCE_system  gSys,
geom_item  g 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of geometric object
Returns:
Descriptor of a new constraint.
constraint_item GCE_FixLength ( GCE_system  gSys,
geom_item  ls 
)
Parameters:
[in]gSys- System of constraints.
[in]ls- Descriptor of segment.
Returns:
Descriptor of a new constraint.

The constraint is applicable only for segments so far.

constraint_item GCE_FixRadius ( GCE_system  gSys,
geom_item  circ,
coord_name  cName = GCE_RADIUS 
)

The constraint is applicable to fix radius of circle or semiaxis of ellipse.

Parameters:
[in]gSys- System of constraints.
[in]circ- Descriptor of circle or ellipse.
[in]cName-Type of fixed coordinate. It can be GCE_RADIUS, GCE_MAJOR_RADIUS or GCE_MINOR_RADIUS.
Returns:
Descriptor of a new constraint.
constraint_item GCE_FixSplineDerivative ( GCE_system  gSys,
geom_item  spline,
double  par,
uint  derOrder,
GCE_vec2d fixVal = NULL 
)
Parameters:
[in]gSys- System of constraints.
[in]spline- Descriptor of spline.
[in]par- Parameter value in which it is necessary to record a derivative.
[in]derOrder- Order of the derivative which must be fixed.
[in]fixVal- The value to which it is necessary to equate the derivative.
Returns:
Descriptor of a new constraint.

Fixation point is specified via the parameter value corresponding to it.
The order of a fixed derivative can be equal 0 (point fixing), 1, 2 or 3.
If fixVal is NULL current value of the derivative vector will be fixed. Otherwise the derivative vector will be fixed at fixVal value.

constraint_item GCE_AddMiddlePoint ( GCE_system  gcSys,
geom_item  pnt[3] 
)
Parameters:
[in]gSys- System of constraints.
[in]pnt- Descriptors of point triplet.
Returns:
Descriptor of a new constraint.

For the given three points on a plane set the relation connecting the point triplet in such way that the third point lies in the middle of points pnt[0] and pnt[1].

constraint_item GCE_AddParallel ( GCE_system  gSys,
geom_item  g[2] 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptors of a pair of linear objects.
Returns:
Descriptor of a new constraint.

The constraint is used for lines or segments.

constraint_item GCE_AddPerpendicular ( GCE_system  gSys,
geom_item  g[2] 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptors of a pair of linear objects.
Returns:
Descriptor of a new constraint.

The constraint is used for lines or segments.

constraint_item GCE_AddSymmetry ( GCE_system  gSys,
geom_item  g[2],
geom_item  lObj 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptors pair of symmetrical objects..
[in]lObj- Descriptor of the axis of symmetry.
Returns:
Descriptor of a new constraint.
Attention:
Currently, this restriction only applies to the symmetry of the points.
constraint_item GCE_AddTangent ( GCE_system  gSys,
geom_item  g[2],
var_item  tPar[2] 
)
Parameters:
[in]gSysSystem of constraints.
[in]gDescriptors of a pair of curves or lines.
[in]tParDescriptors of parameters of tangency for parametric curves.
Returns:
Descriptor of a new constraint.
Help parameters of tangency
Variable descriptors tPar[0], tPar[1] specify help values parametrizing a tangent point on the first and the second curve. One of both tPar can be equal GCE_NULL_V.
Note:
tPar[0] or tPar[1] may be equal to GCE_NULL_V if parameters of tangency are not provided or curves have no parametric representation. There are only two types having parametric representation: GCE_SPLINE and GCE_PARAMETRIC_CURVE.
constraint_item GCE_AddDistance ( GCE_system  gSys,
geom_item  g[2],
const GCE_ldim_pars dPars 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptors of a pair of geometric objects.
[in]dPars- Parameters of linear dimension (see #GCE_adim_ldim).
Returns:
Descriptor of a new constraint.

Set linear dimension for a pair of geometric objects.

constraint_item GCE_AddDistance2P ( GCE_system  gSys,
geom_item  p[2],
const GCE_dim_pars dPars 
)
Parameters:
[in]gSys- System of constraints.
[in]p- Descriptors of point pair.
[in]dPars- Parameters of dimensional constraint.
Returns:
Descriptor of a new constraint.
constraint_item GCE_AddDistancePLs ( GCE_system  gSys,
geom_item  p[3],
const GCE_dim_pars dPars 
)
Parameters:
[in]gSys- System of constraints.
[in]p- Descriptors of point triplet.
[in]dPars- Parameters of dimensional constraint.
Returns:
Descriptor of a new constraint.

Linear dimension from the point p1 to the segment <p0,p2>. The dimension is sensitive to a sign of its value.

constraint_item GCE_AddDirectedDistance ( GCE_system  gSys,
geom_item  p[2],
const GCE_ldim_pars dPars 
)
Parameters:
[in]gSys- System of constraints.
[in]p- Descriptors of point pair.
[in]dPars- Parameters of dimensional constraint.
Returns:
Descriptor of a new constraint.

The constraint represents the dimension type that dimensions the distance between two points in plane when they are projected onto a line at an angle specified by parameter dPars dirAngle, which sets the direction of dimension in radians. With driving dPars.dirAngle it is possible to set the vertical or the horizontal dimension. So a dimension with an angle equal to 0 radians specifies a "horizontal". The angle equal to PI/2 radians corresponds to "vertical" dimension.

constraint_item GCE_AddLinearEquation ( GCE_system  gSys,
const double *  a,
const var_item v,
size_t  n,
double  c 
)
Parameters:
[in]gSys- System of constraints.
[in]a- Vector of coefficients of linear equation.
[in]v- Descriptors of variables of equation.
[in]n- Quantity of variables.
[in]c- Free coefficient.
Returns:
Descriptor of a new constraint.

Set a linear equation in form of a1*v1 + a2*v2 + .. + an*vn + c = 0.

GCE_result GCE_ChangeDrivingDimension ( GCE_system  gSys,
constraint_item  dItem,
double  dVal 
)
Parameters:
[in]gSys- System of constraints.
[in]dItem- Descriptor of dimensional constraint.
[in]dVal- Required value of constraint.
Returns:
Operation result code.

The function is used only for driving dimensions or driving parameters. If the driving dimension or parameter is angular, then the parameter dVal is specified in radians.
It should be taken into account that the function doesn't perform computations but only prepares the changing of dimension. For the changes to take effect it is required to call the function GCE_Evaluate.

GCE_result GCE_DeviateDimension ( GCE_system  gSys,
constraint_item  dItem,
double  delta 
)
Parameters:
[in]dItem- Descriptor of geometric constraint.
[in]delta- Deviation value.
Returns:
errCode - Solution of constraint system.

The function is used for the diagnostics of constraints redundancy based on the deviation of the region of solution of the constraint. It works only for dimensional constraints and other types of geometric constraints such as "Points alignment", "Horizontality" etc. The applicability to a certain type was not documented and it is defined only empirically. If GCE_RESULT_None is returned, the constraint wasn't deviated.

GCE_result GCE_DeviationTest ( GCE_system  gSys,
constraint_item  dItem,
double  delta 
)
Parameters:
[in]dItem- Descriptor of geometric constraint.
[in]delta- Deviation value.
Returns:
- Solution of constraint system.

The function is used for the diagnostics of constraints redundancy based on the deviation of the region of solution of the constraint. It works only for dimensional constraints and other types of geometric constraints such as "Points alignment", "Horizontality" etc. The applicability to a certain type (for non dimensional) was not documented and it is defined only empirically. If GCE_RESULT_None is returned, the constraint wasn't deviated.

Note:
Unlike GCE_DeviateDimension this function does not change state of geometric constraint system.
double GCE_DimensionParameter ( GCE_system  gSys,
constraint_item  dItem 
)

The function returns a value of dimension parameter of the constraint. If the constraint is a driving dimension, the function returns a value of dimension parameter specified when creating the constraint or last call of GCE_ChangeDrivingDimension.

GCE_result GCE_Evaluate ( GCE_system  gSys)
Parameters:
[in]gSys- System of constraints.
Returns:
Calculation result code.

The function solves problem of constraints. The problem of constraint is formulated by API functions of geometric solver; the functions of a kind GCE_Add_XXXXXXX add a new object, the functions of kinds GCE_Change_XXXXXXX and GCE_Set_XXXXXXX change a state of objects. Thus, for all changes to take effect it is necessary to call the method GCE_Evaluate.
The algorithms GCE_Evaluate take into account whether constraint systems are satisfied, if all constraints have been already solved, then the function doesn't spend time for calculations, and the state of geometric objects remains unchanged.

GCE_result GCE_PrepareMovingOfPoint ( GCE_system  gSys,
geom_item  obj,
point_type  pntId,
GCE_point  curXY 
)
Parameters:
[in]gSysSystem of constraints.
[in]objGeometric object.
[in]pntIdDenotation of the dragged control point of the object.
[in]curXYCoordinates of cursor where the moving point follows.
Returns:
Error code. Returns GCE_RESULT_Ok if preparing the dragging mode was successful.
GCE_result GCE_PrepareDraggingPoint ( GCE_system  gSys,
GCE_dragging_point  drgPnt,
GCE_point  curXY 
)
Parameters:
[in]gSys- System of constraints.
[in]drgPnt- A geom control point.
[in]curXY- Coordinates of dragging point.
Returns:
Error code. Returns GCE_RESULT_Ok if preparing the dragging mode was successful.
GCE_result GCE_PrepareDraggingPoint ( GCE_system  gSys,
const std::vector< GCE_dragging_point > &  cPntArr,
GCE_point  curXY 
)

This method is intended for the group dragging of few objects with the "common" hot-point. A "common" hot-point is not necessarily the only point (with the only descriptor), but a set of points with different descriptors but with equal coordinates.

Parameters:
[in]gSys- System of constraints.
[in]cPntArr- A set of geometrically equal control points.
[in]curXY- Coordinates of dragging point.
Returns:
Error code. Returns GCE_RESULT_Ok if preparing the dragging mode was successful.
GCE_result GCE_PrepareMovingGeoms ( GCE_system  gSys,
std::vector< geom_item > &  geoms,
GCE_point  curXY 
)
Parameters:
[in]gSys- System of constraints.
geoms- Set of geometric objects.
curXY- Coordinates of dragging point.
Returns:
Error code. Returns GCE_RESULT_Ok if preparing the dragging mode was successful.
GCE_result GCE_MovePoint ( GCE_system  gcSys,
GCE_point  curXY 
)
Parameters:
[in]gcSys- System of constraints.
[in]curXY- Current coordinates of cursor.
Returns:
Error code. Returns GCE_RESULT_Ok if preparing the dragging mode was successful.

The procedure services the dragging mode, with a help of it a geometric solver tracks the cursor location. This call allows to perform a two-coordinate control of an underdetermined model. If the function returns an error code, which is not GCE_RESULT_Ok, then it is guaranteed that the state of geometric objects will remain the same. If the function returned GCE_RESULT_Ok, then the solver contains a new state of geometric objects satisfying to all the constraints created before (a new solution). In this case it not required to call GCE_Evaluate for the conversion of objects to the solved state.

GCE_result GCE_Transform ( GCE_system  gSys,
const MbMatrix mat 
)

brief Transform the geometry of the constraints system according to a given matrix.

Parameters:
[in]gSys- System of constraints.
[in]mat- Transformation matrix.
Returns:
Error code.
bool GCE_SetJournal ( GCE_system  gSys,
const char *  fName 
)
Parameters:
[in]gSys- System of constraints.
[in]fName- Name of destination file with a full path.
Returns:
true, if journalling has been successfully switched on.
Attention:
The journal file will be written only when a session of work with the constraint system is finished, i.e. immediately after calling the GCE_RemoveSystem method.
geom_item GCE_AddPoint ( GCE_system  gSys,
GCE_point  pVal,
int   
) [inline]
Attention:
An obsolete function. The call will be removed in one of the next versions.
GCE_system GCE_CreateSystem ( void *  )
Attention:
An obsolete function. The call will be removed in one of the next versions.
constraint_item GCE_AddDirectedDistance2P ( GCE_system  gSys,
geom_item  p[2],
const GCE_ldim_pars dPars 
)
Attention:
An obsolete function. The call will be removed in one of the next versions (2016).
constraint_item GCE_AddAlignPoints ( GCE_system  gSys,
geom_item  p[2],
bool  hor 
)
Attention:
An obsolete function. The call will be removed in one of the next versions.
constraint_item GCE_AddFixedLength ( GCE_system  ,
geom_item   
)
Attention:
The function is obsolete. Use GCE_FixLength instead.
constraint_item GCE_AddFixVariable ( GCE_system  ,
var_item   
)
Attention:
The function is obsolete. Use GCE_FixVariable instead.
constraint_item GCE_AddIncidence ( GCE_system  ,
geom_item  ,
geom_item   
)
Attention:
This call is deprecated. Call GCE_AddCoincidence instead.
GCE_result GCE_PrepareMovingOfPoint ( GCE_system  gSys,
const std::vector< geom_point > &  cPntArr,
GCE_point  curXY 
)
Attention:
An obsolete function. The call will be removed in one of the next versions. Use GCE_PrepareDraggingPoint( GCE_system gSys, const std::vector<GCE_dragging_point> & cPntArr, GCE_point curXY ) instead of this.
constraint_item GCE_AddEquation ( GCE_system  gSys,
ItAlgebraicConstraint iEqu,
size_t  varsCount,
const var_item varsVector 
)
Parameters:
gSysthe solver context
iEquinterface of the equation specified by the user
varsCountcount of variables
varsVectorvector of variables
Returns:
descriptor of a new constraint
MbCartPoint GCE_GetPoint ( GCE_system  gSys,
geom_item  g,
point_type  pName = GCE_PROPER_POINT 
)
Parameters:
gSysthe solver context
gdescriptor of a point or other geometric object
pNameidentifier of a point belonging to the object
Returns:
point coordinates
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines