The HSubwindow2 class encapsulates interactive floating subwindows. More...

#include <HUtilitySubwindow2.h>

Public Member Functions

virtual void ChangeType (int type, long appearance=SW_BORDER|SW_SIZE_FIELD|SW_MOVE_FIELD|SW_DRAG_FIELD|SW_DELETE_FIELD|SW_BACKGROUND_BOX)
 
virtual void ComputeCoordinates (HBaseView *view, const char *in_system, HPoint &from, const char *out_system, HPoint &to)
 
virtual void ConvertFromSubwindowToView (HPoint &in_point, HPoint &out_point)
 
virtual void ConvertFromViewToSubwindow (HPoint const &in_point, HPoint &out_point)
 
virtual void DrawScrollBox ()
 
virtual bool FindSubwindow (HBaseView *view, HPoint pos, bool &pointerselected)
 
virtual HC_KEY FindSubwindowFromSegment (HC_KEY key)
 
virtual void GetFromKey (HC_KEY key)
 
virtual HC_KEY GetKey ()
 
virtual const char * GetName ()
 
virtual void GetPosition (float &x, float &y)
 
virtual void GetSize (float &x, float &y)
 
virtual int GetType ()
 
virtual HC_KEY GetWindowKey ()
 
 HSubwindow2 (HBaseView *view, int DoRepeat=0, int DoCapture=1)
 
 HSubwindow2 ()
 
virtual void Insert (float left, float right, float bottom, float top, char const *title=0, float minwidth=0, float minheight=0, int type=SUBWINDOW_NOTYPE, long appearance=SW_BORDER|SW_SIZE_FIELD|SW_MOVE_FIELD|SW_DRAG_FIELD|SW_DELETE_FIELD|SW_BACKGROUND_BOX|SW_SCROLL_FIELD)
 
virtual bool IsActive ()
 
virtual bool IsSubwindow (HC_KEY key)
 
virtual int ObjectMovedEvent (HBaseView *view, HC_KEY key, HPoint *p)
 
virtual int ObjectScaledEvent (HBaseView *view, HC_KEY key, HPoint &scale)
 
virtual int OnLButtonDown (HEventInfo &hevent)
 
virtual int OnLButtonDownAndMove (HEventInfo &hevent)
 
virtual int OnLButtonUp (HEventInfo &hevent)
 
virtual int PostFitWorldEvent (HBaseView *view)
 
virtual int PreFitWorldEvent (HBaseView *view)
 
virtual void Reset ()
 
virtual void SetPosition (float x, float y)
 
virtual void SetSize (float deltax, float deltay)
 
virtual void SetSize (float left, float right, float bottom, float top)
 
virtual int SetupHandlesEvent (HBaseView *view, HC_KEY key, bool complex)
 
- Public Member Functions inherited from HObject
 HObject ()
 
- 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.
 
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 const char * GetStaticName ()
 

Protected Member Functions

void BuildBorder ()
 
void BuildMagnifyController (float pos)
 
void ChangeMagnification (HBaseView *view, HPoint &p)
 
void ChangeMagnification (HBaseView *view, float magnification)
 
void CopyViewLight (HBaseView *view)
 
void GetParameters ()
 
bool IsInCloseArea (HPoint &point)
 
bool IsInDragArea (HPoint &point)
 
bool IsInMagnifyArea (HPoint &point)
 
bool IsInMoveArea (HPoint &point)
 
bool IsInScrollArea (HPoint &point)
 
bool IsInSizeArea (HPoint &point)
 
void Magnify (HBaseView *view)
 
virtual void UpdateContent ()
 
- Protected Member Functions inherited from HBaseOperator
bool IsSpecialKey (HC_KEY key)
 

Protected Attributes

int m_Action
 
long m_Appearance
 
float m_Bottom
 
float m_Left
 
float m_MinHeight
 
float m_MinWidth
 
HC_KEY m_OuterKey
 
HPoint m_Pointer
 
HPoint m_ptLast
 
float m_Right
 
int m_ScrollHeight
 
int m_ScrollPos
 
char m_title [256]
 
float m_Top
 
