C3D Toolkit
Kernel - 117982, Vision - 2.9.2.2
|
Geometric constraint solver. More...
#include <gcm_manager.h>
Public Member Functions | |
Definition functions of the constraint system | |
MtPatternId | AddPattern (MtMateType, MtArgument, MtArgument, MtParVariant par=MtParVariant::undef) |
Add a pattern. | |
MtPatternId | SubPattern (MtPatternId ptrn, GCM_coord_name, MtArgument axis) |
Create the constraint coordinate of the coordinate system pattern. | |
MtConstraintId | AddGeomToPattern (MtPatternId ptrn, MtArgument ptrnObj, MtParVariant par1=MtParVariant::undef, MtParVariant par2=MtParVariant::undef, GCM_scale scale=GCM_RIGID) |
Add a geometric object to the pattern. | |
MtResultCode3D | AddConstraintItem (ItConstraintItem &) |
Add constraint. More... | |
ItConstraintItem * | AddConstraint (MtMateType t, MtArgument g1, MtArgument g2, MtParVariant p1=MtParVariant::undef, MtParVariant p2=MtParVariant::undef, MtParVariant p3=MtParVariant::undef) |
Add mate (constraint) of two geometric objects. More... | |
ItConstraintItem * | AddConstraint (MtMateType, MtArgument, MtArgument, MtArgument, MtParVariant p1=MtParVariant::undef, MtParVariant p2=MtParVariant::undef) |
Add constraint of three geometric objects. | |
ItGeom * | AddGeom (MtGeomVariant) |
Add black box to the constraint system. More... | |
MtResultCode3D | AddBlackbox (ItGCBlackbox &) |
ItGeom * | SetDependentGeom (ItConstraintItem *, ItGeom *) |
MtResultCode3D | ChangeDefinition (ItConstraintItem &) |
Report about change in the data defining conjugation. | |
MtResultCode3D | ChangeDimension (ItConstraintItem &) |
Report about change of float-parameter of dimensional conjugation. | |
MtResultCode3D | ChangeGeomPositions () |
Report about position change of conjugated solids. More... | |
ItGeom * | CreateCluster (std::vector< ItGeom * > &) |
Create an user-defined cluster. More... | |
MtResultCode3D | FixGeom (const ItGeom *) |
Fix geometric object in the WCS. | |
bool | IsFixed (const ItGeom *) |
Check if a geometric object is fixed? | |
void | Flush () |
Clear the system constraint. | |
MtResultCode3D | RemoveAllBlackboxes () |
Remove all the black boxes from the constraint system. | |
MtResultCode3D | RemoveConstraint (ItConstraintItem *) |
Remove constraint from system. | |
MtResultCode3D | RemoveBlackbox (ItGCBlackbox &) |
Remove black box from constraint system. | |
bool | RemoveGeom (const ItGeom *) |
Remove geometric object from constraint system. | |
MtResultCode3D | UnfixGeom (const ItGeom &) |
Free geometric object from fixation in the WCS. | |
Functions of solution and diagnostics | |
GCM_closest_params | ClosestParams (const ItConstraintItem *) const |
The function evaluates a closest parameters that tend to satisfy dimension or constraint. | |
bool | IsSatisfied (const ItConstraintItem &) |
Check if constraint is satisfied? | |
GCM_dof_result | IsWellConstrained (const ItGeom &) |
Check if solid is fully-specified or fixed? | |
void | DiagnoseConstraints () |
Send out diagnostic codes to constraints. More... | |
MtResultCode3D | Evaluate () |
Solve the constraint system. More... | |
MbMatrix3D | TransMatrix (ItGeom *) const |
Current or calculated position of a geometric object. | |
const ItGeom * | Cluster (const ItGeom *subGeom) const |
Get cluster which contains a given geometric object. | |
Functions for interactive manipulation of the constraint system | |
void | FinishReposition () |
Finish the dragging mode. | |
ItGeom * | GetMovingGeom () const |
Get manipulation object. Solver works with it when being in the dragging mode (rotating or moving). | |
MtResultCode3D | PrepareReposition (ItGeom &movGeom, const MbPlacement3D &projPlane, const MbCartPoint3D &curPnt) |
Initialize mode of object moving in the screen plane. More... | |
MtResultCode3D | PrepareReposition (ItGeom &rotGeom, const MbCartPoint3D &org, const MbVector3D &axis) |
Initialize mode of component rotation around a fixed point of axis. More... | |
MtResultCode3D | SolveReposition (ItGeom &gItem, const MbPlacement3D &newPos, MtRepositionMode movType) |
Solve the system for an arbitrary change of position of one solid. More... | |
MtResultCode3D | SolveReposition (const MbCartPoint3D &curXYZ) |
Solve the system of conjugations for new position of cursor in the dragging mode. More... | |
MtResultCode3D | SolveReposition (double alpha) |
Solve the system with the position of the component through one coordinate. More... | |
![]() | |
refcount_t | AddRef () const |
Adds a reference to this object. | |
refcount_t | Release () const |
Releases a reference to this object. | |
refcount_t | GetUseCount () const |
Returns a number of objects referring to this. | |
Auxiliary functions and queries. | |
bool | IsMyGeom (const ItGeom &) const |
Check if geometric object belongs to the system. | |
bool | IsMyConstraint (const ItConstraintItem &) const |
Check if geometric constraint belongs to the system. | |
ItGeom * | Ground () const |
Get the cluster of rigid subset of objects which are given in global coordinate system. | |
GCM_system | System () const |
Get a geometric constraint system, which is served by the solver. | |
void | WriteSystem (TCHAR *fileName) |
SPtr< ItConstraintsEnum > | GetConstraintsEnum () |
Get the constraints iterator. | |
GCM_geom | _QueryArgument (const MtArgument &gArg) |
const ItGeom * | _SetDependencyGeom (MtGeomId gId, const ItGeom *gItem) |
SPtr< MtGeomSolver > | GCM_CreateSolver (SPtr< ItPositionManager > posMan) |
Create an object-oriented interface of 3D solver. More... | |
SPtr< MtGeomSolver > | GCT_GetSolver (GCM_system gSys) |
Geometric constraint solver.
Interface of geometric solver. Client application can run any count of constraint systems, for each of them is put
one copy of the solver by calling #CreateSolver.
MtResultCode3D MtGeomSolver::AddConstraintItem | ( | ItConstraintItem & | ) |
Add constraint.
ItConstraintItem* MtGeomSolver::AddConstraint | ( | MtMateType | t, |
MtArgument | g1, | ||
MtArgument | g2, | ||
MtParVariant | p1 = MtParVariant::undef , |
||
MtParVariant | p2 = MtParVariant::undef , |
||
MtParVariant | p3 = MtParVariant::undef |
||
) |
Add mate (constraint) of two geometric objects.
[in] | t | - Type of geometric constraint. |
[in] | g1,g2 | - Pair of geometric objects - arguments of constraint. |
[in] | p1 | - Condition of alignment for or these types of constraints like GCM_COINCIDENT, GCM_PARALLEL, GCM_PERPENDICULAR, GCM_CONCENTRIC, GCM_IN_PLACE, mct_Tangency. Values of this parameter are taken from GCM_alignment. |
[in] | p1 | - Numeric parameter (double) of dimensional constraints to the types of GCM_ANGLE, GCM_DISTANCE. |
[in] | p2 | - Tangency variant GCM_tan_choice for constraint with type GCM_TANGENCY or value GCM_alignment for dimensional constraint. |
[in] | p3 | - Irrelevant. |
ItGeom* MtGeomSolver::AddGeom | ( | MtGeomVariant | ) |
Add black box to the constraint system.
[in] | bBox | - Interface of Interface black box. |
MtResultCode3D MtGeomSolver::ChangeGeomPositions | ( | ) |
Report about position change of conjugated solids.
Using this function implements synchronization of position of objects of constraints as objects of a client application. It should be said that the update of the positions happens only for those inheritors of ItGeom which are implemented by the application. State of objects added by method MtGeomSolver::AddGeom remains unchanged.
Create an user-defined cluster.
void MtGeomSolver::DiagnoseConstraints | ( | ) |
Send out diagnostic codes to constraints.
Solving the constraint system. If it is not solved partly, then by the results of the solution diagnostic codes of errors are sent to all the constraints. The function doesn't have a substantial amount of time if have already tried to solve the constraint system before.
MtResultCode3D MtGeomSolver::Evaluate | ( | ) |
Solve the constraint system.
Changes positions of geometric objects according to geometric constraints.
MtResultCode3D MtGeomSolver::PrepareReposition | ( | ItGeom & | movGeom, |
const MbPlacement3D & | projPlane, | ||
const MbCartPoint3D & | curPnt | ||
) |
Initialize mode of object moving in the screen plane.
movGeom | - Component, part which is manipulated. |
projPlane | - Plane of the screen given in the WCS of assembly. |
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; |
The function runs once before running the dragging mode of components, which is controlled (by movement of the mouse) by the command MtResultCode3D SolveReposition( const MbCartPoint3D & ). Mode is stopped calling any other command other than these two. There is also the special feature. To exit from the dragging mode - void FinishReposition(), for explicit stop of the dragging mode.
MtResultCode3D MtGeomSolver::PrepareReposition | ( | ItGeom & | rotGeom, |
const MbCartPoint3D & | org, | ||
const MbVector3D & | axis | ||
) |
Initialize mode of component rotation around a fixed point of axis.
geom | - The geom object on which is directed at impact. |
org,axis | - Point and vector in the GCS which define constant axis of rotation. |
MtResultCode3D MtGeomSolver::SolveReposition | ( | ItGeom & | gItem, |
const MbPlacement3D & | newPos, | ||
MtRepositionMode | movType | ||
) |
Solve the system for an arbitrary change of position of one solid.
gItem | solid, the position of which is changed; |
newPos | new position of solid g_item; |
movType | code of the desired behavior |
MtResultCode3D MtGeomSolver::SolveReposition | ( | const MbCartPoint3D & | curXYZ | ) |
Solve the system of conjugations for new position of cursor in the dragging mode.
- | curXYZ the current position of cursor in the WCS. |
Work procedure which controls dragging mode which are stopped after call any other command. For example: add a new constraint or rebuild.
MtResultCode3D MtGeomSolver::SolveReposition | ( | double | alpha | ) |
Solve the system with the position of the component through one coordinate.
alpha | - Driving parameter (often, it's in radians ). |
This is the work 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 MtGeomSolver::FinishReposition or any other command, which is changes state of the solver. For example MtGeomSolver::AddConstraint. Function for large systems is faster than the Solve(bool) or SolveReposition( ItGeom &, const MbPlacement3D &).
|
friend |
Create an object-oriented interface of 3D solver.
[in] | pMan | - Interface that provides functions of reposition of geometric objects on the application side. |
The call creates an empty constraint system. Besides, there are created internal data structures of geometric solver maintaining the constraint system. The function returns an instance of class representing an object-oriented interface of the 3D solver.