dcs_ufnc.h

<< Click to Display Table of Contents >>

Navigation:  User DLLs > Writing DLLs > Link Libraries >

dcs_ufnc.h

The dcs_ufnc.h serves as the interface between 3DCS and your user-DLL routines. Structures are used to commonly define moves, tolerances, and measures for the user-routines. The information in these structures is filled in by 3DCS with all the information the user has provided in the corresponding MTM definition via its GUI. The structure is then given to the user-routine, which subsequently modifies the output parameters in the structures and returns control back to 3DCS to perform the user-specified action. Vector and Matrix structures as also provided for simplifying the definitions of various parameters such as point coordinates, direction vectors, and rotation matrices. There are a great many helper functions also provided and it is recommended that these functions be used rather than manipulating the structure's parameters themselves.

The structures are shown below:

1.) VECTOR STRUCTURE

2.) VECTOR FUNCTIONS

3.) MATRIX STRUCTURE

4.) MATRIX FUNCTIONS

5.) MOVE STRUCTURE

6.) MOVE FUNCTIONS

7.) TOLERANCE STRUCTURE

8.) TOLERANCE FUNCTIONS

9.) MEASURE STRUCTURE

10.) MEASURE FUNCTIONS

 

 

1.) VECTOR STRUCTURE

 

// =======================================================

// vector structure definition ===========================

// =======================================================

typedef struct wpVEC3D_d

{

double x;

double y;

double z;

} wpVEC3D_s;

 

// end vector structure definition

 

 

 

2.) VECTOR FUNCTIONS

 

// =======================================================

// vector utility function definitions ===================

// =======================================================

 

// sets the vector to [0,0,0]

wpDLLExportC void wpGlbInitVec3D(wpVEC3D_s* vec);

 

// sets the first vector with the second vector

wpDLLExportC void wpGlbSetVec3D(wpVEC3D_s* vec, wpVEC3D_s src);

 

// sets the vector to [x,y,z]

wpDLLExportC void wpGlbSetVec3DByXYZ(wpVEC3D_s* vec, double x, double y, double z);

 

// returns the length of the vector (sqrt(x*x + y*y + z*z))

wpDllExportC double wpGlbLengthOfVec3D(wpVEC3D_s vec);

 

// returns the length of the vector squared (x*x + y*y + z*z)

wpDllExportC double wpGlbSqLengthOfVec3D(wpVEC3D_s vec);

 

// adds the second vector to the first vector

wpDllExportC void wpGlbAddVec3D(wpVEC3D_s* rsltVec, wpVEC3D_s addVec);

 

// subtracts the second vector from the first vector

wpDllExportC void wpGlbSubtractVec3D(wpVEC3D_s* rsltVec, wpVEC3D_s minusVec);

 

// multiplies the vector by a scalar value

wpDllExportC void wpGlbMultiplyVec3D(wpVEC3D_s* vec, double value);

 

// returns the dot product of two vectors

wpDllExportC double wpGlbDotProductOfVec3D(wpVEC3D_s first, wpVEC3D_s second);

 

// calculates a unitized vector normal to two vectors,

// calculated as (first X second), returns 0 for failure (parallel vectors)

wpDllExportC int wpGlbNormalVec3D(wpVEC3D_s first, wpVEC3D_s second, wpVEC3D_s* norm);

 

// unitizes the vector, returns 0 for failure (zero vector)

wpDllExportC int wpGlbUnitizeVec3D(wpVEC3D_s* vec);

 

// calculates the cross product of two vectors

wpDllExportC void wpGlbCrossProductOfVec3D(wpVEC3D_s first, wpVEC3D_s second,

wpVEC3D_s* cross);

 

// projects the vector onto the reference plane (projection = vector if plane is 0)

wpDllExportC void wpGlbProjVec3DOnPlane(wpVEC3D_s vec, wpVEC3D_s ref, wpVEC3D_s* proj);

 

// obtains a vector normal to the input vector, returns 0 for failure (zero input vector)

wpDllExportC int wpGlbAnyNormalVec3D(wpVEC3D_s vec, wpVEC3D_s* norm);

 

// calculates the angle between two vectors, angle range between 0 and PI

wpDllExportC double wpGlbAngleBetweenVec3D(wpVEC3D_s first, wpVEC3D_s second);

 

// calculates the angle between two vectors from a view direction using the

// right-hand rule, returns 0.0 for failure (zero view vector)

wpDllExportC double wpGlbAngleFromViewDir(wpVEC3D_s first, wpVEC3D_s second,

wpVEC3D_s viewDir);

 

// end vector utility function definitions

 

 

 

3.) MATRIX STRUCTURE

 

// =======================================================

// matrix structure definition ===========================

// =======================================================

typedef struct wpRMATRIX_d

{

double mt_R11;

double mt_R12;

double mt_R13;

double mt_R14;

 

double mt_R21;

double mt_R22;

double mt_R23;

double mt_R24;

 

double mt_R31;

double mt_R32;

double mt_R33;

double mt_R34;

} wpRMATRIX_s;

 

// end matrix structure definition

 

 

 

4.) MATRIX FUNCTIONS

 

// =======================================================

// matrix utility function definitions ===================

// =======================================================

 

// sets the matrix to an identity matrix

wpDllExportC void wpGlbInitRMatrix(wpRMATRIX_s* m);

 

// sets the matrix as a rotation matrix around the axis, through the point,

// and by the angle, returns 0 for failure (zero axis vector)

wpDllExportC int wpGlbGetRotateMatrix(wpVEC3D_s point, wpVEC3D_s axis,

double angle, wpRMATRIX_s* m);

 

// rotate the vector by the matrix

wpDllExportC void wpGlbRotateVec3DByRMatrix(wpVEC3D_s* vec, wpRMATRIX_s* m);

 

// end matrix utility function definitions

 

 

 

5.) MOVE STRUCTURE

 

// =======================================================

// move structure definition =============================

// =======================================================

typedef struct wpMOVECAL_d

{

 

// ===================== input data ======================

 

int m_NumObjVec; // number of object points

int m_NumTgtVec; // number of target points

int m_NumDirVec; // number of direction vectors

 

wpVEC3D_s* m_ObjVec; // object point coordinates

double* m_ObjVal; // object circle radii (R<0 if no circle at point)

wpBOOL* m_ObjPin; // object circle pin flags (wpFALSE if is hole or no circle)

 

wpVEC3D_s* m_TgtVec; // target point coordinates

double* m_TgtVal; // target circle radii (R<0 if no circle at point)

wpBOOL* m_TgtPin; // target circle pin flags (FALSE if hold or no circle)

 

char** m_ObjPtNames; // object point names, added 5/1/02

char** m_TgtPtNames; // target point names, added 5/1/02

 

int* m_ObjPtParentIDs; // object point parent IDs, added 7/15/02

int* m_TgtPtParentIDs; // target point parent IDs, added 7/15/02

 

wpVEC3D_s* m_DirVec; // direction vectors

wpVEC3D_s* m_StartV; // start angle vectors

 

wpBOOL m_IsPrimOn; // primary flag

wpBOOL m_IsO6T6On; // O6-T6 flag

wpBOOL m_IsRotate; // rotation flag

wpBOOL m_IsUseMeas; // using measure flag

 

double m_CurIterStep; // current iteration step size

double m_SrchStep; // search step size

int m_SrchNum; // maximum search steps

double m_SrchAcc; // search accuracy

 

int m_NumStr; // number of strings added 3/7/00

char** m_StrArray; // string array added 3/7/00

 

int m_NumDbls; // number of real values, added 3/7/00

double* m_DblArray; // real values array, added 3/7/00

 

wpBOOL m_IsFlexType; // indicates that the move is a flexible body move, added 6/15/00

int m_FlexPartNum; // indicates number of flexible parts defined, added 6/20/00

int* m_FlexPartPtNum; // number of points per flexible part, added 6/20/00

wpVEC3D_s** m_FlexPartPts; // point coordinates for flexible parts, added 6/20/00

 

wpLONG m_MoveID; // the ID of this move, added 4/30/02

wpLONG m_ParentPartID; // the ID of the parent part of this move, added 4/30/02

 

// 4/30/02 these renamed for clarity

// int m_NumIDs; // number of IDs, added 6/19/00

// int* m_IDArray; // IDs array, added 6/19/00

 

int m_NumMoveParts; // number of move part IDs, added 4/30/02

wpLONG* m_MovePartIDArray; // move part IDs array, added 4/30/02

 

char** m_MovePartNames; // move part names, added 5/1/02

 

char* m_MoveName; // name of move in dialog, added 4/30/02

 

int m_DlgStatus; // indicates status of dialog if in dialog mode, added 4/30/02

int m_DlgIndex; // usable index when needed by dialog status, added 4/30/02

char* m_DlgString; // usable string when needed by dialog status, added 7/15/02

 

wpBOOL m_IsNominalBuild; // indicates nominal build status, added 1/19/00

 

 

// ===================== output data =====================

 

int m_NumMvPair; // number of translation/rotation pairs to be performed

 

wpVEC3D_s* m_TrnVec; // translation vectors

wpVEC3D_s* m_RotVec; // rotation points

wpVEC3D_s* m_RtAxis; // rotation axes

double* m_Angles; // rotation angles

 

int m_NumTgtedVec; // number of targeted object vectors

wpVEC3D_s* m_TgtedVec; // targeted object vectors

 

wpBOOL m_IsMvCalOk; // move calculation flag

wpBOOL m_IsMvInfoCal; // success flag, must be set to TRUE for move to be performed

 

} wpMOVECAL_s;

 

