Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::PassiveViewportBase Class Reference

PassiveViewport Base Class.

#include <OSGPassiveViewportBase.h>

Inheritance diagram for osg::PassiveViewportBase:

osg::Viewport osg::ViewportBase osg::AttachmentContainer osg::FieldContainer osg::PassiveViewport List of all members.

Public Types

typedef PassiveViewportPtr Ptr
enum  {
  LeftFieldId = Inherited::NextFieldId, RightFieldId = LeftFieldId + 1, BottomFieldId = RightFieldId + 1, TopFieldId = BottomFieldId + 1,
  ParentFieldId = TopFieldId + 1, CameraFieldId = ParentFieldId + 1, RootFieldId = CameraFieldId + 1, BackgroundFieldId = RootFieldId + 1,
  ForegroundsFieldId = BackgroundFieldId + 1, TravMaskFieldId = ForegroundsFieldId + 1, DrawTimeFieldId = TravMaskFieldId + 1, NextFieldId = DrawTimeFieldId + 1
}

Public Member Functions

FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Binary Access
*virtual UInt32 getBinSize (const BitVector &whichField)
virtual void copyToBin (BinaryDataHandler &pMem, const BitVector &whichField)
virtual void copyFromBin (BinaryDataHandler &pMem, const BitVector &whichField)
Copy
*virtual FieldContainerPtr shallowCopy (void) const
access
*void setSize (Real32 left, Real32 bottom, Real32 right, Real32 top)
Int32 getPixelLeft (void) const
Int32 getPixelRight (void) const
Int32 getPixelBottom (void) const
Int32 getPixelTop (void) const
Int32 getPixelWidth (void) const
Int32 getPixelHeight (void) const
bool isFullWindow (void) const
your_category
*virtual void draw (DrawAction *action)
virtual void render (RenderActionBase *action)
change
*virtual void changed (BitVector whichField, UInt32 origin)
dump
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
Field Get
*SFReal32getSFLeft (void)
 Get the Viewport::_sfLeft field.
SFReal32getSFRight (void)
 Get the Viewport::_sfRight field.
SFReal32getSFBottom (void)
 Get the Viewport::_sfBottom field.
SFReal32getSFTop (void)
 Get the Viewport::_sfTop field.
SFWindowPtrgetSFParent (void)
 Get the Viewport::_sfParent field.
SFCameraPtrgetSFCamera (void)
 Get the Viewport::_sfCamera field.
SFNodePtrgetSFRoot (void)
 Get the Viewport::_sfRoot field.
SFBackgroundPtrgetSFBackground (void)
 Get the Viewport::_sfBackground field.
MFForegroundPtrgetMFForegrounds (void)
 Get the Viewport::_mfForegrounds field.
SFUInt32getSFTravMask (void)
 Get the Viewport::_sfTravMask field.
SFReal32getSFDrawTime (void)
 Get the Viewport::_sfDrawTime field.
Real32getLeft (void)
 Get the value of the Viewport::_sfLeft field.
const Real32getLeft (void) const
 Get the value of the Viewport::_sfLeft field.
Real32getRight (void)
 Get the value of the Viewport::_sfRight field.
const Real32getRight (void) const
 Get the value of the Viewport::_sfRight field.
Real32getBottom (void)
 Get the value of the Viewport::_sfBottom field.
const Real32getBottom (void) const
 Get the value of the Viewport::_sfBottom field.
Real32getTop (void)
 Get the value of the Viewport::_sfTop field.
const Real32getTop (void) const
 Get the value of the Viewport::_sfTop field.
WindowPtrgetParent (void)
 Get the value of the Viewport::_sfParent field.
const WindowPtrgetParent (void) const
 Get the value of the Viewport::_sfParent field.
CameraPtrgetCamera (void)
 Get the value of the Viewport::_sfCamera field.
const CameraPtrgetCamera (void) const
 Get the value of the Viewport::_sfCamera field.
NodePtrgetRoot (void)
 Get the value of the Viewport::_sfRoot field.
const NodePtrgetRoot (void) const
 Get the value of the Viewport::_sfRoot field.
BackgroundPtrgetBackground (void)
 Get the value of the Viewport::_sfBackground field.
const BackgroundPtrgetBackground (void) const
 Get the value of the Viewport::_sfBackground field.
UInt32getTravMask (void)
 Get the value of the Viewport::_sfTravMask field.
