C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
+ Collaboration diagram for Solver Interface:

Classes

struct  GCE_callback_table
 The structure uniting 2D-solver callbacks. More...
 
struct  MbGeomTol
 Tolerances to test the accuracy of geometry. More...
 
struct  GcPrecision
 Tolerances of 2D-constraint 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 an 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_interval
 Parameters of interval constraint. More...
 
struct  GCE_dragging_point
 Control point of the dragging. More...
 
struct  GCE_diagnostic_pars
 Diagnostic characteristics of constraint system. More...
 
struct  GCT_diagnostic_pars
 Diagnostic characteristics of constraint system. More...
 

Typedefs

typedef voidGCE_app_geom
 Geometric object of the application using the solver.
 
typedef void(* GCE_geom_registered) (GCE_app_geom ag)
 Application geom was registered in the solver.
 
typedef bool(* GCE_abort) ()
 Query to interrupt calculations.
 
typedef int8 sign_t
 A number from discrete set {-1,0,1}.
 
typedef voidGCE_system
 Geometric constraints system. More...
 
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 geom_item pattern_item
 Descriptor of pattern registered in the solver context.
 
typedef query_geom_type point_type
 Type of the requested point (used as subset of values query_geom_type).
 

Enumerations

enum  geom_type {
  GCE_ANY_GEOM , GCE_POINT , GCE_LINE , GCE_CIRCLE ,
  GCE_ELLIPSE , GCE_SPLINE , GCE_PARAMETRIC_CURVE , GCE_BOUNDED_CURVE ,
  GCE_OFFSET_CURVE , GCE_LINE_SEGMENT , GCE_SET , GCE_INSTANCE ,
  GCE_PATTERN
}
 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_L_NORMAL , GCE_ORIENTATION , GCE_BASE_CURVE
}
 IDs denoting control points and other elements that form a record (tuple) of a geometric object. ~. More...
 
enum  coord_name {
}
 Enumeration of geom's coordinates. More...
 
enum  constraint_type {
  GCE_FIX_GEOM , GCE_HORIZONTAL , GCE_VERTICAL , GCE_ANGLE_OX ,
  GCE_COINCIDENT , GCE_EQUAL_CURVATURE , GCE_EQUAL_LENGTH , GCE_EQUAL_RADIUS ,
  GCE_EQUAL_OFFSET , GCE_PARALLEL , GCE_PERPENDICULAR , GCE_TANGENT ,
  GCE_COLINEAR , GCE_ALIGN_2P , GCE_BISECTOR , GCE_MIDDLE_POINT ,
  GCE_COLINEAR_3P , GCE_SYMMETRIC , GCE_PERCENT_POINT , GCE_EQUATION ,
  GCE_PATTERNED , GCE_DISTANCE , GCE_DIAMETER , GCE_LENGTH ,
  GCE_RADIUS_DIM , GCE_OFFSET_DIM , GCE_ANGLE , GCE_INTERVAL ,
  GCE_CONSTRAINTS_COUNT , GCE_UNKNOWN = GCE_CONSTRAINTS_COUNT , GCE_UNKNOWN_CON = GCE_UNKNOWN
}
 Identifier of 2D constraint type. More...
 
enum  GCE_result {
  GCE_RESULT_None , GCE_RESULT_Ok , GCE_RESULT_Satisfied = GCE_RESULT_Ok , GCE_RESULT_Not_Satisfied ,
  GCE_RESULT_Overconstrained , GCE_RESULT_InvalidGeometry , GCE_RESULT_MovingOfFixedGeom , GCE_RESULT_CircleCantStretched ,
  GCE_RESULT_SingularMatrix , GCE_RESULT_DegenerateScalingFactor , GCE_RESULT_InvalidDimensionTransform , GCE_RESULT_IsNotDrivingDimension ,
  GCE_RESULT_UnsupportedConstraint , GCE_RESULT_AnisotropicScaling , GCE_RESULT_OverconstrainedInstance , GCE_RESULT_SystemError ,
  GCE_RESULT_NullSystem , GCE_RESULT_Unregistered , GCE_RESULT_Aborted
}
 Diagnostic codes of the geometric solver functions execution. More...
 
enum  GCE_c_status { }
 Status of a geometric constraint. More...
 
enum  GCE_s_state { GCE_STATE_Unknown = 0 , GCE_STATE_WellConstrained , GCE_STATE_UnderConstrained , GCE_STATE_UnresolvedRedundancy }
 Difinition State of geometric constraints system. 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_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. More...
 
GCE_s_state GCE_DefinitionState (GCE_system gSys)
 Get constraint system definition state. More...
 
GCE_result GCE_CheckSatisfaction (GCE_system gSys, VERSION c3dVer=GetCurrentMathFileVersion())
 To check the satisfaction of constraints. More...
 
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_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
More...
 
void GCE_ResetMovingMode (GCE_system)
 Cancel dragging mode.
 
bool GCE_InitFrozenCoords (GCE_system gSys)
 
bool GCE_CollectLinearDependedConstrains (GCE_system, SArray< constraint_item > &)
 Collect ill-conditioned part of the constraint system. More...
 
GCE_system GCE_CreateSystem ()
 Create a simple constraint system.
More...
 
void GCE_ClearSystem (GCE_system gSys)
 Make the constraint system empty. More...
 
void GCE_RemoveSystem (GCE_system gSys)
 Delete system of constraints.
More...
 
geom_item GCE_AddPoint (GCE_system gSys, GCE_point pVal)
 Add point to the constraint system. More...
 
geom_item GCE_AddLine (GCE_system gSys, const GCE_line &lVal)
 Add line to the constraint system. More...
 
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. More...
 
geom_item GCE_AddCircle (GCE_system gSys, const GCE_circle &cVal)
 Add circle to the constraint system. More...
 
geom_item GCE_AddEllipse (GCE_system gSys, const GCE_ellipse &eVal)
 Add ellipse to the constraint system. More...
 
geom_item GCE_AddSpline (GCE_system gSys, const GCE_spline &spl)
 Add spline (NURBS) to the constraint system. More...
 
geom_item GCE_AddParametricCurve (GCE_system gSys, const MbCurve &crv)
 Add parametric curve to the constraint system. More...
 
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. More...
 
geom_item GCE_AddOffsetCurve (GCE_system gSys, geom_item curve, double offset)
 Add an equidistant curve to the constraint system. More...
 
pattern_item GCE_AddPattern (GCE_system gSys, geom_item geom, double step)
 Declare a pattern with a direction along a line and a given offset or with the center at a point and a given angle. More...
 
