IGraphicItem Interface
- Draw
- DrawEx
- AttachView
IGraphicItem interface is implemented by objects, which can be rendered in 3D
view but are not normally part of the scene. Methods of IGraphicItem have to be
called only from inside (between its start and before its end) of handler of
ClientDraw
event. See Patchwork Sample for an
example.
Call either of the methods to render the item. Use
IDraw.Color and other methods of
IDraw to control the way the item is rendered.
Not all objects implement IGraphicItem. Objects which implement
IPatch or ICurve implement IGraphicItem too. There are other obejects, which implement the interface. Please refer to topics for the specific object
Starting from version 5.0 the graphic item has to be aware of the view. This can be achieved during construction of the graphic item with IView*.GetGraphicItem() or by calling the AttachView method
To draw a standalone frame create new Graphic Item object with
IDIObjectGenerator.Create(EObjectType.eObjTypeGraphicItem) and attach
IView
of the component, which must display the frame using AttachView.
.See also Patchwork Sample, Interface List
HRESULT Draw()
Remarks:
The method will draw the item this interface was queried from as part of the
3D scene. See the general description above..
HRESULT DrawEx(RenderContext* context)
Parameters
context - [in]
additional options for rendering
Remarks:
The method will draw the item this interface was queried from as part of the
3D scene. See the general description above. members of context
parameter allow selection between surface and wire frame rendering and whether
normals to the surface should be drawn.
HRESULT AttachView(IView* view)
Parameters
view - [in]
IView
of the component, which is going to display the item
Remarks:
The method attaches view for items, which require the reference (Graphic Item
of a frame). See
CreateFrameGraphicItem() method of
Collision Path
sample for an example. Graphic Items queried from
IPatch or ICurve
do not need this call. See also
Frame Graphic
Item
|