mudbox::ViewPort Class Reference

#include <viewport.h>

Inheritance diagram for mudbox::ViewPort:

Inheritance graph
[legend]
List of all members.

Detailed Description

Represents the 3D viewport where Mudbox renders the scene.

Public Types

enum   RedrawType { eFull, eArea, eOverlayOnly }
  This type controls the behaviour of the Redraw function, used as a parameter there. More...

Public Member Functions

virtual const mudbox::ClassDesc *  RuntimeClass (void) const
virtual unsigned int  FilterCount (void) const
  Returns the number of ViewPortFilters associated with this ViewPort.
virtual ViewPortFilter *  Filter (unsigned int iIndex) const
  Returns a pointer to a ViewPortFilter associated with this ViewPort.
virtual void  AddFilter (ViewPortFilter *pFilter)
  Associates a ViewPortFilter with this ViewPort.
virtual void  RemoveFilter (unsigned int iIndex)
  Removes a ViewPortFilter that was associated with this ViewPort. The filter is not deleted.
void  LockFilterCalibration (bool bLocked)
  Locks/unlocks the calibration of all viewport filters associated with this ViewPort. (See ViewPortFilter::LockCalibration()).
virtual void  SaveScreenshot (const QString &sFileName) const
  Saves a snapshot of the current viewport to the given image file name.
virtual int  Width (void)
  Returns the width of the ViewPort in pixels.
virtual int  Height (void)
  Returns the height of the ViewPort in pixels.
virtual float  CursorXPosition (void) const
  Returns the current cursor horizontal position inside the viewport in the 0-1 range.
virtual float  CursorYPosition (void) const
  Returns the current cursor vertical position inside the viewport in the 0-1 range.
const SurfacePoint *  CursorSurfacePoint (void) const
  Returns the surface point which is under the cursor.
unsigned int  LayerCount (void) const
  This is the same as FilterCount().
Layer *  Layer (unsigned int iLayerIndex) const
  This is the same as Filter().
void  UnlinkLayer (class Layer *pLayer)
  This is the same as RemoveFilter().
Layer *  CreateLayer (void)
  Returns a new ViewPortFilter.
void  AddLayer (class Layer *pLayer)
  This is the same as AddFilter().
Layer *  ActiveLayer (void) const
  Returns a pointer to the active layer (filter). That is, the one last clicked on by the user.
void  SetActiveLayer (class Layer *pLayer)
  Set a layer (filter) to be the active one.
ViewPortFilter::RequirementValue  ViewPortFilterRequirements (void) const
  Returns the combined requirements of all visible ViewPortFilters associated with this ViewPort.
void  Redraw (RedrawType eType=eFull, float fXStart=0, float fYStart=0, float fXEnd=0, float fYEnd=0)
  Calling this function will redraw the viewport.
virtual struct ViewPortState  ViewPortState (void)
  Returns the viewport state structure.

Static Public Member Functions

const mudbox::ClassDesc *  StaticClass (void)
mudbox::Node *  CreateInstances (unsigned int iCount=1)

Member Enumeration Documentation

enum mudbox::ViewPort::RedrawType
 

This type controls the behaviour of the Redraw function, used as a parameter there.

Enumeration values:
eFull 
eArea  Schedule a full redraw of the 3d viewport later, ViewPort::Redraw returns immediately when this parameter is used.
eOverlayOnly  Redraws the overlay part of the viewport right away. The 3d content is not redrawn.
00228     {
00229         eFull, 
00230         eArea, 
00231         eOverlayOnly 
00232     };

Member Function Documentation

virtual const mudbox::ClassDesc* mudbox::ViewPort::RuntimeClass (  void   )  const [inline, virtual]
 

Reimplemented from mudbox::LayerContainer.

00145 :
const mudbox::ClassDesc* mudbox::ViewPort::StaticClass (  void   )  [static]
 

Reimplemented from mudbox::LayerContainer.

mudbox::Node* mudbox::ViewPort::CreateInstances (  unsigned int  iCount = 1  )  [static]
 

Reimplemented from mudbox::LayerContainer.

virtual unsigned int mudbox::ViewPort::FilterCount (  void   )  const [virtual]
 

Returns the number of ViewPortFilters associated with this ViewPort.

virtual ViewPortFilter* mudbox::ViewPort::Filter (  unsigned int  iIndex  )  const [virtual]
 

Returns a pointer to a ViewPortFilter associated with this ViewPort.

Parameters:
iIndex  [in] index of the ViewPortFilter to be returned
virtual void mudbox::ViewPort::AddFilter (  ViewPortFilter *  pFilter  )  [virtual]
 

