#include <OSGPassiveViewport.h>
Inheritance diagram for osg::PassiveViewport:

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 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 |
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 | |
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 |
Definition at line 57 of file OSGPassiveViewport.h.
|
|
Reimplemented from osg::PassiveViewportBase. Definition at line 61 of file OSGPassiveViewport.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 73 of file OSGPassiveViewport.cpp. 00073 : 00074 Inherited() 00075 { 00076 }
|
|
|
Definition at line 78 of file OSGPassiveViewport.cpp. 00078 : 00079 Inherited(source) 00080 { 00081 }
|
|
|
Definition at line 83 of file OSGPassiveViewport.cpp.
|
|
||||||||||||
|
Reimplemented from osg::Viewport. Definition at line 93 of file OSGPassiveViewport.cpp. References osg::Viewport::changed(). 00094 { 00095 Inherited::changed(whichField, origin); 00096 }
|
|
||||||||||||
|
Reimplemented from osg::Viewport. Definition at line 98 of file OSGPassiveViewport.cpp. References SLOG. 00100 { 00101 SLOG << "Dump PassiveViewport NI" << std::endl; 00102 }
|
|
|
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 }
|
|
|
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 }
|
|
|
Reimplemented from osg::Viewport. Definition at line 89 of file OSGPassiveViewport.cpp.
|
|
|
|
|
|
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 }
|
|
|
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 }
|
|
|
Reimplemented from osg::ViewportBase. Definition at line 86 of file OSGPassiveViewportBase.cpp. References osg::PassiveViewportBase::_type. 00087 { 00088 return _type; 00089 }
|
|
|
Reimplemented from osg::ViewportBase. Definition at line 91 of file OSGPassiveViewportBase.cpp. References osg::PassiveViewportBase::_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(), 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 }
|
|
|
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 osg::PassiveViewportBase::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 osg::PassiveViewportBase::executeSync(). 00193 { 00194 00195 Inherited::executeSyncImpl(pOther, whichField); 00196 00197 00198 }
|
|
||||||||||||
|
||||||||||||
|
||||||||||||
|
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().
|
|
||||||||||||
|
Reimplemented from osg::ViewportBase. Definition at line 113 of file OSGPassiveViewportBase.cpp. References osg::PassiveViewportBase::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(), 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(), 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(), 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(), 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 }
|
|
|