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

osg::GLUTWindowBase Class Reference

GLUTWindow Base Class.

#include <OSGGLUTWindowBase.h>

Inheritance diagram for osg::GLUTWindowBase:

osg::Window osg::WindowBase osg::AttachmentContainer osg::FieldContainer List of all members.

Extension handling

bool hasExtension (UInt32 id)
bool hasExtension (const Char8 *s)
void * getFunction (UInt32 id)
void * getFunctionNoCheck (UInt32 id)
void dumpExtensions (void)
GLExtensionFunction getFunctionByName (const Char8 *s)
Real32 getConstantValue (GLenum val)
const Vec2fgetConstantValuev (GLenum val)
const std::vector< std::string > & getRegisteredFunctions (void)
const std::vector< std::string > & getExtensions (void)
const std::vector< std::string > & getIgnoredExtensions (void)
*static void setGLLibraryName (const Char8 *s)
static Int32 getExtensionId (const Char8 *s)
static bool hasCommonExtension (UInt32 id)
static const std::vector<
std::string > & 
getRegisteredExtensions (void)

GL object handling

*void validateGLObject (UInt32 id)
void validateAllGLObjects (void)
GLObjectStatusE getGLObjectStatus (UInt32 id)
void setGLObjectId (UInt32 id, UInt32 id2)
UInt32 getGLObjectId (UInt32 id)
static void refreshGLObject (UInt32 id)
static void reinitializeGLObject (UInt32 id)
static void destroyGLObject (UInt32 id, UInt32 num=1)
static void unpackIdStatus (UInt32 idstatus, UInt32 &id, GLObjectStatusE &status)

GL object handling

void doInitRegisterGLObject (UInt32 id, UInt32 num)
*static void initRegisterGLObject (UInt32 id, UInt32 num)
static UInt32 packIdStatus (UInt32 id, GLObjectStatusE status)

Public Types

typedef GLUTWindowPtr Ptr
enum  { IdFieldId = Inherited::NextFieldId, NextFieldId = IdFieldId + 1 }
typedef ArgsCollector< UInt32GLObjectFunctorArgs
typedef TypedVoidFunctor2Base<
PtrCallArg< Window >, GLObjectFunctorArgs
GLObjectFunctor
typedef void(* GLExtensionFunction )(void)
enum  GLObjectStatusE {
  notused = 1, initialize, reinitialize, initialized,
  needrefresh, destroy, finaldestroy
}
enum  { statusShift = 3, statusMask = 7 }

Public Member Functions

FieldContainer Get
*virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get
*SFInt32getSFId (void)
 Get the GLUTWindow::_sfId field.
Int32getId (void)
 Get the value of the GLUTWindow::_sfId field.
const Int32getId (void) const
 Get the value of the GLUTWindow::_sfId field.
Field Set
*void setId (const Int32 &value)
 Set the value of the GLUTWindow::_sfId field.
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
Sync
*virtual void changed (BitVector whichField, UInt32 origin)
Viewport handling
*void addPort (const ViewportPtr &portP)
void insertPort (UInt32 portIndex, const ViewportPtr &portP)
void replacePort (UInt32 portIndex, const ViewportPtr &portP)
void replacePortBy (const ViewportPtr &portP, const ViewportPtr &newPortP)
void subPort (const ViewportPtr &portP)
void subPort (UInt32 portIndex)
Size handling
*bool isResizePending (void)
virtual void resize (int width, int height)
virtual void resizeGL (void)
void setSize (UInt16 width, UInt16 height)
Drawing
*virtual void frameInit (void)
virtual void frameExit (void)
virtual void draw (DrawAction *action=NULL)
virtual void drawAllViewports (DrawAction *action=NULL)
virtual void render (RenderActionBase *action=NULL)
virtual void renderAllViewports (RenderActionBase *action=NULL)
Window system implementation functions
*virtual void init (void)=0
virtual void activate (void)=0
virtual void deactivate (void)=0
virtual void swap (void)=0
Output
*virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
Field Get
*SFUInt16getSFWidth (void)
 Get the Window::_sfWidth field.
SFUInt16getSFHeight (void)
 Get the Window::_sfHeight field.
MFViewportPtrgetMFPort (void)
 Get the Window::_mfPort field.