Associates a ViewPortFilter with this ViewPort.

Parameters:
pFilter  [in] a pointer to the ViewPortFilter to be added
virtual void mudbox::ViewPort::RemoveFilter (  unsigned int  iIndex  )  [virtual]
 

Removes a ViewPortFilter that was associated with this ViewPort. The filter is not deleted.

Parameters:
iIndex  [in] index of the ViewPortFilter to be removed
void mudbox::ViewPort::LockFilterCalibration (  bool  bLocked  ) 
 

Locks/unlocks the calibration of all viewport filters associated with this ViewPort. (See ViewPortFilter::LockCalibration()).

Parameters:
bLocked  [in] Set this true to lock calibration, and false to unlock it
virtual void mudbox::ViewPort::SaveScreenshot (  const QString &  sFileName  )  const [virtual]
 

Saves a snapshot of the current viewport to the given image file name.

The file type will be determined by the extension of the file name (eg .png, .bmp, .tif).

See also Kernel()->RenderScene() for a more flexible method.

Parameters:
sFileName  [in] Name of the image file where the screenshot should be saved
virtual int mudbox::ViewPort::Width (  void   )  [virtual]
 

Returns the width of the ViewPort in pixels.

virtual int mudbox::ViewPort::Height (  void   )  [virtual]
 

Returns the height of the ViewPort in pixels.

virtual float mudbox::ViewPort::CursorXPosition (  void   )  const [virtual]
 

Returns the current cursor horizontal position inside the viewport in the 0-1 range.

virtual float mudbox::ViewPort::CursorYPosition (  void   )  const [virtual]
 

Returns the current cursor vertical position inside the viewport in the 0-1 range.

const SurfacePoint* mudbox::ViewPort::CursorSurfacePoint (  void   )  const
 

Returns the surface point which is under the cursor.

unsigned int mudbox::ViewPort::LayerCount (  void   )  const [virtual]
 

This is the same as FilterCount().

Reimplemented from mudbox::LayerContainer.

class Layer* mudbox::ViewPort::Layer (  unsigned int  iLayerIndex  )  const [virtual]
 

This is the same as Filter().

Parameters:
iLayerIndex  [in] index of the layer (filter) to be returned

Reimplemented from mudbox::LayerContainer.

void mudbox::ViewPort::UnlinkLayer (  class Layer *  pLayer  )  [virtual]
 

This is the same as RemoveFilter().

Parameters:
pLayer  [in] index of the layer (filter) to be removed

Reimplemented from mudbox::LayerContainer.

class Layer* mudbox::ViewPort::CreateLayer (  void   )  [virtual]
 

Returns a new ViewPortFilter.

Reimplemented from mudbox::LayerContainer.

void mudbox::ViewPort::AddLayer (  class Layer *  pLayer  )  [virtual]
 

This is the same as AddFilter().

Parameters:
pLayer  [in] a pointer to the layer (filter) to be added

Reimplemented from mudbox::LayerContainer.

class Layer* mudbox::ViewPort::ActiveLayer (  void   )  const [virtual]
 

Returns a pointer to the active layer (filter). That is, the one last clicked on by the user.

Reimplemented from mudbox::LayerContainer.

void mudbox::ViewPort::SetActiveLayer (  class Layer *  pLayer  )  [virtual]
 

Set a layer (filter) to be the active one.

Parameters:
pLayer  [in] a pointer to the layer (filter) to be made active

Reimplemented from mudbox::LayerContainer.

ViewPortFilter::RequirementValue mudbox::ViewPort::ViewPortFilterRequirements (  void   )  const
 

Returns the combined requirements of all visible ViewPortFilters associated with this ViewPort.

void mudbox::ViewPort::Redraw (  RedrawType  eType = eFull,
float  fXStart = 0,
float  fYStart = 0,
float  fXEnd = 0,
float  fYEnd = 0
) 
 

Calling this function will redraw the viewport.

Parameters:
eType  [in] This parameter determined what should be affected by the function. See ViewPort::RedrawType for mode details.
fXStart  [in] Left side of the area which has to be refreshed in the 0-1 intervall. Ignored if eType != eArea.
fYStart  [in] Top side of the area which has to be refreshed in the 0-1 intervall. Ignored if eType != eArea.
fXEnd  [in] Right side of the area which has to be refreshed in the 0-1 intervall. Ignored if eType != eArea.
fYEnd  [in] Upper side of the area which has to be refreshed in the 0-1 intervall. Ignored if eType != eArea.
virtual struct ViewPortState mudbox::ViewPort::ViewPortState (  void   )  [virtual]
 

Returns the viewport state structure.


mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort
mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort mudbox::ViewPort