C3D Kernel  104598
Classes | Typedefs | Enumerations | Functions | Variables
Basic functions and data types
Geometric Constraint Solver in Three-Dimensional Space
Collaboration diagram for Basic functions and data types:

Classes

struct  GCM_vec3d
 Coordinates of 3D-vector. More...
struct  GCM_point
 Сoordinates of point in three-dimensional space. More...
struct  GCM_g_record
 Structure of data fields representing a geometric object. More...
struct  GCM_extra_param
 Additional parameter for functions of type #GCM_dependent_func. More...
struct  GCM_diagnostic_pars
 Diagnostic characteristics of constraint system. More...

Typedefs

typedef MtGeomSolverGCM_system
 System of geometric constraints.
typedef MtObjectId GCM_object
 Descriptor of geometrical object registered in the solver context.
typedef GCM_object GCM_geom
 Descriptor of geometrical object registered in the solver context.
typedef GCM_object GCM_constraint
 Descriptor of a constraint registered in the solver.
typedef GCM_object GCM_pattern
 Descriptor of a pattern registered in the solver.
typedef bool(* GCM_dependent_func )(MbPlacement3D gPlaces[], size_t gPlacesSize, GCM_extra_param exPar)
typedef GCM_dependent_func GCM_dependent_geom_func
 Alternative typename of #GCM_dependent_func.

Enumerations

enum  GCM_g_type {
  GCM_NULL_GTYPE = 0, GCM_POINT, GCM_LINE, GCM_PLANE,
  GCM_CYLINDER, GCM_CONE, GCM_SPHERE, GCM_TORUS,
  GCM_CIRCLE, GCM_LCS, GCM_MARKER, GCM_SPLINE,
  GCM_VECTOR, GCM_UNKNOWN_GTYPE, GCM_LAST_GTYPE
}
 Dictionary of geometric primitives types. More...
enum  GCM_c_type {
  GCM_UNKNOWN = -1, GCM_COINCIDENT = 0, GCM_PARALLEL = 1, GCM_PERPENDICULAR = 2,
  GCM_TANGENT = 3, GCM_CONCENTRIC = 4, GCM_DISTANCE = 5, GCM_ANGLE = 6,
  GCM_IN_PLACE = 7, GCM_TRANSMITTION = 9, GCM_CAM_MECHANISM = 10, GCM_SYMMETRIC = 11,
  GCM_DEPENDENT = 14, GCM_PATTERNED = 15, GCM_LINEAR_PATTERN = 16, GCM_ANGULAR_PATTERN = 17,
  GCM_RADIUS = 18, GCM_LAST_CTYPE
}
 Dictionary of constraint types. More...
enum  GCM_alignment {
  GCM_MIN_ALIGNMENT = -1, GCM_OPPOSITE = -1, GCM_CLOSEST = 0, GCM_COORIENTED = 1,
  GCM_ALIGNED = 1, GCM_NO_ALIGNMENT = 2, GCM_ALIGNED_0 = 1, GCM_ALIGNED_1 = 3,
  GCM_ALIGNED_2 = 4, GCM_ALIGNED_3 = 5, GCM_REVERSE_0 = -1, GCM_REVERSE_1 = 6,
  GCM_REVERSE_2 = 7, GCM_REVERSE_3 = 8, GCM_ROTATED = 9, GCM_ALIGN_WITH_AXIAL_GEOM = 10,
  GCM_MAX_ALIGNMENT
}
 Variants of alignment. More...
enum  GCM_angle_type { GCM_NONE_ANGLE = 0, GCM_2D_ANGLE = 1, GCM_3D_ANGLE = 2, GCM_PLANAR_ANGLE = GCM_2D_ANGLE }
 Variant of angular dimension. More...
enum  GCM_tan_choice { GCM_TAN_NONE = 0x00, GCM_TAN_POINT = 0x01, GCM_TAN_LINE = 0x02, GCM_TAN_CIRCLE = 0x04 }
 Variants of tangency of surfaces or curves. More...
enum  GCM_result {
  GCM_RESULT_None = 0, GCM_RESULT_Ok = 1, GCM_RESULT_Satisfied = GCM_RESULT_Ok, GCM_RESULT_Overconstrained = 2,
  GCM_RESULT_MatedFixation = 3, GCM_RESULT_DraggingFailed = 4, GCM_RESULT_Not_Satisfied = 5, GCM_RESULT_Unsolvable = 6,
  GCM_RESULT_DependentConstraintUnsolved = 7, GCM_RESULT_Error = 8, GCM_RESULT_InappropriateAlignment = 9, GCM_RESULT_InappropriateArgument = 10,
  GCM_RESULT_IncompatibleArguments = 3001, GCM_RESULT_InconsistentAngleType, GCM_RESULT_InconsistentAlignment, GCM_RESULT_Duplicated,
  GCM_RESULT_CyclicDependence, GCM_RESULT_MultiDependedGeom, GCM_RESULT_OverconstrainingDependedGeoms, mtResCode_InvalidDependenceForFixGeom,
  GCM_RESULT_InvalidArguments, mtResCode_UnsupportedTangencyChoice, mtResCode_IsNoPossibleForCircTanChoice, mtResCode_CoaxialMtGearTransmissionIsNotAvalable,
  mtResCode_NoSeparatedSolutionForCamGear, mtResCode_CyclicDependenceForTwoOrMoreCamGears, mtResCode_InconsistentFollowerAxis, GCM_RESULT_InconsistentPlanarAngle,
  GCM_RESULT_ItsNotDrivingDimension, GCM_RESULT_Unregistered, GCM_RESULT_InternalError, GCM_RESULT_Aborted,
  GCM_RESULT_Last_
}
 Diagnostic codes of 3D-solver. More...