// end move structure definition

 

 

 

6.) MOVE FUNCTIONS

 

// =======================================================

// move utility function definitions =====================

// =======================================================

// ===================== input data ======================

 

// added 7/15/02

// returns the number of object points in the move structure

wpDllExportC int mvGlbGetObjPtNum(wpMOVECAL_s* pMvCal);

 

// added 7/15/02

// returns the number of target points in the move structure

wpDllExportC int mvGlbGetTgtPtNum(wpMOVECAL_s* pMvCal);

 

// returns the coordinates of the object point at index in the move structure

wpDllExportC wpVEC3D_s mvGlbGetObjVec(wpMOVECAL_s* pMvCal, int index);

 

// returns the coordinates of the target point at index in the move structure

wpDllExportC wpVEC3D_s mvGlbGetTgtVec(wpMOVECAL_s* pMvCal, int index);

 

// returns the radius of the circle on the object point at index in the move structure,

// returns a negative value if there is no circle on the point

wpDllExportC double mvGlbGetObjVal(wpMOVECAL_s* pMvCal, int index);

 

// returns the radius of the target on the object point at index in the move structure,

// returns a negative value if there is no circle on the point

wpDllExportC double mvGlbGetTgtVal(wpMOVECAL_s* pMvCal, int index);

 

// determines if there is a pin at the object point at index in the move structure,

// returns wpFALSE if there is no circle at the point or if the circle is a hole

wpDllExportC wpBOOL mvGlbIsObjPin(wpMOVECAL_s* pMvCal, int index);

 

// added 5/1/02

// returns the object point's name at index in the move structure

wpDllExportC char* mvGlbGetObjNameAt(wpMOVECAL_s* pMvCal, int index);

 

// determines if there is a pin at the target point at index in the move structure,

// returns wpFALSE if there is no circle at the point or if the circle is a hole

wpDllExportC wpBOOL mvGlbIsTgtPin(wpMOVECAL_s* pMvCal, int index);

 

// added 5/1/02

// returns the target point's name at index in the move structure

wpDllExportC char* mvGlbGetTgtNameAt(wpMOVECAL_s* pMvCal, int index);

 

// added 7/15/02

// returns the object point's parent ID at index in the move structure

wpDllExportC int mvGlbGetObjParentIDAt(wpMOVECAL_s* pMvCal, int index);

 

// added 7/15/02

// returns the target point's parent ID at index in the move structure

wpDllExportC int mvGlbGetTgtParentIDAt(wpMOVECAL_s* pMvCal, int index);

 

// returns the vector direction at index in the move structure

wpDllExportC wpVEC3D_s mvGlbGetDirVec(wpMOVECAL_s* pMvCal, int index);

 

// returns the start angle vector at index in the move structure

wpDllExportC wpVEC3D_s mvGlbGetStartVec(wpMOVECAL_s* pMvCal, int index);

 

// added 3/7/00

// returns the string at index in the move structure

wpDllExportC char* mvGlbGetStrAt(wpMOVECAL_s* pMvCal, int index);

 

// added 4/30/02

// returns the number of strings in the move structure

wpDllExportC int mvGlbGetStrNum(wpMOVECAL_s* pMvCal);

 

// added 3/7/00

// returns the real value at index in the move structure

wpDllExportC double mvGlbGetDblAt(wpMOVECAL_s* pMvCal, int index);

 

// added 4/30/02

// returns the number of doubles in the move structure

wpDllExportC int mvGlbGetDblNum(wpMOVECAL_s* pMvCal);

 

// removed 4/30/02

// use new functions below

// added 6/19/00

// returns the number of IDs in the move structure

//wpDllExportC int mvGlbGetIDNum(wpMOVECAL_s* pMvCal);

 

// removed 4/30/02

// use new functions below

// added 6/19/00

// returns the ID at index in the move structure

//wpDllExportC int mvGlbGetIDAt(wpMOVECAL_s* pMvCal, int index);

 

// added 6/19/00

// returns the ID of this move in the move structure

wpDllExportC wpLONG mvGlbGetMoveID(wpMOVECAL_s* pMvCal);

 

// added 6/19/00

// returns the ID of the parent part of this move in the move structure

wpDllExportC wpLONG mvGlbGetParentPartID(wpMOVECAL_s* pMvCal);

 

// modified 4/30/02

// renamed for clarity

// added 6/19/00

// returns the number of move parts in the move structure

//wpDllExportC int mvGlbGetMovePartNum(wpMOVECAL_s* pMvCal);

wpDllExportC int mvGlbGetMovePartIDNum(wpMOVECAL_s* pMvCal);

 

// modified 4/30/02

// return wpLONG instead of int

// added 6/19/00

// returns the ID of the move part at index in the move structure

// allows for easy use of id list (this is offset by 2 in the list due MoveID & ParentPartID)

//wpDllExportC int mvGlbGetMovePartIDAt(wpMOVECAL_s* pMvCal, int index);

wpDllExportC wpLONG mvGlbGetMovePartIDAt(wpMOVECAL_s* pMvCal, int index);

 

// added 5/1/02

// returns the move part's name at index in the move structure

wpDllExportC char* mvGlbGetMovePartNameAt(wpMOVECAL_s* pMvCal, int index);

 

// added 6/20/00

// returns the number of points in the flexible part at index in the move structure

wpDllExportC int mvGlbGetFlexPartPtNumAtIndex(wpMOVECAL_s* pMvCal, int partIndex);

 

// added 6/20/00

// returns the point coords in the flexible part at index in the move structure

wpDllExportC wpVEC3D_s mvGlbGetFlexVec(wpMOVECAL_s* pMvCal, int ptIndex, int partIndex);

 

// added 5/2/02

// returns the nominal build flag in the move structure

wpDllExportC wpBOOL mvGlbGetNominalBuildFlag(wpMOVECAL_s* pMvCal);

 

// added 5/2/02

// returns the status of the dialog operation in the move structure

wpDllExportC int mvGlbGetDialogStatus(wpMOVECAL_s* pMvCal);

 

// added 5/2/02

// returns the index of the dialog operation in the move structure

wpDllExportC int mvGlbGetDialogIndex(wpMOVECAL_s* pMvCal);

 

 

// ===================== output data =====================

 

// sets the number of translation / rotation pairs in the move structure,

// allocates memory

wpDllExportC void mvGlbSetMovePairNum(wpMOVECAL_s* pMvCal, int pairNum);

 

// sets the translation vector at index in the move structure

wpDllExportC void mvGlbSetMoveTrInfo(wpMOVECAL_s* pMvCal, int index, wpVEC3D_s vec);

 

// sets the rotation information at index in the move structure

wpDllExportC void mvGlbSetMoveRtInfo(wpMOVECAL_s* pMvCal, int index, wpVEC3D_s rtVec,

wpVEC3D_s axis, double angle);

 

// added 5/2/02

// sets the translation vector at index in the move structure

