HSubwindow2
-
class
HSubwindow2 The
HSubwindow2class 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.
Inherits from:
HObject,HBaseOperator, HUpdateListener, HFitWorldListener, HObjectManipulationListenerIndex
Methods
BuildBorder()BuildMagnifyController()ChangeMagnification()ChangeMagnification()ChangeType()ComputeCoordinates()ConvertFromSubwindowToView()ConvertFromViewToSubwindow()CopyViewLight()DrawScrollBox()FindSubwindow()FindSubwindowFromSegment()GetFromKey()GetKey()GetName()GetParameters()GetPosition()GetSize()GetStaticName()GetType()GetWindowKey()HSubwindow2()HSubwindow2()Insert()IsActive()IsInCloseArea()IsInDragArea()IsInMagnifyArea()IsInMoveArea()IsInScrollArea()IsInSizeArea()IsSubwindow()Magnify()ObjectMovedEvent()ObjectScaledEvent()OnLButtonDown()OnLButtonDownAndMove()OnLButtonUp()PostFitWorldEvent()PreFitWorldEvent()Reset()SetPosition()SetSize()SetSize()SetupHandlesEvent()UpdateContent()~HSubwindow2()
Variables
Methods
-
HSubwindow2::HSubwindow2(HBaseView *view, int DoRepeat = 0, int DoCapture = 1) Constructs an
HSubwindow2object.Parameters
view: A pointer to an
HBaseViewobject.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::HSubwindow2() Constructs an
HSubwindow2object.
-
virtual
HSubwindow2::~HSubwindow2() virtual
-
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
HSubwindow2object 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_SNAPSHOTorSUBWINDOW_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
HSubwindow2::Reset() virtual
This method resets the window parameters so the
HSubwindow2object is disassociated from the subwindow segment key in the HOOPS database.
-
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.
-
virtual void
HSubwindow2::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 bool
HSubwindow2::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.
-
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
view: A pointer to the
HBaseViewobject.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
HSubwindow2::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
HSubwindow2::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
HSubwindow2::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 HC_KEY
HSubwindow2::GetWindowKey() virtual
Returns
The top level subwindow key.
-
virtual void
HSubwindow2::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.
-
virtual void
HSubwindow2::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 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_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
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_point: The 2D coordinate in the View in window space.
out_point: Returns the 2D coordinated in windowspace for the subwindow.
-
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
type: The Subwindow Type which can be
SUBWINDOW_NOTYPE,SUBWINDOW_MAGNIFIER,SUBWINDOW_SNAPSHOTorSUBWINDOW_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
HSubwindow2::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
HSubwindow2::ComputeCoordinates(HBaseView *view, char const *in_system, HPoint &from, char const *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
HBaseViewobject.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 int
HSubwindow2::GetType() virtual
This method retrieves the subwindow type.
Returns
The subwindow type which can beSUBWINDOW_NOTYPE,SUBWINDOW_MAGNIFIER,SUBWINDOW_SNAPSHOTorSUBWINDOW_POINTER.
-
virtual HC_KEY
HSubwindow2::GetKey() virtual
This method retrieves the subwindow key.
Returns
The subwindow key.
-
virtual char const *
HSubwindow2::GetName() virtual
Returns
The name of the object which is ‘subwindow’.
-
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
hevent: AnHEventInfoobject containing the information about the current event.Returns
AnHOperatorReturnindicating the status of the event.
-
virtual int
HSubwindow2::OnLButtonUp(HEventInfo &hevent) virtual
This method handles the left button up event. If the action is
SW_ACTION_MOVEorSW_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: AnHEventInfoobject containing the information about the current event.Returns
AnHOperatorReturnindicating the status of the event.
-
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
view: A pointer to theHBaseViewobject.Returns
AnHOperatorReturnindicating the status of the event.
-
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
view: A pointer to theHBaseViewobject.Returns
AnHOperatorReturnindicating the status of the event.
-
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 wasSW_ACTION_SIZING, then the subwindow would be resized.Parameters
hevent: AnHEventInfoobject containing the information about the current event.Returns
AnHOperatorReturnindicating the status of the event.
-
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
view: A pointer to the
HBaseViewobject.key: The key of the current object.
complex: Pass true to create complex handles.
Returns
AnHOperatorReturnindicating the status of the event.
-
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
view: A pointer to the
HBaseViewobject.key: The key of the current object.
p: The new object position.
Returns
AnHOperatorReturnindicating the status of the event.
-
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
view: A pointer to the
HBaseViewobject.key: The key of the current object.
scale: The object scaling.
Returns
AnHOperatorReturnindicating the status of the event.
-
virtual void
HSubwindow2::DrawScrollBox() virtual
-
static char const *
HSubwindow2::GetStaticName() static
Returns
The name of the object which is ‘subwindow’.
-
void
HSubwindow2::GetParameters() protected
This method retrieves the window parameters from the window segment key.
-
bool
HSubwindow2::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 theSW_SIZE_FIELDflag.
-
bool
HSubwindow2::IsInScrollArea(HPoint &point) protected
-
bool
HSubwindow2::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 theSW_MAGNIFIER_FIELD.
-
void
HSubwindow2::CopyViewLight(HBaseView *view) protected
This method copies the light associated with the view to the subwindow.
Parameters
view: A pointer to theHBaseViewobject.
-
void
HSubwindow2::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.
-
void
HSubwindow2::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
HBaseViewobject.p: The slider position.
-
void
HSubwindow2::Magnify(HBaseView *view) protected
This method performs magnification on the window.
Parameters
view: A pointer to theHBaseViewobject.
-
bool
HSubwindow2::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 flagSW_DELETE_FIELD.
-
bool
HSubwindow2::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 theSW_DRAG_FIELDflag.
-
void
HSubwindow2::BuildBorder() protected
This method constructs a window border area if the appearance has the
SW_BORDERflag.
-
bool
HSubwindow2::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 theSW_MOVE_FIELDflag.
-
void
HSubwindow2::ChangeMagnification(HBaseView *view, float magnification) protected
This method adjusts the subwindow’s magnification.
Parameters
view: A pointer to the
HBaseViewobject.magnification: The magnification level.
-
virtual void
HSubwindow2::UpdateContent() protected virtual
Variables
-
HC_KEY
HSubwindow2::m_OuterKey protected
HC_KEYThe top level key for the window.
-
HC_KEY
HSubwindow2::m_WindowKey protected
HC_KEYThe key to the “window” segment.
-
float
HSubwindow2::m_Left protected
floatThe minimum horizontal value of the subwindow in window coordinates.
-
float
HSubwindow2::m_Right protected
floatThe maximum horizontal value of the subwindow in window coordinates.
-
float
HSubwindow2::m_Bottom protected
floatThe maximum vertical value of the subwindow in window coordinates.
-
float
HSubwindow2::m_Top protected
floatThe minimum vertical value of the subwindow in window coordinates.
-
int
HSubwindow2::m_Type protected
intThe window type which can be
SUBWINDOW_NOTYPE,SUBWINDOW_MAGNIFIER,SUBWINDOW_SNAPSHOTorSUBWINDOW_POINTER.
-
long
HSubwindow2::m_Appearance protected
longThe 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.
-
HPoint
HSubwindow2::m_Pointer protected
The location of the window pointer.
-
int
HSubwindow2::m_Action protected
intThe current window action which can be
SW_ACTION_NOACTION,SW_ACTION_MOVE,SW_ACTION_SIZING,SW_ACTION_MAGNIFYING,SW_ACTION_POINTERMOVEorSW_ACTION_DRAGGING.
-
HPoint
HSubwindow2::m_ptLast protected
The last mouse position.
-
char
HSubwindow2::m_title[256] protected
char
-
int
HSubwindow2::m_ScrollHeight protected
int
-
int
HSubwindow2::m_ScrollPos protected
int
-
float
HSubwindow2::m_MinWidth protected
float
-
float
HSubwindow2::m_MinHeight protected
float