int m_Type
 
HC_KEY m_WindowKey
 
- 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 HSubwindow2 class encapsulates interactive floating subwindows.

Subwindows can be used for things like displaying legend bars to different views of a particular scene. They can live outside of a particular model or can be stored inside an HSF file while retaining their functionality. Similar to GUI windows, they can be dragged, resized and deleted.

Constructor & Destructor Documentation

◆ HSubwindow2() [1/2]

HSubwindow2::HSubwindow2 ( HBaseView view,
int  DoRepeat = 0,
int  DoCapture = 1 
)

Constructs an HSubwindow2 object.

Parameters
viewA pointer to an HBaseView object.
DoRepeatAn integer denoting whether this is a repeatable operator. This parameter has been deprecated.
DoCaptureAn integer denoting whether the mouse state should be captured, which means that all mouse events should be received after a mousedown, even if it leaves the window. This parameter has been deprecated.

◆ HSubwindow2() [2/2]

HSubwindow2::HSubwindow2 ( )

Constructs an HSubwindow2 object.

Member Function Documentation

◆ BuildBorder()

void HSubwindow2::BuildBorder ( )
protected

This method constructs a window border area if the appearance has the SW_BORDER flag.

◆ BuildMagnifyController()

void HSubwindow2::BuildMagnifyController ( float  pos)
protected

This method constructs a magnifier slider for the window if the appearance has the SW_MAGNIFIER_FIELD.

Parameters
posThe initial position of the slider.

◆ ChangeMagnification() [1/2]

void HSubwindow2::ChangeMagnification ( HBaseView view,
HPoint p 
)
protected

This method changes the subwindow's manification based on the position of the magnification slider.

Parameters
viewA pointer to the HBaseView object.
pThe slider position.

◆ ChangeMagnification() [2/2]

void HSubwindow2::ChangeMagnification ( HBaseView view,
float  magnification 
)
protected

This method adjusts the subwindow's magnification.

Parameters
viewA pointer to the HBaseView object.
magnificationThe magnification level.

◆ ChangeType()

virtual void HSubwindow2::ChangeType ( int  type,
long  appearance = SW_BORDER|SW_SIZE_FIELD|SW_MOVE_FIELD|SW_DRAG_FIELD|SW_DELETE_FIELD|SW_BACKGROUND_BOX 
)
virtual

This method updates the subwindow type and appearance.

Parameters
typeThe Subwindow Type which can be SUBWINDOW_NOTYPE, SUBWINDOW_MAGNIFIER, SUBWINDOW_SNAPSHOT or SUBWINDOW_POINTER.
appearanceBitfields describing the window characteristics which can be any combination of the following: SW_BORDER, SW_SIZE_FIELD, SW_MOVE_FIELD, SW_DRAG_FIELD, SW_DELETE_FIELD, SW_MAGNIFIER_FIELD, SW_BACKGROUND_BOX.

◆ ComputeCoordinates()

virtual void HSubwindow2::ComputeCoordinates ( HBaseView view,
const char *  in_system,
HPoint from,
const char *  out_system,
HPoint to 
)
virtual

This method converts the given coordinate into the the out_system while still taking into account the transformation and rotation matrices along the subwindow segment path.

Parameters
viewA pointer to the HBaseView object.
in_systemThe from coordinate space as described in #HC_Compute_Coordinates.
fromThe coordinates to be converted.
out_systemThe coordinate space that from will be converted into as described in #HC_Compute_Coordinates.
toReturns the newly converted coordinate.

◆ ConvertFromSubwindowToView()

virtual void HSubwindow2::ConvertFromSubwindowToView ( HPoint in_point,
HPoint out_point 
)
virtual

This method converts a 2D point in the subwindow to a 2D point in the view.

Parameters
in_pointThe 2D window space coordinates of the subwindow to be converted.
out_pointReturns the 2D coordinates converted to window space for the view.

◆ ConvertFromViewToSubwindow()

virtual void HSubwindow2::ConvertFromViewToSubwindow ( HPoint const &  in_point,
HPoint out_point 
)
virtual

This method converts a 2D point in the View to a 2D point in the subwindow.