wpDllExportC void mvGlbSetTranslateVecAt(wpMOVECAL_s* pMvCal, int ii, wpVEC3D_s vec);

 

// added 5/2/02

// sets the rotation vector at index in the move structure

wpDllExportC void mvGlbSetRotationVecAt(wpMOVECAL_s* pMvCal, int ii, wpVEC3D_s vec);

 

// added 5/2/02

// sets the rotation axis vector at index in the move structure

wpDllExportC void mvGlbSetRotationAxisVecAt(wpMOVECAL_s* pMvCal, int ii, wpVEC3D_s vec);

 

// added 5/2/02

// sets the rotation angle at index in the move structure

wpDllExportC void mvGlbSetRotationAngleAt(wpMOVECAL_s* pMvCal, int ii, double angle);

 

// added 5/2/02

// sets the move info cal flag in the move structure

wpDllExportC void mvGlbSetMvInfoCalFlag(wpMOVECAL_s* pMvCal, wpBOOL flag);

 

// added 5/2/02

// sets the move calc ok flag in the move structure

wpDllExportC void mvGlbSetMvCalcOkFlag(wpMOVECAL_s* pMvCal, wpBOOL flag);

 

// added 5/2/02

// returns the move info cal flag in the move structure

wpDllExportC wpBOOL mvGlbGetMvInfoCalFlag(wpMOVECAL_s* pMvCal);

 

// added 5/2/02

// returns the move calc OK flag in the move structure

wpDllExportC wpBOOL mvGlbGetMvCalcOkFlag(wpMOVECAL_s* pMvCal);

 

// added 5/2/02

// returns the number of move pairs in the move structure

wpDllExportC int mvGlbGetNumMovePairs(wpMOVECAL_s* pMvCal);

 

// added 5/2/02

// returns the translation vector at index in the move structure

wpDllExportC wpVEC3D_s mvGlbGetTranslateVecAt(wpMOVECAL_s* pMvCal, int ii);

 

// added 5/2/02

// returns the rotation vector at index in the move structure

wpDllExportC wpVEC3D_s mvGlbGetRotationVecAt(wpMOVECAL_s* pMvCal, int ii);

 

// added 5/2/02

// returns the rotation axis vector at index in the move structure

wpDllExportC wpVEC3D_s mvGlbGetRotationAxisVecAt(wpMOVECAL_s* pMvCal, int ii);

 

// added 5/2/02

// returns the rotation angle at index in the move structure

wpDllExportC double mvGlbGetRotationAngleAt(wpMOVECAL_s* pMvCal, int ii);

 

 

 

// === set functions === (typically not called by user-dll)

 

// sets the number of object and target points in the move structure, allocates memory

wpDllExportC void mvGlbSetTgtObjVecNum(wpMOVECAL_s* pMvCal, int tgtVecNum, int objVecNum);

 

// sets the coordinates of the object point at index in the move structure

wpDllExportC void mvGlbSetObjVec(wpMOVECAL_s* pMvCal, int index, wpVEC3D_s vec);

 

// sets the coordinates of the target point at index in the move structure

wpDllExportC void mvGlbSetTgtVec(wpMOVECAL_s* pMvCal, int index, wpVEC3D_s vec);

 

// sets the radius of the circle on the object point at index in the move structure

wpDllExportC void mvGlbSetObjVal(wpMOVECAL_s* pMvCal, int index, double value);

 

// sets the radius of the circle on the target point at index in the move structure

wpDllExportC void mvGlbSetTgtVal(wpMOVECAL_s* pMvCal, int index, double value);

 

// sets the object point at index in the move structure as having a pin

wpDllExportC void mvGlbSetObjAsPin(wpMOVECAL_s* pMvCal, int index, wpBOOL isTrue);

 

// sets the target point at index in the move structure as having a pin

wpDllExportC void mvGlbSetTgtAsPin(wpMOVECAL_s* pMvCal, int index, wpBOOL isTrue);

 

// added 5/1/02

// sets the object point's name at index in the move structure

wpDllExportC void mvGlbSetObjNameAt(wpMOVECAL_s* pTlCal, int index, const char* pstr);

 

// added 5/1/02

// sets the target point's name at index in the move structure

wpDllExportC void mvGlbSetTgtNameAt(wpMOVECAL_s* pMvCal, int index, const char* pstr);

 

// added 7/15/02

// sets the object point's parent ID at index in the move structure

wpDllExportC void mvGlbSetObjParentIDAt(wpMOVECAL_s* pMvCal, int index, int parentID);

 

// added 7/15/02

// sets the targets point's parent ID at index in the move structure

wpDllExportC void mvGlbSetTgtParentIDAt(wpMOVECAL_s* pMvCal, int index, int parentID);

 

// sets the number directions in the move structure

wpDllExportC void mvGlbSetDirVecNum(wpMOVECAL_s* pMvCal, int vecNum);

 

// sets the direction vector at index in the move structure

wpDllExportC void mvGlbSetDirVec(wpMOVECAL_s* pMvCal, int index, wpVEC3D_s vec);

 

// sets the start angle vector at index in the move structure

wpDllExportC void mvGlbSetStartVec(wpMOVECAL_s* pMvCal, int index, wpVEC3D_s vec);

 

// added 3/7/00

// sets the number of strings in the move structure

wpDllExportC void mvGlbSetStrNum(wpMOVECAL_s* pMvCal, int num);

 

// added 3/7/00

// sets the string at index in the move structure

wpDllExportC void mvGlbSetStrAt(wpMOVECAL_s* pMvCal, int index, const char* pstr);

 

// added 4/30/02

// sets the move name in the move structure

wpDllExportC void mvGlbSetName(wpMOVECAL_s* pMvCal, const char* pstr);

 

// added 3/7/00

// sets the number of real values in the move structure

wpDllExportC void mvGlbSetDblNum(wpMOVECAL_s* pMvCal, int num);

 

// added 4/30/02

// sets the move ID in the move structure

wpDllExportC void mvGlbSetMoveID(wpMOVECAL_s* pMvCal, wpLONG id);

 

// added 4/30/02

// sets the move's parent part ID in the move structure

wpDllExportC void mvGlbSetParentPartID(wpMOVECAL_s* pMvCal, wpLONG id);

 

// added 3/7/00

// sets the real value at index in the move structure

wpDllExportC void mvGlbSetDblAt(wpMOVECAL_s* pMvCal, int index, double value);

 

// modified 4/30/02

// renamed and modified to only store the IDs of the move parts

// added 6/19/00

// sets the number of IDs in the move structure

//wpDllExportC void mvGlbSetIDNum(wpMOVECAL_s* pMvCal, int num);

wpDllExportC void mvGlbSetMovePartIDNum(wpMOVECAL_s* pMvCal, int num);

 

// modified 4/24/02

// renamed and modified to only store the IDs of the move parts

// added 6/19/00

// sets the ID at index in the move structure

//wpDllExportC void mvGlbSetIDAt(wpMOVECAL_s* pMvCal, int index, int ID);

wpDllExportC void mvGlbSetMovePartIDAt(wpMOVECAL_s* pMvCal, int index, wpLONG id);

 

// added 5/1/02

// sets the move part's name at index in the move structure

wpDllExportC void mvGlbSetMovePartNameAt(wpMOVECAL_s* pTlCal, int index, const char* pstr);

 

// added 6/20/00

// sets the number of flexible parts in the move structure

wpDllExportC void mvGlbSetFlexPartNum(wpMOVECAL_s* pMvCal, int partNum);

 

// added 6/20/00

// sets the number of points in the flexible part at index in the move structure

wpDllExportC void mvGlbSetFlexPartPtNumAtIndex(wpMOVECAL_s* pMvCal, int ptNum, int partIndex);

 

// added 6/20/00

// sets the point coords in the flexible part at index in the move structure

wpDllExportC void mvGlbSetFlexVec(wpMOVECAL_s* pMvCal, int ptIndex, int partIndex, wpVEC3D_s vec);

 

// added 5/2/02

// sets the nominal build flag in the move structure

wpDllExportC void mvGlbSetNominalBuildFlag(wpMOVECAL_s* pMvCal, wpBOOL isNomiBuild);

 

// added 5/2/02

// sets the status of the dialog operation in the move structure

wpDllExportC void mvGlbSetDialogStatus(wpMOVECAL_s* pMvCal, int status);

 