enum  GCM_dependency { GCM_NO_DEPENDENCY = 0, GCM_1ST_DEPENDENT = 2, GCM_2ND_DEPENDENT = 1 }
 Dependency character of solid pair (geoms) More...
enum  GCM_scale { GCM_NO_SCALE = 0, GCM_RIGID = 1, GCM_LINEAR_SCALE = 2 }
 The type of relationship between elements in the pattern. More...

Functions

GCM_system GCM_CreateSystem ()
 Create a simple constraint system.
void GCM_ClearSystem (GCM_system gSys)
 Make the constraint system empty.
void GCM_RemoveSystem (GCM_system gSys)
 Delete system of constraints.
bool GCM_ReadSystem (GCM_system gSys, reader &in)
 Read constraint system from stream.
bool GCM_WriteSystem (GCM_system gSys, writer &out)
 Write constraint system to stream.
GCM_g_record GCM_NullGeom ()
 Give the record of empty geometric object.
GCM_g_record GCM_Point (const MbCartPoint3D &)
 Get a record of point from the type MbCartPoint3D to the type GCM_g_record.
GCM_g_record GCM_Line (const MbCartPoint3D &org, const MbVector3D &axisZ)
 Record of line specified by the point and direction vector.
GCM_g_record GCM_Plane (const MbCartPoint3D &org, const MbVector3D &axisZ)
 Record of plane specified by the point and normal vector.
GCM_g_record GCM_Cone (const MbCartPoint3D &centre, const MbVector3D &axis, double radiusA, double radiusB)
 Get data record of cone for the given set of parameters.
GCM_g_record GCM_Cylinder (const MbCartPoint3D &centre, const MbVector3D &axis, double radius)
 Get data record of cylinder for the given set of parameters.
GCM_g_record GCM_Circle (const MbCartPoint3D &centre, const MbVector3D &axis, double radius)
 Get record of circle specified by the set of parameters.
GCM_g_record GCM_Torus (const MbCartPoint3D &centre, const MbVector3D &axis, double majorR, double minorR)
 Get data record of torus for the given set of parameters.
GCM_g_record GCM_Sphere (const MbCartPoint3D &centre, double radius)
 Get data record of sphere specified by center and radius.
GCM_g_record GCM_SolidLCS (const MbCartPoint3D &org, const MbVector3D &axisZ=MbVector3D::zAxis, const MbVector3D &axisX=MbVector3D::xAxis)
 Get a data record of solid specified by its origin of coordinates, Z-axis and X-axis.
GCM_g_record GCM_SolidLCS (const MbPlacement3D &)
 Get a data record of the solid coordinate system by its placement.
GCM_geom GCM_AddPoint (GCM_system gSys, const MbCartPoint3D &pVal)
 Add point to the constraint system.
GCM_geom GCM_AddGeom (GCM_system gSys, const GCM_g_record &gRec)
 Add geometric object to the constraint system.
GCM_geom GCM_AddGeom (GCM_system gSys, GCM_g_type gType, const MbMatrix3D &gMat, double radiusA, double radiusB)
 Add geometric object to the constraint system.
GCM_geom GCM_SubGeom (GCM_system gSys, GCM_geom sol, const GCM_g_record &gRec)
 Include a geometric sub-object to the subsystem of a solid (rigid cluster).
GCM_geom GCM_Parent (GCM_system gSys, GCM_geom subGeom)
 Give a cluster (solid) in which a geometric object is included.
GCM_g_type GCM_GeomType (GCM_system gSys, GCM_geom g)
 A type of geometric object.
void GCM_RemoveGeom (GCM_system gSys, GCM_geom g)
 Delete a geometric object from the constraint system.
GCM_constraint GCM_AddBinConstraint (GCM_system gSys, GCM_c_type cType, GCM_geom g1, GCM_geom g2, GCM_alignment aVal=GCM_CLOSEST, GCM_tan_choice tVar=GCM_TAN_POINT)
 Set a binary constraint for two geometric objects.
GCM_constraint GCM_AddDistance (GCM_system gSys, GCM_geom g1, GCM_geom g2, double dVal, GCM_alignment aVal=GCM_CLOSEST)
 Set a constraint which specifies distance between a pair of geometric objects.
GCM_constraint GCM_AddAngle (GCM_system gSys, GCM_geom g1, GCM_geom g2, GCM_geom axis, double dVal)
 Set a constraint which specifies angle between a pair of geometric objects.
GCM_constraint GCM_AddAngle (GCM_system gSys, GCM_geom g1, GCM_geom g2, double dVal)
GCM_constraint GCM_FixRadius (GCM_system gSys, GCM_geom g1)
 To create a constraint which specifies a radius of geometric objects.