Parameters
in_pointThe 2D coordinate in the View in window space.
out_pointReturns the 2D coordinated in windowspace for the subwindow.

◆ CopyViewLight()

void HSubwindow2::CopyViewLight ( HBaseView view)
protected

This method copies the light associated with the view to the subwindow.

Parameters
viewA pointer to the HBaseView object.

◆ FindSubwindow()

virtual bool HSubwindow2::FindSubwindow ( HBaseView view,
HPoint  pos,
bool &  pointerselected 
)
virtual

Given a 2D position, this method finds if the subwindow is in that position.

Parameters
viewA pointer to the HBaseView object.
posThe 2d window position.
pointerselectedReturns true if window maginifier pointer is found.
Returns
True if the subwindow was found or false if it was not.

◆ FindSubwindowFromSegment()

virtual HC_KEY HSubwindow2::FindSubwindowFromSegment ( HC_KEY  key)
virtual

Given a segment key, this method looks under the key to find if a subwindow exists.

Parameters
keyThe segment key to look under.
Returns
The key to the top level subwindow segment or INVALID_KEY if no subwindow segment was found.

◆ GetFromKey()

virtual void HSubwindow2::GetFromKey ( HC_KEY  key)
virtual

This method retrieves the window characteristics from the given segment key.

Parameters
keyThe segment key to get the window characteristics from.

◆ GetKey()

virtual HC_KEY HSubwindow2::GetKey ( )
inlinevirtual

This method retrieves the subwindow key.

Returns
The subwindow key.

◆ GetName()

virtual const char* HSubwindow2::GetName ( )
virtual
Returns
The name of the object which is 'subwindow'.

Reimplemented from HBaseOperator.

◆ GetParameters()

void HSubwindow2::GetParameters ( )
protected

This method retrieves the window parameters from the window segment key.

◆ GetPosition()

virtual void HSubwindow2::GetPosition ( float &  x,
float &  y 
)
virtual

This method gets the subwindow's position.

Parameters
xReturns the horizontal position in window space.
yReturns the vertical position in window space.

◆ GetSize()

virtual void HSubwindow2::GetSize ( float &  x,
float &  y 
)
virtual

This method gets the subwindow size.

Parameters
xReturns the width of the subwindow in window space.
yReturns the height of the subwindow in window space.

◆ GetStaticName()

static const char* HSubwindow2::GetStaticName ( )
static
Returns
The name of the object which is 'subwindow'.

◆ GetType()

virtual int HSubwindow2::GetType ( )
inlinevirtual

This method retrieves the subwindow type.

Returns
The subwindow type which can be SUBWINDOW_NOTYPE, SUBWINDOW_MAGNIFIER, SUBWINDOW_SNAPSHOT or SUBWINDOW_POINTER.

◆ GetWindowKey()

virtual HC_KEY HSubwindow2::GetWindowKey ( )
virtual
Returns
The top level subwindow key.

◆ Insert()

virtual void HSubwindow2::Insert ( float  left,
float  right,
float  bottom,
float  top,
char const *  title = 0,
float  minwidth = 0,
float  minheight = 0,
int  type = SUBWINDOW_NOTYPE,
long  appearance = SW_BORDER|SW_SIZE_FIELD|SW_MOVE_FIELD|SW_DRAG_FIELD|SW_DELETE_FIELD|SW_BACKGROUND_BOX|SW_SCROLL_FIELD 
)
virtual

This method inserts a new HSubwindow2 object into the currently open segment.

Parameters
leftThe minimum horizontal coordinate of the window.
rightThe maxium horizontal coordinate of the window.
bottomThe maximum vertical coordinate of the window.
topThe minium vertical coordinate of the window.
typeThe subwindow type which can be SUBWINDOW_NOTYPE, SUBWINDOW_MAGNIFIER, SUBWINDOW_SNAPSHOT or SUBWINDOW_POINTER.
appearanceBitfields describing the window characteristics which can be any combination of the following: SW_BORDER , SW_SIZE_FIELD, SW_MOVE_FIELD, SW_DRAG_FIELD, SW_DELETE_FIELD, SW_MAGNIFIER_FIELD, SW_BACKGROUND_BOX.

◆ IsActive()

virtual bool HSubwindow2::IsActive ( )
virtual
Returns
True if the subwindow is represented by a segment in the HOOPS database or false if it isn't.

◆ IsInCloseArea()

bool HSubwindow2::IsInCloseArea ( HPoint point)
protected

This method determines if the mouse position is in the "close window" area.

Parameters
pointThe mouse position.
Returns
True if it is in the "close window" area or false if it is not or the appearance does not have the flag SW_DELETE_FIELD.

◆ IsInDragArea()

bool HSubwindow2::IsInDragArea ( HPoint point)
protected

This method determines if the mouse position is in the mouse drag area.

Parameters
pointThe mouse position.
Returns
True if it is in the magnifying slider area or false if it is not or the appearance does not have the SW_DRAG_FIELD flag.

◆ IsInMagnifyArea()

bool HSubwindow2::IsInMagnifyArea ( HPoint point)
protected

This method determines if the mouse pointer is in magnifying slider area.

Parameters
pointThe position of the mouse pointer.
Returns
True if it is in the magnifying slider area or false if it is not or the appearance doesn't have the SW_MAGNIFIER_FIELD.

◆ IsInMoveArea()

bool HSubwindow2::IsInMoveArea ( HPoint point)
protected

This method determines if the mouse pointer is in the move area.

Parameters
pointThe position of the mouse pointer.
Returns
True if the mouse is in the move area or false if it isn't or the appearance does not have the SW_MOVE_FIELD flag.

◆ IsInSizeArea()

bool HSubwindow2::IsInSizeArea ( HPoint point)
protected

This method determine if the mouse pointer is in the resizing area.

Parameters
pointThe position of the mouse pointer.
Returns
True if it is in the resize area or false if it is not or the appearance does not have the SW_SIZE_FIELD flag.

◆ IsSubwindow()

virtual bool HSubwindow2::IsSubwindow ( HC_KEY  key)
virtual

This method determines if the given segment is a subwindow.

Parameters
keyThe segment key to check if it is a subwindow.
Returns
True if the given segment is a subwindow segment.

◆ Magnify()

void HSubwindow2::Magnify ( HBaseView view)
protected

This method performs magnification on the window.

Parameters
viewA pointer to the HBaseView object.

◆ ObjectMovedEvent()

virtual int HSubwindow2::ObjectMovedEvent ( HBaseView view,
HC_KEY  key,
HPoint p 
)
virtual

This method handles the object moved event by updating the subwindow position to the new object position p.

Parameters
viewA pointer to the HBaseView object.
keyThe key of the current object.
pThe new object position.
Returns
An HOperatorReturn indicating the status of the event.

◆ ObjectScaledEvent()

virtual int HSubwindow2::ObjectScaledEvent ( HBaseView view,
HC_KEY  key,
HPoint scale 
)
virtual

This method handles the object scaled event by updating the size of the subwindow with the given scale parameter.

Parameters
viewA pointer to the HBaseView object.
keyThe key of the current object.
scaleThe object scaling.
Returns
An HOperatorReturn indicating the status of the event.

◆ OnLButtonDown()

virtual int HSubwindow2::OnLButtonDown ( HEventInfo hevent)
virtual

This method handles the left button down event by determining what type of action the user is trying to take depending on the position of the mouse pointer and the characteristics of the subwindow.

Parameters
heventAn HEventInfo object containing the information about the current event.
Returns
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

Reimplemented in HTexturePickerWindow.

◆ OnLButtonDownAndMove()

virtual int HSubwindow2::OnLButtonDownAndMove ( HEventInfo hevent)
virtual

This method handles the left button down and move event by updating the window characteristics depending on the current action identified in the OnLButtonDown event. For instance, if the action was determined to be SW_ACTION_MOVE, then this event would cause the subwindow to move to the new position indicated in hevent. If the action was SW_ACTION_SIZING, then the subwindow would be resized.

Parameters
heventAn HEventInfo object containing the information about the current event.
Returns
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

