Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HSubwindow Class Reference

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

#include <HUtilitySubwindow.h>

Inheritance diagram for HSubwindow:

HObject HBaseOperator

List of all members.

Public Member Functions

virtual int CameraChangedEvent (HBaseView *view)
virtual void ChangeType (int type, long appearance=SW_BORDER|SW_SIZE_FIELD|SW_MOVE_FIELD|SW_DRAG_FIELD|SW_DELETE_FIELD|SW_MAGNIFIER_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 Drag (HBaseView *view, HPoint p1, HPoint p2)
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 GetPointerPosition (float &x, float &y)
virtual void GetPosition (float &x, float &y)
virtual void GetSize (float &x, float &y)
virtual int GetType ()
virtual HC_KEY GetWindowKey ()
 HSubwindow ()
 HSubwindow (HBaseView *view, int DoRepeat=0, int DoCapture=1)
virtual void Insert (float left, float right, float bottom, float top, int type=SUBWINDOW_NOTYPE, long appearance=SW_BORDER|SW_SIZE_FIELD|SW_MOVE_FIELD|SW_DRAG_FIELD|SW_DELETE_FIELD|SW_MAGNIFIER_FIELD|SW_BACKGROUND_BOX)
virtual bool IsActive ()
virtual bool IsSubwindow (HC_KEY key)
virtual void MakeCameraSnapshot (HBaseView *view)
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 SetPointerPosition (float x, float y)
virtual void SetPosition (float x, float y)
virtual void SetSize (float left, float right, float bottom, float top)
virtual void SetSize (float deltax, float deltay)
virtual int SetupHandlesEvent (HBaseView *view, HC_KEY key, bool complex)
virtual void SyncViewToWindow (HBaseView *view)

Static Public Member Functions

static const char * GetStaticName ()

Protected Member Functions

void BuildBorder ()
void BuildMagnifyController (float pos)
void ChangeMagnification (HBaseView *view, float magnification)
void ChangeMagnification (HBaseView *view, HPoint &p)
void CopyViewLight (HBaseView *view)
void GetParameters ()
bool IsInCloseArea (HPoint &point)
bool IsInDragArea (HPoint &point)
bool IsInMagnifyArea (HPoint &point)
bool IsInMoveArea (HPoint &point)
bool IsInSizeArea (HPoint &point)
void Magnify (HBaseView *view)
void MakeKeyframe ()
void MakeScaleKeyframe ()
void ShowPointer ()

Protected Attributes

int m_Action
long m_Appearance
float m_Bottom
float m_Left
float m_Magnification
float m_OldMagnification
HC_KEY m_OuterKey
HPoint m_Pointer
HPoint m_ptLast
float m_Right
float m_Top
int m_Type
HC_KEY m_WindowKey


Detailed Description

The HSubwindow 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

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

Constructs an HSubwindow object.

Parameters:
view A pointer to an HBaseView object.
DoRepeat An integer denoting whether this is a repeatable operator. This parameter has been deprecated.
DoCapture An 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.

HSubwindow::HSubwindow (  ) 

Constructs an HSubwindow object.


Member Function Documentation

void HSubwindow::BuildBorder (  )  [protected]

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

void HSubwindow::BuildMagnifyController ( float  pos  )  [protected]

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

Parameters:
pos The initial position of the slider.

virtual int HSubwindow::CameraChangedEvent ( HBaseView view  )  [virtual]

This method handles the event that is generated when the camera position changes by updating the scene according to the new camera position.

Parameters:
view A pointer to the HBaseView object.
Returns:
An HOperatorReturn indicating the status of the event.

void HSubwindow::ChangeMagnification ( HBaseView view,
float  magnification 
) [protected]

This method adjusts the subwindow's magnification.

Parameters:
view A pointer to the HBaseView object.
magnification The magnification level.

void HSubwindow::ChangeMagnification ( HBaseView view,
HPoint p 
) [protected]

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

Parameters:
view A pointer to the HBaseView object.
p The slider position.

virtual void HSubwindow::ChangeType ( int  type,
long  appearance = SW_BORDER|SW_SIZE_FIELD|SW_MOVE_FIELD|SW_DRAG_FIELD|SW_DELETE_FIELD|SW_MAGNIFIER_FIELD|SW_BACKGROUND_BOX 
) [virtual]

This method updates the subwindow type and appearance.

Parameters:
type The Subwindow Type which can be SUBWINDOW_NOTYPE, SUBWINDOW_MAGNIFIER, SUBWINDOW_SNAPSHOT or SUBWINDOW_POINTER.
appearance Bitfields 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.

virtual void HSubwindow::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:
view A pointer to the HBaseView object.
in_system The from coordinate space as described in HC_Compute_Coordinates.
from The coordinates to be converted.
out_system The coordinate space that from will be converted into as described in HC_Compute_Coordinates.
to Returns the newly converted coordinate.

virtual void HSubwindow::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_point The 2D window space coordinates of the subwindow to be converted.
out_point Returns the 2D coordinates converted to window space for the view.

virtual void HSubwindow::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_point The 2D coordinate in the View in window space.
out_point Returns the 2D coordinated in windowspace for the subwindow.

void HSubwindow::CopyViewLight ( HBaseView view  )  [protected]

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

Parameters:
view A pointer to the HBaseView object.

virtual void HSubwindow::Drag ( HBaseView view,
HPoint  p1,
HPoint  p2 
) [virtual]

This method drags the subwindow from point p1 to point p2.

Parameters:
view A pointer to the HBaseView object.
p1 The point to drag from.
p2 The point to drag to.

virtual bool HSubwindow::FindSubwindow ( HBaseView view,
HPoint  pos,
bool &  pointerselected 
) [virtual]

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

Parameters:
view A pointer to the HBaseView object.
pos The 2d window position.
pointerselected Returns true if window maginifier pointer is found.
Returns:
True if the subwindow was found or false if it was not.

virtual HC_KEY HSubwindow::FindSubwindowFromSegment ( HC_KEY  key  )  [virtual]

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

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

virtual void HSubwindow::GetFromKey ( HC_KEY  key  )  [virtual]

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

Parameters:
key The segment key to get the window characteristics from.

virtual HC_KEY HSubwindow::GetKey (  )  [inline, virtual]

This method retrieves the subwindow key.

Returns:
The subwindow key.

References HC_KEY.

virtual const char* HSubwindow::GetName (  )  [virtual]

Returns:
The name of the object which is 'subwindow'.

Reimplemented from HBaseOperator.

void HSubwindow::GetParameters (  )  [protected]

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

virtual void HSubwindow::GetPointerPosition ( float &  x,
float &  y 
) [virtual]

This method gets the position of the subwindow pointer.

Parameters:
x Returns the horizontal position in window space.
y Returns the vertical position in window space.

virtual void HSubwindow::GetPosition ( float &  x,
float &  y 
) [virtual]

This method gets the subwindow's position.

Parameters:
x Returns the horizontal position in window space.
y Returns the vertical position in window space.

virtual void HSubwindow::GetSize ( float &  x,
float &  y 
) [virtual]

This method gets the subwindow size.

Parameters:
x Returns the width of the subwindow in window space.
y Returns the height of the subwindow in window space.

static const char* HSubwindow::GetStaticName (  )  [static]

Returns:
The name of the object which is 'subwindow'.

virtual int HSubwindow::GetType (  )  [inline, virtual]

This method retrieves the subwindow type.

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

virtual HC_KEY HSubwindow::GetWindowKey (  )  [virtual]

Returns:
The top level subwindow key.

virtual void HSubwindow::Insert ( float  left,
float  right,
float  bottom,
float  top,
int  type = SUBWINDOW_NOTYPE,
long  appearance = SW_BORDER|SW_SIZE_FIELD|SW_MOVE_FIELD|SW_DRAG_FIELD|SW_DELETE_FIELD|SW_MAGNIFIER_FIELD|SW_BACKGROUND_BOX 
) [virtual]

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

Parameters:
left The minimum horizontal coordinate of the window.
right The maxium horizontal coordinate of the window.
bottom The maximum vertical coordinate of the window.
top The minium vertical coordinate of the window.
type The subwindow type which can be SUBWINDOW_NOTYPE, SUBWINDOW_MAGNIFIER, SUBWINDOW_SNAPSHOT or SUBWINDOW_POINTER.
appearance Bitfields 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.

virtual bool HSubwindow::IsActive (  )  [virtual]

Returns:
True if the subwindow is represented by a segment in the HOOPS database or false if it isn't.

bool HSubwindow::IsInCloseArea ( HPoint point  )  [protected]

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

Parameters:
point The 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.

bool HSubwindow::IsInDragArea ( HPoint point  )  [protected]

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

Parameters:
point The 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.

bool HSubwindow::IsInMagnifyArea ( HPoint point  )  [protected]

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

Parameters:
point The 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.

bool HSubwindow::IsInMoveArea ( HPoint point  )  [protected]

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

Parameters:
point The 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.

bool HSubwindow::IsInSizeArea ( HPoint point  )  [protected]

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

Parameters:
point The 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.

virtual bool HSubwindow::IsSubwindow ( HC_KEY  key  )  [virtual]

This method determines if the given segment is a subwindow.

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

void HSubwindow::Magnify ( HBaseView view  )  [protected]

This method performs magnification on the window.

Parameters:
view A pointer to the HBaseView object.

virtual void HSubwindow::MakeCameraSnapshot ( HBaseView view  )  [virtual]

This method resets the subwindow camera to the current camera in the view.

Parameters:
view A pointer to the HBaseView object.

void HSubwindow::MakeKeyframe (  )  [protected]

This method creates a subwindow movement keyframe.

void HSubwindow::MakeScaleKeyframe (  )  [protected]

This method creates a subwindow scaling keyframe.

virtual int HSubwindow::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:
view A pointer to the HBaseView object.
key The key of the current object.
p The new object position.
Returns:
An HOperatorReturn indicating the status of the event.

virtual int HSubwindow::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:
view A pointer to the HBaseView object.
key The key of the current object.
scale The object scaling.
Returns:
An HOperatorReturn indicating the status of the event.

virtual int HSubwindow::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:
hevent An HEventInfo object containing the information about the current event.
Returns:
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

virtual int HSubwindow::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:
hevent An HEventInfo object containing the information about the current event.
Returns:
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

virtual int HSubwindow::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:
hevent An HEventInfo object containing the information about the current event.
Returns:
An HOperatorReturn indicating the status of the event.

Reimplemented from HBaseOperator.

virtual int HSubwindow::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:
view A pointer to the HBaseView object.
Returns:
An HOperatorReturn indicating the status of the event.

virtual int HSubwindow::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:
view A pointer to the HBaseView object.
Returns:
An HOperatorReturn indicating the status of the event.

virtual void HSubwindow::Reset (  )  [virtual]

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

virtual void HSubwindow::SetPointerPosition ( float  x,
float  y 
) [virtual]

This method set the position of subwindow pointer.

Parameters:
x The horizontal position in window space.
y The vertical position in window space.

virtual void HSubwindow::SetPosition ( float  x,
float  y 
) [virtual]

The method sets the subwindow position.

Parameters:
x The horizontal position in window space.
y The vertical position in window space.

virtual void HSubwindow::SetSize ( float  left,
float  right,
float  bottom,
float  top 
) [virtual]

This method set the size of the subwindow.

Parameters:
left The left horizontal position.
right The right horizontal position.
bottom The bottom vertical position.
top The top vertical position.

virtual void HSubwindow::SetSize ( float  deltax,
float  deltay 
) [virtual]

This method sets the subwindow size.

Parameters:
deltax The width of the subwindow in window space.
deltay The height of the subwindow in window space.

virtual int HSubwindow::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:
view A pointer to the HBaseView object.
key The key of the current object.
complex Pass true to create complex handles.
Returns:
An HOperatorReturn indicating the status of the event.

void HSubwindow::ShowPointer (  )  [protected]

This method constructs the magnification/view pointer.

virtual void HSubwindow::SyncViewToWindow ( HBaseView view  )  [virtual]

This method synchronizes the view camera to the subwindow camera.

Parameters:
view A pointer to the HBaseView object.


Member Data Documentation

long HSubwindow::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.

float HSubwindow::m_Bottom [protected]

The maximum vertical value of the subwindow in window coordinates.

float HSubwindow::m_Left [protected]

The minimum horizontal value of the subwindow in window coordinates.

float HSubwindow::m_Magnification [protected]

The window magnification level.

float HSubwindow::m_OldMagnification [protected]

The previous magnification field.

HC_KEY HSubwindow::m_OuterKey [protected]

The top level key for the window.

The location of the window pointer.

The last mouse position.

float HSubwindow::m_Right [protected]

The maximum horizontal value of the subwindow in window coordinates.

float HSubwindow::m_Top [protected]

The minimum vertical value of the subwindow in window coordinates.

HC_KEY HSubwindow::m_WindowKey [protected]

The key to the "window" segment.


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