IFrame2 Interface
- Translate
- Rotate
- RotateEx
- Copy
- SetupAxes
The IFrame2 interface allows modification of position and
orientation of a frame, which implements it. As opposed to I3DObject:
or IFrame interface, IFrame2 takes local coordinates in
its methods.
IFrame2 can be obtained by query/cast/coercion from ISection
interface of an object of the model, or from relevant I3DObject:
or IFrame interface.
See also MiniCAD Sample,
Interface List
HRESULT Translate(double vx, double vy, double vz)
Parameters
vx, vy, vz - [in] - Coordinates of
the translation vector relative to local axes of the frame
Returns
- S_OK in case of
success.
- Remarks:
TTranslates origin of the local frame
along its own (local) x axis by vx, along y axis by vx and along z axis by vz. Use I3DObject.Translate
to perform the operation in global coordinates
HRESULT Rotate(double dAng, double vxDirAxis, double vyDirAxis, double vzDirAxis)
Parameters
dAng - [in] angle in degrees to rotate by. dAng can be negative.
vxDirAxis, vyDirAxis, vzDirAxis - [in] vector in local coordinates of direction of the rotation axis
Return Values
- S_OK in case of success.
- Remarks:
Rotates the frame around axis passing through the origin of the frame.
Coordinates vxDirAxis, vxDirAxis, vxDirAxis of the
axis are expressed in local axes of the frame.
HRESULT RotateEx(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 local coordinates, where axis or rotation passes
through.
vxDirAxis, vyDirAxis, vzDirAxis - [in] vector in
local 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. All coordinates are expressed in local axes of the frame. Use I3DObject.Rotate
to perform the operation in global coordinates
HRESULT Copy(IFrame** frame)
Parameters
frame - [in]
IFrame interface implemented by the frame object to be copied.
- Remarks:
- This method will copy position and orientation of frame
into the frame, which implements this interface. For example, when this IFrame2
and frame are queried from two different object.
the first object will be located at the same point and oriented in the same way
as the second object.
HRESULT SetupAxes(int nAxis0, DIVect* axis, int nAxis1)
Parameters
nAxis0 - [in]
0-based index of the axis, which will be directed along axis
nAxis1 - [in]
0-based index of the axis, which will be calculated second
- Remarks:
- Use this method to make sure that nAxis0 is
directed along axis. Direction of others will be modified by
making the current nAxis1 axis perpendicular to axis
nAxis0 and the last axis will be perpendicular to the others.
|