Reimplemented in HTexturePickerWindow.

◆ OnLButtonUp()

virtual int HSubwindow2::OnLButtonUp ( HEventInfo hevent)
virtual

This method handles the left button up event. If the action is SW_ACTION_MOVE or SW_ACTION_MAGNIFYING, this method creates a new movement keyframe. If the action is SW_ACTION_SIZING, this method creates a new scale keyframe.

Parameters
heventAn HEventInfo object containing the information about the current event.
Returns
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

Reimplemented in HTexturePickerWindow.

◆ PostFitWorldEvent()

virtual int HSubwindow2::PostFitWorldEvent ( HBaseView view)
virtual

This handles the event generate by a call to FitWorld by unsetting the subwindow's visibility which was set to off during the PreFitWorldEvent and the associated attribute lock.

Parameters
viewA pointer to the HBaseView object.
Returns
An HOperatorReturn indicating the status of the event.

◆ PreFitWorldEvent()

virtual int HSubwindow2::PreFitWorldEvent ( HBaseView view)
virtual

This method handles the event generated before a call to FitWorld by setting the subwindow's visiblity to off and locking the visibility attribute.

Parameters
viewA pointer to the HBaseView object.
Returns
An HOperatorReturn indicating the status of the event.

◆ Reset()

virtual void HSubwindow2::Reset ( )
virtual

This method resets the window parameters so the HSubwindow2 object is disassociated from the subwindow segment key in the HOOPS database.

◆ SetPosition()

virtual void HSubwindow2::SetPosition ( float  x,
float  y 
)
virtual

The method sets the subwindow position.

Parameters
xThe horizontal position in window space.
yThe vertical position in window space.

◆ SetSize() [1/2]

virtual void HSubwindow2::SetSize ( float  deltax,
float  deltay 
)
virtual

This method sets the subwindow size.

Parameters
deltaxThe width of the subwindow in window space.
deltayThe height of the subwindow in window space.

◆ SetSize() [2/2]

virtual void HSubwindow2::SetSize ( float  left,
float  right,
float  bottom,
float  top 
)
virtual

This method set the size of the subwindow.

Parameters
leftThe left horizontal position.
rightThe right horizontal position.
bottomThe bottom vertical position.
topThe top vertical position.

◆ SetupHandlesEvent()

virtual int HSubwindow2::SetupHandlesEvent ( HBaseView view,
HC_KEY  key,
bool  complex 
)
virtual

This method handles set up handles event. Note that this implementation does not create handles for the subwindow.

Parameters
viewA pointer to the HBaseView object.
keyThe key of the current object.
complexPass true to create complex handles.
Returns
An HOperatorReturn indicating the status of the event.

Member Data Documentation

◆ m_Action

int HSubwindow2::m_Action
protected

◆ m_Appearance

long HSubwindow2::m_Appearance
protected

The appearance bitfield which can be any combination of the following: SW_BORDER, SW_SIZE_FIELD, SW_MOVE_FIELD, SW_DRAG_FIELD, SW_DELETE_FIELD, SW_MAGNIFIER_FIELD, SW_BACKGROUND_BOX.

◆ m_Bottom

float HSubwindow2::m_Bottom
protected

The maximum vertical value of the subwindow in window coordinates.

◆ m_Left

float HSubwindow2::m_Left
protected

The minimum horizontal value of the subwindow in window coordinates.

◆ m_OuterKey

HC_KEY HSubwindow2::m_OuterKey
protected

The top level key for the window.

◆ m_Pointer

HPoint HSubwindow2::m_Pointer
protected

The location of the window pointer.

◆ m_ptLast

HPoint HSubwindow2::m_ptLast
protected

The last mouse position.

◆ m_Right

float HSubwindow2::m_Right
protected

The maximum horizontal value of the subwindow in window coordinates.

◆ m_Top

float HSubwindow2::m_Top
protected

The minimum vertical value of the subwindow in window coordinates.

◆ m_Type

int HSubwindow2::m_Type
protected

◆ m_WindowKey

HC_KEY HSubwindow2::m_WindowKey
protected

The key to the "window" segment.


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