pattern_item GCE_AddLinearPattern (GCE_system gSys, GCE_vec2d trans)
 Declare a linear pattern with the step given by the translation vector. More...
 
pattern_item GCE_AddAngularPattern (GCE_system gSys, GCE_point point, double angle)
 Declare an angular pattern with a center and an angle. More...
 
geom_item GCE_AddInstance (GCE_system gSys, pattern_item pItem, geom_item sample, int k)
 Create k-th instance of the sample in a given pattern. More...
 
geom_item GCE_AddRigidSet (GCE_system gSys, const std::vector< geom_item > &geoms)
 Add a rigid set of geometric objects to the system. More...
 
var_item GCE_AddVariable (GCE_system gSys, double val)
 Add a variable to the constraint system. More...
 
var_item GCE_VariableOf (GCE_system gSys, geom_item g, coord_type coordType)
 Get a variable from the constraint system. More...
 
constraint_item GCE_AddBound (GCE_system gSys, var_item var, GCE_interval dim)
 Limit the value of a variable to an interval. More...
 
geom_type GCE_GeomType (GCE_system gSys, geom_item g)
 A type of geometric object. More...
 
geom_type GCE_BaseCurveType (GCE_system gSys, geom_item crv)
 A type of geometric curve. More...
 
bool GCE_RemoveVariable (GCE_system gSys, var_item var)
 Delete variable from the constraint system. More...
 
void GCE_ReleaseVariable (GCE_system gSys, var_item var)
 Control variable's lifetime by solver. More...
 
bool GCE_RemoveGeom (GCE_system gSys, geom_item g)
 Delete geometric object from the constraint system. More...
 
void GCE_ReleaseGeom (GCE_system gSys, geom_item g)
 Control geometry object's lifetime by solver. More...
 
bool GCE_RemoveConstraint (GCE_system gSys, constraint_item con)
 Delete a constraint from the system. More...
 
geom_item GCE_PointOf (GCE_system gSys, geom_item g, point_type pnt)
 Request of the object control point descriptor. More...
 
GCE_vec2d GCE_GetVectorValue (GCE_system gSys, geom_item g, query_geom_type vType)
 Get the current coordinates of vector. More...
 
GCE_point GCE_GetPointXY (GCE_system gSys, geom_item g, point_type pName=GCE_PROPER_POINT)
 Get the current coordinates of point. More...
 
double GCE_GetCoordValue (GCE_system gSys, geom_item g, coord_name cName)
 Get the current value of geometric object's coordinate. More...
 
double GCE_GetVarValue (GCE_system gSys, var_item var)
 Get the current value of variable. More...
 
bool GCE_SetPointXY (GCE_system gSys, geom_item g, point_type pName, GCE_point xyVal)
 Set the current coordinates of point. More...
 
bool GCE_SetCoordValue (GCE_system gSys, geom_item g, coord_name cName, double crdVal)
 Set the current value of geometric object's coordinate. More...
 
bool GCE_SetVarValue (GCE_system gSys, var_item var, double val)
 Set the current value of variable. More...
 
geom_item GCE_SplinePoint (GCE_system gSys, geom_item spl, size_t pntIdx)
 Descriptor of spline control point by index. More...
 
geom_item GCE_AddSplinePoint (GCE_system gSys, geom_item spl, size_t pntIdx, GCE_point pnt)
 Add control point to spline (NURBS) More...
 
bool GCE_RemoveSplinePoint (GCE_system gSys, geom_item spl, size_t pntIdx)
 Remove spline (NURBS) control point. More...
 
bool GCE_FreezeGeom (GCE_system gSys, geom_item g)
 Freeze geometric object. More...
 
geom_item GCE_FixOffset (GCE_system gSys, geom_item curve)
 Set the constraint "Fixation of offset". More...
 
bool GCE_IsConstrainedGeom (GCE_system gSys, geom_item g)
 The function answers the question: Is geometric object connected with constraints? More...
 
bool GCE_HasInstance (GCE_system gSys, pattern_item p)
 The function answers the question: Is there an instance of the pattern? More...
 
bool GCE_IsSatisfied (GCE_system gSys, constraint_item cItem)
 Perform a check that a constraint is satisfied. More...
 
GCE_c_status GCE_ConstraintStatus (GCE_system gSys, constraint_item cItem)
 Status of constraint inn the system. More...
 
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. More...
 
GCE_point_dof GCE_PointDOF (GCE_system gSys, geom_item pnt)
 Calculate point's degree of freedom. More...
 
int GCE_CoordDOF (GCE_system gSys, geom_item g, coord_name cName)
 Get the degree of freedom of geometric coordinate. More...
 
constraint_item GCE_AddUnaryConstraint (GCE_system gSys, constraint_type cType, geom_item geom)
 Set a constraint on single object (unary constraint). More...
 
constraint_item GCE_AddCoincidence (GCE_system gSys, geom_item g[2])
 Set the constraint "Coincidence". More...
 
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". More...
 
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". More...
 
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". More...
 
constraint_item GCE_AddPointOnParEllipse (GCE_system gSys, geom_item pnt, geom_item ellipse, double t)
 Set the constraint "Point on parametric ellipse". More...
 
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". More...
 
constraint_item GCE_AddAlignPoints (GCE_system gSys, geom_item p[2], double ang)
 Set the constraint "Alignment of points along the given direction". More...
 
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". More...
 
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". More...
 
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. More...
 
constraint_item GCE_AddColinear (GCE_system gSys, geom_item g[2])
 Set the constraint "Colinearity".
More...
 
constraint_item GCE_AddColinear3Points (GCE_system gcSys, geom_item pnt[3])
 Set the constraint "Colinearity of three points". More...
 
constraint_item GCE_AddEqualLength (GCE_system gSys, geom_item curve1, geom_item curve2)
 Set the constraint "Equality of lengths" for curves. More...
 
constraint_item GCE_AddEqualRadius (GCE_system gSys, geom_item c1, geom_item c2)
 Set the constraint "Equality of radii" for two circles (arcs) More...
 
geom_item GCE_AddEqualOffset (GCE_system gSys, geom_item curve1, geom_item curve2)
 Set the constraint "Equal of offset of equidistant curves". More...
 
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". More...
 
constraint_item GCE_AddRadiusDimension (GCE_system gSys, geom_item cir, GCE_dim_pars dPar)
 Specify a "Radius dimension" constraint. More...
 
constraint_item GCE_AddDiameter (GCE_system gSys, geom_item cir, GCE_dim_pars dPar)
 Specify a "Diameter dimension" constraint. More...
 
constraint_item GCE_AddLength (GCE_system gSys, geom_item curve, GCE_dim_pars dPar)
 Specify a "Curve Length" constraint. More...
 