// added 5/2/02

// sets the index of the dialog operation in the move structure

wpDllExportC void mvGlbSetDialogIndex(wpMOVECAL_s* pMvCal, int index);

 

// added 7/15/02

// sets the string related to the dialog operation move structure

wpDllExportC void mvGlbSetDialogString(wpMOVECAL_s* pMvCal, const char* pstr);

 

 

// === other functions === (typically not called by user-dll)

 

// initializes the move structure

wpDllExportC void mvGlbInitMoveCalInfo(wpMOVECAL_s* pMvCal);

 

// deallocates the memory in the move structure

wpDllExportC void mvGlbCleanMoveCalInfo(wpMOVECAL_s* pMvCal);

 

// sets the number of targeted object vectors in the move structure

wpDllExportC void mvGlbSetTgtedObjVecNum(wpMOVECAL_s* pMvCal, int num);

 

// returns the targeted object vector at index in the move structure

wpDllExportC wpVEC3D_s mvGlbGetTgtedObjVec(wpMOVECAL_s* pMvCal, int index);

 

// sets the targeted object vector at index in the move structure

wpDllExportC void mvGlbSetTgtedObjVec(wpMOVECAL_s* pMvCal, int index, wpVEC3D_s vec);

 

// sets the rotation angle at index in the move structure

wpDllExportC void mvGlbSetRtAngle(wpMOVECAL_s* pMvCal, int index, double angle);

 

// end move utility function definitions

 

 

 

7.) TOLERANCE STRUCTURE

 

// =======================================================

// tolerance structure definition ========================

// =======================================================

typedef struct wpTOLECAL_d

{

 

// ===================== input data ======================

 

int m_NumPt3Vec; // number of points

wpVEC3D_s* m_Pt3Vec; // point coordinates

double* m_Pt3Val; // circle radii (R<0 if no circle at point)

wpBOOL* m_Pt3Pin; // circle pin flags (wpFALSE if is hole or no circle)

 

char** m_PtNames; // point names, added 5/1/02

 

int* m_PtParentIDs; // point parent IDs, added 7/15/02

 

int m_NumDirVec; // number of direction vectors

wpVEC3D_s* m_DirVec; // direction vectors

wpVEC3D_s* m_StartV; // start angle vectors

 

int m_NumRanVal; // number of random values (#rand val * #outputs)

 

double* m_MagVal; // magnitudes of random values (radians if is angle)

wpBOOL* m_IsAngVal; // angle flags set for random values that are angles

 

int m_NumRanInputs; // number of random inputs (#rand val only), added 5/2/02

int* m_RanDistribTypes; // distribution types of random values, added 5/1/02

double* m_RanRanges; // ranges of random value, added 5/1/02

double* m_RanOffsets; // offsets of random values, added 5/1/02

double* m_RanMinTruncs; // min truncations of random values, added 5/1/02

double* m_RanMaxTruncs; // max truncations of random values, added 5/1/02

wpBOOL* m_RanIsMinTruncs; // min truncation flags of random values, added 5/1/02

wpBOOL* m_RanIsMaxTruncs; // max truncation flags of random values, added 5/1/02

double* m_RanScales; // scales for random values, added 5/1/02

int* m_RanSigmaNums; // sigma nums of random values, added 5/1/02

int* m_RanHLMLevels; // HLM levels of random values, added 5/1/02

 

wpBOOL m_IsUseCenter; // center point flag

wpVEC3D_s m_Center; // center point coordinates

 

int m_NumStr; // number of strings

char** m_StrArray; // string list

 

int m_NumDbls; // number of doubles added 3/7/00

double* m_DblArray; // real value array added 3/7/00

 

int m_NumDeltaVec; // number of output vectors (group==1, else==ptNum)

 

wpBOOL m_IsNominalBuild; // indicates nominal build status

int m_IsSimuOrSens; // Simulation or Sensitivity run flag (0==simu, 1==sens)

 

wpLONG m_ToleID; // the ID of this tolerance, added 4/30/02

wpLONG m_ParentPartID; // the ID of the parent part of this tolerance, added 4/30/02

 

char* m_ToleName; // name of tolerance in dialog, added 4/30/02

 

int m_DlgStatus; // indicates status of dialog if in dialog mode, added 4/30/02

int m_DlgIndex; // usable index when needed by dialog status, added 4/30/02

char* m_DlgString; // usable string when needed by dialog status, added 7/15/02

 

 

// ===================== output data =====================

 

wpVEC3D_s* m_DeltaVec; // deviation vectors to be applied

 

 

// ============ composite tolerance variables =============

 

// common

int m_ConditionType; // condition type (Profile: 0==flatness,1==parallelism,

// 2==perpendicularity,3==angularity,4==profile

// TruePos: 0==composite, 1==dual)

 

double m_ConditionValue; // condition value

int m_ConditionDatums; // datums condition (0 = none, 1 = A, 2 = AB)

 

// profile-specific

double m_ProfileValue; // Profile value

double m_FlatnessValue[2]; // Flatness values

 

int m_NumDatumPt3Vec; // number of datum points

wpVEC3D_s* m_DatumPt3Vec; // datum point coordinates

 

int m_NumDatumDirVec; // number of datum direction vectors

wpVEC3D_s* m_DatumDirVec; // datum direction vectors

 

int m_NumDatumStr; // number of datum strings

char** m_DatumStrArray; // names of datum points

 

// true position-specific

double m_TruePos1; // 1st True Position value

double m_TruePos2; // 2nd True Position value

double* m_Pt3MMC; // MMC conditions

 

wpBOOL m_IsGroup; // group flag

 

int m_ErrorCode; // error code index

 

} wpTOLECAL_s;

 

// end tolerance structure definition

 

 

 

8.) TOLERANCE FUNCTIONS

 

// =======================================================

// tolerance utility function definitions ================

// =======================================================

 

// ===================== input data ======================

 

// added 7/15/02

// returns the number of point in the tolerance structure

wpDllExportC int tlGlbGetPtNum(wpTOLECAL_s* pTlCal);

 

// returns the coordinates of the point at index in the tolerance structure

wpDllExportC wpVEC3D_s tlGlbGetPtVec(wpTOLECAL_s* pTlCal, int index);

 

// returns the radius of the circle on the point at index in the tolerance structure,

// returns a negative value if there is no circle on the point

wpDllExportC double tlGlbGetPtVal(wpTOLECAL_s* pTlCal, int index);

 

// determines if there is a pin at the point at index in the tolerance structure,

// returns wpFALSE if there is no circle at the point or if the circle is a hole

wpDllExportC wpBOOL tlGlbIsPtPin(wpTOLECAL_s* pTlCal, int index);

 

// added 7/15/02

// returns the parent ID of the point at index in the tolerance structure,

wpDllExportC int tlGlbGetPtParentIDAt(wpTOLECAL_s* pTlCal, int index);

 

// added 5/1/02

// returns the point name at index in the tolerance structure

wpDllExportC char* tlGlbGetPtNameAt(wpTOLECAL_s* pTlCal, int index);

 

// returns the direction vector at index in the tolerance structure

wpDllExportC wpVEC3D_s tlGlbGetDirVec(wpTOLECAL_s* pTlCal, int index);

 

// returns the start angle vector at index in the tolerance structure

wpDllExportC wpVEC3D_s tlGlbGetStartVec(wpTOLECAL_s* pTlCal, int index);

 

// added 5/2/02

// returns the number of random values in the tolerance structure

wpDllExportC int tlGlbGetRandomValNum(wpTOLECAL_s* pTlCal);

 

// returns the magnitude of the random value at index in the tolerance structure

wpDllExportC double tlGlbGetRandomMagVal(wpTOLECAL_s* pTlCal, int index);

 

// determines if the random value at index is an angle in the tolerance structure

wpDllExportC wpBOOL tlGlbGetRandomIsAngVal(wpTOLECAL_s* pTlCal, int index);

 

// added 5/2/02

// returns the number of random inputs in the tolerance structure

wpDllExportC int tlGlbGetRandomInputNum(wpTOLECAL_s* pTlCal);

 

// added 5/1/02

// returns the distribution type of the random value at index in the tolerance structure

wpDllExportC int tlGlbGetRanDistributionAt(wpTOLECAL_s* pTlCal, int index);

 

// added 5/1/02

// returns the range of the random value at index in the tolerance structure

wpDllExportC double tlGlbGetRanRangeAt(wpTOLECAL_s* pTlCal, int index);

 

// added 5/1/02

// returns the offset of the random value at index in the tolerance structure

wpDllExportC double tlGlbGetRanOffsetAt(wpTOLECAL_s* pTlCal, int index);

 

// added 5/1/02

// returns the min truncation of the random value at index in the tolerance structure

wpDllExportC double tlGlbGetRanMinTruncationAt(wpTOLECAL_s* pTlCal, int index);

 

// added 5/1/02

// returns the max truncation of the random value at index in the tolerance structure

wpDllExportC double tlGlbGetRanMaxTruncationAt(wpTOLECAL_s* pTlCal, int index);

 

// added 5/1/02

// returns the min truncation flag of the random value at index in the tolerance structure

wpDllExportC wpBOOL tlGlbGetMinTruncationFlagAt(wpTOLECAL_s* pTlCal, int index);

 

// added 5/1/02

// returns the max truncation flag of the random value at index in the tolerance structure

wpDllExportC wpBOOL tlGlbGetMaxTruncationFlagAt(wpTOLECAL_s* pTlCal, int index);

 

// added 5/1/02

// returns the scale of the random value at index in the tolerance structure

wpDllExportC double tlGlbGetRanScaleAt(wpTOLECAL_s* pTlCal, int index);

 

// added 5/1/02

// returns the sigma-num of the random value at index in the tolerance structure

wpDllExportC int tlGlbGetRanSigmaNumAt(wpTOLECAL_s* pTlCal, int index);

 

// added 5/1/02

// returns the HLM level of the random value at index in the tolerance structure

wpDllExportC int tlGlbGetRanHLMLevelAt(wpTOLECAL_s* pTlCal, int index);

 

// returns the string at index in the tolerance structure

wpDllExportC char* tlGlbGetStrAt(wpTOLECAL_s* pTlCal, int index);

 

// added 4/30/02

// returns the number of strings in the tolerance structure

wpDllExportC int tlGlbGetStrNum(wpTOLECAL_s* pTlCal);

 

// added 3/7/00

// returns the real value at index in the tolerance structure

wpDllExportC double tlGlbGetDblAt(wpTOLECAL_s* pTlCal, int index);

 

// added 4/30/02

// returns the number of doubles in the tolerance structure

wpDllExportC int tlGlbGetDblNum(wpTOLECAL_s* pTlCal);

 

// added 4/30/02

// returns the ID of this tolerance in the tolerance structure

wpDllExportC wpLONG tlGlbGetToleID(wpTOLECAL_s* pTlCal);

 

// added 4/30/02

// returns the ID of the parent part of this tolerance in the tolerance structure

wpDllExportC wpLONG tlGlbGetParentPartID(wpTOLECAL_s* pTlCal);

 

// added 5/2/02

// returns the number of outputs in the tolerance structure

wpDllExportC int tlGlbGetDeltaVecNum(wpTOLECAL_s* pTlCal);

 

// added 5/2/02

// returns the nominal build flag in the tolerance structure

wpDllExportC wpBOOL tlGlbGetNominalBuildFlag(wpTOLECAL_s* pTlCal);

 

// added 5/2/02

// returns the status of the dialog operation in the tolerance structure

wpDllExportC int tlGlbGetDialogStatus(wpTOLECAL_s* pTlCal);

 

// added 5/2/02

// returns the index of the dialog operation in the tolerance structure

wpDllExportC int tlGlbGetDialogIndex(wpTOLECAL_s* pTlCal);

 

 

 

// ===================== output data =====================

 

// sets the output vector at index in the tolerance structure

wpDllExportC void tlGlbSetDeltaVec(wpTOLECAL_s* pTlCal, int index, wpVEC3D_s vec);

 

 

 

// === set functions === (typically not used by user-dll)

 

// sets the number of points in the tolerance structure

wpDllExportC void tlGlbSetPtVecNum(wpTOLECAL_s* pTlCal, int vecNum);

 

// sets the coordinates of the point at index in the tolerance structure

wpDllExportC void tlGlbSetPtVec(wpTOLECAL_s* pTlCal, int index, wpVEC3D_s vec);

 

// sets the radius of the circle on the point at index in the tolerance structure

wpDllExportC void tlGlbSetPtVal(wpTOLECAL_s* pTlCal, int index, double value);

 

// sets the point at index in the tolerance structure as having a pin

wpDllExportC void tlGlbSetPtAsPin(wpTOLECAL_s* pTlCal, int index, wpBOOL isPin);

 

// added 5/1/02

// sets the point name at index in the tolerance structure

wpDllExportC void tlGlbSetPtNameAt(wpTOLECAL_s* pTlCal, int index, const char* pstr);

 

// added 7/15/02

// sets the parent ID of the point at index in the tolerance structure

wpDllExportC void tlGlbSetPtParentIDAt(wpTOLECAL_s* pTlCal, int index, int parentID);

 

// sets the number of directions in the tolerance structure

wpDllExportC void tlGlbSetDirVecNum(wpTOLECAL_s* pTlCal, int num);

 

// sets the direction vector at index in the tolerance structure

wpDllExportC void tlGlbSetDirVec(wpTOLECAL_s* pTlCal, int index, wpVEC3D_s vec);

 

// sets the start angle vector at index in the tolerance structure

wpDllExportC void tlGlbSetStartVec(wpTOLECAL_s* pTlCal, int index, wpVEC3D_s vec);

 

// renamed 5/2/02

// sets the number of random values in the tolerance structure

//wpDllExportC void tlGlbSetRandomInputNum(wpTOLECAL_s* pTlCal, int num);

wpDllExportC void tlGlbSetRandomValNum(wpTOLECAL_s* pTlCal, int num);

 

// sets the magnitude of the random number at index in the tolerance structure

wpDllExportC void tlGlbSetRandomMagVal(wpTOLECAL_s* pTlCal, int index, double value);

 

// sets the random number at index in the tolerance structure as being an angle

wpDllExportC void tlGlbSetRandomAsAngVal(wpTOLECAL_s* pTlCal, int index, wpBOOL isTrue);

 

// sets the number of random numbers in the tolerance structure

wpDllExportC void tlGlbSetRandomInputsNum(wpTOLECAL_s* pTlCal, int num);

 

// added 5/1/02

// returns the distribution type of the random value at index in the tolerance structure

wpDllExportC void tlGlbSetRanDistributionAt(wpTOLECAL_s* pTlCal, int index, int distribution);

 

// added 5/1/02

// returns the range of the random value at index in the tolerance structure

wpDllExportC void tlGlbSetRanRangeAt(wpTOLECAL_s* pTlCal, int index, double offset);

 

// added 5/1/02

// returns the offset of the random value at index in the tolerance structure

wpDllExportC void tlGlbSetRanOffsetAt(wpTOLECAL_s* pTlCal, int index, double range);

 

// added 5/1/02

// returns the min truncation of the random value at index in the tolerance structure

wpDllExportC void tlGlbSetRanMinTruncationAt(wpTOLECAL_s* pTlCal, int index, double min_truncation);

 

// added 5/1/02

// returns the max truncation of the random value at index in the tolerance structure

wpDllExportC void tlGlbSetRanMaxTruncationAt(wpTOLECAL_s* pTlCal, int index, double max_truncation);

 

// added 5/1/02

// returns the min truncation flag of the random value at index in the tolerance structure

wpDllExportC void tlGlbSetMinTruncationFlagAt(wpTOLECAL_s* pTlCal, int index, wpBOOL min_trunc_flag);

 

// added 5/1/02

// returns the max truncation flag of the random value at index in the tolerance structure

wpDllExportC void tlGlbSetMaxTruncationFlagAt(wpTOLECAL_s* pTlCal, int index, wpBOOL max_trunc_flag);

 

// added 5/1/02

// returns the scale of the random value at index in the tolerance structure

wpDllExportC void tlGlbSetRanScaleAt(wpTOLECAL_s* pTlCal, int index, double scale);

 

// added 5/1/02

// returns the sigma-num of the random value at index in the tolerance structure

wpDllExportC void tlGlbSetRanSigmaNumAt(wpTOLECAL_s* pTlCal, int index, int sigma_num);

 

// added 5/1/02

// returns the HLM level of the random value at index in the tolerance structure

wpDllExportC void tlGlbSetRanHLMLevelAt(wpTOLECAL_s* pTlCal, int index, int hlm_level);

 

// sets the coordinates of the center point in the tolerance structure

wpDllExportC void tlGlbSetCenterVec(wpTOLECAL_s* pTlCal, wpVEC3D_s vec);

 

// sets the number of strings in the tolerance structure

wpDllExportC void tlGlbSetStrNum(wpTOLECAL_s* pTlCal, int num);

 

// sets the string at index in the tolerance structure

wpDllExportC void tlGlbSetStrAt(wpTOLECAL_s* pTlCal, int index, const char* pstr);

 

// added 4/30/02

// sets the tolerance name in the tolerance structure

wpDllExportC void tlGlbSetName(wpTOLECAL_s* pTlCal, const char* pstr);

 

// added 3/7/00

// sets the number of real values in the tolerance structure

wpDllExportC void tlGlbSetDblNum(wpTOLECAL_s* pTlCal, int num);

 

// added 3/7/00

// sets the real value at index in the tolerance structure

wpDllExportC void tlGlbSetDblAt(wpTOLECAL_s* pTlCal, int index, double value);

 

// added 4/30/02

// sets the tolerance ID in the tolerance structure

wpDllExportC void tlGlbSetToleID(wpTOLECAL_s* pTlCal, wpLONG id);

 

// added 4/30/02

// sets the tolerance's parent part ID in the tolerance structure

wpDllExportC void tlGlbSetParentPartID(wpTOLECAL_s* pTlCal, wpLONG id);

 

// sets the number of outputs in the tolerance structure

wpDllExportC void tlGlbSetDeltaVecNum(wpTOLECAL_s* pTlCal, int num);

 

// sets the nominal build flag in the tolerance structure

wpDllExportC void tlGlbSetNominalBuildFlag(wpTOLECAL_s* pTlCal, wpBOOL isNomiBuild);

 

// sets the analysis type flag in the tolerance structure (0==simu, 1==sens)

wpDllExportC void tlGlbSetSimuOrSens(wpTOLECAL_s* pTlCal, int simuorsens);

 

// added 5/2/02

// returns the status of the dialog operation in the tolerance structure

wpDllExportC void tlGlbSetDialogStatus(wpTOLECAL_s* pTlCal, int status);

 

// added 5/2/02

// returns the index of the dialog operation in the tolerance structure

wpDllExportC void tlGlbSetDialogIndex(wpTOLECAL_s* pTlCal, int index);

 

// added 7/15/02

// sets the string related to the dialog operation tolerance structure

wpDllExportC void tlGlbSetDialogString(wpMOVECAL_s* pMvCal, const char* pstr);

 

 

// === other functions === (typically not used by user-dll)

 

// initialize the tolerance structure

wpDllExportC void tlGlbInitToleCalInfo(wpTOLECAL_s* pTlCal);

 

// deallocates the memory in the tolerance structure

wpDllExportC void tlGlbCleanToleCalInfo(wpTOLECAL_s* pTlCal);

 

// returns the output vector at index in the tolerance structure

wpDllExportC wpVEC3D_s tlGlbGetDeltaVec(wpTOLECAL_s* pTlCal, int index);

 

// returns the coordinates of the center point in the tolerance structure

wpDllExportC wpVEC3D_s tlGlbGetCenterVec(wpTOLECAL_s* pTlCal);

 

 

// === composite tolerancing functions === (typically not used by user-dll)

 

// common

// sets the 2nd condition value in the tolerance structure

wpDllExportC void tlGlbSet2ndCondition(wpTOLECAL_s* pTlCal, int type,

double value, int datums);

 

// profile-specific

// sets the number of datum points in the tolerance structure

wpDllExportC void tlGlbSetDatumPtVecNum(wpTOLECAL_s* pTlCal, int vecNum);

 

// sets the coordinates of the datum point at index in the tolerance structure

wpDllExportC void tlGlbSetDatumPtVec(wpTOLECAL_s* pTlCal, int index, wpVEC3D_s vec);

 

// sets the number of datum point name strings in the tolerance structure

wpDllExportC void tlGlbSetDatumStrNum(wpTOLECAL_s* pTlCal, int num);

 

// sets the datum point name string at index in the tolerance structure

wpDllExportC void tlGlbSetDatumStrAt(wpTOLECAL_s* pTlCal, int index, const char* pstr);

 

// sets the number of direction vectors in the tolerance structure

wpDllExportC void tlGlbSetDatumDirVecNum(wpTOLECAL_s* pTlCal, int num);

 

// sets the direction vector at index in the tolerance structure

wpDllExportC void tlGlbSetDatumDirVec(wpTOLECAL_s* pTlCal, int index, wpVEC3D_s vec);

 

// sets the profile value in the tolerance structure

wpDllExportC void tlGlbSetProfileVal(wpTOLECAL_s* pTlCal, double value);

 

// sets the flatness value at index in the tolerance structure

wpDllExportC void tlGlbSetFlatnessVals(wpTOLECAL_s* pTlCal, int index, double value);

 

// true position-specific

// sets the group flag in the tolerance structure

wpDllExportC void tlGlbSetAsGroup(wpTOLECAL_s* pTlCal, wpBOOL isGroup);

 

// sets the true position values in the tolerance structure

wpDllExportC void tlGlbSetTruePosVals(wpTOLECAL_s* pTlCal, double truepos1,

double truepos2);

 

// sets the MMC sizes in the tolerance structure

wpDllExportC void tlGlbSetMMCSize(wpTOLECAL_s* pTlCal, int index, double sizeAtMMC);

 

// end tolerance utility function definitions

 

 

 

9.) MEASURE STRUCTURE

 

// =======================================================

// measure structure definition ==========================

// =======================================================

typedef struct wpMEASCAL_d

{

 

// ===================== input data ======================

 

// int m_NumPt3Vec; // number of points, removed 5/1/02

// int m_NumPt3Vec1; // number of points in first list, removed 5/1/02

int m_PtList1Num; // number of points in first list, added 5/1/02

int m_PtList2Num; // number of points in second list, added 5/1/02

// wpVEC3D_s* m_Pt3Vec; // point coordinates, removed 5/1/02

wpVEC3D_s* m_PtList1Coords; // point coordinates for points in list1, added 5/1/02

wpVEC3D_s* m_PtList2Coords; // point coordinates for points in list2, added 5/1/02

 

// point radii: R<0 if no circle at point

// wpDBLE* m_Pt3Val; // circle radii, removed 5/1/02

wpDBLE* m_PtList1Radii; // circle radii for points in list1, added 5/1/02

wpDBLE* m_PtList2Radii; // circle radii for points in list2, added 5/1/02

 

// wpBOOL* m_Pt3Pin; // circle pin flags, removed 5/1/02

// hole/pin flags: wpFALSE if is hole or no circle

wpBOOL* m_PtList1PinFlags; // circle pin flags for points in list1, added 5/1/02

wpBOOL* m_PtList2PinFlags; // circle pin flags for points in list2, added 5/1/02

 

char** m_PtList1Names; // point names from list1, added 5/1/02

char** m_PtList2Names; // point names from list2, added 5/1/02

 

int* m_PtList1ParentIDs; // point parent part IDs from list1, added 7/15/02

int* m_PtList2ParentIDs; // point parent part IDs from list2, added 7/15/02

 

int m_NumDirVec; // number of direction vectors

wpVEC3D_s* m_DirVec; // direction vectors

wpVEC3D_s* m_StartV; // start angle vectors

wpBOOL m_IsDirAsPlaneVec; // planar vector flag

 

double m_Scale; // scale

 

wpVEC3D_s m_NomiVec; // nominal vector

 

int m_NumSubMeas; // number of sub-measures

double* m_SubMeasVal; // values of sub-measures

// double* m_LslVal; // Lower specification limits of sub-measures

// double* m_UslVal; // Upper specification limits of sub-measures

double* m_SubMeasLslVals; // Lower specification limits of sub-measures, renamed 5/1/02

double* m_SubMeasUslVals; // Upper specification limits of sub-measures, renamed 5/1/02

 

int m_NumStr; // number of strings added 3/7/00

char** m_StrArray; // string array added 3/7/00

 

int m_NumDbls; // number of doubles added 3/7/00

double* m_DblArray; // real value array added 3/7/00

 

double m_MeasUsl; // upper spec limit for this measure, added 5/1/02

double m_MeasLsl; // lower spec limit for this measure, added 5/1/02

wpBOOL m_MeasIsRelative; // measurement mode, relative or absolute, added 5/1/02

 

wpBOOL m_IsNominalBuild; // indicates nominal build status, added 1/19/00

 

wpLONG m_MeasID; // the ID of this measure, added 4/30/02

wpLONG m_ParentPartID; // the ID of the parent part of this measure, added 4/30/02

 

char* m_MeasName; // name of measure routine, added 4/30/02

 

int m_DlgStatus; // indicates status of dialog if in dialog mode, added 4/30/02

int m_DlgIndex; // usable index when needed by dialog status, added 4/30/02

char* m_DlgString; // usable string when needed by dialog status, added 7/15/02

 

// ===================== output data =====================

double m_Output; // output result

 

wpBOOL m_IsOutputOk; // success flag, set to wpTRUE by call to SetValue()

 

} wpMEASCAL_s;

 

// end measure structure definitions

 

 

 

10.) MEASURE FUNCTIONS

 

// =======================================================

// measure utility function definitions ==================

// =======================================================

 

// ===================== input data ======================

 

// added 7/15/02

// returns the number of points in list1 in the measure structure

wpDllExportC int msGlbGetPtList1Num(wpMEASCAL_s* pMsCal);

 

// added 7/15/02

// returns the number of points in list2 in the measure structure

wpDllExportC int msGlbGetPtList2Num(wpMEASCAL_s* pMsCal);

 

// modified 5/1/02

// separated into 2 functions for point lists 1 & 2

// returns the coordinates of the point in list1 at index in the measure structure

//wpDllExportC wpVEC3D_s msGlbGetPtVec(wpMEASCAL_s* pMsCal, int index);

wpDllExportC wpVEC3D_s msGlbGetPtList1VecAt(wpMEASCAL_s* pMsCal, int index);

 

// added 5/1/02

// returns the coordinates of the point in list2 at index in the measure structure

wpDllExportC wpVEC3D_s msGlbGetPtList2VecAt(wpMEASCAL_s* pMsCal, int index);

 

// modified 5/1/02

// separated into 2 functions for point lists 1 & 2

// returns the radius of circle on the point in list1 at index in the measure structure

// returns a negative value if there is no circle on the point

//wpDllExportC double msGlbGetPtVal(wpMEASCAL_s* pMsCal, int index);

wpDllExportC double msGlbGetPtList1RadiusAt(wpMEASCAL_s* pMsCal, int index);

 

// added 5/1/02

// returns the radius of circle on the point in list2 at index in the measure structure

// returns a negative value if there is no circle on the point

wpDllExportC double msGlbGetPtList2RadiusAt(wpMEASCAL_s* pMsCal, int index);

 

// modified 5/1/02

// separated into 2 functions for point lists 1 & 2

// determines if there is a pin on the point in list1 at index in the measure structure

//wpDllExportC wpBOOL msGlbIsPtPin(wpMEASCAL_s* pMsCal, int index);

wpDllExportC wpBOOL msGlbGetPtList1PinFlagAt(wpMEASCAL_s* pMsCal, int index);

 

// added 5/1/02

// determines if there is a pin on the point in list2 at index in the measure structure

wpDllExportC wpBOOL msGlbGetPtList2PinFlagAt(wpMEASCAL_s* pMsCal, int index);

 

// added 7/15/02

// obtains the parent ID of the point at index in list 1 in the measure structure

wpDllExportC int msGlbGetPtList1ParentIDAt(wpMEASCAL_s* pMsCal, int index);

 

// added 7/15/02

// obtains the parent ID of the point at index in list 2 in the measure structure

wpDllExportC int msGlbGetPtList2ParentIDAt(wpMEASCAL_s* pMsCal, int index);

 

// added 5/1/02

// returns the point name in list1 at index in the measure structure

wpDllExportC char* msGlbGetPtList1NameAt(wpMEASCAL_s* pMsCal, int index);

 

// added 5/1/02

// returns the point name in list2 at index in the measure structure

wpDllExportC char* msGlbGetPtList2NameAt(wpMEASCAL_s* pMsCal, int index);

 

// returns the direction vector at index in the measure structure

wpDllExportC wpVEC3D_s msGlbGetDirVec(wpMEASCAL_s* pMsCal, int index);

 

// returns the start angle vector at index in the measure structure

wpDllExportC wpVEC3D_s msGlbGetStartVec(wpMEASCAL_s* pMsCal, int index);

 

// returns the scale in the measure structure

wpDllExportC double msGlbGetScale(wpMEASCAL_s* pMsCal);

 

// returns the nominal vector in the measure structure

wpDllExportC wpVEC3D_s msGlbGetNominalVec(wpMEASCAL_s* pMsCal);

 

// added 4/30/02

// returns the number of strings in the measure structure

wpDllExportC int msGlbGetStrNum(wpMEASCAL_s* pMsCal);

 

// added 3/7/00

// returns the string at index in the measure structure

wpDllExportC char* msGlbGetStrAt(wpMEASCAL_s* pMsCal, int index);

 

// added 4/30/02

// returns the number of doubles in the measure structure

wpDllExportC int msGlbGetDblNum(wpMEASCAL_s* pMsCal);

 

// added 3/7/00

// returns the real value at index in the measure structure

wpDllExportC double msGlbGetDblAt(wpMEASCAL_s* pMsCal, int index);

 

// added 5/1/02

// returns the upper spec limit in the measure structure

wpDllExportC double msGlbGetUSL(wpMEASCAL_s* pMsCal);

 

// added 5/1/02

// returns the lower spec limit in the measure structure

wpDllExportC double msGlbGetLSL(wpMEASCAL_s* pMsCal);

 

// added 5/1/02

// returns the mode in the measure structure

// wpFALSE if Absolute, wpTRUE if Relative

wpDllExportC wpBOOL msGlbIsRelativeMode(wpMEASCAL_s* pMsCal);

 

// added 4/30/02

// returns the ID of this measure in the measure structure

wpDllExportC wpLONG msGlbGetMeasID(wpMEASCAL_s* pMsCal);

 

// added 4/30/02

// returns the ID of the parent part of this measure in the measure structure

wpDllExportC wpLONG msGlbGetParentPartID(wpMEASCAL_s* pMsCal);

 

// added 5/2/02

// returns the nominal build flag in the measure structure

wpDllExportC wpBOOL msGlbGetNominalBuildFlag(wpMEASCAL_s* pMsCal);

 

// added 5/2/02

// returns the status of the dialog operation in the measure structure

wpDllExportC int msGlbGetDialogStatus(wpMEASCAL_s* pMsCal);

 

// added 5/2/02

// returns the index of the dialog operation in the measure structure

wpDllExportC int msGlbGetDialogIndex(wpMEASCAL_s* pMsCal);

 

 

// ===================== output data =====================

 

// sets the output result in the measure structure

wpDllExportC void msGlbSetMeasVal(wpMEASCAL_s* pMsCal, double value);

 

 

// === set functions === (typically not used by user-dll)

 

// modified 5/1/02

// separated into 2 functions for point lists 1 & 2

// sets the number of points in list1 in the measure structure

//wpDllExportC void msGlbSetPtVecNum(wpMEASCAL_s* pMsCal, int vecNum);

wpDllExportC void msGlbSetPtList1Num(wpMEASCAL_s* pMsCal, int ptNum);

 

// added 5/1/02

// sets the number of points in list2 in the measure structure

wpDllExportC void msGlbSetPtList2Num(wpMEASCAL_s* pMsCal, int ptNum);

 

// removed 5/1/02

// separated into 2 functions for point lists 1 & 2

// sets the number of points in the first list in the measure structure

//wpDllExportC void msGlbSetPtVecNum1(wpMEASCAL_s* pMsCal, int ptNum1);

 

// modified 5/1/02

// separated into 2 functions for point lists 1 & 2

// sets the coordinates of the point in list1 at index in the measure structure

//wpDllExportC void msGlbSetPtVec(wpMEASCAL_s* pMsCal, int index, wpVEC3D_s vec);

wpDllExportC void msGlbSetPtList1VecAt(wpMEASCAL_s* pMsCal, int index, wpVEC3D_s vec);

 

// added 5/1/02

// sets the coordinates of the point in list2 at index in the measure structure

wpDllExportC void msGlbSetPtList2VecAt(wpMEASCAL_s* pMsCal, int index, wpVEC3D_s vec);

 

// modified 5/1/02

// separated into 2 functions for point lists 1 & 2

// sets the radius of the circle on the point in list1 at index in the measure structure

//wpDllExportC void msGlbSetPtVal(wpMEASCAL_s* pMsCal, int index, double value);

wpDllExportC void msGlbSetPtList1RadiusAt(wpMEASCAL_s* pMsCal, int index, double value);

 

// added 5/1/02

// sets the radius of the circle on the point in list2 at index in the measure structure

wpDllExportC void msGlbSetPtList2RadiusAt(wpMEASCAL_s* pMsCal, int index, double value);

 

// modified 5/1/02

// separated into 2 functions for point lists 1 & 2

// sets the point in list1 at index in the measure structure as having a pin

//wpDllExportC void msGlbSetPtAsPin(wpMEASCAL_s* pMsCal, int index, wpBOOL isPin);

wpDllExportC void msGlbSetPtList1PinFlagAt(wpMEASCAL_s* pMsCal, int index, wpBOOL isPin);

 

// added 5/1/02

// sets the point in list2 at index in the measure structure as having a pin

wpDllExportC void msGlbSetPtList2PinFlagAt(wpMEASCAL_s* pMsCal, int index, wpBOOL isPin);

 

// added 7/15/02

// sets the parent ID of the point in list1 at index in the measure structure

wpDllExportC void msGlbSetPtList1ParentIDAt(wpMEASCAL_s* pMsCal, int index, int parentID);

 

// added 7/15/02

// sets the parent ID of the point in list2 at index in the measure structure

wpDllExportC void msGlbSetPtList2ParentIDAt(wpMEASCAL_s* pMsCal, int index, int parentID);

 

// added 5/1/02

// sets the point name in list1 at index in the measure structure

wpDllExportC void msGlbSetPtList1NameAt(wpMEASCAL_s* pMsCal, int index, const char* pstr);

 

// added 5/1/02

// sets the point name in list2 at index in the measure structure

wpDllExportC void msGlbSetPtList2NameAt(wpMEASCAL_s* pMsCal, int index, const char* pstr);

 

// sets the number of direction vectors in the measure structure

wpDllExportC void msGlbSetDirVecNum(wpMEASCAL_s* pMsCal, int num);

 

// sets the direction vector at index in the measure structure

wpDllExportC void msGlbSetDirVec(wpMEASCAL_s* pMsCal, int index, wpVEC3D_s vec);

 

// sets the start angle vector at index in the measure structure

wpDllExportC void msGlbSetStartVec(wpMEASCAL_s* pMsCal, int index, wpVEC3D_s vec);

 

// sets the direction vector at index in the measure structure as being planar

wpDllExportC void msGlbSetDirAsPlaneVec(wpMEASCAL_s* pMsCal, wpBOOL isTrue);

 

// sets the scale in the measure structure

wpDllExportC void msGlbSetScale(wpMEASCAL_s* pMsCal, double scale);

 

// sets the nominal vector in the measure structure

wpDllExportC void msGlbSetNominalVec(wpMEASCAL_s* pMsCal, wpVEC3D_s vec);

 

// sets the number of sub-measures in the measure structure

wpDllExportC void msGlbSetSubMeasNum(wpMEASCAL_s* pMsCal, int msNum);

 

// sets the value of the sub-measure at index in the measure structure

wpDllExportC void msGlbSetSubMeasVal(wpMEASCAL_s* pMsCal, int index, double value);

 

// renamed 5/1/02

// sets the value of the lower spec. limit at index in the measure structure

//wpDllExportC void msGlbSetLslVal(wpMEASCAL_s* pMsCal, int index, double value);

wpDllExportC void msGlbSetSubMeasLslAt(wpMEASCAL_s* pMsCal, int index, double value);

 

// renamed 5/1/02

// sets the value of the upper spec. limit at index in the measure structure

//wpDllExportC void msGlbSetUslVal(wpMEASCAL_s* pMsCal, int index, double value);

wpDllExportC void msGlbSetSubMeasUslAt(wpMEASCAL_s* pMsCal, int index, double value);

 

// added 3/7/00

// sets the number of strings in the measure structure

wpDllExportC void msGlbSetStrNum(wpMEASCAL_s* pMsCal, int num);

 

// added 3/7/00

// sets the string at index in the measure structure

wpDllExportC void msGlbSetStrAt(wpMEASCAL_s* pMsCal, int index, const char* pstr);

 

// added 3/7/00

// sets the number of real values in the measure structure

wpDllExportC void msGlbSetDblNum(wpMEASCAL_s* pMsCal, int num);

 

// added 3/7/00

// sets the real value at index in the measure structure

wpDllExportC void msGlbSetDblAt(wpMEASCAL_s* pMsCal, int index, double value);

 

// added 5/1/02

// sets the upper spec limit in the measure structure

wpDllExportC void msGlbSetUSL(wpMEASCAL_s* pMsCal, double usl);

 

// added 5/1/02

// sets the lower spec limit in the measure structure

wpDllExportC void msGlbSetLSL(wpMEASCAL_s* pMsCal, double lsl);

 

// added 5/1/02

// sets the mode in the measure structure

// wpFALSE if Absolute, wpTRUE if Relative

wpDllExportC void msGlbSetMode(wpMEASCAL_s* pMsCal, wpBOOL isRelative);

 

// added 4/30/02

// sets the measure name in the measure structure

wpDllExportC void msGlbSetName(wpMEASCAL_s* pMsCal, const char* pstr);

 

// added 4/30/02

// sets the measure ID in the measure structure

wpDllExportC void msGlbSetMeasID(wpMEASCAL_s* pMsCal, wpLONG id);

 

// added 4/30/02

// sets the measure's parent part ID in the measure structure

wpDllExportC void msGlbSetParentPartID(wpMEASCAL_s* pMsCal, wpLONG id);

 

// added 5/2/02

// sets the nominal build flag in the measure structure

wpDllExportC void msGlbSetNominalBuildFlag(wpMEASCAL_s* pMsCal, wpBOOL isNomiBuild);

 

// added 5/2/02

// returns the status of the dialog operation in the measure structure

wpDllExportC void msGlbSetDialogStatus(wpMEASCAL_s* pMsCal, int status);

 

// added 5/2/02

// returns the index of the dialog operation in the measure structure

wpDllExportC void msGlbSetDialogIndex(wpMEASCAL_s* pMsCal, int index);

 

// added 7/15/02

// sets the string related to the dialog operation measure structure

wpDllExportC void msGlbSetDialogString(wpMOVECAL_s* pMvCal, const char* pstr);

 

 

// === other functions === (typically not used by user-dll)

 

// initializes the measure structure

wpDllExportC void msGlbInitMeasCalInfo(wpMEASCAL_s* pMsCal);

 

// deallocates the memory in the measure structure

wpDllExportC void msGlbCleanMeasCalInfo(wpMEASCAL_s* pMsCal);

 

// returns the output value in the measure structure

wpDllExportC double msGlbGetMeasVal(wpMEASCAL_s* pMsCal);

 

// returns the value of the sub-measure at index in the measure structure

wpDllExportC double msGlbGetSubMeasVal(wpMEASCAL_s* pMsCal, int index);

 

// renamed 5/1/02

// returns the lower spec limit of the sub-measure at index in the measure structure

//wpDllExportC double msGlbGetLslVal(wpMEASCAL_s* pMsCal, int index);

wpDllExportC double msGlbGetSubMeasLslAt(wpMEASCAL_s* pMsCal, int index);

 

// renamed 5/1/02

// returns the upper spec limit of the sub-measure at index in the measure structure

//wpDllExportC double msGlbGetUslVal(wpMEASCAL_s* pMsCal, int index);

wpDllExportC double msGlbGetSubMeasUslAt(wpMEASCAL_s* pMsCal, int index);

 

// end measure utility function definitions