SFBoolgetSFResizePending (void)
 Get the Window::_sfResizePending field.
UInt16getWidth (void)
 Get the value of the Window::_sfWidth field.
const UInt16getWidth (void) const
 Get the value of the Window::_sfWidth field.
UInt16getHeight (void)
 Get the value of the Window::_sfHeight field.
const UInt16getHeight (void) const
 Get the value of the Window::_sfHeight field.
bool & getResizePending (void)
 Get the value of the Window::_sfResizePending field.
const bool & getResizePending (void) const
 Get the value of the Window::_sfResizePending field.
ViewportPtrgetPort (const UInt32 index)
 Get the value of the index element the Window::_mfPort field.
MFViewportPtrgetPort (void)
 Get the Window::_mfPort field.
const MFViewportPtrgetPort (void) const
 Get the Window::_mfPort field.
Field Set
*void setWidth (const UInt16 &value)
 Set the value of the Window::_sfWidth field.
void setHeight (const UInt16 &value)
 Set the value of the Window::_sfHeight field.
void setResizePending (const bool &value)
 Set the value of the Window::_sfResizePending 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 GLUTWindowPtr create (void)
 create a new instance of the class
static GLUTWindowPtr createEmpty (void)
 create an empty new instance of the class, do not copy the prototype
Class Get
*static const char * getClassname (void)
Extension registration
*static UInt32 registerExtension (const Char8 *s)
static void ignoreExtensions (const Char8 *s)
static UInt32 registerFunction (const Char8 *s, Int32 ext=-1)
static void registerConstant (GLenum val)
GL object registration
*static UInt32 registerGLObject (GLObjectFunctor functor, UInt32 num=1)

Static Public Attributes

static const osg::BitVector IdFieldMask
static const osg::BitVector MTInfluenceMask
static const Real32 unknownConstant = -1e100
static const osg::BitVector WidthFieldMask
static const osg::BitVector HeightFieldMask
static const osg::BitVector PortFieldMask
static const osg::BitVector ResizePendingFieldMask
static const osg::BitVector GlObjectEventCounterFieldMask
static const osg::BitVector GlObjectLastRefreshFieldMask
static const osg::BitVector GlObjectLastReinitializeFieldMask
static const BitVector AttachmentsFieldMask
static const BitVector NextFieldMask

Protected Member Functions

Constructors
GLUTWindowBase (void)
 GLUTWindowBase (const GLUTWindowBase &source)
Destructors
*virtual ~GLUTWindowBase (void)
Sync
*void executeSyncImpl (GLUTWindowBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
GL setup handling
*virtual void setupGL (void)
Field Get
*SFUInt32getSFGlObjectEventCounter (void)
 Get the Window::_sfGlObjectEventCounter field.
MFUInt32getMFGlObjectLastRefresh (void)
 Get the Window::_mfGlObjectLastRefresh field.
MFUInt32getMFGlObjectLastReinitialize (void)
 Get the Window::_mfGlObjectLastReinitialize field.
UInt32getGlObjectEventCounter (void)
 Get the value of the Window::_sfGlObjectEventCounter field.
const UInt32getGlObjectEventCounter (void) const
 Get the value of the Window::_sfGlObjectEventCounter field.
UInt32getGlObjectLastRefresh (UInt32 index)
 Get the value of the index element the Window::_mfGlObjectLastRefresh field.
MFUInt32getGlObjectLastRefresh (void)
 Get the Window::_mfGlObjectLastRefresh field.
const MFUInt32getGlObjectLastRefresh (void) const
 Get the Window::_mfGlObjectLastRefresh field.
UInt32getGlObjectLastReinitialize (UInt32 index)
 Get the value of the index element the Window::_mfGlObjectLastReinitialize field.
MFUInt32getGlObjectLastReinitialize (void)
 Get the Window::_mfGlObjectLastReinitialize field.
const MFUInt32getGlObjectLastReinitialize (void) const
 Get the Window::_mfGlObjectLastReinitialize field.
Field Set
*void setGlObjectEventCounter (const UInt32 &value)
 Set the value of the Window::_sfGlObjectEventCounter field.
Sync
*void executeSyncImpl (WindowBase *pOther, const BitVector &whichField)

Protected Attributes

Fields
*SFInt32 _sfId
Map for GL cvonstant handling
*typedef std::map< GLenum,
Vec2f
ConstHash
Fields
*SFUInt16 _sfWidth
SFUInt16 _sfHeight
MFViewportPtr _mfPort
SFBool _sfResizePending
SFUInt32 _sfGlObjectEventCounter
MFUInt32 _mfGlObjectLastRefresh
MFUInt32 _mfGlObjectLastReinitialize

Private Types

typedef Window Inherited

Private Member Functions

void operator= (const GLUTWindowBase &source)

Static Private Attributes

static FieldDescription_desc []
 GLUTWindow description.
static FieldContainerType _type

Friends

class FieldContainer
GL object handling helper class
class GLObject

Detailed Description

Definition at line 81 of file OSGGLUTWindowBase.h.


Member Typedef Documentation

typedef Window osg::GLUTWindowBase::Inherited [private]
 

Reimplemented from osg::Window.

Definition at line 85 of file OSGGLUTWindowBase.h.

typedef GLUTWindowPtr osg::GLUTWindowBase::Ptr
 

Reimplemented from osg::WindowBase.

Definition at line 90 of file OSGGLUTWindowBase.h.

typedef ArgsCollector<UInt32> osg::Window::GLObjectFunctorArgs [inherited]
 

Definition at line 96 of file OSGWindow.h.

typedef TypedVoidFunctor2Base<PtrCallArg<Window> , GLObjectFunctorArgs> osg::Window::GLObjectFunctor [inherited]
 

Definition at line 99 of file OSGWindow.h.

typedef void(* osg::Window::GLExtensionFunction)(void) [inherited]
 

Definition at line 101 of file OSGWindow.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
IdFieldId 
NextFieldId 

Reimplemented from osg::Window.

Definition at line 92 of file OSGGLUTWindowBase.h.

00093     {
00094         IdFieldId   = Inherited::NextFieldId,
00095         NextFieldId = IdFieldId   + 1
00096     };

enum osg::Window::GLObjectStatusE [inherited]
 

Enumeration values for the status of the GL objects. This is primarily used to signal the object's callback functions what to do. See OpenGL Objects & Extension Handling for a description.

Enumerator:
notused  Object is not used at all right now.
initialize  The object is being initialized for the first time.
reinitialize  The object is being re-initialized, i.e. it has changed significantly.
initialized  The object is initialized and valid.
needrefresh  The object is initialized but needs a refresh.
destroy  The object is to be destroyed, i.e. removed from the current OpenGL context.
finaldestroy  The object has been removed from all OpenGL contexts and used ressources but be freed now.

Definition at line 78 of file OSGWindow.h.

00079     {
00080         notused      = 1, 
00081         initialize, 
00082         reinitialize, 
00083         initialized,
00084         needrefresh, 
00085         destroy, 
00086         finaldestroy 
00087     };

anonymous enum [inherited]
 

Enumerator:
statusShift  Shift value to transform object id and status into asingle int.
statusMask  Mask value to transform object id and status into asingle int.

Definition at line 92 of file OSGWindow.h.

00092 { statusShift = 3, statusMask = 7 }; 


Constructor & Destructor Documentation

GLUTWindowBase::GLUTWindowBase void   )  [protected]
 

Definition at line 164 of file OSGGLUTWindowBase.cpp.

00164                                    :
00165     _sfId                     (Int32(0)), 
00166     Inherited() 
00167 {
00168 }

GLUTWindowBase::GLUTWindowBase const GLUTWindowBase source  )  [protected]
 

Definition at line 174 of file OSGGLUTWindowBase.cpp.

00174                                                            :
00175     _sfId                     (source._sfId                     ), 
00176     Inherited                 (source)
00177 {
00178 }

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

Definition at line 182 of file OSGGLUTWindowBase.cpp.

00183 {
00184 }


Member Function Documentation

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

Reimplemented from osg::WindowBase.

Definition at line 58 of file OSGGLUTWindowBase.inl.

References _type.

Referenced by create().

00059 {
00060     return _type; 
00061 } 

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

Reimplemented from osg::WindowBase.

Definition at line 65 of file OSGGLUTWindowBase.inl.

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

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

FieldContainerType & GLUTWindowBase::getType void   )  [virtual]
 

Reimplemented from osg::WindowBase.