const UInt32getTravMask (void) const
 Get the value of the Viewport::_sfTravMask field.
Real32getDrawTime (void)
 Get the value of the Viewport::_sfDrawTime field.
const Real32getDrawTime (void) const
 Get the value of the Viewport::_sfDrawTime field.
ForegroundPtrgetForegrounds (const UInt32 index)
 Get the value of the index element the Viewport::_mfForegrounds field.
MFForegroundPtrgetForegrounds (void)
 Get the Viewport::_mfForegrounds field.
const MFForegroundPtrgetForegrounds (void) const
 Get the Viewport::_mfForegrounds field.
Field Set
*void setLeft (const Real32 &value)
 Set the value of the Viewport::_sfLeft field.
void setRight (const Real32 &value)
 Set the value of the Viewport::_sfRight field.
void setBottom (const Real32 &value)
 Set the value of the Viewport::_sfBottom field.
void setTop (const Real32 &value)
 Set the value of the Viewport::_sfTop field.
void setParent (const WindowPtr &value)
 Set the value of the Viewport::_sfParent field.
void setCamera (const CameraPtr &value)
 Set the value of the Viewport::_sfCamera field.
void setRoot (const NodePtr &value)
 Set the value of the Viewport::_sfRoot field.
void setBackground (const BackgroundPtr &value)
 Set the value of the Viewport::_sfBackground field.
void setTravMask (const UInt32 &value)
 Set the value of the Viewport::_sfTravMask field.
void setDrawTime (const Real32 &value)
 Set the value of the Viewport::_sfDrawTime field.

Static Public Member Functions

Class Get
*static FieldContainerTypegetClassType (void)
 access the type of the class
static UInt32 getClassTypeId (void)
 access the numerical type of the class
Construction
*static PassiveViewportPtr create (void)
 create a new instance of the class
static PassiveViewportPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype
Class Get
*static const char * getClassname (void)

Static Public Attributes

static const osg::BitVector MTInfluenceMask
static const osg::BitVector LeftFieldMask
static const osg::BitVector RightFieldMask
static const osg::BitVector BottomFieldMask
static const osg::BitVector TopFieldMask
static const osg::BitVector ParentFieldMask
static const osg::BitVector CameraFieldMask
static const osg::BitVector RootFieldMask
static const osg::BitVector BackgroundFieldMask
static const osg::BitVector ForegroundsFieldMask
static const osg::BitVector TravMaskFieldMask
static const osg::BitVector DrawTimeFieldMask
static const BitVector AttachmentsFieldMask
static const BitVector NextFieldMask

Protected Member Functions

MT Destruction
*virtual void onDestroy (void)
MT Destruction
*virtual void onDestroy (void)
MT Destruction
*virtual void onDestroy (void)
MT Destruction
*virtual void onDestroy (void)
MT Destruction
*virtual void onDestroy (void)
MT Destruction
*virtual void onDestroy (void)
MT Destruction
*virtual void onDestroy (void)
Constructors
PassiveViewportBase (void)
 PassiveViewportBase (const PassiveViewportBase &source)
Destructors
*virtual ~PassiveViewportBase (void)
Sync
*void executeSyncImpl (PassiveViewportBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync
*void executeSyncImpl (ViewportBase *pOther, const BitVector &whichField)
MT Destruction
*virtual void onDestroy (void)

Protected Attributes

Fields
*SFReal32 _sfLeft
SFReal32 _sfRight
SFReal32 _sfBottom
SFReal32 _sfTop
SFWindowPtr _sfParent
SFCameraPtr _sfCamera
SFNodePtr _sfRoot
SFBackgroundPtr _sfBackground
MFForegroundPtr _mfForegrounds
SFUInt32 _sfTravMask
SFReal32 _sfDrawTime

Private Types

typedef Viewport Inherited

Private Member Functions

void operator= (const PassiveViewportBase &source)

Static Private Attributes

static FieldContainerType _type

Friends

class FieldContainer

Detailed Description

Definition at line 80 of file OSGPassiveViewportBase.h.


Member Typedef Documentation

typedef Viewport osg::PassiveViewportBase::Inherited [private]
 

Reimplemented from osg::Viewport.

Reimplemented in osg::PassiveViewport.

Definition at line 84 of file OSGPassiveViewportBase.h.

typedef PassiveViewportPtr osg::PassiveViewportBase::Ptr
 

Reimplemented from osg::ViewportBase.

Definition at line 89 of file OSGPassiveViewportBase.h.


Member Enumeration Documentation

anonymous enum [inherited]
 

Enumerator:
LeftFieldId 
RightFieldId 
BottomFieldId 
TopFieldId 
ParentFieldId 
CameraFieldId 
RootFieldId 
BackgroundFieldId 
ForegroundsFieldId 
TravMaskFieldId 
DrawTimeFieldId 
NextFieldId 

Reimplemented from osg::AttachmentContainer.

Definition at line 102 of file OSGViewportBase.h.

00103     {
00104         LeftFieldId        = Inherited::NextFieldId,
00105         RightFieldId       = LeftFieldId        + 1,
00106         BottomFieldId      = RightFieldId       + 1,
00107         TopFieldId         = BottomFieldId      + 1,
00108         ParentFieldId      = TopFieldId         + 1,
00109         CameraFieldId      = ParentFieldId      + 1,
00110         RootFieldId        = CameraFieldId      + 1,
00111         BackgroundFieldId  = RootFieldId        + 1,
00112         ForegroundsFieldId = BackgroundFieldId  + 1,
00113         TravMaskFieldId    = ForegroundsFieldId + 1,
00114         DrawTimeFieldId    = TravMaskFieldId    + 1,
00115         NextFieldId        = DrawTimeFieldId    + 1
00116     };


Constructor & Destructor Documentation

PassiveViewportBase::PassiveViewportBase void   )  [protected]
 

Definition at line 144 of file OSGPassiveViewportBase.cpp.

00144                                              :
00145     Inherited() 
00146 {
00147 }

PassiveViewportBase::PassiveViewportBase const PassiveViewportBase source  )  [protected]
 

Definition at line 153 of file OSGPassiveViewportBase.cpp.

00153                                                                           :
00154     Inherited                 (source)
00155 {
00156 }

PassiveViewportBase::~PassiveViewportBase void   )  [protected, virtual]
 

Definition at line 160 of file OSGPassiveViewportBase.cpp.

00161 {
00162 }


Member Function Documentation

osg::FieldContainerType & osg::PassiveViewportBase::getClassType void   )  [inline, static]
 

Reimplemented from osg::ViewportBase.

Definition at line 58 of file OSGPassiveViewportBase.inl.

References _type.

Referenced by create().

00059 {
00060     return _type; 
00061 } 

osg::UInt32 osg::PassiveViewportBase::getClassTypeId void   )  [inline, static]
 

Reimplemented from osg::ViewportBase.

Definition at line 65 of file OSGPassiveViewportBase.inl.

References _type, and osg::TypeBase::getId().

00066 {
00067     return _type.getId(); 
00068 } 

FieldContainerType & PassiveViewportBase::getType void   )  [virtual]
 

Reimplemented from osg::ViewportBase.

Definition at line 86 of file OSGPassiveViewportBase.cpp.

References _type.

00087 {
00088     return _type; 
00089 } 

const FieldContainerType & PassiveViewportBase::getType void   )  const [virtual]
 

Reimplemented from osg::ViewportBase.

Definition at line 91 of file OSGPassiveViewportBase.cpp.

References _type.

00092 {
00093     return _type;
00094 } 

UInt32 PassiveViewportBase::getContainerSize void   )  const [virtual]
 

Reimplemented from osg::ViewportBase.

Definition at line 106 of file OSGPassiveViewportBase.cpp.

00107 { 
00108     return sizeof(PassiveViewport); 
00109 }

UInt32 PassiveViewportBase::getBinSize const BitVector whichField  )  [virtual]
 

Reimplemented from osg::ViewportBase.

Definition at line 166 of file OSGPassiveViewportBase.cpp.

References osg::ViewportBase::getBinSize().

00167 {
00168     UInt32 returnValue = Inherited::getBinSize(whichField);
00169 
00170 
00171     return returnValue;
00172 }

void PassiveViewportBase::copyToBin BinaryDataHandler pMem,
const BitVector whichField
[virtual]
 

Reimplemented from osg::ViewportBase.

Definition at line 174 of file OSGPassiveViewportBase.cpp.

References osg::ViewportBase::copyToBin().

00176 {
00177     Inherited::copyToBin(pMem, whichField);
00178 
00179 
00180 }

void PassiveViewportBase::copyFromBin BinaryDataHandler pMem,
const BitVector whichField
[virtual]
 