constraint_item GCE_AddPatterned (GCE_system gSys, pattern_item pItem, geom_item sample, geom_item instance, int k)
 Bind two geometric objects by a pattern constraint. More...
 
constraint_item GCE_FixVariable (GCE_system gSys, var_item var)
 Set the constraint "Driving parameter" or "Fixation of variable". More...
 
constraint_item GCE_FixGeom (GCE_system gSys, geom_item g)
 Set the constraint "Fixation of geom". More...
 
constraint_item GCE_FixLength (GCE_system gSys, geom_item ls)
 Set the constraint "Fixation of curve length". More...
 
constraint_item GCE_FixRadius (GCE_system gSys, geom_item circ, coord_name cName=GCE_RADIUS)
 Set the constraint "Fixation of radius". More...
 
constraint_item GCE_FixCoordValue (GCE_system gSys, geom_item g, coord_name cName)
 Specify fixation of a parametric object coordinate. More...
 
constraint_item GCE_FixSplineDerivative (GCE_system gSys, geom_item spline, double par, uint derOrder, GCE_vec2d *fixVal=nullptr)
 Set the constraint "Fixation of derivative vector of the spline at a given point". More...
 
constraint_item GCE_AddMiddlePoint (GCE_system gcSys, geom_item pnt[3])
 Set the constraint "Middle point". More...
 
constraint_item GCE_AddParallel (GCE_system gSys, geom_item g[2])
 Set the constraint "Parallelism". More...
 
constraint_item GCE_AddPerpendicular (GCE_system gSys, geom_item g[2])
 Set the constraint "Perpendicularity". More...
 
constraint_item GCE_AddSymmetry (GCE_system gSys, geom_item g[2], geom_item lObj)
 Set the constraint "Symmetry relative to the linear object". More...
 
constraint_item GCE_AddTangent (GCE_system gSys, geom_item g[2], var_item tPar[2])
 Set the constraint "Tangency of two curves". More...
 
constraint_item GCE_AddDistance (GCE_system gSys, geom_item g[2], const GCE_ldim_pars &dPars)
 Set the dimensional constraint "Distance between objects". More...
 
constraint_item GCE_AddDistance2P (GCE_system gSys, geom_item p[2], const GCE_dim_pars &dPars)
 Set the constraint "Distance between points". More...
 
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". More...
 
constraint_item GCE_AddDirectedDistance (GCE_system gSys, geom_item p[2], const GCE_ldim_pars &dPars)
 Set the constraint "Directed distance between points". More...
 
constraint_item GCE_AddLinearEquation (GCE_system gSys, const double *a, const var_item *v, size_t n, double c)
 Set the linear equation. More...
 
GCE_result GCE_ChangeDrivingDimension (GCE_system gSys, constraint_item dItem, double dVal)
 Change the value of driving dimension. More...
 
GCE_result GCE_DeviateDimension (GCE_system gSys, constraint_item dItem, double delta)
 Deviate the constraint from the point of solution. More...
 
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. More...
 
double GCE_DimensionParameter (GCE_system gSys, constraint_item dItem)
 A current value of the dimension parameter. More...
 
GCE_result GCE_Evaluate (GCE_system gSys)
 Calculate the constraint system. More...
 
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. More...
 
GCE_result GCE_PrepareDraggingPoint (GCE_system gSys, GCE_dragging_point drgPnt, GCE_point curXY)
 Initialize the dragging mode of the object control point. More...
 
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. More...
 
GCE_result GCE_PrepareMovingGeoms (GCE_system gSys, std::vector< geom_item > &geoms, GCE_point curXY)
 Initialize mode of moving a set of objects. More...
 
GCE_result GCE_MovePoint (GCE_system gcSys, GCE_point curXY)
 Move a dragging point. More...
 
GCE_result GCE_DynamicTransform (GCE_system gSys, const std::vector< geom_item > &geoms, const MbMatrix &mat)
 
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. More...
 
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_AddPoint (GCE_system gSys, GCE_point pVal, int)
 
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". More...
 
DEPRECATE_DECLARE GCE_result GCE_PrepareMovingOfPoint (GCE_system, const std::vector< geom_point > &, GCE_point)
 
GCE_callback_tableGCE_InitCallbacks (GCE_callback_table &)
 Set and return default callback functions. More...
 
GCE_result GCE_Register (GCE_system gSys, const GCE_callback_table &cbTable)
 Register callback table for new constraint system. More...
 
void GCE_Bind (GCE_system, geom_item, GCE_app_geom)
 Associate an application geometry and a solver's descriptor.
 
constraint_item GCE_AddEquation (GCE_system gSys, ItAlgebraicConstraint &iEqu, size_t varsCount, const var_item *varsVector)
 Specify a constraint implemented by the user. More...
 
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. More...
 
bool OK (GCE_result resCode)
 Return true, if the result code is successful.
 

Variables

const GCE_app_geom GCE_NOGEOM = 0
 Specifies an undefined object of the user's app.
 
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 pattern_item GCE_NULL_P = GCE_NULL
 Undefined value of pattern_item type.
 
const double GCE_UNDEFINED_DBL = UNDEFINED_DBL
 An undefined value of double.
 

Detailed Description

Typedef Documentation

◆ GCE_system

typedef void* GCE_system

Geometric constraints 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

◆ geom_type

enum geom_type

Dictionary of geometric primitives types.

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_OFFSET_CURVE 

Equidistant curve.

GCE_LINE_SEGMENT 

Line segment.

GCE_SET 

Subset of geometric objects.

GCE_INSTANCE 

An instance of the base object.

GCE_PATTERN 

A geometrical pattern.

◆ query_geom_type

IDs denoting control points and other elements that form a record (tuple) of a geometric object. ~.

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 

Central point 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) or pattern.

GCE_L_NORMAL 

Normal vector of a linear geometry entity.

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

◆ coord_name

enum coord_name

Enumeration of geom's coordinates.

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_OFFSET 

Offset of equidistant curve.

GCE_STEP 

Linear or angular pattern shift.

GCE_NULL_CRD 

Empty (nonexistent) coordinate.

◆ constraint_type

Identifier of 2D constraint type.

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

Fixation of geometric object.

GCE_HORIZONTAL 

Horizontality of a linear object.

GCE_VERTICAL 

Verticality of a linear object.

GCE_COINCIDENT 

Coincidence of a pair of geometric objects.

GCE_EQUAL_CURVATURE 

Equality of curves curvature in given points.

GCE_EQUAL_LENGTH 

Equality of two curves lengths.

GCE_EQUAL_RADIUS 

Equality of two circles lengths.

GCE_EQUAL_OFFSET 

Equality of offset of two equidistant curves.

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_BISECTOR 

Bisector of angle.

GCE_MIDDLE_POINT 

Middle point.

GCE_COLINEAR_3P 

Collinearity of a point triple.

GCE_SYMMETRIC 

Symmetry.

GCE_EQUATION 

Equation.

GCE_PATTERNED 

Bind a pair of curves in a pattern.

GCE_LENGTH 

Fixation of length of a line segment or arc.

GCE_CONSTRAINTS_COUNT 

Number of types.

GCE_UNKNOWN 

Unknown constraint type.

◆ GCE_result

enum GCE_result

Diagnostic codes of the geometric solver functions execution.

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_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.

GCE_RESULT_IsNotDrivingDimension 

Given constraint should be a driving dimension.

GCE_RESULT_UnsupportedConstraint 

An impossible constraint was set on geometric objects.

GCE_RESULT_AnisotropicScaling 

Anisotropic scaling.

GCE_RESULT_OverconstrainedInstance 

An attempt to make an instance patterned on more than one pattern.

GCE_RESULT_SystemError 

Internal system error.

GCE_RESULT_NullSystem 

Access to invalid system of constraints.

GCE_RESULT_Unregistered 

Access to invalid object.

GCE_RESULT_Aborted 

The evaluation process aborted by the application.

◆ GCE_c_status

Status of a geometric constraint.


Enumerator
GCE_STATUS_IllConditioned 

/ru Ограничения из плохо-обусловленной части. /en A constraint of ill-condition

GCE_STATUS_Redundant 

/ru Ограничение игнорируется решателем по причине избыточности. // en A constraint is ignored by the solving process because of the redundancy.

◆ GCE_s_state

Difinition State of geometric constraints system.

Enumerator
GCE_STATE_Unknown 

State is unknown.

GCE_STATE_WellConstrained 

Well-constrained system: all degrees of freedom are zero.

GCE_STATE_UnderConstrained 

Underconstrained system: there are non-zero degrees of freedom.

◆ GCE_bisec_variant

Variant of a bisector for two lines.

Enumerator
GCE_BISEC_CLOSEST 

Undefined direction (nearest solution).

GCE_BISEC_MINUS 

Bisector along vector difference of the line directions.

GCE_BISEC_PLUS 

Bisector along vector sum of the line directions.

Function Documentation

◆ GCE_CheckPointSatisfaction()

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.

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.

◆ GCE_DefinitionState()

GCE_s_state GCE_DefinitionState ( GCE_system  gSys)

Get constraint system definition state.

Parameters
[in]gSys- System of constraints.

The function will return #GCE_STATE_Underconstrained if there is at least one geometric object with nonzero degree of freedom. State code GCE_STATE_WellConstrained means that the geometry is fully-defined. And the other state is #GCE_STATE_UnresolvedRedundancy means there are unresolved redundant constraints (non solved overdefinition).

Returns
One of the states enumerated by a set: "Under-defined", "Well-defined" and "There are unsolved redundant constraints (non solved overdefinition)".
Note
Function complexity is comparable to GCE_Evaluate.

◆ GCE_CheckSatisfaction()

GCE_result GCE_CheckSatisfaction ( GCE_system  gSys,
VERSION  c3dVer = GetCurrentMathFileVersion() 
)

To check the satisfaction of constraints.

For internal use only!

Parameters
gSys- Solver state.
c3dVer- Mathematical kernel version.
Returns
Calculation result code.

◆ GCE_FormCirDimension()

constraint_item GCE_FormCirDimension ( GCE_system  gcContext,
geom_item  cir,
GCE_dim_pars  dPars,
bool  diam 
)

Specify "Radial dimension" constraint

Parameters
cir- a circle or an arc
diam- flag of diametral dimension

◆ GCE_InitFrozenCoords()

bool GCE_InitFrozenCoords ( GCE_system  gSys)

The call is intended to replay an old-version evaluation for the start values of the frozen coordinates.

◆ GCE_CollectLinearDependedConstrains()

bool GCE_CollectLinearDependedConstrains ( GCE_system  ,
SArray< constraint_item > &   
)

Collect ill-conditioned part of the constraint system.

Note
The call may be removed from the API in the future. Use GCE_ConstraintStatus call to query which of constraints form a redundant or overdefined subsystem with each other.

This is an auxiliary call for diagnostic purposes.The function collects
constraints that have one of the following statuses:
GCE_STATUS_IllConditioned,
GCE_STATUS_WellConditioned,
GCE_STATUS_Redundant,
GCE_STATUS_OverConstrained,
GCE_STATUS_NotConsistent,
GCE_STATUS_NotSolved.
These constraints usually form the redundant or overdifined part. For more detailed information about the status of each constraint use the call GCE_ConstraintStatus.

◆ GCE_CreateSystem()

GCE_system GCE_CreateSystem ( )

Create a simple constraint system.

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.

◆ GCE_ClearSystem()

void GCE_ClearSystem ( GCE_system  gSys)

Make the constraint system empty.

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

◆ GCE_RemoveSystem()

void GCE_RemoveSystem ( GCE_system  gSys)

Delete system of constraints.

This method releases memory from internal data structures maintaining the constraint system. The removed constraint system is invalidated after this call.

Parameters
[in]gSys- System of constraints.
See also
GCE_ClearSystem

◆ GCE_AddPoint() [1/2]

geom_item GCE_AddPoint ( GCE_system  gSys,
GCE_point  pVal 
)

Add point to the constraint system.

Parameters
[in]gSys- System of constraints.
[in]pVal- Point coordinates.
Returns
Descriptor of registered point.

◆ GCE_AddLine()

geom_item GCE_AddLine ( GCE_system  gSys,
const GCE_line lVal 
)

Add line to the constraint system.

Parameters
[in]gSys- System of constraints.
[in]lVal- Line coordinates.
Returns
Descriptor of registered line.

◆ GCE_AddLineSeg()

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.

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.

◆ GCE_AddCircle()

geom_item GCE_AddCircle ( GCE_system  gSys,
const GCE_circle cVal 
)

Add circle to the constraint system.

Parameters
[in]gSys- System of constraints.
[in]cVal- Coordinates of a circle.
Returns
Descriptor of the registered circle.

◆ GCE_AddEllipse()

geom_item GCE_AddEllipse ( GCE_system  gSys,
const GCE_ellipse eVal 
)

Add ellipse to the constraint system.

Parameters
[in]gSysSystem of constraints.
[in]eValEllipse coordinates.
Returns
Descriptor of registered ellipse.