Definition at line 106 of file OSGGLUTWindowBase.cpp.

References _type.

00107 {
00108     return _type; 
00109 } 

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

Reimplemented from osg::WindowBase.

Definition at line 111 of file OSGGLUTWindowBase.cpp.

References _type.

00112 {
00113     return _type;
00114 } 

UInt32 GLUTWindowBase::getContainerSize void   )  const [virtual]
 

Reimplemented from osg::WindowBase.

Definition at line 126 of file OSGGLUTWindowBase.cpp.

00127 { 
00128     return sizeof(GLUTWindow); 
00129 }

SFInt32 * osg::GLUTWindowBase::getSFId void   )  [inline]
 

Definition at line 101 of file OSGGLUTWindowBase.inl.

References _sfId.

00102 {
00103     return &_sfId;
00104 }

Int32 & osg::GLUTWindowBase::getId void   )  [inline]
 

Definition at line 109 of file OSGGLUTWindowBase.inl.

References _sfId, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00110 {
00111     return _sfId.getValue();
00112 }

const Int32 & osg::GLUTWindowBase::getId void   )  const [inline]
 

Definition at line 116 of file OSGGLUTWindowBase.inl.

References _sfId, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00117 {
00118     return _sfId.getValue();
00119 }

void osg::GLUTWindowBase::setId const Int32 value  )  [inline]
 

Definition at line 123 of file OSGGLUTWindowBase.inl.

References _sfId, and osg::SField< FieldTypeT, fieldNameSpace >::setValue().

00124 {
00125     _sfId.setValue(value);
00126 }

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

Reimplemented from osg::WindowBase.

Definition at line 188 of file OSGGLUTWindowBase.cpp.

References _sfId, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::WindowBase::getBinSize(), IdFieldMask, and osg::FieldBits::NoField.

00189 {
00190     UInt32 returnValue = Inherited::getBinSize(whichField);
00191 
00192     if(FieldBits::NoField != (IdFieldMask & whichField))
00193     {
00194         returnValue += _sfId.getBinSize();
00195     }
00196 
00197 
00198     return returnValue;
00199 }

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

Reimplemented from osg::WindowBase.

Definition at line 201 of file OSGGLUTWindowBase.cpp.

References _sfId, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::WindowBase::copyToBin(), IdFieldMask, and osg::FieldBits::NoField.

00203 {
00204     Inherited::copyToBin(pMem, whichField);
00205 
00206     if(FieldBits::NoField != (IdFieldMask & whichField))
00207     {
00208         _sfId.copyToBin(pMem);
00209     }
00210 
00211 
00212 }

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

Reimplemented from osg::WindowBase.

Definition at line 214 of file OSGGLUTWindowBase.cpp.

References _sfId, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::WindowBase::copyFromBin(), IdFieldMask, and osg::FieldBits::NoField.

00216 {
00217     Inherited::copyFromBin(pMem, whichField);
00218 
00219     if(FieldBits::NoField != (IdFieldMask & whichField))
00220     {
00221         _sfId.copyFromBin(pMem);
00222     }
00223 
00224 
00225 }

GLUTWindowPtr osg::GLUTWindowBase::create void   )  [inline, static]
 

Definition at line 72 of file OSGGLUTWindowBase.inl.

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

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

GLUTWindowPtr osg::GLUTWindowBase::createEmpty void   )  [inline, static]
 

Definition at line 87 of file OSGGLUTWindowBase.inl.

References osg::FieldContainer::newPtr().

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

FieldContainerPtr GLUTWindowBase::shallowCopy void   )  const [virtual]
 

Implements osg::FieldContainer.

Definition at line 117 of file OSGGLUTWindowBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by create().

00118 { 
00119     GLUTWindowPtr returnValue; 
00120 
00121     newPtr(returnValue, dynamic_cast<const GLUTWindow *>(this)); 
00122 
00123     return returnValue; 
00124 }

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

Definition at line 228 of file OSGGLUTWindowBase.cpp.

References _sfId, osg::WindowBase::executeSyncImpl(), IdFieldMask, osg::FieldBits::NoField, and osg::SField< FieldTypeT, fieldNameSpace >::syncWith().

Referenced by executeSync().