Reimplemented from osg::ViewportBase.

Definition at line 182 of file OSGPassiveViewportBase.cpp.

References osg::ViewportBase::copyFromBin().

00184 {
00185     Inherited::copyFromBin(pMem, whichField);
00186 
00187 
00188 }

PassiveViewportPtr osg::PassiveViewportBase::create void   )  [inline, static]
 

Reimplemented from osg::ViewportBase.

Definition at line 72 of file OSGPassiveViewportBase.inl.

References osg::AttachmentContainerPtr::dcast(), getClassType(), osg::FieldContainerType::getPrototype(), osg::NullFC, and shallowCopy().

00073 {
00074     PassiveViewportPtr fc; 
00075 
00076     if(getClassType().getPrototype() != OSG::NullFC) 
00077     {
00078         fc = PassiveViewportPtr::dcast(
00079             getClassType().getPrototype()-> shallowCopy()); 
00080     }
00081     
00082     return fc; 
00083 }

PassiveViewportPtr osg::PassiveViewportBase::createEmpty void   )  [inline, static]
 

Reimplemented from osg::ViewportBase.

Definition at line 87 of file OSGPassiveViewportBase.inl.

References osg::FieldContainer::newPtr().

00088 { 
00089     PassiveViewportPtr returnValue; 
00090     
00091     newPtr(returnValue); 
00092 
00093     return returnValue; 
00094 }

FieldContainerPtr PassiveViewportBase::shallowCopy void   )  const [virtual]
 

Reimplemented from osg::ViewportBase.

Definition at line 97 of file OSGPassiveViewportBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by create().

00098 { 
00099     PassiveViewportPtr returnValue; 
00100 
00101     newPtr(returnValue, dynamic_cast<const PassiveViewport *>(this)); 
00102 
00103     return returnValue; 
00104 }

void PassiveViewportBase::executeSyncImpl PassiveViewportBase pOther,
const BitVector whichField
[protected]
 

Definition at line 191 of file OSGPassiveViewportBase.cpp.

References osg::ViewportBase::executeSyncImpl().

Referenced by executeSync().

00193 {
00194 
00195     Inherited::executeSyncImpl(pOther, whichField);
00196 
00197 
00198 }

void PassiveViewportBase::executeSync FieldContainer other,
const BitVector whichField
[protected, virtual]
 

Reimplemented from osg::ViewportBase.

Definition at line 113 of file OSGPassiveViewportBase.cpp.

References executeSyncImpl().

00115 {
00116     this->executeSyncImpl((PassiveViewportBase *) &other, whichField);
00117 }

void osg::PassiveViewportBase::operator= const PassiveViewportBase source  )  [private]
 

* static const char* osg::Viewport::getClassname void   )  [inline, static, inherited]
 

Definition at line 67 of file OSGViewport.h.

00067 { return "Viewport"; };

void osg::Viewport::setSize Real32  left,
Real32  bottom,
Real32  right,
Real32  top
[inline, inherited]
 

Set all of the size-related fields of the viewport.

Does not call begin/endEdit internally!

Definition at line 66 of file OSGViewport.inl.

References osg::ViewportBase::_sfBottom, osg::ViewportBase::_sfLeft, osg::ViewportBase::_sfRight, osg::ViewportBase::_sfTop, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00068 {
00069     _sfLeft.setValue( left );
00070     _sfRight.setValue( right );
00071     _sfBottom.setValue( bottom );
00072     _sfTop.setValue( top );
00073 }

Int32 Viewport::getPixelLeft void   )  const [inherited]
 

Calculate the positon of the left border of the viewport. Needs a valid _sfParent value.

Definition at line 138 of file OSGViewport.cpp.

References osg::ViewportBase::getLeft(), and osg::ViewportBase::getParent().

Referenced by osg::Camera::calcViewRay(), osg::TextureGrabBackground::clear(), osg::DVRIsoShader::deactivate_ColorMatrixShading(), osg::Viewport::draw(), osg::TextureGrabForeground::draw(), osg::PassiveViewport::draw(), osg::GrabForeground::draw(), osg::Viewport::getPixelWidth(), osg::Viewport::isFullWindow(), and osg::RenderAction::start().

00139 {
00140     if(getLeft() > 1)
00141         return Int32(getLeft());
00142 
00143     return Int32(getParent()->getWidth() * getLeft());
00144 }