GCM_constraint GCM_AddPlanarAngle (GCM_system gSys, GCM_geom g1, GCM_geom g2, GCM_geom axis, double dVal)
 Set a driving planar angle between a pair of geometric objects.
GCM_constraint GCM_AddSymmeric (GCM_system gSys, GCM_geom g1, GCM_geom g2, GCM_geom plane, GCM_alignment aVal=GCM_NO_ALIGNMENT)
GCM_pattern GCM_AddLinearPattern (GCM_system gSys, GCM_geom g1, GCM_geom g2, GCM_alignment align=GCM_NO_ALIGNMENT)
 Create a linear pattern constraint.
GCM_pattern GCM_AddAngularPattern (GCM_system gSys, GCM_geom g1, GCM_geom g2, GCM_alignment align=GCM_NO_ALIGNMENT)
 Create an angular pattern constraint.
GCM_constraint GCM_AddGeomToPattern (GCM_system gSys, GCM_pattern ptrn, GCM_geom geom, double position, GCM_alignment align=GCM_NO_ALIGNMENT, GCM_scale scale=GCM_RIGID)
 Add geometric object to the pattern.
GCM_constraint GCM_AddConstraint (GCM_system gSys, const GCM_c_record &cRec)
 Set a constraint.
GCM_geom GCM_SetDependent (GCM_system gSys, GCM_constraint con, GCM_geom g)
void GCM_RemoveConstraint (GCM_system gSys, GCM_constraint con)
 Delete a constraint from the system.
GCM_constraint GCM_FixGeom_ (GCM_system gSys, GCM_geom g)
void GCM_FixGeom (GCM_system gSys, GCM_geom g)
 Set a geometric object fixed.
void GCM_FreeGeom (GCM_system gSys, GCM_geom g)
 Set free geometric object fixed by GCM_FixGeom call.
bool GCM_IsFixed (GCM_system gSys, GCM_geom g)
 Returns 'true' if the object is fixed by GCM_FixGeom call.
GCM_result GCM_Evaluate (GCM_system gSys)
 Calculate the constraint system.
GCM_result GCM_EvaluationResult (GCM_system gSys, GCM_constraint cItem)
 Get result code of the evaluation of constraint.
bool GCM_IsSatisfied (GCM_system gSys, GCM_constraint cItem)
 Perform a check that a constraint is satisfied.
MbPlacement3D GCM_Placement (GCM_system gSys, GCM_geom g)
 Get current placement (solution) of the geometric object.
double GCM_Radius (GCM_system gSys, GCM_geom g)
 Current radius value of the geometric object.
double GCM_RadiusA (GCM_system gSys, GCM_geom g)
 Current "major" radius value of torus or cone.
double GCM_RadiusB (GCM_system gSys, GCM_geom g)
 Current "minor" radius value of torus or cone.
GCM_result GCM_ChangeDrivingDimension (GCM_system gSys, GCM_constraint dItem, double dVal)
 Change the value of driving dimension.
void GCM_SetPlacement (GCM_system gSys, GCM_geom g, const MbPlacement3D &place)
 Set current placement of the geometric object.
GCM_result GCM_PrepareReposition (GCM_system gSys, GCM_geom movGeom, const MbPlacement3D &projPlane, const MbCartPoint3D &curPnt)
 Initialize mode of object moving in the screen plane.
GCM_result GCM_PrepareReposition (GCM_system gSys, GCM_geom rotGeom, const MbCartPoint3D &org, const MbVector3D &axis)
 To initialize the rotation mode of the component around a fixed axis.
void GCM_FinishReposition (GCM_system gSys)
 Finish the dragging mode.
GCM_geom GCM_GetMovingGeom (GCM_system gSys)
 Get manipulation object with which the Solver works when being in the dragging mode (rotating or moving).
GCM_result GCM_SolveReposition (GCM_system gSys, GCM_geom g, const MbPlacement3D &newPos, MtRepositionMode movType)
 Solve the system for an arbitrary change of position of one solid.
GCM_result GCM_SolveReposition (GCM_system gSys, const MbCartPoint3D &curXYZ)
 Solve the system of constraints for new position of cursor in the dragging mode.
GCM_result GCM_SolveReposition (GCM_system gSys, double alpha)
 Solve the system by changing the position of the component through one coordinate.
bool GCM_SetJournal (GCM_system gSys, const char *fName)
 Switch on the journaling and specify the file for recording a journal of GCE API calls.

Variables

const GCM_object GCM_NULL = _GCM_NULL
 Descriptor of empty object or constraint.
const GCM_geom GCM_GROUND = _GCM_GROUND
 Descriptor of rigid subset of objects which are given in global coordinate system.

Enumeration Type Documentation

enum GCM_g_type
Enumerator:
GCM_NULL_GTYPE 

Empty geometric object.

GCM_POINT 

Point.

GCM_LINE 

Line.

GCM_PLANE 

Plane.

GCM_CYLINDER 

Cylinder.

GCM_CONE 

Cone.

GCM_SPHERE 

Spherical surface.