00230 {
00231 
00232     Inherited::executeSyncImpl(pOther, whichField);
00233 
00234     if(FieldBits::NoField != (IdFieldMask & whichField))
00235         _sfId.syncWith(pOther->_sfId);
00236 
00237 
00238 }

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

Reimplemented from osg::WindowBase.

Definition at line 133 of file OSGGLUTWindowBase.cpp.

References executeSyncImpl().

00135 {
00136     this->executeSyncImpl((GLUTWindowBase *) &other, whichField);
00137 }

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

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

Definition at line 107 of file OSGWindow.h.

00107 { return "Window"; };

void osg::Window::changed BitVector  whichField,
UInt32  origin
[virtual, inherited]
 

react to field changes

Reimplemented from osg::AttachmentContainer.

Reimplemented in osg::ClusterWindow, osg::MultiDisplayWindow, osg::SortFirstWindow, osg::PassiveWindow, osg::XWindow, and osg::QTWindow.

Definition at line 399 of file OSGWindow.cpp.

References osg::AttachmentContainer::changed().

Referenced by osg::XWindow::changed(), osg::PassiveWindow::changed(), and osg::ClusterWindow::changed().

00400 {
00401     Inherited::changed(whichField, origin);
00402 }

void osg::Window::addPort const ViewportPtr portP  )  [inherited]
 

Definition at line 406 of file OSGWindow.cpp.

References osg::WindowBase::_mfPort, osg::MField< FieldTypeT, fieldNameSpace >::back(), osg::beginEditCP(), osg::endEditCP(), osg::NullFC, osg::ViewportBase::ParentFieldMask, and osg::MField< FieldTypeT, fieldNameSpace >::push_back().

00407 {
00408     if(portP != NullFC)
00409     {
00410         _mfPort.push_back(portP);
00411 // CHECK CHECK
00412 //        _mfPort.back()->setParent(FieldContainer::getPtr<WindowPtr>(*this));
00413 
00414         beginEditCP(portP, Viewport::ParentFieldMask);
00415         {
00416             _mfPort.back()->setParent(WindowPtr(*this));
00417         }
00418         endEditCP  (portP, Viewport::ParentFieldMask);
00419     }
00420 }

void osg::Window::insertPort UInt32  portIndex,
const ViewportPtr portP
[inherited]
 

Definition at line 422 of file OSGWindow.cpp.

References osg::WindowBase::_mfPort, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::beginEditCP(), osg::endEditCP(), osg::MField< FieldTypeT, fieldNameSpace >::insert(), osg::NullFC, and osg::ViewportBase::ParentFieldMask.

00423 {    
00424     MFViewportPtr::iterator portIt = _mfPort.begin();
00425 
00426     if(portP != NullFC)
00427     {
00428         portIt += portIndex;
00429   
00430 // CHECK CHECK      
00431 //        (*(_mfPort.insert(portIt, portP)))->setParent(
00432 //            FieldContainer::getPtr<WindowPtr>(*this));
00433 
00434         beginEditCP(portP, Viewport::ParentFieldMask);
00435         {
00436             (*(_mfPort.insert(portIt, portP)))->setParent(
00437                 WindowPtr(*this));
00438         }
00439         endEditCP  (portP, Viewport::ParentFieldMask);
00440 
00441     }
00442 }

void osg::Window::replacePort UInt32  portIndex,
const ViewportPtr portP
[inherited]
 

Definition at line 445 of file OSGWindow.cpp.

References osg::WindowBase::_mfPort, and osg::NullFC.

00446 {
00447     if(portP != NullFC)
00448     {
00449         _mfPort[portIndex]->setParent(NullFC);
00450         _mfPort[portIndex] = portP;
00451 // CHECK CHECK
00452 //        _mfPort.getValue(portIndex)->setParent(
00453 //            FieldContainer::getPtr<WindowPtr>(*this));
00454         _mfPort[portIndex]->setParent(
00455             WindowPtr(*this));
00456     }
00457 }

void osg::Window::replacePortBy const ViewportPtr portP,
const ViewportPtr newPortP
[inherited]
 

Definition at line 459 of file OSGWindow.cpp.

References osg::WindowBase::_mfPort, osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::MField< FieldTypeT, fieldNameSpace >::find(), and osg::NullFC.

00461 {
00462     MFViewportPtr::iterator portIt = _mfPort.