C3D Toolkit
Kernel - 117982, Vision - 2.9.2.2
|
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 void * | GCE_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 void * | GCE_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). | |
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_item > | GCE_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_table & | GCE_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. | |
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.
enum geom_type |
Dictionary of geometric primitives types.
enum 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... ~\
enum coord_name |
Enumeration of geom's coordinates.
enum constraint_type |
Identifier of 2D constraint type.
enum GCE_result |
Diagnostic codes of the geometric solver functions execution.
enum GCE_c_status |
Status of a geometric constraint.
enum GCE_s_state |
enum GCE_bisec_variant |
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_s_state GCE_DefinitionState | ( | GCE_system | gSys | ) |
Get constraint system definition state.
[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).
GCE_result GCE_CheckSatisfaction | ( | GCE_system | gSys, |
VERSION | c3dVer = GetCurrentMathFileVersion() |
||
) |
To check the satisfaction of constraints.
For internal use only!
gSys | - Solver state. |
c3dVer | - Mathematical kernel version. |
constraint_item GCE_FormCirDimension | ( | GCE_system | gcContext, |
geom_item | cir, | ||
GCE_dim_pars | dPars, | ||
bool | diam | ||
) |
Specify "Radial dimension" constraint
cir | - a circle or an arc |
diam | - flag of diametral dimension |
bool GCE_InitFrozenCoords | ( | GCE_system | gSys | ) |
The call is intended to replay an old-version evaluation for the start values of the frozen coordinates.
bool GCE_CollectLinearDependedConstrains | ( | GCE_system | , |
SArray< constraint_item > & | |||
) |
Collect ill-conditioned part of the constraint system.
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_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.
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.
[in] | gSys | - System of constraints. |
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.
[in] | gSys | - System of constraints. |
geom_item GCE_AddPoint | ( | GCE_system | gSys, |
GCE_point | pVal | ||
) |
Add point to the constraint system.
[in] | gSys | - System of constraints. |
[in] | pVal | - Point coordinates. |
geom_item GCE_AddLine | ( | GCE_system | gSys, |
const GCE_line & | lVal | ||
) |
Add line to the constraint system.
[in] | gSys | - System of constraints. |
[in] | lVal | - Line coordinates. |
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.
[in] | gSys | - System of constraints. |
[in] | p | - Descriptors of end points of the line 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 | ||
) |
Add circle to the constraint system.
[in] | gSys | - System of constraints. |
[in] | cVal | - Coordinates of a circle. |
geom_item GCE_AddEllipse | ( | GCE_system | gSys, |
const GCE_ellipse & | eVal | ||
) |
Add ellipse to the constraint system.
[in] | gSys | System of constraints. |
[in] | eVal | Ellipse coordinates. |
geom_item GCE_AddSpline | ( | GCE_system | gSys, |
const GCE_spline & | spl | ||
) |
Add spline (NURBS) to the constraint system.
[in] | gSys | - System of constraints. |
[in] | spl | - Spline coordinates. |
geom_item GCE_AddParametricCurve | ( | GCE_system | gSys, |
const MbCurve & | crv | ||
) |
Add parametric curve to the constraint system.
[in] | gSys | - System of constraints. |
[in] | crv | - Mathematical description of parametric curve. |
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.
[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. |
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.
[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. |
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.
[in] | gSys | - System of constraints. |
[in] | geom | - Descriptor of line. |
[in] | step | - Pattern offset. |
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.
pattern_item GCE_AddLinearPattern | ( | GCE_system | gSys, |
GCE_vec2d | trans | ||
) |
Declare a linear pattern with the step given by the translation vector.
[in] | gSys | - System of constraints. |
[in] | trans | - Offset vector. |
The method creates a linear pattern with the step given by this translation vector.
pattern_item GCE_AddAngularPattern | ( | GCE_system | gSys, |
GCE_point | point, | ||
double | angle | ||
) |
Declare an angular pattern with a center and an angle.
[in] | gSys | - System of constraints. |
[in] | point | - The point is the center of the pattern. |
[in] | angle | - Angle of rotation. |
The method creates an angular pattern defined by a center and an angle.
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.
[in] | gSys | - System of constraints. |
[in] | pItem | - Descriptor of pattern. |
[in] | sample | - Descriptor of sample. |
[in] | k | - Copy number. |
The method creates the k-th instance of the sample in the given pattern. It returns the sample descriptor if k = 0.
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.
[in] | gSys | - System of constraints. |
[in] | geoms | - |
var_item GCE_AddVariable | ( | GCE_system | gSys, |
double | val | ||
) |
Add a variable to the constraint system.
[in] | gSys | - System of constraints. |
[in] | val | - A start value of the variable. |
var_item GCE_VariableOf | ( | GCE_system | gSys, |
geom_item | g, | ||
coord_type | coordType | ||
) |
Get a variable from the constraint system.
[in] | gSys | - System of constraints. |
[in] | g | - Descriptor of geometric object. |
[in] | coordType | - Type of variable of geometric object. |
constraint_item GCE_AddBound | ( | GCE_system | gSys, |
var_item | var, | ||
GCE_interval | dim | ||
) |
Limit the value of a variable to an interval.
[in] | gSys | - System of constraints. |
[in] | var | - Descriptor of variable. |
[in] | GCE_interval | - Boundaries for changing a variable. |
geom_type GCE_GeomType | ( | GCE_system | gSys, |
geom_item | g | ||
) |
A type of geometric object.
[in] | gSys | - System of constraints. |
[in] | g | - Descriptor of geometric object. |
geom_type GCE_BaseCurveType | ( | GCE_system | gSys, |
geom_item | crv | ||
) |
A type of geometric curve.
[in] | gSys | - System of constraints. |
[in] | g | - Descriptor of curve |
Функция вернет геометрический тип кривой 'crv' либо тип базовой кривой, если 'crv' имеет тип GCE_BOUNDED_CURVE.
bool GCE_RemoveVariable | ( | GCE_system | gSys, |
var_item | var | ||
) |
Delete variable from the constraint system.
[in] | gSys | - System of constraints. |
[in] | var | - Descriptor of variable. |
void GCE_ReleaseVariable | ( | GCE_system | gSys, |
var_item | var | ||
) |
Control variable's lifetime by solver.
[in] | gSys | - System of constraints. |
[in] | var | - Descriptor of variable. |
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.
[in] | gSys | - System of constraints. |
[in] | g | - Descriptor of geometric object |
void GCE_ReleaseGeom | ( | GCE_system | gSys, |
geom_item | g | ||
) |
Control geometry object's lifetime by solver.
[in] | gSys | - System of constraints. |
[in] | g | - Descriptor of geometric object. |
bool GCE_RemoveConstraint | ( | GCE_system | gSys, |
constraint_item | con | ||
) |
Delete a constraint from the system.
[in] | gSys | - System of constraints. |
[in] | con | - Descriptor of constraint. |
geom_item GCE_PointOf | ( | GCE_system | gSys, |
geom_item | g, | ||
point_type | pnt | ||
) |
Request of the object control point descriptor.
[in] | gSys | - System of constraints. |
[in] | g | - Descriptor of object. |
[in] | pnt | - Name 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_vec2d GCE_GetVectorValue | ( | GCE_system | gSys, |
geom_item | g, | ||
query_geom_type | vType | ||
) |
Get the current coordinates of vector.
[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. |
GCE_point GCE_GetPointXY | ( | GCE_system | gSys, |
geom_item | g, | ||
point_type | pName = GCE_PROPER_POINT |
||
) |
Get the current coordinates of point.
[in] | gSys | - System of constraints. |
[in] | g | - Descriptor of point or other geometric object. |
[in] | pName | - Identifier of a point belonging to the object. |
double GCE_GetCoordValue | ( | GCE_system | gSys, |
geom_item | g, | ||
coord_name | cName | ||
) |
Get the current value of geometric object's coordinate.
[in] | gSys | - System of constraints. |
[in] | g | - Descriptor of object. |
[in] | cName | - Denotation of object parameter. |
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 | ||
) |
Get the current value of variable.
[in] | gSys | - System of constraints. |
[in] | var | - Descriptor of variable. |
bool GCE_SetPointXY | ( | GCE_system | gSys, |
geom_item | g, | ||
point_type | pName, | ||
GCE_point | xyVal | ||
) |
Set the current coordinates of point.
[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. |
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 | ||
) |
Set the current value of geometric object's coordinate.
[in] | gSys | - System of constraints. |
[in] | g | - Descriptor of object. |
[in] | cName | - Denotation of object parameter. |
[in] | crdVal | - New value of coordinate. |
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 | ||
) |
Set the current value of variable.
[in] | gSys | - System of constraints. |
[in] | var | - Descriptor of variable. |
[in] | val | - New value of variable. |
geom_item GCE_SplinePoint | ( | GCE_system | gSys, |
geom_item | spl, | ||
size_t | pntIdx | ||
) |
Descriptor of spline control point by index.
[in] | gSys | - System of constraints. |
[in] | spl | - Descriptor of spline. |
[in] | pntIdx | - A control point index. |
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_AddSplinePoint | ( | GCE_system | gSys, |
geom_item | spl, | ||
size_t | pntIdx, | ||
GCE_point | pnt | ||
) |
Add control point to spline (NURBS)
[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. |
If the spline is interpolation or spl is not a spline, then GCE_NULL_G is returned.
bool GCE_RemoveSplinePoint | ( | GCE_system | gSys, |
geom_item | spl, | ||
size_t | pntIdx | ||
) |
Remove spline (NURBS) control point.
[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. |
If the spline is interpolation or spl is not a spline, then false is returned.
bool GCE_FreezeGeom | ( | GCE_system | gSys, |
geom_item | g | ||
) |
Freeze geometric object.
[in] | gSys | - System of constraints. |
[in] | g | - Geometric object. |
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.
geom_item GCE_FixOffset | ( | GCE_system | gSys, |
geom_item | curve | ||
) |
Set the constraint "Fixation of offset".
Fix offset of equidistant curve (GCE_OFFSET_CURVE).
[in] | gSys | - System of constraints. |
[in] | curve | - Descriptor of equidistant curve. |
bool GCE_IsConstrainedGeom | ( | GCE_system | gSys, |
geom_item | g | ||
) |
The function answers the question: Is geometric object connected with constraints?
[in] | gSys | - System of constraints. |
[in] | g | - Descriptor of geometric object. |
bool GCE_HasInstance | ( | GCE_system | gSys, |
pattern_item | p | ||
) |
The function answers the question: Is there an instance of the pattern?
[in] | gSys | - System of constraints. |
[in] | pattern | - Descriptor of pattern. |
bool GCE_IsSatisfied | ( | GCE_system | gSys, |
constraint_item | cItem | ||
) |
Perform a check that a constraint is satisfied.
[in] | gSys | - System of constraints. |
[in] | cItem | - Descriptor of constraint. |
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.
[in] | gSys | - System of constraints. |
[in] | cItem | - Descriptor of constraint. |
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.
[in] | gcSys | - System of constraints. |
ptrdiff_t GCE_GetPointDOF | ( | GCE_system | gSys, |
geom_item | g, | ||
point_type | cp, | ||
double & | dofDir | ||
) |
Calculate point's degree of freedom.
[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. |
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 | ||
) |
Calculate point's degree of freedom.
[in] | gSys | - System of constraints. |
[in] | pnt | - Descriptor of point |
[out] | dofDir- | Angular direction of point moving freedom in radians. |
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 | ||
) |
Get the degree of freedom of geometric coordinate.
[in] | gSys | - System of constraints. |
[in] | g | - Descriptor of a geometric object. |
[in] | cName | - Denotation of geometric 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 | ||
) |
Set a constraint on single object (unary constraint).
[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 |
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] | ||
) |
Set the constraint "Coincidence".
[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.
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".
[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. |
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 | ||
) |
The constraint "Point on a piece of a curve by the coefficient of its length".
[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. |
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.
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".
[in] | gSys | - System of constraints. |
[in] | curve | - Descriptor of a curve. |
[in] | pnt | - Descriptors of a point. |
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.
constraint_item GCE_AddPointOnParEllipse | ( | GCE_system | gSys, |
geom_item | pnt, | ||
geom_item | ellipse, | ||
double | t | ||
) |
Set the constraint "Point on parametric ellipse".
[in] | gSys | - System of constraints. |
[in] | pnt | - Descriptor of a point. |
[in] | ellipse | - Descriptor of ellipse. |
[in] | t | The value of parameter on ellipse from the region [-PI,PI]. |
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 | ||
) |
Specify a constraint "Point on curve at a given parameter".
[in] | gSys | - System of constraints. |
[in] | pnt | - Descriptor of a point. |
[in] | curve | - Descriptor of a curve. |
[in] | t | - Descriptor of a curve parameter. |
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 | ||
) |
Set the constraint "Alignment of points along the given direction".
[in] | gSys | - System of constraints. |
[in] | p | - Descriptors of point pair. |
[in] | ang | - An angle specifying alignment direction, in radians. |
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".
[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). |
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 | ||
) |
Set the constraint "Bisector of angle".
[in] | gSys | System of constraints. |
[in] | bl | a segment, bisector of angle between two lines. |
[in] | l1,l2 | lines or segments a bisector of angle is set between. |
[in] | variant | variant of solution for 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.
Angular dimension is constructed for two segments with points p1-p2, p3-p4.
[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). |
constraint_item GCE_AddColinear | ( | GCE_system | gSys, |
geom_item | g[2] | ||
) |
Set the constraint "Colinearity".
[in] | gSys | - System of constraints. |
[in] | g | - Descriptors of a pair of linear objects. |
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 the constraint "Colinearity of three points".
Set such a constraint for three points that points should lie on the same line.
[in] | gSys | - System of constraints. |
[in] | pnt | - A triplet of points lying on the same line. |
constraint_item GCE_AddEqualLength | ( | GCE_system | gSys, |
geom_item | curve1, | ||
geom_item | curve2 | ||
) |
Set the constraint "Equality of lengths" for curves.
[in] | gSys | - System of constraints. |
[in] | curve1 | - Descriptor of the first curve. |
[in] | curve2 | - Descriptor of the second curve. |
The constraint is applicable for segments or line or spline pieces created by the function GCE_AddBoundedCurve or GCE_AddLineSeg.
constraint_item GCE_AddEqualRadius | ( | GCE_system | gSys, |
geom_item | c1, | ||
geom_item | c2 | ||
) |
Set the constraint "Equality of radii" for two circles (arcs)
[in] | gSys | - System of constraints. |
[in] | c1 | - Descriptor of the first circle. |
[in] | c2 | - Descriptor of the second circle. |
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.
[in] | gSys | - System of constraints. |
[in] | curve1 | - Descriptor of equidistant curve. |
[in] | curve2 | - Descriptor of equidistant curve. |
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".
[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. |
constraint_item GCE_AddRadiusDimension | ( | GCE_system | gSys, |
geom_item | cir, | ||
GCE_dim_pars | dPar | ||
) |
Specify a "Radius dimension" constraint.
[in] | gSys | - System of constraints. |
[in] | cir | - Descriptor of circle. |
[in] | dPar | - Parameters of linear dimension (see GCE_dim_pars). |
constraint_item GCE_AddDiameter | ( | GCE_system | gSys, |
geom_item | cir, | ||
GCE_dim_pars | dPar | ||
) |
Specify a "Diameter dimension" constraint.
[in] | gSys | - System of constraints. |
[in] | cir | - Descriptor of circle. |
[in] | dPar | - Parameters of linear dimension (see GCE_dim_pars). |
constraint_item GCE_AddLength | ( | GCE_system | gSys, |
geom_item | curve, | ||
GCE_dim_pars | dPar | ||
) |
Specify a "Curve Length" constraint.
[in] | gSys | - System of constraints. |
[in] | curve | - Descriptor of curve. |
[in] | dPar | - Parameters of linear dimension (see GCE_dim_pars). |
The curve must have a start and end points (GCE_FIRST_END и GCE_SECOND_END). Constraint is supported for linear objects and circular arcs.
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.
[in] | gSys | - System of constraints. |
[in] | pItem | - Descriptor of pattern. |
[in] | sample | - Descriptor of sample. |
[in] | instance | - Descriptor of instance. |
[in] | k | - Copy number. |
The method binds the two objects by a pattern constraint.
constraint_item GCE_FixVariable | ( | GCE_system | gSys, |
var_item | var | ||
) |
Set the constraint "Driving parameter" or "Fixation of variable".
[in] | gSys | - System of constraints. |
[in] | var | - Descriptor of variable. |
constraint_item GCE_FixGeom | ( | GCE_system | gSys, |
geom_item | g | ||
) |
Set the constraint "Fixation of geom".
[in] | gSys | - System of constraints. |
[in] | g | - Descriptor of geometric object |
constraint_item GCE_FixLength | ( | GCE_system | gSys, |
geom_item | ls | ||
) |
Set the constraint "Fixation of curve length".
[in] | gSys | - System of constraints. |
[in] | ls | - Descriptor of curve. |
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.
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.
[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. |
constraint_item GCE_FixCoordValue | ( | GCE_system | gSys, |
geom_item | g, | ||
coord_name | cName | ||
) |
Specify fixation of a parametric object coordinate.
[in] | gSys | - System of constraints. |
[in] | g | - Descriptor of object. |
[in] | cName | - Denotation of object parameter. |
Set the fixation of the parametric object coordinate by coordinate type.
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".
[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. |
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.
constraint_item GCE_AddMiddlePoint | ( | GCE_system | gcSys, |
geom_item | pnt[3] | ||
) |
Set the constraint "Middle point".
[in] | gSys | - System of constraints. |
[in] | pnt | - Descriptors of point triplet. |
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].
constraint_item GCE_AddParallel | ( | GCE_system | gSys, |
geom_item | g[2] | ||
) |
Set the constraint "Parallelism".
[in] | gSys | - System of constraints. |
[in] | g | - Descriptors of a pair of linear objects. |
The constraint is used for lines or segments.
constraint_item GCE_AddPerpendicular | ( | GCE_system | gSys, |
geom_item | g[2] | ||
) |
Set the constraint "Perpendicularity".
[in] | gSys | - System of constraints. |
[in] | g | - Descriptors of a pair of linear objects. |
The constraint is used for lines or segments.
constraint_item GCE_AddSymmetry | ( | GCE_system | gSys, |
geom_item | g[2], | ||
geom_item | lObj | ||
) |
Set the constraint "Symmetry relative to the linear object".
[in] | gSys | - System of constraints. |
[in] | g | - Descriptors pair of symmetrical objects.. |
[in] | lObj | - Descriptor of the axis of symmetry. |
The constraint applies to symmetry of any geometric objects defined in geom_type enum.
constraint_item GCE_AddTangent | ( | GCE_system | gSys, |
geom_item | g[2], | ||
var_item | tPar[2] | ||
) |
Set the constraint "Tangency of two curves".
[in] | gSys | System of constraints. |
[in] | g | Descriptors of a pair of curves or lines. |
[in] | tPar | Descriptors of parameters of tangency for parametric curves. |
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.
constraint_item GCE_AddDistance | ( | GCE_system | gSys, |
geom_item | g[2], | ||
const GCE_ldim_pars & | dPars | ||
) |
Set the dimensional constraint "Distance between objects".
[in] | gSys | - System of constraints. |
[in] | g | - Descriptors of a pair of geometric objects. |
[in] | dPars | - Parameters of linear dimension (see #GCE_adim_ldim). |
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 | ||
) |
Set the constraint "Distance between points".
[in] | gSys | - System of constraints. |
[in] | p | - Descriptors of point pair. |
[in] | dPars | - Parameters of dimensional constraint. |
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".
[in] | gSys | - System of constraints. |
[in] | p | - Descriptors of point triplet. |
[in] | dPars | - Parameters of dimensional 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 | ||
) |
Set the constraint "Directed distance between points".
[in] | gSys | - System of constraints. |
[in] | p | - Descriptors of point pair. |
[in] | dPars | - Parameters of dimensional 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 | ||
) |
Set the linear equation.
[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. |
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 | ||
) |
Change the value of driving dimension.
[in] | gSys | - System of constraints. |
[in] | dItem | - Descriptor of dimensional constraint. |
[in] | dVal | - Required value of constraint. |
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 | ||
) |
Deviate the constraint from the point of solution.
[in] | dItem | - Descriptor of geometric constraint. |
[in] | delta | - Deviation value. |
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 | ||
) |
Test for redundancy of constraint based on the deviation the constraint from the point of solution.
[in] | dItem | - Descriptor of geometric constraint. |
[in] | delta | - Deviation value. |
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.
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_result GCE_Evaluate | ( | GCE_system | gSys | ) |
Calculate the constraint system.
[in] | gSys | - System of constraints. |
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 | ||
) |
Initialize the dragging mode of the object control point.
[in] | gSys | System of constraints. |
[in] | obj | Geometric object. |
[in] | pntId | Denotation of the dragged control point of the object. |
[in] | curXY | Coordinates of cursor where the moving point follows. |
GCE_result GCE_PrepareDraggingPoint | ( | GCE_system | gSys, |
GCE_dragging_point | drgPnt, | ||
GCE_point | curXY | ||
) |
Initialize the dragging mode of the object control point.
[in] | gSys | - System of constraints. |
[in] | drgPnt | - A geom control point. |
[in] | curXY | - Coordinates of dragging 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.
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.
[in] | gSys | - System of constraints. |
[in] | cPntArr | - A set of geometrically equal control points. |
[in] | curXY | - Coordinates of dragging point. |
GCE_result GCE_PrepareMovingGeoms | ( | GCE_system | gSys, |
std::vector< geom_item > & | geoms, | ||
GCE_point | curXY | ||
) |
Initialize mode of moving a set of objects.
[in] | gSys | - System of constraints. |
geoms | - Set of geometric objects. | |
curXY | - Coordinates of dragging point. |
GCE_result GCE_MovePoint | ( | GCE_system | gcSys, |
GCE_point | curXY | ||
) |
Move a dragging point.
[in] | gcSys | - System of constraints. |
[in] | curXY | - Current coordinates of cursor. |
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_DynamicTransform | ( | GCE_system | gSys, |
const std::vector< geom_item > & | geoms, | ||
const MbMatrix & | mat | ||
) |
brief Transform geometric objects according to a given matrix.
[in] | gSys | - System of constraints. |
[in] | geoms | - Set of geometric objects. |
[in] | mat | - Transformation matrix. |
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_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.
[in] | gSys | - System of constraints. |
[in] | mat | - Transformation matrix. |
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.
[in] | gSys | - System of constraints. |
[in] | fName | - Name of destination file with a full path. |
|
inline |
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".
|
inline |
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_result GCE_Register | ( | GCE_system | gSys, |
const GCE_callback_table & | cbTable | ||
) |
Register callback table for new constraint system.
[in] | gSys | - Constraint system. |
[in] | cbTable | - Table of callbacks. |
constraint_item GCE_AddEquation | ( | GCE_system | gSys, |
ItAlgebraicConstraint & | iEqu, | ||
size_t | varsCount, | ||
const var_item * | varsVector | ||
) |
Specify a constraint implemented by the user.
gSys | the solver context |
iEqu | interface of the equation specified by the user |
varsCount | count of variables |
varsVector | vector of variables |
MbCartPoint GCE_GetPoint | ( | GCE_system | gSys, |
geom_item | g, | ||
point_type | pName = GCE_PROPER_POINT |
||
) |
Get the current coordinates of point.
gSys | the solver context |
g | descriptor of a point or other geometric object |
pName | identifier of a point belonging to the object |