Interface to the Alias modeling windows.
Synopsis
#include <AlWindow.h>
class AlWindow : public AlObject , public AlAnimatable
enum AlViewType {
kViewInvalid,
kViewOther,
kFront,
kBack, /* unused */
kRight,
kLeft, /* unused */
kTop,
kBottom, /* unused */
kSbd,
kPerspective
};
enum AlCornerType {
kBottomLeft,
kTopLeft,
kTopRight,
kBottomRight
};
enum AlAspectType {
kNoScale,
kScaleY,
kScaleX
};
AlWindow();
virtual ~AlWindow();
virtual AlObjectType type() const;
statusCode create( AlViewType );
virtual AlObject* copyWrapper() const;
virtual statusCode deleteObject();
AlWindow* next() const;
AlWindow* prev() const;
statusCode nextD();
statusCode prevD();
statusCode windowType( AlViewType& );
statusCode isZoom( boolean& );
statusCode isVisible( boolean& );
virtual AlCamera* camera( void );
virtual statusCode setCamera( AlPerspectiveCamera* );
statusCode position( Screencoord&, Screencoord& );
statusCode setPosition( Screencoord, Screencoord );
statusCode resolution( Screencoord&, Screencoord& );
statusCode setResolution( Screencoord, Screencoord, AlCornerType = kTopLeft, AlAspectType = kNoScale );
statusCode priority( int& );
statusCode setPriority( int );
double gridSize();
statusCode setGridSize( double size );
virtual statusCode mapToWorldSpace( Screencoord, Screencoord, double&, double&, double&, double&, double&, double& );
virtual statusCode worldSpaceBounds( double&, double&, double&, double&, double&, double& );
static statusCode aliasWindowSize( int&, int& );
static statusCode aliasWindowPosition( int&, int& );
Description
Alias modeling windows are the windows in which geometry information is actually viewed and modified. These are the Top, Front,
Right and Perspective windows, as well as the SBD window. This class allows the creation, positioning and sizing of windows.
You can also get the camera associated with a window. In addition, plug-ins can use the mapping functions to determine where
in world space a screen event occurred.
AlUniverse contains methods for getting the first modeling window, the current modeling window, and the SBD window.
AlWindow::AlWindow()
Description
Constructs an AlWindow wrapper object.
AlWindow::~AlWindow()
Description
Deletes an AlWindow wrapper object.
AlObjectType AlWindow::type() const
Description
Returns the class identifier kWindowType.
statusCode AlWindow::create( AlViewType tp )
Description
Creates a window with the specified view type. The possible view types are kFront, kRight, kTop, kPerspective, or kSbd.
Arguments
tp - the view type to create
Return Codes
sSuccess - the window was created
sFailure - the window could not be created
sInvalidArgument - an unknown view type was specified
AlObject* AlWindow::copyWrapper() const
Description
Returns an exact duplicate of this AlWindow wrapper.
statusCode AlWindow::deleteObject()
Description
Deletes the window.
Return Codes
sSuccess - the window was deleted
sFailure - the window was not attached to a layer
sInvalidObject - the window was not valid
AlWindow* AlWindow::next() const
Description
Returns a pointer to the next AlWindow. Otherwise, returns NULL if there is no next window.
AlWindow* AlWindow::prev() const
Description
Returns a pointer to the previous AlWindow. Otherwise, returns NULL if there is no previous window.
statusCode AlWindow::nextD()
Description
Destructively points this wrapper to next window. If there is no such window, the object pointer is unaltered.
Return Codes
sSuccess - the wrapper points to the next window
sFailure - there is no next window
sInvalidObject - the window is invalid
statusCode AlWindow::prevD()
Description
Destructively points this wrapper to the previous window. If there is no such window, the object pointer is unaltered.
Return Codes
sSuccess - the wrapper points to the previous window
sFailure - there is no previous window
sInvalidObject - the window is invalid
statusCode AlWindow::windowType( AlViewType& tp )
Description
Returns the view type of the current window.
Arguments
> tp - the variable to return the view type in
Return Codes
sSuccess - the view type was returned
sInvalidObject - the window is invalid
statusCode AlWindow::isZoom( boolean& b )
Description
Returns TRUE if the window is zoomed.
Arguments
> b - the variable to return the status
Return Codes
sSuccess - the status was returned
sInvalidObject - the window is invalid
statusCode AlWindow::isVisible( boolean& visible )
Description:
Use this method to find out if this window is visible. A window may be hidden by another.
Arguments:
> visible - the variable to return the result
Return Codes:
sSuccess - the status was returned
sInvalidObject - the window is invalid
AlCamera* AlWindow::camera( void )
Description
Returns the effective camera of a modeling window.
This function returns either:
a) its camera if it has one.
b) if the window is a MagnifyWindow, and the parent window has a camera, then that camera.
c) NULL, if the window is null, or we couldn’t find a camera using (a) or (b).
statusCode AlWindow::setCamera( AlPerspectiveCamera* cam )
Description
Sets the window’s camera to the given perspective camera.
Arguments
cam - the perspective camera
Return Codes
sSuccess - the camera was set
sInvalidObject - the window is invalid
sInvalidArgument - the camera is invalid
statusCode AlWindow::position( Screencoord& x, Screencoord& y )
Description
Retrieves the position of a window.
Arguments
x,y - the variables to return the window’s positions in
Return Codes
sSuccess - the position was returned
sInvalidObject - the window is invalid
statusCode AlWindow::setPosition( Screencoord x, Screencoord y )
Description
Sets the position of a window.
Arguments
x,y - the window’s new position
Return Codes
sSuccess - the position was set
sFailure - the window could not be moved
sInvalidObject - the window is invalid
statusCode AlWindow::resolution( Screencoord& x, Screencoord& y )
Description
Retrieves the resolution of a window.
Arguments
x,y - the variables to return the window’s resolution
Return Codes
sSuccess - the resolution was returned
sInvalidObject - the window is invalid
statusCode AlWindow::setResolution( Screencoord x, Screencoord y, AlCornerType c, AlAspectType t )
Description
Sets the resolution of a window.
Arguments
x,y - the window’s new resolution
c - the corner that the window is relative to
t - the scale aspect type (kNoScale, kScaleY, kScaleX)
Return Codes
sSuccess - the position was set
sFailure - the window could not be moved
sInvalidObject - the window is invalid
statusCode AlWindow::priority( int& p )
Description
Retrieves the priority of a window as a number ranging from 1 to 9. If a window’s priority is not contained within a PRIORITYICON,
it is implied to be 3.
Arguments
p - the variables to return the window’s priority
Return Codes
sSuccess - the priority was returned
sInvalidObject - the window is invalid
statusCode AlWindow::setPriority( int p )
Description
Sets the priority of a window, as a number of range [1..9]. If priority is out of range, nothing is changed and sFailure is
returned.
Arguments
p - the window’s new priority
Return Codes
sSuccess - the priority was set
sFailure - the priority was out of range
sInvalidObject - the window is invalid
statusCode AlWindow::mapToWorldSpace( Screencoord x, Screencoord y,double& rx1, double& ry1, double& rz1,double& rx2, double&
ry2, double& rz2 )
Description
Maps a screen pixel (x,y) coordinate pair to world space coordinates (rx1,ry1,rz1)-(rx2,ry2,rz2). This function will always
return sFailure in OpenModel.
Arguments
< x,y - the screen position
> rx1,ry1,rz1 - one corner of the mapped area
> rx2,ry2,rz2 - the other corner of the mapped area
Return Codes
sSuccess - the priority was set
sFailure - the priority was out of range
sInvalidObject - the window is invalid
statusCode AlWindow::worldSpaceBounds( double& xmin, double& ymin, double& zmin, double& xmax, double& ymax, double& zmax
)
Description
Retrieves the bounding box of the window.
Arguments
> xmin, ymin, zmin - lower corner of the bounding box
> xmax, ymax, zmax - upper corner of the bounding box
Return Codes
sSuccess - the priority was set
sFailure - the priority was out of range
sInvalidObject - the window is invalid
statusCode AlWindow::aliasWindowSize( int& sizex, int& sizey )
Description
Retrieves the size of the window. This function will always return sFailure in OpenModel.
Arguments
> sizex, sizey - the returned size
Return Codes
sSuccess - the size was returned
sFailure - size could not be determined
statusCode AlWindow::aliasWindowPosition( int& posx, int& posy )
Description
Retrieves the position of the window. This function will always return sFailure in OpenModel.
Arguments
> posx, posy - the returned position
Return Codes
sSuccess - the position was returned
sFailure - position could not be determined
double AlWindow::gridSize()
Description
Retrieves the size of the grid in world coordinates.
statusCode AlWindow::setGridSize( double size )
Description
Sets the size of the grid (in world coordinates) of a window.
Arguments
size - the window’s new grid size
Return Codes
sSuccess - the grid size was set
sInvalidObject - the window is invalid