I3DObject Interface
- GetOrigin
- SetOrigin
- GetAxis
- Translate
- Rotate
I3DObject interface allows modification of position and
orientation of the local frame and hence position and orientation of the
whole object, which implements it.
I3DObject can be obtained by query/cast/coercion from ISection
interface of the correspondent object of the model.
Methods of this interface use coordinates relative to the global axes. Very
often it is more convenient to express rotations or translations of the frame
revative to its current orientation and position. Query
IFrame2 from I3DObject to achieve that.
See also MiniCAD Sample,
IInterface List
HRESULT GetOrigin(double *px, double *py, double *pz)
Parameters
px, py, pz- [out] pointers to variables
which will receive coordinates of the origin.
Returns
S_OK in case of success.
Remarks
Call this method to retrieve coordinates of the origin of the local frame.
HRESULT SetOrigin(double x, double y, double z)
Parameters:
x, y, z - [in] coordinates of new position of
the origin.
Returns
- S_OK in case of success.
-
- Remarks
- Call this method to change position of the local frame.
HRESULT GetAxis(int nAxis, double *x, double *y, double *z)
Parameters
int nAxis - [in] 0-based index of the
axis.
px, py, pz- [out]
pointers to variables which will receive coordinates of the vector
which points in direction of the nAxis-th axis of the
local frame.
Return Values
- S_OK in case of success
- Remarks
-
- RReturns coordinates of vector
which points in direction of the nAxis-th axis of the local
frame.
HRESULT Translate(double vx, double vy, double vz)
Parameters
px, py, pz- [in] step size in x,y and z
direction respectively
Return Values
S_OK in case of success
- Remarks
- Call this method to translate origin of the local frame
along global x axis by vx, along global y axis by vx and along global z axis by vz.
HRESULT Rotate(double dAng, double xAxis, double yAxis, double zAxis,
double vxDirAxis, double vyDirAxis, double vzDirAxis)
Parameters
dAng - [in] angle in
degrees to rotate by. dAng can be negative.
xAxis,yAxis,zAxis- [in] point in global coordinates, where axis or rotation passes
through.
vxDirAxis, vxDirAxis, vxDirAxis - [in] vector in
global coordinates of
direction of the rotation axis
Return
Values
S_OK in case of success
Remarks
Call this method to rotate the local frame around an
arbitrary axis in 3D space.
RotateStd method of IFrame offers a
simplified version of this operation.
|