#include <OSGPassiveViewportBase.h>
Inheritance diagram for osg::PassiveViewportBase:

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 FieldContainerType & | getType (void) |
| virtual const FieldContainerType & | getType (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 | |
| *SFReal32 * | getSFLeft (void) |
| Get the Viewport::_sfLeft field. | |
| SFReal32 * | getSFRight (void) |
| Get the Viewport::_sfRight field. | |
| SFReal32 * | getSFBottom (void) |
| Get the Viewport::_sfBottom field. | |
| SFReal32 * | getSFTop (void) |
| Get the Viewport::_sfTop field. | |
| SFWindowPtr * | getSFParent (void) |
| Get the Viewport::_sfParent field. | |
| SFCameraPtr * | getSFCamera (void) |
| Get the Viewport::_sfCamera field. | |
| SFNodePtr * | getSFRoot (void) |
| Get the Viewport::_sfRoot field. | |
| SFBackgroundPtr * | getSFBackground (void) |
| Get the Viewport::_sfBackground field. | |
| MFForegroundPtr * | getMFForegrounds (void) |
| Get the Viewport::_mfForegrounds field. | |
| SFUInt32 * | getSFTravMask (void) |
| Get the Viewport::_sfTravMask field. | |
| SFReal32 * | getSFDrawTime (void) |
| Get the Viewport::_sfDrawTime field. | |
| Real32 & | getLeft (void) |
| Get the value of the Viewport::_sfLeft field. | |
| const Real32 & | getLeft (void) const |
| Get the value of the Viewport::_sfLeft field. | |
| Real32 & | getRight (void) |
| Get the value of the Viewport::_sfRight field. | |
| const Real32 & | getRight (void) const |
| Get the value of the Viewport::_sfRight field. | |
| Real32 & | getBottom (void) |
| Get the value of the Viewport::_sfBottom field. | |
| const Real32 & | getBottom (void) const |
| Get the value of the Viewport::_sfBottom field. | |
| Real32 & | getTop (void) |
| Get the value of the Viewport::_sfTop field. | |
| const Real32 & | getTop (void) const |
| Get the value of the Viewport::_sfTop field. | |
| WindowPtr & | getParent (void) |
| Get the value of the Viewport::_sfParent field. | |
| const WindowPtr & | getParent (void) const |
| Get the value of the Viewport::_sfParent field. | |
| CameraPtr & | getCamera (void) |
| Get the value of the Viewport::_sfCamera field. | |
| const CameraPtr & | getCamera (void) const |
| Get the value of the Viewport::_sfCamera field. | |
| NodePtr & | getRoot (void) |
| Get the value of the Viewport::_sfRoot field. | |
| const NodePtr & | getRoot (void) const |
| Get the value of the Viewport::_sfRoot field. | |
| BackgroundPtr & | getBackground (void) |
| Get the value of the Viewport::_sfBackground field. | |
| const BackgroundPtr & | getBackground (void) const |
| Get the value of the Viewport::_sfBackground field. | |
| UInt32 & | getTravMask (void) |
| Get the value of the Viewport::_sfTravMask field. | |
| const UInt32 & | getTravMask (void) const |
| Get the value of the Viewport::_sfTravMask field. | |
| Real32 & | getDrawTime (void) |
| Get the value of the Viewport::_sfDrawTime field. | |
| const Real32 & | getDrawTime (void) const |
| Get the value of the Viewport::_sfDrawTime field. | |
| ForegroundPtr & | getForegrounds (const UInt32 index) |
| Get the value of the index element the Viewport::_mfForegrounds field. | |
| MFForegroundPtr & | getForegrounds (void) |
| Get the Viewport::_mfForegrounds field. | |
| const MFForegroundPtr & | getForegrounds (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 FieldContainerType & | getClassType (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 |
Definition at line 80 of file OSGPassiveViewportBase.h.
|
|
Reimplemented from osg::Viewport. Reimplemented in osg::PassiveViewport. Definition at line 84 of file OSGPassiveViewportBase.h. |
|
|
Reimplemented from osg::ViewportBase. Definition at line 89 of file OSGPassiveViewportBase.h. |
|
|
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 };
|
|
|
Definition at line 144 of file OSGPassiveViewportBase.cpp. 00144 : 00145 Inherited() 00146 { 00147 }
|
|
|
Definition at line 153 of file OSGPassiveViewportBase.cpp. 00153 : 00154 Inherited (source) 00155 { 00156 }
|
|
|
Definition at line 160 of file OSGPassiveViewportBase.cpp.
|
|
|
Reimplemented from osg::ViewportBase. Definition at line 58 of file OSGPassiveViewportBase.inl. References _type. Referenced by create(). 00059 { 00060 return _type; 00061 }
|
|
|
Reimplemented from osg::ViewportBase. Definition at line 65 of file OSGPassiveViewportBase.inl. References _type, and osg::TypeBase::getId(). 00066 { 00067 return _type.getId(); 00068 }
|
|
|
Reimplemented from osg::ViewportBase. Definition at line 86 of file OSGPassiveViewportBase.cpp. References _type. 00087 { 00088 return _type; 00089 }
|
|
|
Reimplemented from osg::ViewportBase. Definition at line 91 of file OSGPassiveViewportBase.cpp. References _type. 00092 { 00093 return _type; 00094 }
|
|
|
Reimplemented from osg::ViewportBase. Definition at line 106 of file OSGPassiveViewportBase.cpp. 00107 { 00108 return sizeof(PassiveViewport); 00109 }
|
|
|
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 }
|
|
||||||||||||
|
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 }
|
|
||||||||||||
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
||||||||||||
|
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 }
|
|
||||||||||||
|
Reimplemented from osg::ViewportBase. Definition at line 113 of file OSGPassiveViewportBase.cpp. References executeSyncImpl(). 00115 { 00116 this->executeSyncImpl((PassiveViewportBase *) &other, whichField); 00117 }
|
|
|
|
|
|
Definition at line 67 of file OSGViewport.h.
|
|
||||||||||||||||||||
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
|
|
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 }
|
|
|
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 |