◆ GCE_AddSpline()

geom_item GCE_AddSpline ( GCE_system  gSys,
const GCE_spline spl 
)

Add spline (NURBS) to the constraint system.

Parameters
[in]gSys- System of constraints.
[in]spl- Spline coordinates.
Returns
Descriptor of registered spline.

◆ GCE_AddParametricCurve()

geom_item GCE_AddParametricCurve ( GCE_system  gSys,
const MbCurve crv 
)

Add parametric curve to the constraint system.

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.

◆ GCE_AddBoundedCurve()

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.

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.

◆ GCE_AddOffsetCurve()

geom_item GCE_AddOffsetCurve ( GCE_system  gSys,
geom_item  curve,
double  offset 
)

Add an equidistant curve to the constraint system.

Base curve may be only a curve of one of the following types: point, line, segment, circle, ellipse, spline, bounded curve, parametric curve, or equidistant curve.

Parameters
[in]gSys- System of constraints.
[in]crv- Descriptor of base geometric curve. Base curve may be only a curve of one of the following types: point, line, segment, circle, ellipse, spline, bounded curve, parametric curve, or equidistant curve.
[in]offset- Offsets of the equidistant curve relative to the base curve.
Returns
Descriptor of registered equidistant curve.

◆ GCE_AddPattern()

pattern_item GCE_AddPattern ( GCE_system  gSys,
geom_item  geom,
double  step 
)

Declare a pattern with a direction along a line and a given offset or with the center at a point and a given angle.

Parameters
[in]gSys- System of constraints.
[in]geom- Descriptor of line.
[in]step- Pattern offset.
Returns
Descriptor of registered pattern.

The method creates a pattern. If the object is a line or a segment, then a linear pattern is created with the direction along this line or segment and a step. If the object is a point, circle or ellipse, then an angular pattern is created with the center at the given point or center of the circle or ellipse and the step angle.

◆ GCE_AddLinearPattern()

pattern_item GCE_AddLinearPattern ( GCE_system  gSys,
GCE_vec2d  trans 
)

Declare a linear pattern with the step given by the translation vector.

Parameters
[in]gSys- System of constraints.
[in]trans- Offset vector.
Returns
Descriptor of registered pattern.

The method creates a linear pattern with the step given by this translation vector.

◆ GCE_AddAngularPattern()

pattern_item GCE_AddAngularPattern ( GCE_system  gSys,
GCE_point  point,
double  angle 
)

Declare an angular pattern with a center and an angle.

Parameters
[in]gSys- System of constraints.
[in]point- The point is the center of the pattern.
[in]angle- Angle of rotation.
Returns
Descriptor of registered pattern.

The method creates an angular pattern defined by a center and an angle.

◆ GCE_AddInstance()

geom_item GCE_AddInstance ( GCE_system  gSys,
pattern_item  pItem,
geom_item  sample,
int  k 
)

Create k-th instance of the sample in a given pattern.

Parameters
[in]gSys- System of constraints.
[in]pItem- Descriptor of pattern.
[in]sample- Descriptor of sample.
[in]k- Copy number.
Returns
Descriptor of registered instance.

The method creates the k-th instance of the sample in the given pattern. It returns the sample descriptor if k = 0.

◆ GCE_AddRigidSet()

geom_item GCE_AddRigidSet ( GCE_system  gSys,
const std::vector< geom_item > &  geoms 
)

Add a rigid set of geometric objects to the system.

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.

◆ GCE_AddVariable()

var_item GCE_AddVariable ( GCE_system  gSys,
double  val 
)

Add a variable to the constraint system.

Parameters
[in]gSys- System of constraints.
[in]val- A start value of the variable.
Returns
Descriptor of registered variable.

◆ GCE_VariableOf()

var_item GCE_VariableOf ( GCE_system  gSys,
geom_item  g,
coord_type  coordType 
)

Get a variable from the constraint system.

Parameters
[in]gSys- System of constraints.
[in]g- Descriptor of geometric object.
[in]coordType- Type of variable of geometric object.
Returns
Descriptor of registered variable of geometric object.

◆ GCE_AddBound()

constraint_item GCE_AddBound ( GCE_system  gSys,
var_item  var,
GCE_interval  dim 
)

Limit the value of a variable to an interval.

Parameters
[in]gSys- System of constraints.
[in]var- Descriptor of variable.
[in]GCE_interval- Boundaries for changing a variable.
Returns
Descriptor of a new constraint.

◆ GCE_GeomType()

geom_type GCE_GeomType ( GCE_system  gSys,
geom_item  g 
)

A type of geometric object.

Parameters
[in]gSys- System of constraints.
[in]g- Descriptor of geometric object.
Returns
A type of geometric object.

◆ GCE_BaseCurveType()

geom_type GCE_BaseCurveType ( GCE_system  gSys,
geom_item  crv 
)

A type of geometric curve.

Parameters
[in]gSys- System of constraints.
[in]g- Descriptor of curve
Returns
A type of geometric object.

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

◆ GCE_RemoveVariable()

bool GCE_RemoveVariable ( GCE_system  gSys,
var_item  var 
)

Delete variable from the constraint system.

Parameters
[in]gSys- System of constraints.
[in]var- Descriptor of variable.
Returns
it equals true if the variable var is actually deleted.

◆ GCE_ReleaseVariable()

void GCE_ReleaseVariable ( GCE_system  gSys,
var_item  var 
)

Control variable's lifetime by solver.

Parameters
[in]gSys- System of constraints.
[in]var- Descriptor of variable.

◆ GCE_RemoveGeom()

bool GCE_RemoveGeom ( GCE_system  gSys,
geom_item  g 
)

Delete geometric object from the constraint system.

The function removes a geometric object if it isn't connected to constraints, which can be checked by calling IsConstrainedGeom. The function can be applied to geometric nodes subordinated to other geometric objects, such as GCE_BOUNDED_CURVE, GCM_OFFSET_CURVE, GCM_LINE_SEGMENT. In this case, the call succeeds but the actual deletion can happen later in an automatic order after all the owning geometry has released it.

Note
The call only applies to geometry added by the user with calls GCE_Add***(...).
Parameters
[in]gSys- System of constraints.
[in]g- Descriptor of geometric object
Returns
it equals true if the function was performed successfully.

◆ GCE_ReleaseGeom()

void GCE_ReleaseGeom ( GCE_system  gSys,
geom_item  g 
)

Control geometry object's lifetime by solver.

Parameters
[in]gSys- System of constraints.
[in]g- Descriptor of geometric object.

◆ GCE_RemoveConstraint()

bool GCE_RemoveConstraint ( GCE_system  gSys,
constraint_item  con 
)

