Leaper Vision Toolkit
中文 / English 2.x
Public Member Functions | Properties
ILDisplay Interface Reference

This interface provide functionalities of the display control. More...

Inheritance diagram for ILDisplay:
ILDisplayCommon LDisplay

Public Member Functions

int AddInteractableObject (IDispatch *interactable, int drawFlags)
 
int AddObject (IDispatch *drawable, int drawFlags)
 
int AddRegion (IDispatch *region, BOOL interactable)
 
void ClientToImage (int x, int y, double *imageX, double *imageY)
 
void FitInViewObject (IDispatch *object, LPVAlignment alignFlags)
 
IDispatch * GetImage ()
 
IDispatch * GetObjectByID (int objectId)
 
IDispatch * GetRegionByID (int regionId)
 
void ImageToClient (double imageX, double imageY, int *x, int *y)
 
void RemoveAllObjects ()
 
void RemoveAllRegions ()
 
void RemoveImage ()
 
void RemoveObject (IDispatch *drawable)
 
void RemoveObjectByID (int objectId)
 
void RemoveRegion (IDispatch *region)
 
void RemoveRegionByID (int regionId)
 
void SetImage (IDispatch *image)
 
- Public Member Functions inherited from ILDisplayCommon
int AddReferenceLineH (double position, double relativePosition, BOOL attached, OLE_COLOR clr)
 
int AddReferenceLineV (double position, double relativePosition, BOOL attached, OLE_COLOR clr)
 
void FitInView (int tlx, int tly, int w, int h, LPVAlignment alignFlags)
 
void FitToWindow (LPVAlignment alignFlags)
 
void Refresh ()
 
void RefreshImmediate ()
 
void RemoveAllReferenceLine ()
 
void RemoveReferenceLine (int refLineId)
 
int SaveSceneToFile (BSTR filename, double zoomX, double zoomY)
 
int SaveWindowToFile (BSTR filename)
 
void SetDisplayFlag (LPVDisplayFlags flag, BOOL enable)
 
void SetSize (int w, int h)
 
void ShowDialog (BSTR dialogName, int x, int y, int w, int h)
 
void ShowDialogAsync (BSTR dialogName, int x, int y, int w, int h, int refreshInterval)
 

Properties

BOOL KeepAspectRatio [get, set]
 Whether the display control should keep the aspect ratio when zooming.
 
int PixelUnderMouse [get]
 The pixel value under current cursor's position.
 
- Properties inherited from ILDisplayCommon
LPVAlignment Alignment [get, set]
 The alignment the control is used when fit some part of the scene to the window.
 
BOOL AutoRefreshEnabled [get, set]
 Enables or disables automatically display re-rendering triggered by add/remove objects or regions or the image. By default, it's on.
 
OLE_COLOR BackColor [get, set]
 The background color of the display control.
 
LPVDisplayFlags DisplayFlags [get, set]
 The display flags, see LPVDisplayFlags.
 
BOOL DrawingEnabled [get, set]
 Enables or disables all display rendering. Useful when performing many graphics or image operations at once.
 
LPVScrollBarPolicy HScrollBarPolicy [get, set]
 The policy of the horizontal scroll bar, see LPVScrollBarPolicy.
 
double PanX [get, set]
 The scene's translation in the x-coordinate direction for panning. The final display x position is calculated as: \( (x + panX) \times zoomX \).
 
double PanY [get, set]
 The scene's translation in the y-coordinate direction for panning. The final display y position is calculated as: \( (y + panY) \times zoomY \).
 
LPVScrollBarPolicy VScrollBarPolicy [get, set]
 The policy of the vertical scroll bar, see LPVScrollBarPolicy.
 
double Zoom [set]
 Set the scene's zoom factor in both x- and y-coordinate direction.
 
LPVZoomAnchor ZoomAnchor [get, set]
 How the control should position the scene when resized, see LPVZoomAnchor.
 
double ZoomX [get, set]
 The scene's zoom factor in or out in the x-coordinate direction.
 
double ZoomY [get, set]
 The scene's zoom factor in or out in the y-coordinate direction.
 

Detailed Description

This interface provide functionalities of the display control.

Usually you add the display control via the Toolbox in Visual Studio. This interface helps you to manage the scene in the display control, for the image, regions, geometric primitives and algorithms' results to shown in the control.

See ILDisplayEvents for the control's event.

Example Code

Note: This interface is currently not available on Linux / MacOS platform.

Member Function Documentation

◆ AddInteractableObject()

int AddInteractableObject ( IDispatch *  interactable,
int  drawFlags 
)

Add the interactable item to the scene. It's usually a geometric primitive.

Parameters
[in]interactableThe object item, it should be a geometric primitive object implemented the ILGeomObject interface and also ILDrawable interface.
[in]drawFlagsThe draw flags to control the item's drawing behavior.
Return values
objectIdReturn the ID of the new item in the scene.
See also
AddObject()
Since
2.12.0

◆ AddObject()

int AddObject ( IDispatch *  drawable,
int  drawFlags 
)

Add the drawable item to the scene. It's usually a geometric primitive or some algorithm' results.

Parameters
[in]drawableThe object item, it should be an object implemented the ILDrawable interface, or LText object.
[in]drawFlagsThe draw flags to control the item's drawing behavior.
Return values
objectIdReturn the ID of the new item in the scene.
See also
AddInteractableObject()

◆ AddRegion()

int AddRegion ( IDispatch *  region,
BOOL  interactable 
)

Add the region item to the scene.

Parameters
[in]regionThe region item, it should be a LRegion instance.
[in]interactableWhether the region object is interactable. By default, it's True.
Return values
regionIdReturn the ID of the new item in the scene.

◆ ClientToImage()

void ClientToImage ( int  x,
int  y,
double *  imageX,
double *  imageY 
)

Map the position from the display control's client coordinates to the images' coordinates.

Parameters
[in]xThe x-coordinate of the position, relative to the upper-left corner of the display control's client area.
[in]yThe y-coordinate of the position, relative to the upper-left corner of the display control's client area.
[out]imageXOutput the x-coordinate of the transformed position, relative to the upper-left corner of the image.
[out]imageYOutput the y-coordinate of the transformed position, relative to the upper-left corner of the image.

◆ FitInViewObject()

void FitInViewObject ( IDispatch *  object,
LPVAlignment  alignFlags 
)

Zoom and translate the scene, to view the specified object and fit the window.

Parameters
[in]objectThe object item to view.
[in]alignFlagsThe alignment, the control's Alignment property is used if it's not set.

◆ GetImage()

IDispatch* GetImage ( )

Get the image of the scene.

Return values
imageReturn the image object

◆ GetObjectByID()

IDispatch* GetObjectByID ( int  objectId)

Get the drawable item by its ID in the scene

Parameters
[in]objectIdThe drawable item's ID.
Return values
drawableReturn the object item

◆ GetRegionByID()

IDispatch* GetRegionByID ( int  regionId)

Get the region item by its ID in the scene

Parameters
[in]regionIdThe region item's ID.
Return values
regionReturn the region item

◆ ImageToClient()

void ImageToClient ( double  imageX,
double  imageY,
int *  x,
int *  y 
)

Map the position from the images' coordinates to the display control's client coordinates.

Parameters
[in]imageXThe x-coordinate of the position, relative to the upper-left corner of the image.
[in]imageYThe y-coordinate of the position, relative to the upper-left corner of the image.
[out]xOutput the x-coordinate of the transformed position, relative to the upper-left corner of the display control's client area
[out]yOutput the y-coordinate of the transformed position, relative to the upper-left corner of the display control's client area

◆ RemoveAllObjects()

void RemoveAllObjects ( )

Remove all drawable items from the scene.

◆ RemoveAllRegions()

void RemoveAllRegions ( )

Remove all region items from the scene.

◆ RemoveImage()

void RemoveImage ( )

Remove the image from the scene. The current scene size is retained.

◆ RemoveObject()

void RemoveObject ( IDispatch *  drawable)

Remove the drawable item from the scene.

Parameters
[in]drawableThe drawable item to be removed.

◆ RemoveObjectByID()

void RemoveObjectByID ( int  objectId)

Remove the drawable item from the scene, by its ID.

Parameters
[in]objectIdThe drawable item's ID.

◆ RemoveRegion()

void RemoveRegion ( IDispatch *  region)

Remove the region item from the scene.

Parameters
[in]regionThe region item to be removed.

◆ RemoveRegionByID()

void RemoveRegionByID ( int  regionId)

Remove the region item from the scene, by its ID.

Parameters
[in]regionIdThe region item's ID.

◆ SetImage()

void SetImage ( IDispatch *  image)

Set the image of the scene. The size of the scene is extended to the image size.

Parameters
[in]imageThe image item, it should be a LImage instance.