GCM_TORUS 

Toroidal surface.

GCM_CIRCLE 

Circle.

GCM_LCS 

Coordinate system.

GCM_MARKER 

Point and pair of orthonormalized vectors.

GCM_SPLINE 

Spline curve.

enum GCM_c_type
Note:
Values of this enum can be used for permanent storage and will be kept in the future versions.
Enumerator:
GCM_UNKNOWN 

Unknown type.

GCM_COINCIDENT 

Coincidence of loci.

GCM_PARALLEL 

Parallelism of two objects which have a direction vector.

GCM_PERPENDICULAR 

Perpendicularity of two objects which have a direction vector.

GCM_TANGENT 

Tangency of two objects, surfaces and curves.

GCM_CONCENTRIC 

Concentricity of two objects having a center or an axis.

GCM_DISTANCE 

Linear dimension between objects.

GCM_ANGLE 

Angular dimension between directed objects (vectors).

GCM_IN_PLACE 

Exact coincidence of LCS of two planes.

GCM_TRANSMITTION 

Mechanical transmission.

GCM_CAM_MECHANISM 

Cam mechanism.

GCM_SYMMETRIC 

Symmetry.

GCM_DEPENDENT 

Dependent object.

GCM_PATTERNED 

Patterned object.

GCM_LINEAR_PATTERN 

Linear pattern.

GCM_ANGULAR_PATTERN 

Angular pattern.

GCM_RADIUS 

Radial dimension.

Note:
Values of this enum can be used for permanent storage and will be kept in the future versions.
Enumerator:
GCM_OPPOSITE 

Anti-align the directions.

GCM_CLOSEST 

Orientation according to the nearest solution.

GCM_COORIENTED 

Cooriented directions.

GCM_ALIGNED 

Axis aligned local coordinate systems.

GCM_NO_ALIGNMENT 

No defined orientation.

GCM_ROTATED 

Ротационное (вращательной) выравнивание элементов паттерна.

GCM_ALIGN_WITH_AXIAL_GEOM 

Выровнить с объектом, задающим ось.

Note:
Values of this enum can be used for permanent storing of app data and will be kept in the future versions.
Enumerator:
GCM_NONE_ANGLE 

Undefined.

GCM_2D_ANGLE 

Angle of planar joints (0 .. 360 degrees)

GCM_3D_ANGLE 

Angle in space (0 .. 180 degrees)

Note:
Values of this enum can be used for permanent storage of app data and will be kept in the future versions.
Enumerator:
GCM_TAN_NONE 

Not chosen.

GCM_TAN_POINT 

Tangency in general case (contact at a point).

GCM_TAN_LINE 

Tangency by a generating line (for instance, two cylinders with parallel axes).

GCM_TAN_CIRCLE 

Tangency by a circle (for instance, a sphere inside a cone).

enum GCM_result

GCM_result enumerates the values returned by the GCM API calls including the diagnostic codes of solving geometric constraints. Values of this type are returned by functions such as GCM_Evaluate and GCM_EvaluationResult.

Note:
Values of this enum can be used for permanent storage of app data and will be kept in the future versions.
Enumerator:
GCM_RESULT_None 

Code of undefined result or status.

GCM_RESULT_Ok 

The successful result of GCM API call.

GCM_RESULT_Satisfied 

Constraint or system of constraints are fulfilled.

GCM_RESULT_Overconstrained 

Constraint is redundant and contradicts the other conditions.

GCM_RESULT_MatedFixation 

Constraints are specified for pair of fixed objects.

GCM_RESULT_DraggingFailed 

Failed attempt to move a fixed object (as the object rigidly connected with fixed).

GCM_RESULT_Not_Satisfied 

Constraint(s) has not been solved (for unknown reasons).

GCM_RESULT_Unsolvable 

Constraint(s) is not solvable.

GCM_RESULT_Error 

Unknown error is usually not related to the solving.

GCM_RESULT_InappropriateAlignment 

The alignment option is inappropriate to a given constraint type.

GCM_RESULT_InappropriateArgument 

Geometric type of an argument is inappropriate to the constraint.

GCM_RESULT_IncompatibleArguments 

Inconsistent types of constraint arguments.

GCM_RESULT_InconsistentAngleType 

Angular option is inconsistent with the degree of freedom of the joint (planar type of angle is only applicable for the joint leaving only one degree of freedom of rotation);.

GCM_RESULT_InconsistentAlignment 

The orientation value is inconsistent with other mates.

GCM_RESULT_Duplicated 

Constraint duplicates another.

GCM_RESULT_CyclicDependence 

Unsolvable cyclic dependence.

GCM_RESULT_MultiDependedGeom 

A geometric object is dependent on two or more constraints of 'GCM_DEPENDED' type.

GCM_RESULT_OverconstrainingDependedGeoms 

A redundancy constraint between depended geoms.

mtResCode_InvalidDependenceForFixGeom 

Fixed component can not be dependent geom of a pattern constraint;.

GCM_RESULT_InvalidArguments 

Constraint has invalid or undefined (void) arguments.

mtResCode_UnsupportedTangencyChoice 

For mate the option of tangency choice by circle or generating curve is unsupported.

