Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

SbViewportRegion Class Reference
[Base classes]

The SbViewportRegion class is a viewport within a full window. More...

#include <Inventor/SbViewportRegion.h>

List of all members.

Public Member Functions

 SbViewportRegion (void)
 SbViewportRegion (short width, short height)
 SbViewportRegion (SbVec2s winSize)
 SbViewportRegion (const SbViewportRegion &vpReg)
void setWindowSize (short width, short height)
void setWindowSize (SbVec2s winSize)
void setViewport (float left, float bottom, float width, float height)
void setViewport (SbVec2f origin, SbVec2f size)
void setViewportPixels (short left, short bottom, short width, short height)
void setViewportPixels (SbVec2s origin, SbVec2s size)
const SbVec2sgetWindowSize (void) const
const SbVec2fgetViewportOrigin (void) const
const SbVec2sgetViewportOriginPixels (void) const
const SbVec2fgetViewportSize (void) const
const SbVec2sgetViewportSizePixels (void) const
float getViewportAspectRatio (void) const
void scaleWidth (float ratio)
void scaleHeight (float ratio)
void setPixelsPerInch (float ppi)
float getPixelsPerInch (void) const
float getPixelsPerPoint (void) const
void print (FILE *file) const

Friends

int operator== (const SbViewportRegion &reg1, const SbViewportRegion &reg2)


Detailed Description

The SbViewportRegion class is a viewport within a full window.

The SbViewportRegion class contains information to represent a subview within a window. It stores information about the origin and size of the subview, aswell as the size of the underlying "full" window.

Available methods include inquiries and manipulation in both normalized coordinates and pixel coordinates.

See also:
SbViewVolume


Constructor & Destructor Documentation

SbViewportRegion::SbViewportRegion void   ) 
 

The default SbViewportRegion constructor initializes the viewport to fully cover a [100, 100] size window with 72 pixels per inch resolution.

SbViewportRegion::SbViewportRegion short  width,
short  height
 

Construct and initialize an SbViewportRegion instance with the given pixel value window dimensions. The viewport within this window will be set to cover the window completely.

SbViewportRegion::SbViewportRegion SbVec2s  winsize  ) 
 

Construct and initialize an SbViewportRegion instance with the given pixel value window dimensions. The viewport within this window will be set to cover the window completely.

SbViewportRegion::SbViewportRegion const SbViewportRegion vpReg  ) 
 

Copy constructor.


Member Function Documentation

void SbViewportRegion::setWindowSize short  width,
short  height
 

Set the window size in pixels. The viewport rectangle dimensions will stay intact.

See also:
getWindowSize()

void SbViewportRegion::setWindowSize SbVec2s  winsize  ) 
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void SbViewportRegion::setViewport float  left,
float  bottom,
float  width,
float  height
 

Set up the origin and size of the viewport region in normalized coordinates.

See also:
getViewportOrigin(), getViewportSize(), setViewportPixels().

void SbViewportRegion::setViewport SbVec2f  origin,
SbVec2f  size
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void SbViewportRegion::setViewportPixels short  left,
short  bottom,
short  width,
short  height
 

Set up the origin and size of the viewport region in pixel coordinates.

See also:
getViewportOriginPixels(), getViewportSizePixels(), setViewport()

void SbViewportRegion::setViewportPixels SbVec2s  origin,
SbVec2s  size
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

const SbVec2s & SbViewportRegion::getWindowSize void   )  const
 

Returns window dimensions (which are in absolute (i.e. pixel) coordinates).

See also:
setWindowSize().

const SbVec2f & SbViewportRegion::getViewportOrigin void   )  const
 

Return normalized viewport origin coordinates.

See also:
setViewport(), getViewportOriginPixels().

const SbVec2s & SbViewportRegion::getViewportOriginPixels void   )  const
 

Return viewport origin coordinates in pixel values.

See also:
setViewportPixels(), getViewportOrigin().

const SbVec2f & SbViewportRegion::getViewportSize void   )  const
 

Returns the normalized viewport size.

See also:
setViewport(), getViewportSizePixels().

const SbVec2s & SbViewportRegion::getViewportSizePixels void   )  const
 

Returns viewport size in pixel coordinates.

See also:
setViewportPixels(), getViewportSize().

float SbViewportRegion::getViewportAspectRatio void   )  const
 

Returns the aspect ratio of the viewport region. The aspect ratio is calculated as pixelwidth divided on pixelheight.

void SbViewportRegion::scaleWidth float  ratio  ) 
 

Scale the width of the viewport region.

The scale factor should not make the viewport larger than the window. If this happens, the viewport will be clamped.

The scaling will be done around the viewport region center point, but if this causes the viewport origin to be moved below (0,0), the origin coordinates will be clamped.

See also:
scaleHeight().

void SbViewportRegion::scaleHeight float  ratio  ) 
 

Scale the height of the viewport region.

The scale factor should not make the viewport larger than the window. If this happens, the viewport will be clamped.

The scaling will be done around the viewport region center point, but if this causes the viewport origin to be moved below (0,0), the origin coordinates will be clamped.

See also:
scaleWidth().

void SbViewportRegion::setPixelsPerInch float  ppi  ) 
 

Set pixels per inch. Default value is 72.

See also:
getPixelsPerInch().

float SbViewportRegion::getPixelsPerInch void   )  const
 

Get pixels per inch.

See also:
setPixelsPerInch().

float SbViewportRegion::getPixelsPerPoint void   )  const
 

Get pixels per point. A point is defined as something you can put 72 of per inch...

See also:
setPixelsPerInch(), getPixelsPerInch().

void SbViewportRegion::print FILE *  fp  )  const
 

Dump the state of this object to the file stream. Only works in debug version of library, method does nothing in an optimized compile.


Friends And Related Function Documentation

int operator== const SbViewportRegion reg1,
const SbViewportRegion reg2
[friend]
 

Compares two SbViewportRegion instances for equality.


The documentation for this class was generated from the following files:
Generated on Tue Jul 27 23:53:09 2004 for Coin by doxygen 1.3.7