Delete a constraint from the system.

Parameters
[in]gSys- System of constraints.
[in]con- Descriptor of constraint.
Returns
it equals true if the constraint con is actually deleted.

◆ GCE_PointOf()

geom_item GCE_PointOf ( GCE_system  gSys,
geom_item  g,
point_type  pnt 
)

Request of the object control point descriptor.

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.

◆ GCE_GetVectorValue()

GCE_vec2d GCE_GetVectorValue ( GCE_system  gSys,
geom_item  g,
query_geom_type  vType 
)

Get the current coordinates of vector.

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_GetPointXY()

GCE_point GCE_GetPointXY ( GCE_system  gSys,
geom_item  g,
point_type  pName = GCE_PROPER_POINT 
)

Get the current coordinates of 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

◆ GCE_GetCoordValue()

double GCE_GetCoordValue ( GCE_system  gSys,
geom_item  g,
coord_name  cName 
)

Get the current value of geometric object's coordinate.

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.

◆ GCE_GetVarValue()

double GCE_GetVarValue ( GCE_system  gSys,
var_item  var 
)

Get the current value of variable.

Parameters
[in]gSys- System of constraints.
[in]var- Descriptor of variable.
Returns
A value of variable.

◆ GCE_SetPointXY()

bool GCE_SetPointXY ( GCE_system  gSys,
geom_item  g,
point_type  pName,
GCE_point  xyVal 
)

Set the current coordinates of 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.
[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.

◆ GCE_SetCoordValue()

bool GCE_SetCoordValue ( GCE_system  gSys,
geom_item  g,
coord_name  cName,
double  crdVal 
)

Set the current value of geometric object's coordinate.

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.

◆ GCE_SetVarValue()

bool GCE_SetVarValue ( GCE_system  gSys,
var_item  var,
double  val 
)

Set the current value of variable.

Parameters
[in]gSys- System of constraints.
[in]var- Descriptor of variable.
[in]val- New value of variable.
Returns
true if operation succeeded.

◆ GCE_SplinePoint()

geom_item GCE_SplinePoint ( GCE_system  gSys,
geom_item  spl,
size_t  pntIdx 
)

Descriptor of spline control point by index.

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_AddSplinePoint()

geom_item GCE_AddSplinePoint ( GCE_system  gSys,
geom_item  spl,
size_t  pntIdx,
GCE_point  pnt 
)

Add control point to spline (NURBS)

Parameters
[in]gSys- System of constraints.
[in]spl- Descriptor of spline to which control point is added.
[in]pntIdx- A control point index.
[in]pnt- The control point to add.
Returns
Descriptor of the added control point.

If the spline is interpolation or spl is not a spline, then GCE_NULL_G is returned.

◆ GCE_RemoveSplinePoint()

bool GCE_RemoveSplinePoint ( GCE_system  gSys,
geom_item  spl,
size_t  pntIdx 
)

Remove spline (NURBS) control point.

Parameters
[in]gSys- System of constraints.
[in]spl- Descriptor of spline from which control point is to be removed.
[in]pntIdx- The index of the point to remove.
Returns
Is control point removed.

If the spline is interpolation or spl is not a spline, then false is returned.

◆ GCE_FreezeGeom()

bool GCE_FreezeGeom ( GCE_system  gSys,
geom_item  g 
)

Freeze geometric object.

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
Usually, in CAD applications this command is used only for fixation of projection geometry in associative drawings or sketches with projections of 3D-objects.

◆ GCE_FixOffset()

geom_item GCE_FixOffset ( GCE_system  gSys,
geom_item  curve 
)

Set the constraint "Fixation of offset".

Fix offset of equidistant curve (GCE_OFFSET_CURVE).

Parameters
[in]gSys- System of constraints.
[in]curve- Descriptor of equidistant curve.
Returns
Descriptor of a new constraint.

◆ GCE_IsConstrainedGeom()

bool GCE_IsConstrainedGeom ( GCE_system  gSys,
geom_item  g 
)

The function answers the question: Is geometric object connected with constraints?

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

◆ GCE_HasInstance()

bool GCE_HasInstance ( GCE_system  gSys,
pattern_item  p 
)

The function answers the question: Is there an instance of the pattern?

Parameters
[in]gSys- System of constraints.
[in]pattern- Descriptor of pattern.
Returns
true if there are instances of any object for pattern p.
See also
GCE_RemovePattern, GCE_ReleasePattern

◆ GCE_IsSatisfied()

bool GCE_IsSatisfied ( GCE_system  gSys,
constraint_item  cItem 
)

Perform a check that a constraint is satisfied.

Parameters
[in]gSys- System of constraints.
[in]cItem- Descriptor of constraint.
Returns
true if a constraint is satisfied.

◆ GCE_ConstraintStatus()

GCE_c_status GCE_ConstraintStatus ( GCE_system  gSys,
constraint_item  cItem 
)

Status of constraint inn the system.


The call shows the result of the diagnostic, which highlights the constraint system well-conditioned parts and parts containing redundancies and inconsistencies. As a result diagnosing or evaluating each constraint is marked with one of the statuses enumerated by GCE_c_status enum.

Parameters
[in]gSys- System of constraints.
[in]cItem- Descriptor of constraint.
Returns
The status of the constraint as a result of diagnostics on inconsistence and overdefining.

◆ GCE_DiagnoseGeometry()

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.

◆ GCE_GetPointDOF()

ptrdiff_t GCE_GetPointDOF ( GCE_system  gSys,
geom_item  g,
point_type  cp,
double &  dofDir 
)

Calculate point's degree of freedom.

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_PointDOF()

GCE_point_dof GCE_PointDOF ( GCE_system  gSys,
geom_item  pnt 
)

Calculate point's degree of freedom.

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.

◆ GCE_CoordDOF()

int GCE_CoordDOF ( GCE_system  gSys,
geom_item  g,
coord_name  cName 
)

Get the degree of freedom of geometric coordinate.

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.

◆ GCE_AddUnaryConstraint()

constraint_item GCE_AddUnaryConstraint ( GCE_system  gSys,
constraint_type  cType,
geom_item  geom 
)

Set a constraint on single object (unary constraint).

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.

◆ GCE_AddCoincidence()

constraint_item GCE_AddCoincidence ( GCE_system  gSys,
geom_item  g[2] 
)

Set the constraint "Coincidence".

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.

◆ GCE_AddPointOnPercent()

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".

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.

◆ GCE_AddPointByMetricPercent()

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".

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. The percentage k as a variable is supported for splines.

◆ GCE_AddFixCurvePoint()

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".

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".

◆ GCE_AddPointOnParEllipse()

constraint_item GCE_AddPointOnParEllipse ( GCE_system  gSys,
geom_item  pnt,
geom_item  ellipse,
double  t 
)

Set the constraint "Point on parametric ellipse".

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].

