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

#include <HObjects.h>

Public Member Functions

void AddImageRegion (int identifier, char const *const name)
 
HImageRegionFindSelectedRegion (float xpos, float ypos)
 
char const * GetPanelName ()
 
 HImagePanel (HBaseView *view, HC_KEY startkey, int width, int height, float xpos, float ypos, char const *const name)
 
virtual int OnLButtonDown (HEventInfo &hevent)
 
virtual int OnLButtonDownAndMove (HEventInfo &hevent)
 
virtual int OnLButtonUp (HEventInfo &hevent)
 
void SetImageAction (int(*image_action)(HImageRegion *ii, void *data, HButtonState button_state), void *data)
 
void SetImages (HC_KEY NormalImageKey, HC_KEY HighlightedImageKey, HC_KEY RegionImageKey)
 
void SetImagesFromFile (char const *normal_image_path, char const *highlighted_image_path, char const *region_image_path)
 
void SetPosition (float x, float y, float z=0.0f)
 
void ZoomIn ()
 
void ZoomOut ()
 
- Public Member Functions inherited from HBaseOperator
int Capture ()
 Returns whether we are currently in mouse capture mode. See this class' constructor for a more detailed description of what this means. This method has been deprecated.
 
virtual HBaseOperatorClone ()
 
HPoint const GetFirstPoint ()
 Returns the initial selection point.
 
virtual const char * GetName ()
 
HPoint const GetNewPoint ()
 Returns the current selection point.
 
HBaseViewGetView ()
 Returns a pointer to the view that this operator is associated with.
 
 HBaseOperator (HBaseView *view, int DoRepeat=0, int DoCapture=1)
 
virtual int OnKeyDown (HEventInfo &hevent)
 
virtual int OnKeyUp (HEventInfo &hevent)
 
virtual int OnLButtonDblClk (HEventInfo &hevent)
 
virtual int OnLRButtonDownAndMove (HEventInfo &hevent)
 
virtual int OnMButtonDblClk (HEventInfo &hevent)
 
virtual int OnMButtonDown (HEventInfo &hevent)
 
virtual int OnMButtonDownAndMove (HEventInfo &hevent)
 
virtual int OnMButtonUp (HEventInfo &hevent)
 
virtual int OnMouseMove (HEventInfo &hevent)
 
virtual int OnMouseWheel (HEventInfo &hevent)
 
virtual int OnNoButtonDownAndMove (HEventInfo &hevent)
 
virtual int OnRButtonDblClk (HEventInfo &hevent)
 
virtual int OnRButtonDown (HEventInfo &hevent)
 
virtual int OnRButtonDownAndMove (HEventInfo &hevent)
 
virtual int OnRButtonUp (HEventInfo &hevent)
 
virtual int OnTimer (HEventInfo &hevent)
 
virtual int OnTouchesDown (HEventInfo &hevent)
 
virtual int OnTouchesMove (HEventInfo &hevent)
 
virtual int OnTouchesUp (HEventInfo &hevent)
 
virtual bool OperatorStarted ()
 Operator has been started if true, and has not been started if false.
 
int Repeat ()
 Returns whether the operation is repeatable. This method has been deprecated.
 
void SetFirstPoint (HPoint const &new_point)
 Sets the initial selection point.
 
void SetMapTouchesToMouseEvents (bool val)
 Touch Events are mapped to mouse events if true, and are not if false.
 
void SetNewPoint (HPoint const &new_point)
 Sets the current selection point.
 
void SetOperatorStarted (bool val)
 Operator has been started if true, and has not been started if false.
 
void SetView (HBaseView *new_view)
 Sets the view that this operator is associated with.
 

Static Public Member Functions

static bool ButtonTimerClbk (float request_time, float actual_time, void *user_data)
 

Additional Inherited Members

- Protected Member Functions inherited from HBaseOperator
bool IsSpecialKey (HC_KEY key)
 
- Protected Attributes inherited from HBaseOperator
bool m_bMapTouchesToMouseEvents
 Indicates if touch events are mapped to mouse events.
 
bool m_bOpStarted
 Indicates whether the operator has already 'started'. More...
 
int m_doCapture
 Integer indicating whether to capture mouse on button down and release on button up. This parameter has been deprecated.
 
int m_doRepeat
 Integer indicating if the operator is repeatable . This parameter has been deprecated.
 
HPoint m_ptFirst
 Initial selection point.
 
HPoint m_ptNew
 Current selection point.
 
HBaseViewm_pView
 The HOOPS view corresponding to this operator.
 
HCutGeometryVisibility m_TempCutGeometryVisibility
 stores original cut geometry visibility
 
HShadowMode m_TempShadowMode
 stores original shadow mode
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ HImagePanel()

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

Constructs an HImagePanel object.

Parameters
viewA pointer to the HBaseView object.
startkeyKey of segment containing the image panel.
widthWidth of image panel
heightHeight of image panel
xposInitial X Position of image panel
yposInitial Y Position of image panel
nameName of image panel

Member Function Documentation

◆ AddImageRegion()

void HImagePanel::AddImageRegion ( int  identifier,
char const *const  name 
)

This method adds a new image region to the panel

Parameters
identifierIdentifier of new image region
nameName of new image region

◆ ButtonTimerClbk()

static bool HImagePanel::ButtonTimerClbk ( float  request_time,
float  actual_time,
void *  user_data 
)
static

Timer callback used to react to button presses

◆ FindSelectedRegion()

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

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

Parameters
xposMouse X Position
yposMouse Y Position
Returns
Image Region

◆ GetPanelName()

char const* HImagePanel::GetPanelName ( )
inline

This method returns the name of the image panel

Returns
Name of image panel

◆ OnLButtonDown()

virtual int HImagePanel::OnLButtonDown ( HEventInfo hevent)
virtual

Left Button Down Handler

Parameters
heventAn HEventInfo object containing information about the current event

Reimplemented from HBaseOperator.

◆ OnLButtonDownAndMove()

virtual int HImagePanel::OnLButtonDownAndMove ( HEventInfo hevent)
virtual

Mouse Move Handler

Parameters
heventAn HEventInfo object containing information about the current event

Reimplemented from HBaseOperator.

◆ OnLButtonUp()

virtual int HImagePanel::OnLButtonUp ( HEventInfo hevent)
virtual

Left Button Up Handler

Parameters
heventAn HEventInfo object containing information about the current event

Reimplemented from HBaseOperator.

◆ SetImageAction()

void HImagePanel::SetImageAction ( int(*)(HImageRegion *ii, void *data, HButtonState button_state)  image_action,
void *  data 
)
inline

This method associates a callback function to the image panel

Parameters
image_actionFunction to call for image actions
datageneric data passed to image panel callback function

◆ SetImagesFromFile()

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

Parameters
image_actionFunction to call for image actions
datageneric data passed to image panel callback function


This method sets the 3 images used for display of the image panel and region selection

Parameters
normal_image_pathPath to HMF file containing the image which defines the unhighligted "look" of the image panel
highlighted_image_pathPath to HMF file containing the image which defines the highlighted "look" of the image panel
region_image_pathPath to HMF file containing the image which defines the selectable regions of the image panel

The documentation for this class was generated from the following file: