
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) |
| HImageRegion * | FindSelectedRegion (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 HBaseOperator * | Clone () |
| HPoint const | GetFirstPoint () |
| Returns the initial selection point. | |
| virtual const char * | GetName () |
| HPoint const | GetNewPoint () |
| Returns the current selection point. | |
| HBaseView * | GetView () |
| 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. | |
| HBaseView * | m_pView |
| The HOOPS view corresponding to this operator. | |
| HCutGeometryVisibility | m_TempCutGeometryVisibility |
| stores original cut geometry visibility | |
| HShadowMode | m_TempShadowMode |
| stores original shadow mode | |
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.
| HImagePanel::HImagePanel | ( | HBaseView * | view, |
| HC_KEY | startkey, | ||
| int | width, | ||
| int | height, | ||
| float | xpos, | ||
| float | ypos, | ||
| char const *const | name | ||
| ) |
Constructs an HImagePanel object.
| 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 |
| void HImagePanel::AddImageRegion | ( | int | identifier, |
| char const *const | name | ||
| ) |
This method adds a new image region to the panel
| identifier | Identifier of new image region |
| name | Name of new image region |
|
static |
Timer callback used to react to button presses
| HImageRegion* HImagePanel::FindSelectedRegion | ( | float | xpos, |
| float | ypos | ||
| ) |
This method finds the region associated to a specific x/y position in the image
| xpos | Mouse X Position |
| ypos | Mouse Y Position |
|
inline |
This method returns the name of the image panel
|
virtual |
Left Button Down Handler
| hevent | An HEventInfo object containing information about the current event |
Reimplemented from HBaseOperator.
|
virtual |
Mouse Move Handler
| hevent | An HEventInfo object containing information about the current event |
Reimplemented from HBaseOperator.
|
virtual |
Left Button Up Handler
| hevent | An HEventInfo object containing information about the current event |
Reimplemented from HBaseOperator.
|
inline |
This method associates a callback function to the image panel
| 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
| image_action | Function to call for image actions |
| data | generic data passed to image panel callback function |
This method sets the 3 images used for display of the image panel and region selection
| normal_image_path | Path to HMF file containing the image which defines the unhighligted "look" of the image panel |
| highlighted_image_path | Path to HMF file containing the image which defines the highlighted "look" of the image panel |
| region_image_path | Path to HMF file containing the image which defines the selectable regions of the image panel |