◆ GCE_AddParPointOnCurve()

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".

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.

◆ GCE_AddAlignPoints() [1/2]

constraint_item GCE_AddAlignPoints ( GCE_system  gSys,
geom_item  p[2],
double  ang 
)

Set the constraint "Alignment of points along the given direction".

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.

◆ GCE_AddAngle()

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".

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.

◆ GCE_AddAngleBisector()

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".

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.

◆ GCE_AddAngle4P()

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.

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.

◆ GCE_AddColinear()

constraint_item GCE_AddColinear ( GCE_system  gSys,
geom_item  g[2] 
)

Set the constraint "Colinearity".

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.

◆ GCE_AddColinear3Points()

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

Set the constraint "Colinearity of three points".

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.

◆ GCE_AddEqualLength()

constraint_item GCE_AddEqualLength ( GCE_system  gSys,
geom_item  curve1,
geom_item  curve2 
)

Set the constraint "Equality of lengths" for curves.

Parameters
[in]gSys- System of constraints.
[in]curve1- Descriptor of the first curve.
[in]curve2- Descriptor of the second curve.
Returns
Descriptor of a new constraint.

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

◆ GCE_AddEqualRadius()

constraint_item GCE_AddEqualRadius ( GCE_system  gSys,
geom_item  c1,
geom_item  c2 
)

Set the constraint "Equality of radii" for two circles (arcs)

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.

◆ GCE_AddEqualOffset()

geom_item GCE_AddEqualOffset ( GCE_system  gSys,
geom_item  curve1,
geom_item  curve2 
)

Set the constraint "Equal of offset of equidistant curves".

The constraint is applicable to equal offsets of equidistant curves.

Parameters
[in]gSys- System of constraints.
[in]curve1- Descriptor of equidistant curve.
[in]curve2- Descriptor of equidistant curve.
Returns
Descriptor of a new constraint.

◆ GCE_AddEqualCurvature()

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".

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.

◆ GCE_AddRadiusDimension()

constraint_item GCE_AddRadiusDimension ( GCE_system  gSys,
geom_item  cir,
GCE_dim_pars  dPar 
)

Specify a "Radius dimension" constraint.

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.

◆ GCE_AddDiameter()

constraint_item GCE_AddDiameter ( GCE_system  gSys,
geom_item  cir,
GCE_dim_pars  dPar 
)

Specify a "Diameter dimension" constraint.

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.

◆ GCE_AddLength()

constraint_item GCE_AddLength ( GCE_system  gSys,
geom_item  curve,
GCE_dim_pars  dPar 
)

Specify a "Curve Length" constraint.

Parameters
[in]gSys- System of constraints.
[in]curve- Descriptor of curve.
[in]dPar- Parameters of linear dimension (see GCE_dim_pars).
Returns
Descriptor of a new constraint.

The curve must have a start and end points (GCE_FIRST_END и GCE_SECOND_END). Constraint is supported for linear objects and circular arcs.

◆ GCE_AddPatterned()

constraint_item GCE_AddPatterned ( GCE_system  gSys,
pattern_item  pItem,
geom_item  sample,
geom_item  instance,
int  k 
)

Bind two geometric objects by a pattern constraint.

Parameters
[in]gSys- System of constraints.
[in]pItem- Descriptor of pattern.
[in]sample- Descriptor of sample.
[in]instance- Descriptor of instance.
[in]k- Copy number.
Returns
Descriptor of registered constrained.

The method binds the two objects by a pattern constraint.

◆ GCE_FixVariable()

constraint_item GCE_FixVariable ( GCE_system  gSys,
var_item  var 
)

Set the constraint "Driving parameter" or "Fixation of variable".

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.

◆ GCE_FixGeom()

constraint_item GCE_FixGeom ( GCE_system  gSys,
geom_item  g 
)

Set the constraint "Fixation of geom".

Parameters
[in]gSys- System of constraints.
[in]g- Descriptor of geometric object
Returns
Descriptor of a new constraint.

◆ GCE_FixLength()

constraint_item GCE_FixLength ( GCE_system  gSys,
geom_item  ls 
)

Set the constraint "Fixation of curve length".

Parameters
[in]gSys- System of constraints.
[in]ls- Descriptor of curve.
Returns
Descriptor of a new constraint.

The curve must have a start and end points (GCE_FIRST_END и GCE_SECOND_END). Constraint is supported for linear objects circular arcs and splines.

◆ GCE_FixRadius()

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

Set the constraint "Fixation of 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.

◆ GCE_FixCoordValue()

constraint_item GCE_FixCoordValue ( GCE_system  gSys,
geom_item  g,
coord_name  cName 
)

Specify fixation of a parametric object coordinate.

Parameters
[in]gSys- System of constraints.
[in]g- Descriptor of object.
[in]cName- Denotation of object parameter.
Returns
Descriptor of registered constrained.

Set the fixation of the parametric object coordinate by coordinate type.

◆ GCE_FixSplineDerivative()

constraint_item GCE_FixSplineDerivative ( GCE_system  gSys,
geom_item  spline,
double  par,
uint  derOrder,
GCE_vec2d fixVal = nullptr 
)

Set the constraint "Fixation of derivative vector of the spline at a given point".

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 nullptr current value of the derivative vector will be fixed. Otherwise the derivative vector will be fixed at fixVal value.

◆ GCE_AddMiddlePoint()

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

Set the constraint "Middle point".

Parameters
[in]gSys- System of constraints.
[in]pnt- Descriptors of point triplet.
Returns
Descriptor of a new constraint.

For the given three points 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].

◆ GCE_AddParallel()

constraint_item GCE_AddParallel ( GCE_system  gSys,
geom_item  g[2] 
)

Set the constraint "Parallelism".

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.

◆ GCE_AddPerpendicular()

constraint_item GCE_AddPerpendicular ( GCE_system  gSys,
geom_item  g[2] 
)

Set the constraint "Perpendicularity".

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.

◆ GCE_AddSymmetry()

constraint_item GCE_AddSymmetry ( GCE_system  gSys,
geom_item  g[2],
geom_item  lObj 
)

Set the constraint "Symmetry relative to the linear object".

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.

The constraint applies to symmetry of any geometric objects defined in geom_type enum.

◆ GCE_AddTangent()

constraint_item GCE_AddTangent ( GCE_system  gSys,
geom_item  g[2],
var_item  tPar[2] 
)

Set the constraint "Tangency of two curves".

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.

◆ GCE_AddDistance()

constraint_item GCE_AddDistance ( GCE_system  gSys,
geom_item  g[2],
const GCE_ldim_pars dPars 
)

Set the dimensional constraint "Distance between objects".

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.

◆ GCE_AddDistance2P()

constraint_item GCE_AddDistance2P ( GCE_system  gSys,
geom_item  p[2],
const GCE_dim_pars dPars 
)

Set the constraint "Distance between points".

Parameters
[in]gSys- System of constraints.
[in]p- Descriptors of point pair.
[in]dPars- Parameters of dimensional constraint.
Returns
Descriptor of a new constraint.

◆ GCE_AddDistancePLs()

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".

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.

◆ GCE_AddDirectedDistance()

constraint_item GCE_AddDirectedDistance ( GCE_system  gSys,
geom_item  p[2],
const GCE_ldim_pars dPars 
)

Set the constraint "Directed distance between points".

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.

◆ GCE_AddLinearEquation()

constraint_item GCE_AddLinearEquation ( GCE_system  gSys,
const double *  a,
const var_item v,
size_t  n,
double  c 
)

Set the linear equation.

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_ChangeDrivingDimension()

GCE_result GCE_ChangeDrivingDimension ( GCE_system  gSys,
constraint_item  dItem,
double  dVal 
)

Change the value of driving dimension.

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_DeviateDimension()

GCE_result GCE_DeviateDimension ( GCE_system  gSys,
constraint_item  dItem,
double  delta 
)

Deviate the constraint from the point of solution.

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_DeviationTest()

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.

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.

◆ GCE_DimensionParameter()

double GCE_DimensionParameter ( GCE_system  gSys,
constraint_item  dItem 
)

A current value of the dimension parameter.

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_Evaluate()

GCE_result GCE_Evaluate ( GCE_system  gSys)

Calculate the constraint system.

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_PrepareMovingOfPoint() [1/2]

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.

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_PrepareDraggingPoint() [1/2]

GCE_result GCE_PrepareDraggingPoint ( GCE_system  gSys,
GCE_dragging_point  drgPnt,
GCE_point  curXY 
)

Initialize the dragging mode of the object control point.

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_PrepareDraggingPoint() [2/2]

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.

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_PrepareMovingGeoms()

GCE_result GCE_PrepareMovingGeoms ( GCE_system  gSys,
std::vector< geom_item > &  geoms,
GCE_point  curXY 
)

Initialize mode of moving a set of objects.

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_MovePoint()

GCE_result GCE_MovePoint ( GCE_system  gcSys,
GCE_point  curXY 
)

Move a dragging point.

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_DynamicTransform()

GCE_result GCE_DynamicTransform ( GCE_system  gSys,
const std::vector< geom_item > &  geoms,
const MbMatrix mat 
)

brief Transform geometric objects according to a given matrix.

Parameters
[in]gSys- System of constraints.
[in]geoms- Set of geometric objects.
[in]mat- Transformation matrix.
Returns
Error code.

The dynamic transformation mode for given set of geometric objects is turned on after the first time the GCE_DynamicTransform function is called. In this case, the initial positions of geometric objects are remembered and then the transformations for each new call of the GCE_DynamicTransform are performed relative to their initial position until the dynamic transformation mode is turned off. The mode of dynamic transformation of geometric objects is turned off when calling any other API function or when calling the GCE_DynamicTransform function for another set of geometric objects.

◆ GCE_Transform()

GCE_result GCE_Transform ( GCE_system  gSys,
const MbMatrix mat 
)

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

If the transformation is improper, i.e. includes reflection, direction of bounded curves for which the base curve is closed will be changed. This means that after transformation, the request GCE_PointOf for such curves will return as a GCE_FIRST_END a point that before transformation returned as GCE_SECOND_END and vice versa.

Parameters
[in]gSys- System of constraints.
[in]mat- Transformation matrix.
Returns
Error code.

◆ GCE_SetJournal()

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.

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.

◆ GCE_AddPoint() [2/2]

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_AddDirectedDistance2P()

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).

◆ GCE_AddAlignPoints() [2/2]

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.

◆ GCE_AddFixedLength()

constraint_item GCE_AddFixedLength ( GCE_system  ,
geom_item   
)
Attention
The function is obsolete. Use GCE_FixLength instead.

◆ GCE_AddFixVariable()

constraint_item GCE_AddFixVariable ( GCE_system  ,
var_item   
)
Attention
The function is obsolete. Use GCE_FixVariable instead.

◆ GCE_AddIncidence()

constraint_item GCE_AddIncidence ( GCE_system  ,
geom_item  ,
geom_item   
)

Set the constraint "Point on curve".

Attention
This call is deprecated. Call GCE_AddCoincidence instead.

◆ GCE_PrepareMovingOfPoint() [2/2]

DEPRECATE_DECLARE GCE_result GCE_PrepareMovingOfPoint ( GCE_system  ,
const std::vector< geom_point > &  ,
GCE_point   
)
inline
Attention
An obsolete function. The call will be removed in 2023. Use GCE_PrepareDraggingPoint( GCE_system gSys, const std::vector<GCE_dragging_point> & cPntArr, GCE_point curXY ) instead of this.

◆ GCE_InitCallbacks()

GCE_callback_table& GCE_InitCallbacks ( GCE_callback_table )

Set and return default callback functions.

GCE_callback_table is a plain old data structure with no constructor.
The function is able to set an initial value of the structure to avoid incorrect work with memory.

◆ GCE_Register()

GCE_result GCE_Register ( GCE_system  gSys,
const GCE_callback_table cbTable 
)

Register callback table for new constraint system.

Parameters
[in]gSys- Constraint system.
[in]cbTable- Table of callbacks.
Returns
Returns GCE_RESULT_Ok if the registration fulfilled.

◆ GCE_AddEquation()

constraint_item GCE_AddEquation ( GCE_system  gSys,
ItAlgebraicConstraint iEqu,
size_t  varsCount,
const var_item varsVector 
)

Specify a constraint implemented by the user.

Parameters
gSysthe solver context
iEquinterface of the equation specified by the user
varsCountcount of variables
varsVectorvector of variables
Returns
descriptor of a new constraint

◆ GCE_GetPoint()

MbCartPoint GCE_GetPoint ( GCE_system  gSys,
geom_item  g,
point_type  pName = GCE_PROPER_POINT 
)

Get the current coordinates of point.

Parameters
gSysthe solver context
gdescriptor of a point or other geometric object
pNameidentifier of a point belonging to the object
Returns
point coordinates