mtResCode_IsNoPossibleForCircTanChoice 

For a given pair of surfaces the touching along the circle is geometrically impossible.

mtResCode_CoaxialMtGearTransmissionIsNotAvalable 

Mechanical transmission of components rotation with the same axis is not supported.

mtResCode_NoSeparatedSolutionForCamGear 

The assembly contains mates (geometric conditions) creating dependence of the motion of the pusher from the motion of cam in addition to the cam gear.

mtResCode_CyclicDependenceForTwoOrMoreCamGears 

Given the cyclic dependence for two or more cam gears.

mtResCode_InconsistentFollowerAxis 

Given mates for pusher doesn't correspond to its motion axis.

GCM_RESULT_InconsistentPlanarAngle 

Planar angle conditions are not met (vectors from the sides of angle should be perpendicular to the axis).

GCM_RESULT_ItsNotDrivingDimension 

Given constraint should be a driving dimension.

GCM_RESULT_Unregistered 

Access to invalid object.

GCM_RESULT_Aborted 

The evaluation process aborted by the application.

Enumerator:
GCM_NO_DEPENDENCY 

It means no one-directed dependecy.

GCM_1ST_DEPENDENT 

The first object is dependent on the other(s).

GCM_2ND_DEPENDENT 

The second object is dependent on the other(s).

enum GCM_scale
Enumerator:
GCM_RIGID 

Distance between elements is constant. The pattern is not scaled.

GCM_LINEAR_SCALE 

Distance between elements is linearly scaled when stretching.


Function Documentation

GCM_system GCM_CreateSystem ( )

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

Returns:
Descriptor of constraint system.
void GCM_ClearSystem ( GCM_system  gSys)

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

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

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

Parameters:
[in]gSys- System of constraints.
See also:
GCM_ClearSystem
bool GCM_ReadSystem ( GCM_system  gSys,
reader in 
)
Parameters:
[in]gSys- System of constraints.
[in]in- Stream for reading.
bool GCM_WriteSystem ( GCM_system  gSys,
writer out 
)
Parameters:
[in]gSys- System of constraints.
[in]out- Stream for writing.
GCM_g_record GCM_Cone ( const MbCartPoint3D centre,
const MbVector3D axis,
double  radiusA,
double  radiusB 
)
Parameters:
[in]centre- Center of base circle of the cone.
[in]axis- Direction vector of the cone axis.
[in]radiusA- Radius of the base circle.
[in]radiusB- Radius of section of circle ("minor" radius).
Returns:
Record of cone.

It is assumed that the parameters describe the imaginary cone frustum, whose height is always unit of length. In this radiusA - is the radius of the base of the cone, and radiusB - the radius of its cross-section.

GCM_g_record GCM_Cylinder ( const MbCartPoint3D centre,
const MbVector3D axis,
double  radius 
)
Parameters:
[in]centre- Center of base circle of the cylinder.
[in]axis- Direction vector of the cylinder axis.
[in]radius- Radius of the base circle.
Returns:
Record of cylinder.
GCM_g_record GCM_Circle ( const MbCartPoint3D centre,
const MbVector3D axis,
double  radius 
)
Parameters:
[in]centre- Center of the circle.
[in]axis- Direction vector of the circle axis.
[in]radius- Radius of the circle.
Returns:
Data record of the circle.
GCM_g_record GCM_Torus ( const MbCartPoint3D centre,
const MbVector3D axis,
double  majorR,
double  minorR 
)
Parameters:
[in]centre- Center of torus.
[in]axis- Direction vector of the rotation axis.
[in]majorR- "Major" radius is the radius of circle sweeping center of the rotating section.
[in]minorR- Radius of section of circle ("minor" radius).

Thus, it is assumed that the torus is an imaginary surface formed by rotation of a circle of "minor radius" lying in the same plane as the axis of rotation and the center located at a distance of majorR from the axis.

GCM_g_record GCM_Sphere ( const MbCartPoint3D centre,
double  radius 
)
Parameters:
[in]centre- Center of the sphere.
[in]radius- Radius of the sphere.
Returns:
Data record of the sphere.
GCM_g_record GCM_SolidLCS ( const MbCartPoint3D org,
const MbVector3D axisZ = MbVector3D::zAxis,
const MbVector3D axisX = MbVector3D::xAxis 
)

The result, which returns this function, is used to specify a rigid body (cluster) in the system by calling GCM_AddGeom or GCM_SubGeom.

GCM_g_record GCM_SolidLCS ( const MbPlacement3D )

The result, which returns this function, is used to specify a rigid body (cluster) in the system by calling GCM_AddGeom or GCM_SubGeom.

