I2DView_KC Interface
I2DView_KC interface provides access to
2D View in 2D mode of DG Kernel component
I2DView_KC can be queried from IView interface of the component.. Query path: DG Kernel > GetView
> IView > I2DView_KC
See also Interface List
HRESULT GetContext(IKCContext **context)
Parameters
context - [out, retval] IKCContext
implemented by the view
Remarks:
Gives access to properties
of the 2D View
HRESULT AddText(int xLoc, int yLoc, char* text, IText **iText)
Parameters
xLoc, yLoc- [in] location of the text in pixels relative to
the upper left corner of the control's window
text - [in] string of the text item to be added to
the scene
iText- [out, retval] - Not used in
this update. The return is always NULL
Returns
- S_OK in case of
success.
Remarks:
Adds a text string at the location. Use DeviceToGeom
and GeomToDevice to convert to geometric coordinates
in x and y axes. It is recommended to call this method in the end of scene
definition, after geometric objects have been added.
HRESULT DeviceToGeom(int k, int coord, double *val)
Parameters
k- [in] Window coordinate in pixels
from the left edge of the window if coord = 0 and from the top
edge of the window if coord = 1
coord - [in] indicates the coordinate. Valid values:
0 (horizontal) and 1 - (vertical)
val - [out, retval] The returned value of the geometric
coordinate along x (coord = 0) or y axis (coord = 1)
Remarks:
The method converts a window coordinate to geometric coordinate along x (coord
= 0) or y axis (coord = 1). The operation is inverse to
GeomToDevice()
HRESULT GeomToDevice(double val, int coord, int *k)
Parameters
val - [in] Geometric coordinate along x (coord
= 0) or y axis (coord = 1)
coord - [in] indicates the coordinate. Valid values:
0 (horizontal) and 1 - (vertical)
k- [out, retval] Window coordinate
in pixels from the left edge of the window if coord = 0 and from
the top edge of the window if coord = 1
Remarks:
The method converts geometric coordinate along x (coord = 0) or
y axis (coord = 1) to the correspondent window coordinate. The
operation is inverse to DeviceToGeom()
HRESULT RemoveAll()
Remarks:
Removes all items from the 2D View (clears the scene).
HRESULT AddText2(double x, double y, char* text, IText **iText)
Parameters
x, y - [in] 2D geometric coordinates for the location of the
text
text - [in] string of the text item to be added to
the scene
iText- [out, retval] - Not used in
this update. The return is always NULL
Returns
- S_OK in case of
success.
Remarks:
Adds a text string at the location. Use GeomToDevice
and DeviceToGeom
to convert to window coordinates
(pixels). It is recommended to call this method in the end of scene definition,
after geometric objects have been added.
|