HImagePanel

class HImagePanel

The HImagePanel class displays an image usually representing buttons which a user can highlight with a mouse click and which trigger user defined actions

An image panel object consists of 3 HOOPS images which must be stored in separate HMF files. One of them represents the visual representaton of the unselected panel while the other represents the selected state. The third image defines regions inside the panel (based on the rgb values in the image) which trigger execution of a user supplied callback function.

Inherits from: HBaseOperator

Methods

HImagePanel::HImagePanel(HBaseView *view, HC_KEY startkey, int width, int height, float xpos, float ypos, char const *name)

Constructs an HImagePanel object.

Parameters

view: A pointer to the HBaseView object.

startkey: Key of segment containing the image panel.

width: Width of image panel

height: Height of image panel

xpos: Initial X Position of image panel

ypos: Initial Y Position of image panel

name: Name of image panel

virtual HImagePanel::~HImagePanel()

virtual

HImageRegion *HImagePanel::FindSelectedRegion(float xpos, float ypos)

This method finds the region associated to a specific x/y position in the image

Parameters

xpos: Mouse X Position

ypos: Mouse Y Position

Returns

Image Region
virtual int HImagePanel::OnLButtonDownAndMove(HEventInfo &hevent)

virtual

Mouse Move Handler

Parameters

hevent: An HEventInfo object containing information about the current event
virtual int HImagePanel::OnLButtonDown(HEventInfo &hevent)

virtual

Left Button Down Handler

Parameters

hevent: An HEventInfo object containing information about the current event
virtual int HImagePanel::OnLButtonUp(HEventInfo &hevent)

virtual

Left Button Up Handler

Parameters

hevent: An HEventInfo object containing information about the current event
void HImagePanel::AddImageRegion(int identifier, char const *const name)

This method adds a new image region to the panel

Parameters

identifier: Identifier of new image region

name: Name of new image region

char const *HImagePanel::GetPanelName()

This method returns the name of the image panel

Returns

Name of image panel
void HImagePanel::SetImageAction(int (*image_action)(HImageRegion *ii, void *data, HButtonState button_state), void *data)

This method associates a callback function to the image panel

Parameters

image_action: Function to call for image actions

data: generic data passed to image panel callback function

void HImagePanel::SetImagesFromFile(char const *normal_image_path, char const *highlighted_image_path, char const *region_image_path)

This method associates a callback function to the image panel This method sets the 3 images used for display of the image panel and region selection

Parameters

image_action: Function to call for image actions

data: generic data passed to image panel callback function

void HImagePanel::SetImages(HC_KEY NormalImageKey, HC_KEY HighlightedImageKey, HC_KEY RegionImageKey)
void HImagePanel::ZoomIn()
void HImagePanel::ZoomOut()
void HImagePanel::SetPosition(float x, float y, float z = 0.0f)
static bool HImagePanel::ButtonTimerClbk(float request_time, float actual_time, void *user_data)

static

Timer callback used to react to button presses

void HImagePanel::SetImageFromFile(char const *path, HC_KEY &image_key)

private

This method finds a HOOPS image inside of an HMF file

Parameters

path: Path to HMF file

image_key: Key of image in HMF file

void HImagePanel::ComposeWorkerImage(HImageRegion *reg)

private

This method creates an image by composing the regular image of the image panel with the highlighted region

Parameters

reg: Pointer to ImageRegion object

Variables

HC_KEY HImagePanel::m_Key

private

HC_KEY

Key to image panel segment.

HBaseView *HImagePanel::m_pView

private

A pointer to the HBaseView Object.

struct vlist_s *HImagePanel::m_ImageRegionList

private

struct vlist_s

List of image regions

int HImagePanel::m_width

private

int

Width of Image Panel.

int HImagePanel::m_height

private

int

Height of Image Panel.

int (*HImagePanel::m_ImageAction)(HImageRegion *ii, void *data, HButtonState button_state)

private

int(
void *HImagePanel::m_ImageActionData

private

void
HTClient *HImagePanel::m_pButtonTimer

private

HImageRegion *HImagePanel::m_CurrentImage

private

HC_KEY HImagePanel::m_NormalImageKey

private

HC_KEY
HC_KEY HImagePanel::m_HighlightedImageKey

private

HC_KEY
HC_KEY HImagePanel::m_RegionImageKey

private

HC_KEY
HC_KEY HImagePanel::m_WorkerImageKey

private

HC_KEY
bool HImagePanel::m_bFound

private

bool
bool HImagePanel::m_blButtonDown

private

bool
HPoint HImagePanel::m_ptLast

private

char *HImagePanel::m_Name

private

char