HSubwindow2

Functions

HSubwindow2

HSubwindow2

~HSubwindow2

void

Insert

void

Reset

bool

IsActive

void

GetFromKey

bool

IsSubwindow

bool

FindSubwindow

HC_KEY

FindSubwindowFromSegment

void

GetPosition

void

SetPosition

HC_KEY

GetWindowKey

void

GetSize

void

SetSize

void

ConvertFromSubwindowToView

void

ConvertFromViewToSubwindow

void

ChangeType

void

SetSize

void

ComputeCoordinates

int

GetType

HC_KEY

GetKey

char const *

GetName

int

OnLButtonDown

int

OnLButtonUp

int

PreFitWorldEvent

int

PostFitWorldEvent

int

OnLButtonDownAndMove

int

SetupHandlesEvent

int

ObjectMovedEvent

int

ObjectScaledEvent

void

DrawScrollBox

char const *

GetStaticName

Detailed Description

class HSubwindow2 : public HObject, public HBaseOperator, public HUpdateListener, public HFitWorldListener, public HObjectManipulationListener

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.

Subclassed by HTexturePickerWindow

Public Functions

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

Constructs an HSubwindow2 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.

HSubwindow2()

Constructs an HSubwindow2 object.

virtual ~HSubwindow2()
virtual void Insert(float left, float right, float bottom, float top, char const *title = 0, float minwidth = 0, float minheight = 0, int type = 0, long appearance = 1 | 2 | 4 | 8 | 16 | 64 | 32)

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

Parameters
virtual void Reset()

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

virtual bool IsActive()
Returns

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

virtual void GetFromKey(HC_KEY key)

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

Parameters

key – The segment key to get the window characteristics from.

virtual bool IsSubwindow(HC_KEY key)

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.

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

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 FindSubwindowFromSegment(HC_KEY key)

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 GetPosition(float &x, float &y)

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 SetPosition(float x, float y)

The method sets the subwindow position.

Parameters
  • x – The horizontal position in window space.

  • y – The vertical position in window space.

virtual HC_KEY GetWindowKey()
Returns

The top level subwindow key.

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

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.

virtual void SetSize(float deltax, float deltay)

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 void ConvertFromSubwindowToView(HPoint &in_point, HPoint &out_point)

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 ConvertFromViewToSubwindow(HPoint const &in_point, HPoint &out_point)

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.

virtual void ChangeType(int type, long appearance = 1 | 2 | 4 | 8 | 16 | 64)

This method updates the subwindow type and appearance.

Parameters
virtual void SetSize(float left, float right, float bottom, float top)

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 ComputeCoordinates(HBaseView *view, char const *in_system, HPoint &from, char const *out_system, HPoint &to)

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.

inline virtual int GetType()

This method retrieves the subwindow type.

Returns

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

inline virtual HC_KEY GetKey()

This method retrieves the subwindow key.

Returns

The subwindow key.

virtual char const *GetName()
Returns

The name of the object which is ‘subwindow’.

virtual int OnLButtonDown(HEventInfo &hevent)

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.

virtual int OnLButtonUp(HEventInfo &hevent)

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.

virtual int PreFitWorldEvent(HBaseView *view)

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 int PostFitWorldEvent(HBaseView *view)

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 OnLButtonDownAndMove(HEventInfo &hevent)

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.

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

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.

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

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 ObjectScaledEvent(HBaseView *view, HC_KEY key, HPoint &scale)

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 void DrawScrollBox()

Public Static Functions

static char const *GetStaticName()
Returns

The name of the object which is ‘subwindow’.