Int32 Viewport::getPixelRight void   )  const [inherited]
 

Calculate the positon of the right border of the viewport. Needs a valid _sfParent value.

Definition at line 149 of file OSGViewport.cpp.

References osg::ViewportBase::getParent(), and osg::ViewportBase::getRight().

Referenced by osg::DVRIsoShader::deactivate_ColorMatrixShading(), osg::Viewport::draw(), osg::PassiveViewport::draw(), osg::Viewport::getPixelWidth(), osg::Viewport::isFullWindow(), and osg::RenderAction::start().

00150 {
00151     // >1: pixel
00152     if(getRight() > 1)
00153         return Int32(getRight());
00154 
00155     // <=1: partial screen, use 1 less to not overlap other windows
00156     return Int32(getParent()->getWidth() * getRight() - 1);
00157 }

Int32 Viewport::getPixelBottom void   )  const [inherited]
 

Calculate the positon of the bottom border of the viewport. Needs a valid _sfParent value.

Definition at line 162 of file OSGViewport.cpp.

References osg::ViewportBase::getBottom(), and osg::ViewportBase::getParent().

Referenced by osg::TextureGrabBackground::clear(), osg::DVRIsoShader::deactivate_ColorMatrixShading(), osg::Viewport::draw(), osg::TextureGrabForeground::draw(), osg::PassiveViewport::draw(), osg::GrabForeground::draw(), osg::Viewport::getPixelHeight(), osg::Viewport::isFullWindow(), and osg::RenderAction::start().

00163 {
00164     if(getBottom() > 1)
00165         return Int32(getBottom());
00166 
00167     return Int32(getParent()->getHeight() * getBottom());
00168 }

Int32 Viewport::getPixelTop void   )  const [inherited]
 

Calculate the positon of the top border of the viewport. Needs a valid _sfParent value.

Definition at line 173 of file OSGViewport.cpp.

References osg::ViewportBase::getParent(), and osg::ViewportBase::getTop().

Referenced by osg::Camera::calcViewRay(), osg::DVRIsoShader::deactivate_ColorMatrixShading(), osg::Viewport::draw(), osg::PassiveViewport::draw(), osg::Viewport::getPixelHeight(), osg::Viewport::isFullWindow(), and osg::RenderAction::start().

00174 {
00175     // >1: pixel
00176     if(getTop() > 1)
00177         return Int32(getTop());
00178 
00179     // <=1: partial screen, use 1 less to not overlap other windows
00180     return Int32(getParent()->getHeight() * getTop() - 1);
00181 }

Int32 osg::Viewport::getPixelWidth void   )  const [inline, inherited]
 

Calculate the width of the viewport in Pixel.

Definition at line 48 of file OSGViewport.inl.

References osg::Viewport::getPixelLeft(), and osg::Viewport::getPixelRight().

Referenced by osg::TextureTransformChunk::activate(), osg::TexGenChunk::activate(), osg::GraphicStatisticsForeground::calcPosAndSize(), osg::Camera::calcViewRay(), osg::TextureTransformChunk::changeFrom(), osg::TexGenChunk::changeFrom(), osg::TextureGrabBackground::clear(), osg::SkyBackground::clear(), osg::PolygonBackground::clear(), osg::ImageBackground::clear(), osg::TextureGrabForeground::draw(), osg::SimpleStatisticsForeground::draw(), osg::PolygonForeground::draw(), osg::GraphicStatisticsForeground::draw(), osg::GrabForeground::draw(), osg::GraphicStatisticsForeground::drawBar(), osg::GraphicStatisticsForeground::drawChart(), osg::GraphicStatisticsForeground::drawLineChart(), osg::GraphicStatisticsForeground::drawText(), osg::DVRIsoShader::getCoveredScreenRect(), osg::Camera::getFrustum(), osg::Camera::getWorldToScreen(), osg::Camera::setup(), osg::Camera::setupProjection(), osg::RenderAction::start(), osg::SHLChunk::updateCameraOrientation(), osg::SHLChunk::updateCameraPosition(), osg::SHLChunk::updateInvViewMatrix(), and osg::SHLChunk::updateViewMatrix().

00049 {
00050     return getPixelRight() - getPixelLeft() + 1;
00051 }

Int32 osg::Viewport::getPixelHeight void   )  const [inline, inherited]
 

Calculate the height of the viewport in Pixel.

Definition at line 55 of file OSGViewport.inl.

References osg::Viewport::getPixelBottom(), and osg::Viewport::getPixelTop().

Referenced by osg::TextureTransformChunk::activate(), osg::TexGenChunk::activate(), osg::GraphicStatisticsForeground::calcPosAndSize(), osg::Camera::calcViewRay(), osg::TextureTransformChunk::changeFrom(), osg::TexGenChunk::changeFrom(), osg::TextureGrabBackground::clear(), osg::SkyBackground::clear(), osg::PolygonBackground::clear(), osg::ImageBackground::clear(), osg::TextureGrabForeground::draw(), osg::SimpleStatisticsForeground::draw(), osg::PolygonForeground::draw(), osg::GraphicStatisticsForeground::draw(), osg::GrabForeground::draw(), osg::GraphicStatisticsForeground::drawBar(), osg::GraphicStatisticsForeground::drawChart(), osg::GraphicStatisticsForeground::drawLineChart(), osg::GraphicStatisticsForeground::drawText(), osg::DVRIsoShader::getCoveredScreenRect(), osg::Camera::getFrustum(), osg::Camera::getWorldToScreen(), osg::Camera::setup(), osg::Camera::setupProjection(), osg::RenderAction::start(), osg::SHLChunk::updateCameraOrientation(), osg::SHLChunk::updateCameraPosition(), osg::SHLChunk::updateInvViewMatrix(), and osg::SHLChunk::updateViewMatrix().

00056 {
00057     return getPixelTop() - getPixelBottom() + 1;
00058 }

bool Viewport::isFullWindow void   )  const [inherited]
 

Checks if the viewport fills the whole window. Needs a valid _sfParent value.

Definition at line 186 of file OSGViewport.cpp.

References osg::ViewportBase::getParent(), osg::Viewport::getPixelBottom(), osg::Viewport::getPixelLeft(), osg::Viewport::getPixelRight(), and osg::Viewport::getPixelTop().

Referenced by osg::Viewport::draw(), and osg::RenderAction::start().

00187 {
00188     return  getPixelBottom() == 0 &&
00189             getPixelLeft()   == 0 &&
00190             getPixelTop()    == getParent()->getHeight() - 1 &&
00191             getPixelRight()  == getParent()->getWidth() - 1;
00192 }

void Viewport::draw DrawAction action  )  [virtual, inherited]
 

Draw the viewport. Restrict the OpenGL rendering to the given part of the window, clear it, draw it using the given DrawAction and add the Foregrounds.

The _sfCamera, _sfBackground and _sfRoot Fields need to be valid, otherwise drawing will fail.

Dev:

Activates scissoring only if the viewport doesn't fill the wholw window, as it significantly slows down some OpenGL implementations.

Reimplemented in osg::ColorBufferViewport, osg::PassiveViewport, and osg::StereoBufferViewport.

Definition at line 210 of file OSGViewport.cpp.

References osg::Action::apply(), osg::ViewportBase::getBackground(), osg::ViewportBase::getCamera(), osg::ViewportBase::getForegrounds(), osg::Viewport::getPixelBottom(), osg::Viewport::getPixelLeft(), osg::Viewport::getPixelRight(), osg::Viewport::getPixelTop(), osg::ViewportBase::getRoot(), osg::ViewportBase::getTravMask(), osg::Viewport::isFullWindow(), osg::NullFC, osg::DrawActionBase::setBackground(), osg::DrawActionBase::setCamera(), osg::Action::setTravMask(), osg::DrawActionBase::setViewport(), osg::MField< FieldTypeT, fieldNameSpace >::size(), and SWARNING.

Referenced by osg::StereoBufferViewport::draw(), and osg::ColorBufferViewport::draw().

00211 {
00212     if(getCamera() == NullFC)
00213     {
00214         SWARNING << "Viewport::draw: no camera!" << std::endl;
00215         return;
00216     }
00217     if(getBackground() == NullFC)
00218     {
00219         SWARNING << "Viewport::draw: no Background!" << std::endl;
00220         return;
00221     }
00222     if(getRoot() == NullFC)
00223     {
00224         SWARNING << "Viewport::draw: no root!" << std::endl;
00225         return;
00226     }
00227 
00228     GLint pl=getPixelLeft(), pr=getPixelRight(), pb=getPixelBottom(), 
00229           pt=getPixelTop();
00230     GLint pw=pr-pl+1,ph=pt-pb+1