GCM_geom GCM_AddPoint ( GCM_system  gSys,
const MbCartPoint3D pVal 
)
Parameters:
[in]gSys- System of constraints.
[in]pVal- Coordinates of a point.
Returns:
Descriptor of registered point.
GCM_geom GCM_AddGeom ( GCM_system  gSys,
const GCM_g_record gRec 
)
Parameters:
[in]gSys- System of constraints.
[in]gRec- Record of geometric record.
Returns:
Descriptor of registered object.
GCM_geom GCM_AddGeom ( GCM_system  gSys,
GCM_g_type  gType,
const MbMatrix3D gMat,
double  radiusA,
double  radiusB 
)
Parameters:
[in]gSys- System of constraints.
[in]gType- Type of geometric object.
[in]gMat- Direct matrix of geometric object.
[in]radiusA- Radius of circle, cylinder, sphere, also "major" radius of cone and torus.
[in]radiusB- "Minor" radius of cone and torus.
Returns:
Descriptor of registered object.
GCM_geom GCM_SubGeom ( GCM_system  gSys,
GCM_geom  sol,
const GCM_g_record gRec 
)
Parameters:
[in]gSys- System of constraints.
[in]sol- Solid or rigid cluster.
[in]gRec- Record of geometric sub-object, which is given in LCS of the solid.
Returns:
Descriptor of sub-object in subset of the solid.
GCM_geom GCM_Parent ( GCM_system  gSys,
GCM_geom  subGeom 
)
Parameters:
[in]gSys- System of constraints.
[in]subGeom- A geometric object belonging to the cluster..
Returns:
Descriptor of the cluster that owns this geometric object.
GCM_g_type GCM_GeomType ( GCM_system  gSys,
GCM_geom  g 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptor of geometric object
Returns:
Geometric type of an object.
void GCM_RemoveGeom ( GCM_system  gSys,
GCM_geom  g 
)
Parameters:
gSys- System of constraints.
g- Descriptor of geometric object

After using this function the object descriptor 'g' will be invalidated. It should be noted that the removed geometric object can still involved in other objects and constraints. In this case, the object to be deleted, although it is considered removed actually remains in effect until other objects connected with will be deleted.

GCM_constraint GCM_AddBinConstraint ( GCM_system  gSys,
GCM_c_type  cType,
GCM_geom  g1,
GCM_geom  g2,
GCM_alignment  aVal = GCM_CLOSEST,
GCM_tan_choice  tVar = GCM_TAN_POINT 
)
Parameters:
[in]gSys- System of constraints.
[in]g1- Descriptors of first object.
[in]g2- Descriptors of second object.
[in]aVal- Alignment option.
[in]tVar- Variant of tangency for constraint of type 'GCM_TANGENT'.
Returns:
Descriptor of a new constraint.

The function is used to set a binary constraint of any type except dimensional constraints, namely one of the following types: GCM_COINCIDENT, GCM_PARALLEL, GCM_PERPENDICULAR, GCM_TANGENT, GCM_CONCENTRIC, GCM_IN_PLACE. In a case of failure, the function returns a handle to an empty object GCM_NULL.

GCM_constraint GCM_AddDistance ( GCM_system  gSys,
GCM_geom  g1,
GCM_geom  g2,
double  dVal,
GCM_alignment  aVal = GCM_CLOSEST 
)
Parameters:
[in]gSys- System of constraints.
[in]g1- Descriptors of first object.
[in]g2- Descriptors of second object.
[in]dVal- The value of dimension.
[in]aVal- Alignment option.
Returns:
Descriptor of the created constraint of type GCM_DISTANCE.

The function creates a dimensional constraint of type GCM_DISTANCE, which specifies linear dimension between two geometric objects. In a failed call, the function returns a handle to an empty object GCM_NULL.

Note:
Value of dVal can be positive as well as negative for oriented objects.
GCM_constraint GCM_AddAngle ( GCM_system  gSys,
GCM_geom  g1,
GCM_geom  g2,
GCM_geom  axis,
double  dVal 
)
Parameters:
[in]gSys- System of constraints.
[in]g1- Descriptors of first object.
[in]g2- Descriptors of second object.
[in]axis- Descriptor of an object that specifying the rotation axis of angle. It can be GCM_NULL.
[in]dVal- The value of dimension (radians).
Returns:
Descriptor of the created constraint of type GCM_ANGLE.

The function creates a dimensional constraint of type GCM_ANGLE, which specifies angle between the directions of two geometric objects. If the rotational axis is specified (i.e. != GCM_NULL), the angle has an planar method of measurement (0 ... 2пи). In this case directions of 'g1' and 'g2' must lie on a plane which has a normal specified by the 'axis' parameter (both directions perpendicular to the axis ). In a failed call, the function returns a handle to an empty object GCM_NULL.

GCM_constraint GCM_FixRadius ( GCM_system  gSys,
GCM_geom  g1 
)
Parameters:
[in]gSys- System of constraints.
[in]g1- Descriptor of the first object which has nonzero radius.
Returns:
Descriptor of the created constraint which has a type GCM_RADIUS.

This function allows to specify a radius of the geometric object. To change radius value use the function GCM_ChangeDrivingDimension. To remove limitation on radius of the geometric object use the function GCM_RemoveConstraint. In a case of failure, the function returns a handle to an empty object GCM_NULL.

GCM_constraint GCM_AddPlanarAngle ( GCM_system  gSys,
GCM_geom  g1,
GCM_geom  g2,
GCM_geom  axis,
double  dVal 
)

This is the same call GCM_AddAngle, but requires an axis, which defines a plane in which the angle is measured.

GCM_pattern GCM_AddLinearPattern ( GCM_system  gSys,
GCM_geom  g1,
GCM_geom  g2,
GCM_alignment  align = GCM_NO_ALIGNMENT 
)

The Linear Pattern constraint defines the law under which geometric objects added to this pattern using GCM_AddGeomToPattern function are located on the given line (guide line). In addition to the guide line to create a Linear Pattern constraint it's necessary to specify a geometric object called a Sample. This object defines the starting point of the guide line of the Linear Pattern. Thus, Sample always remains stationary relative to any translations, rotations and deformations in the coordinate system of the Linear Pattern guide line. The position of any object (called a Copy) to be added to the pattern is determined by its position on the guide line with the origin coinciding with the origin of the LCS of the Sample.

Removal procedure
To remove the Linear Pattern completely It's necessary to use the GCM_RemoveConstraint function. There is no need to remove constraints that were created by the addition of new Copies to the pattern using the function GCM_AddGeomToPattern. They will be deleted automatically.
Parameters:
[in]gSys- System of constraints.
[in]g1- Descriptor of the sample.
[in]g2- Descriptor of the direction axis of the Linear Pattern.
[in]align- Option of alignment of a sample g1 relative to the direction axis. If the option GCM_ALIGN_WITH_AXIAL_GEOM is given the sample g1 will be coincident with the direction line(axis).
Returns:
Descriptor of the created constraint which has a type GCM_LINEAR_PATTERN.
GCM_pattern GCM_AddAngularPattern ( GCM_system  gSys,
GCM_geom  g1,
GCM_geom  g2,
GCM_alignment  align = GCM_NO_ALIGNMENT 
)

The Angular Pattern constraint defines the law under which geometric objects added to this pattern using GCM_AddGeomToPattern function are located on the given circle. This circle lies in a plane that is perpendicular to the given axis, and the center of this circle lies on this axis. In addition to the axis to create an Angular Pattern constraint it's necessary to specify a geometric object called a Sample. This object defines the zero angle and the initial radius of the circle for the Angular Pattern. The position of any object (called a Copy) to be added to the pattern is determined by the rotation around the given axis, starting from the Sample. The radius of the circle (the distance from the Copy or the Sample to the axis) is not constant and can vary in the process of solving the system of equations.

Removal procedure
To remove the Angular Pattern completely It's necessary to use the GCM_RemoveConstraint function. There is no need to remove constraints that were created by the addition of new Copies to the pattern using the function GCM_AddGeomToPattern. They will be deleted automatically.
Parameters:
[in]gSys- System of constraints.
[in]g1- Descriptor of the sample.
[in]g2- Descriptor of the rotation axis of the Angular Pattern.
[in]align- Option of alignment of a sample relative to the direction axis. If the GCM_ALIGN_WITH_AXIAL_GEOM option is specified sample g1 will lie in the XY plane of the direction axis object (rotation axis) and if the direction axis object has a radius (for example, this is a circle) the distance from the Angle Pattern objects to the rotation axis will be equal to the radius of the direction axis object (for example, radius of a circle).
Returns:
Descriptor of the created constraint which has a type GCM_ANGULAR_PATTERN.
GCM_constraint GCM_AddGeomToPattern ( GCM_system  gSys,
GCM_pattern  ptrn,
GCM_geom  geom,
double  position,
GCM_alignment  align = GCM_NO_ALIGNMENT,
GCM_scale  scale = GCM_RIGID 
)

Let's call a Copy the object that is added to the pattern. If the Copy is added to the Linear Pattern it's necessary to specify the distance from the Copy to the Sample. It can be positive or negative and is determined by the required position of the Copy relative to the Sample taking into account the guide axis. It's optionally possible to specify alignment of the Copy LCS relative to the Sample LCS. If the Copy is added to the Angular Pattern it's necessary to specify the angle of rotation of the Copy relative to the Sample around the pattern rotation axis. It's optionally possible to specify alignment of the Copy relative to the Sample. There are 2 types of alignment: GCM_ALIGNED - alignment of the local coordinate systems of the Copy and the Sample, GCM_ROTATED - the alignment of the local coordinate system of the Copy with the local coordinate system of the Sample that is rotated around the axis of rotation at the same angle as the Copy. The distance (or angle of rotation) from the sample to the copy is fixed by default,                  but can be varied by specifying the appropriate GCM_scale option.

Removal procedure
To remove a Copy from the pattern use the function GCM_RemoveConstraint. If it's necessary to remove the pattern completely there is no need to remove each copy from the pattern. Just remove the pattern constraint.
Parameters:
[in]gSys- System of constraints.
[in]ptrn- Descriptor of the pattern.
[in]geom- Descriptor of the copy.
[in]position- Variable that specifies the position of the copy in the pattern (distance or angle).
[in]align- Option that specifies the alignment of copy relative to the sample.
[in]scale- Scaling type of pattern element.
Returns:
Descriptor of the created constraint which has a type GCM_PATTERNED.
GCM_constraint GCM_AddConstraint ( GCM_system  gSys,
const GCM_c_record cRec 
)
Parameters:
[in]gSys- System of constraints.
[in]cRec- Uniform record of a constraint.
Returns:
Descriptor of a new constraint.

This function is used only for the automated testing of the solver therefore not documented.

void GCM_RemoveConstraint ( GCM_system  gSys,
GCM_constraint  con 
)
Parameters:
[in]gSys- System of constraints.
[in]con- Descriptor of constraint.
void GCM_FixGeom ( GCM_system  gSys,
GCM_geom  g 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Descriptors of geometric object.

Thе function makes the object fixed depriving it of all degrees of freedom. If the geometric object is a sub geom of a solid (cluster), the object is frozen only in the framework of the cluster, but in the global coordinate system the object has the same freedom as the cluster to which it belongs.

Note:
In the future this function will be returning a descriptor of constraint, i.e. will create a fixing constraint.
See also:
GCM_FreeGeom, GCM_IsFixed
void GCM_FreeGeom ( GCM_system  gSys,
GCM_geom  g 
)
bool GCM_IsFixed ( GCM_system  gSys,
GCM_geom  g 
)
GCM_result GCM_Evaluate ( GCM_system  gSys)
Parameters:
[in]gSys- System of constraints.
Returns:
Calculation result code.

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

GCM_result GCM_EvaluationResult ( GCM_system  gSys,
GCM_constraint  cItem 
)
Parameters:
[in]gSys- System of constraints.
[in]cItem- Descriptor of constraint belonging to the system gSys.
Note:
If the system has not yet been evaluated then the function will return the code GCM_RESULT_None.
Returns:
Diagnostic code stored in the system after the last call GCM_Evaluate.
bool GCM_IsSatisfied ( GCM_system  gSys,
GCM_constraint  cItem 
)
Parameters:
[in]gSys- System of constraints.
[in]cItem- Descriptor of constraint.
Returns:
true if a constraint is satisfied.
GCM_result GCM_ChangeDrivingDimension ( GCM_system  gSys,
GCM_constraint  dItem,
double  dVal 
)
Parameters:
[in]gSys- System of constraints.
[in]dItem- Descriptor of dimensional constraint.
[in]dVal- Required value of constraint.
Returns:
Operation result code.

The function is used only for driving dimensions. If the driving dimension is angular, then the parameter dVal is specified in radians.
It should be noted 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 GCM_Evaluate.

void GCM_SetPlacement ( GCM_system  gSys,
GCM_geom  g,
const MbPlacement3D place 
)
Note:
The function only impart new state of the object without the revaluation of constraints. Call GCM_Evaluate can change the given state to satisfy constraints of this object.
GCM_result GCM_PrepareReposition ( GCM_system  gSys,
GCM_geom  movGeom,
const MbPlacement3D projPlane,
const MbCartPoint3D curPnt 
)
Parameters:
[in]gSys- System of constraints.
[in]movGeom- Component, part which is manipulated.
[in]projPlane- Plane of the screen given in the WCS of assembly.
[in]curPnt- Point of the component which is projected onto plane of the screen to cursor position and is 'dragging'. curPnt given in the LCS of the geometric object movGeom;
Returns:
Result code.

The function runs once to start the dragging mode of components, which is controlled (by movement of the mouse) by the command GCM_SolveReposition(GCM_system, const MbCartPoint3D &). Mode is stopped by the calling any other command except GCM_PrepareReposition. There is also the special function to exit from the dragging mode explicitly - GCM_FinishReposition.

GCM_result GCM_SolveReposition ( GCM_system  gSys,
GCM_geom  g,
const MbPlacement3D newPos,
MtRepositionMode  movType 
)
Parameters:
[in]gSys- System of constraints.
[in]g- Solid, the position of which is changed.
[in]newPos- New position of a solid.
[in]movType- Code of the desired behavior
Returns:
Result code.
Note:
This function doesn't allow to take out constraint system from decided state, except when before call of function the system was already unsolved. If new position 'newPos' doesn't allow to satisfy the system of constraints, then new position of solid will be the most nearest to newPos (while preserving solvability).
GCM_result GCM_SolveReposition ( GCM_system  gSys,
const MbCartPoint3D curXYZ 
)
Parameters:
[in]gSys- System of constraints.
[in]curXYZ- Current position of a cursor in the WCS.
Returns:
Result code.

Procedure that controls dragging mode which are stopped after calling any other command.

GCM_result GCM_SolveReposition ( GCM_system  gSys,
double  alpha 
)
Parameters:
[in]gSys- System of constraints.
[in]alpha- Driving parameter (this is ussualy an angle given in radians).
Returns:
Result code.

This function controls reposition mode, in which the position of the solid is controlled by changing one coordinate. For example the angle of rotation around an axis. Mode is stopped by calling GCM_FinishReposition or any other command, which is changes state of the Solver, for example GCM_AddConstraint. This function is faster than the GCM_Evaluate or GCM_SolveReposition(GCM_system, GCM_geom, const MbPlacement3D &, MtRepositionMode) for large systems.

bool GCM_SetJournal ( GCM_system  gSys,
const char *  fName 
)
Parameters:
[in]gSys- System of constraints.
[in]fName- Name of destination file with a full path.
Returns:
true, if journaling 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 GCM_RemoveSystem method. Adding records to the journal from parallel code does not occur.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines