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

osg::PassiveViewport Class Reference
[Viewports]

Passive Viewport class. See PageSystemWindowViewportsPassive for a description. More...

#include <OSGPassiveViewport.h>

Inheritance diagram for osg::PassiveViewport:

osg::PassiveViewportBase osg::Viewport osg::ViewportBase osg::AttachmentContainer osg::FieldContainer 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

Sync
*virtual void changed (BitVector whichField, UInt32 origin)
Output
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
your_category
*virtual void draw (DrawAction *action)
virtual void render (RenderActionBase *action)
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

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

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

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

Private Types

typedef PassiveViewportBase Inherited

Private Member Functions

void operator= (const PassiveViewport &source)

Static Private Member Functions

static void initMethod (void)

Friends

class FieldContainer
class PassiveViewportBase

Detailed Description

A PassiveViewport is a basic Viewport for integration into other OpenGL programs. See Viewport for a description.

Definition at line 57 of file OSGPassiveViewport.h.


Member Typedef Documentation

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

Reimplemented from osg::PassiveViewportBase.

Definition at line 61 of file OSGPassiveViewport.h.

typedef PassiveViewportPtr osg::PassiveViewportBase::Ptr [inherited]
 

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

PassiveViewport::PassiveViewport void   )  [protected]
 

Definition at line 73 of file OSGPassiveViewport.cpp.

00073                                      :
00074     Inherited()
00075 {
00076 }

PassiveViewport::PassiveViewport const PassiveViewport source  )  [protected]
 

Definition at line 78 of file OSGPassiveViewport.cpp.

00078                                                               :
00079     Inherited(source)
00080 {
00081 }

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

Definition at line 83 of file OSGPassiveViewport.cpp.

00084 {
00085 }


Member Function Documentation

void PassiveViewport::changed BitVector  whichField,
UInt32  origin
[virtual]
 

Reimplemented from osg::Viewport.

Definition at line 93 of file OSGPassiveViewport.cpp.

References osg::Viewport::changed().

00094 {
00095     Inherited::changed(whichField, origin);
00096 }

void PassiveViewport::dump UInt32  uiIndent = 0,
const BitVector  bvFlags = 0
const [virtual]
 

Reimplemented from osg::Viewport.

Definition at line 98 of file OSGPassiveViewport.cpp.

References SLOG.

00100 {
00101     SLOG << "Dump PassiveViewport NI" << std::endl;
00102 }

void PassiveViewport::draw DrawAction action  )  [virtual]
 

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 from osg::Viewport.

Definition at line 105 of file OSGPassiveViewport.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::NullFC, osg::DrawActionBase::setBackground(), osg::ViewportBase::setBottom(), osg::DrawActionBase::setCamera(), osg::ViewportBase::setLeft(), osg::ViewportBase::setRight(), osg::ViewportBase::setTop(), osg::DrawActionBase::setViewport(), and SWARNING.

00106 {
00107     if ( getCamera() == NullFC )
00108     {
00109         SWARNING << "PassiveViewport::draw: no camera!" << std::endl;
00110         return;
00111     }
00112     if ( getBackground() == NullFC )
00113     {
00114         SWARNING << "PassiveViewport::draw: no background!" << std::endl;
00115         return;
00116     }
00117     if ( getRoot() == NullFC )
00118     {
00119         SWARNING << "PassiveViewport::draw: no root!" << std::endl;
00120         return;
00121     }
00122 
00123     GLint vp[4];
00124     glGetIntegerv(GL_VIEWPORT, vp);
00125     setLeft(Real32(vp[0]));
00126     setBottom(Real32(vp[1]));
00127     setRight(Real32(vp[0] + vp[2]));
00128     setTop(Real32(vp[1] + vp[3])); 
00129     
00130     GLint pl=getPixelLeft(), pr=getPixelRight(), pb=getPixelBottom(), 
00131           pt=getPixelTop();
00132     GLint pw=pr-pl+1,ph=pt-pb+1;
00133 
00134     glViewport( pl, pb, pw, ph );
00135     glScissor( pl, pb, pw, ph );
00136     
00137     glEnable( GL_SCISSOR_TEST );
00138 
00139     action->setViewport( this );
00140     action->setCamera( getCamera().getCPtr() );
00141     action->setBackground( getBackground().getCPtr() );
00142     
00143     getCamera()->setup( action, *this );
00144     getBackground()->clear( action, this );
00145 
00146     action->apply( getRoot() );
00147 
00148     for ( UInt16 i=0; i < getForegrounds().size(); i++ )
00149         getForegrounds( i )->draw( action, this );
00150 
00151     glDisable( GL_SCISSOR_TEST );
00152 }

void PassiveViewport::render RenderActionBase action  )  [virtual]
 

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 from osg::Viewport.

Definition at line 155 of file OSGPassiveViewport.cpp.

References osg::Action::apply(), osg::ViewportBase::getBackground(), osg::ViewportBase::getCamera(), osg::ViewportBase::getForegrounds(), osg::ViewportBase::getRoot(), osg::NullFC, osg::DrawActionBase::setBackground(), osg::ViewportBase::setBottom(), osg::DrawActionBase::setCamera(), osg::ViewportBase::setLeft(), osg::ViewportBase::setRight(), osg::ViewportBase::setTop(), osg::DrawActionBase::setViewport(), osg::MField< FieldTypeT, fieldNameSpace >::size(), and SWARNING.

00156 {
00157     if ( getCamera() == NullFC )
00158     {
00159         SWARNING << "Viewport::render: no camera!" << std::endl;
00160         return;
00161     }
00162     if ( getBackground() == NullFC )
00163     {
00164         SWARNING << "Viewport::render: no background!" << std::endl;
00165         return;
00166     }
00167     if ( getRoot() == NullFC )
00168     {
00169         SWARNING << "Viewport::render: no root!" << std::endl;
00170         return;
00171     }
00172 
00173     GLint vp[4];
00174     glGetIntegerv(GL_VIEWPORT, vp);
00175     setLeft(Real32(vp[0]));
00176     setBottom(Real32(vp[1]));
00177     setRight(Real32(vp[0] + vp[2] - 1));
00178     setTop(Real32(vp[1] + vp[3] - 1)); 
00179 
00180 /*
00181     GLint pl=getPixelLeft(), pr=getPixelRight(), pb=getPixelBottom(), 
00182           pt=getPixelTop();
00183     GLint pw=pr-pl+1,ph=pt-pb+1;
00184     bool full = isFullWindow();
00185 
00186     glViewport( pl, pb, pw, ph );
00187     glScissor( pl, pb, pw, ph );
00188 
00189     if ( ! full )
00190         glEnable( GL_SCISSOR_TEST );
00191     */
00192 
00193     action->setCamera    (getCamera    ().getCPtr());
00194     action->setBackground(getBackground().getCPtr());
00195     action->setViewport  (this                     );
00196 
00197 //  getCamera()->setup( action, *this );
00198 //  getBackground()->clear( action, this );
00199 
00200     
00201 
00202     action->apply( getRoot() );
00203 
00204     for(UInt16 i=0; i < getForegrounds().size(); i++)
00205         getForegrounds(i)->draw(action, this);
00206 
00207 /*
00208     if ( ! full )
00209         glDisable( GL_SCISSOR_TEST );
00210         */
00211 }

void PassiveViewport::initMethod void   )  [static, private]
 

Reimplemented from osg::Viewport.

Definition at line 89 of file OSGPassiveViewport.cpp.

00090 {
00091 }

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

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

Reimplemented from osg::ViewportBase.

Definition at line 58 of file OSGPassiveViewportBase.inl.

References osg::PassiveViewportBase::_type.

Referenced by osg::PassiveViewportBase::create().

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::ViewportBase.

Definition at line 65 of file OSGPassiveViewportBase.inl.

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

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

FieldContainerType & PassiveViewportBase::getType void   )  [virtual, inherited]
 

Reimplemented from osg::ViewportBase.

Definition at line 86 of file OSGPassiveViewportBase.cpp.

References osg::PassiveViewportBase::_type.

00087 {
00088     return _type; 
00089 } 

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

Reimplemented from osg::ViewportBase.

Definition at line 91 of file OSGPassiveViewportBase.cpp.

References osg::PassiveViewportBase::_type.

00092 {
00093     return _type;
00094 } 

UInt32 PassiveViewportBase::getContainerSize void   )  const [virtual, inherited]
 

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, inherited]
 

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, inherited]
 

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, inherited]
 

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, inherited]
 

Reimplemented from osg::ViewportBase.

Definition at line 72 of file OSGPassiveViewportBase.inl.

References osg::AttachmentContainerPtr::dcast(), osg::PassiveViewportBase::getClassType(), osg::FieldContainerType::getPrototype(), osg::NullFC, and osg::PassiveViewportBase::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, inherited]
 

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, inherited]
 

Reimplemented from osg::ViewportBase.

Definition at line 97 of file OSGPassiveViewportBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by osg::PassiveViewportBase::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, inherited]
 

Definition at line 191 of file OSGPassiveViewportBase.cpp.

References osg::ViewportBase::executeSyncImpl().

Referenced by osg::PassiveViewportBase::executeSync().

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

void ViewportBase::executeSyncImpl ViewportBase pOther,
const BitVector whichField
[protected, inherited]
 

Definition at line 509 of file OSGViewportBase.cpp.

References osg::ViewportBase::_mfForegrounds, osg::ViewportBase::_sfBackground, osg::ViewportBase::_sfBottom, osg::ViewportBase::_sfCamera, osg::ViewportBase::_sfDrawTime, osg::ViewportBase::_sfLeft, osg::ViewportBase::_sfParent, osg::ViewportBase::_sfRight, osg::ViewportBase::_sfRoot, osg::ViewportBase::_sfTop, osg::ViewportBase::_sfTravMask, osg::ViewportBase::BackgroundFieldMask, osg::ViewportBase::BottomFieldMask, osg::ViewportBase::CameraFieldMask, osg::ViewportBase::DrawTimeFieldMask, osg::AttachmentContainer::executeSyncImpl(), osg::ViewportBase::ForegroundsFieldMask, osg::ViewportBase::LeftFieldMask, osg::FieldBits::NoField, osg::ViewportBase::ParentFieldMask, osg::ViewportBase::RightFieldMask, osg::ViewportBase::RootFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::syncWith(), osg::SField< FieldTypeT, fieldNameSpace >::syncWith(), osg::ViewportBase::TopFieldMask, and osg::ViewportBase::TravMaskFieldMask.

Referenced by osg::ViewportBase::executeSync(), osg::StereoBufferViewportBase::executeSyncImpl(), osg::PassiveViewportBase::executeSyncImpl(), and osg::ColorBufferViewportBase::executeSyncImpl().

00511 {
00512 
00513     Inherited::executeSyncImpl(pOther, whichField);
00514 
00515     if(FieldBits::NoField != (LeftFieldMask & whichField))
00516         _sfLeft.syncWith(pOther->_sfLeft);
00517 
00518     if(FieldBits::NoField != (RightFieldMask & whichField))
00519         _sfRight.syncWith(pOther->_sfRight);
00520 
00521     if(FieldBits::NoField != (BottomFieldMask & whichField))
00522         _sfBottom.syncWith(pOther->_sfBottom);
00523 
00524     if(FieldBits::NoField != (TopFieldMask & whichField))
00525         _sfTop.syncWith(pOther->_sfTop);
00526 
00527     if(FieldBits::NoField != (ParentFieldMask & whichField))
00528         _sfParent.syncWith(pOther->_sfParent);
00529 
00530     if(FieldBits::NoField != (CameraFieldMask & whichField))
00531         _sfCamera.syncWith(pOther->_sfCamera);
00532 
00533     if(FieldBits::NoField != (RootFieldMask & whichField))
00534         _sfRoot.syncWith(pOther->_sfRoot);
00535 
00536     if(FieldBits::NoField != (BackgroundFieldMask & whichField))
00537         _sfBackground.syncWith(pOther->_sfBackground);
00538 
00539     if(FieldBits::NoField != (ForegroundsFieldMask & whichField))
00540         _mfForegrounds.syncWith(pOther->_mfForegrounds);
00541 
00542     if(FieldBits::NoField != (TravMaskFieldMask & whichField))
00543         _sfTravMask.syncWith(pOther->_sfTravMask);
00544 
00545     if(FieldBits::NoField != (DrawTimeFieldMask & whichField))
00546         _sfDrawTime.syncWith(pOther->_sfDrawTime);
00547 
00548 
00549 }

void AttachmentContainer::executeSyncImpl AttachmentContainer pOther,
const BitVector whichField
[protected, inherited]
 

Definition at line 316 of file OSGAttachmentContainer.cpp.

References osg::AttachmentContainer::_attachmentMap, osg::AttachmentContainer::AttachmentsFieldMask, osg::FieldContainer::executeSyncImpl(), osg::FieldBits::NoField, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith().

Referenced by osg::AttachmentContainer::executeSync(), osg::WindowBase::executeSyncImpl(), osg::ViewportBase::executeSyncImpl(), osg::ShaderParameterBase::executeSyncImpl(), osg::Node::executeSyncImpl(), osg::NodeCore::executeSyncImpl(), osg::MaterialBase::executeSyncImpl(), osg::ImageComposerBase::executeSyncImpl(), osg::ImageBase::executeSyncImpl(), osg::ForegroundBase::executeSyncImpl(), osg::DisplayCalibrationBase::executeSyncImpl(), osg::CameraBase::executeSyncImpl(), and osg::BackgroundBase::executeSyncImpl().

00319 {
00320     Inherited::executeSyncImpl(pOther, whichField);
00321 
00322     if (FieldBits::NoField != (AttachmentsFieldMask & whichField))
00323     {
00324         _attachmentMap.syncWith(pOther->_attachmentMap);
00325     }
00326 }

void osg::FieldContainer::executeSyncImpl FieldContainer pOther,
const BitVector whichField
[inline, protected, inherited]
 

Definition at line 333 of file OSGFieldContainerImpl.inl.

Referenced by osg::StateBase::executeSyncImpl(), osg::DVRShaderBase::executeSyncImpl(), osg::DVRClipGeometryBase::executeSyncImpl(), osg::AttachmentContainer::executeSyncImpl(), and osg::Attachment::executeSyncImpl().

00335 {
00336 }

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

Reimplemented from osg::ViewportBase.

Definition at line 113 of file OSGPassiveViewportBase.cpp.

References osg::PassiveViewportBase::executeSyncImpl().

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

* 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(), 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(), 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(), 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(), 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