version 3.3

VRS::EngineGL Class Reference

#include <vrs/opengl/enginegl.h>

Inheritance diagram for VRS::EngineGL:

VRS::Engine VRS::SharedObj VRS::Visitable

List of all members.

Public Types

enum  {
  GLVersion = 1, GLUVersion = 2, Buffers = 4, BufferBits = 8,
  StackDepths = 16, PointLineInfo = 32, MiscInfo = 64, All = 127
}

Public Member Functions

 EngineGL ()
virtual ~EngineGL ()
virtual void initialize ()
virtual void pushMonoAttribute (const ID &category, MonoAttribute *attr)
 Pushes a mono attribute to an explicitly specified stack (by category).
virtual void popMonoAttribute (const ID &category)
 Pops a mono attribute from an explicitly specified stack (by category).
virtual MonoAttributegetMonoAttribute (const ID &category) const
 Returns the top mono attribute of an explicitly specified stack (by category).
virtual void pushTf (Engine::TFType category=Engine::modelviewMatrix)
 Stores the matrix of the specified stack.
virtual void popTf (Engine::TFType category=Engine::modelviewMatrix)
 Restores the matrix of the specified stack.
virtual void multTf (const Matrix &matrix, Engine::TFType category=Engine::modelviewMatrix)
 Multiplies a given matrix on the current top matrix of the specified stack.
virtual void loadTf (const Matrix &matrix, Engine::TFType category=Engine::modelviewMatrix)
 Replaces the top matrix of the specified stack.
virtual Matrix currentTf (Engine::TFType category=Engine::modelviewMatrix) const
 Returns the current top matrix of the specified stack.
virtual Matrix currentNormalizedDeviceCoordsTf () const
 Returns the current normalized device coords transformation.
virtual Matrix currentPureProjectionTf () const
virtual Matrix currentPureProjectionTfInv () const
 Returns the current projectiopn matrix excluding the ndcTf.
PBufferManagerGLpbufferManager () const
SharedContextGLsharedContext () const
void setSharedContext (SharedContextGL *sctx)
GLuint getDisplayList (SharedObj *obj)
GLuint newDisplayList (SharedObj *obj)
GLuint getTextureObject (SharedObj *obj, GLenum target)
GLuint newTextureObject (SharedObj *obj, GLenum target)
unsigned int maxTextureUnits () const
unsigned int maxVertexTextureUnits () const
unsigned int maxFragmentTextureUnits () const
unsigned int maxCombinedTextureUnits () const
void cleanUp ()
std::string glInfo (int info) const
int majorVersion () const
int minorVersion () const
int version () const
bool isVersion (int major, int minor) const
bool hasExtension (const ID &extensionID) const
 Checks for OpenGL extensions.
bool disableExtension (const ID &extensionID)
 Explicitly disables the given extension.
SO< const HashTable< ID > > enabledExtensions () const
 Returns all OpenGL extensions which can be used.
SO< const HashTable< ID > > disabledExtensions () const
 Returns the OpenGL extensions which have been explicitly disabled.
void allowSoftwareEmulation (bool onOff)
 Specifies if software emulation is allowed.
bool isSoftwareEmulationAllowed () const
 returns whether software emulation is allowed or not.
virtual GLenum lightNumber (Light *) const
void registerCleanUpCallback (SO< Callback1< SO< EngineGL > > > callback)
void unregisterCleanUpCallback (SO< Callback1< SO< EngineGL > > > callback)
 VRS_TYPEINFO (EngineGL, Engine)
virtual void push (Attribute *attr)
virtual void push (MonoAttribute *attr)
 Pushes a mono attribute and calls its painter, shader or simplifier.
virtual void push (PolyAttribute *attr)
 Pushes a poly attribute and calls its painter or simplifier, if available.
virtual void push (Handler *hdl)
 Pushes a handler.
virtual void pop (Attribute *attr)
virtual void pop (MonoAttribute *attr)
 Pops a mono attribute and calls its painter, shader or simplifier.
virtual void pop (PolyAttribute *attr)
 Pops a poly attribute and calls its painter or simplifier, if available.
virtual void pop (Handler *hdl)
 Pops a handler.
virtual void pop (const ID &rid)
 Pops an attribute from the stack specified by its id.
virtual void eval (const Shape *shape)

Static Public Member Functions

static bool registerHandler (Handler *handler)
 Registeres a handler.
static std::string ErrorString (GLenum glErrorCode)
 Returns a text message for the given error code returned by glGetError().

Friends

class GLCanvas
class TextureUnitSelectorPainterGL
class GL2::ShaderTextureUnitSelectorPainter


Member Enumeration Documentation

anonymous enum

Enumerator:
GLVersion 
GLUVersion 
Buffers 
BufferBits 
StackDepths 
PointLineInfo 
MiscInfo 
All 


Constructor & Destructor Documentation

VRS::EngineGL::EngineGL (  ) 

The EngineGL specializes the VRS engine and provides a few additional methods regarding OpenGL. It overloads the matrix methods using the functionality of OpenGL directly. It is associated with a shared context which is responsible for display lists and textures.

virtual VRS::EngineGL::~EngineGL (  )  [virtual]


Member Function Documentation

virtual void VRS::EngineGL::initialize (  )  [virtual]

Installs all default handlers and attributes using the associated engine. The engine must be set.

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::pushMonoAttribute ( const ID category,
MonoAttribute attr 
) [virtual]

Pushes a mono attribute to an explicitly specified stack (by category).

Mono attributes of one category are mutually exclusive, i.e. only the top attribute of the category's stack is considered to be active.

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::popMonoAttribute ( const ID category  )  [virtual]

Pops a mono attribute from an explicitly specified stack (by category).

Reimplemented from VRS::Engine.

virtual MonoAttribute* VRS::EngineGL::getMonoAttribute ( const ID category  )  const [virtual]

Returns the top mono attribute of an explicitly specified stack (by category).

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::pushTf ( Engine::TFType  category = Engine::modelviewMatrix  )  [virtual]

Stores the matrix of the specified stack.

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::popTf ( Engine::TFType  category = Engine::modelviewMatrix  )  [virtual]

Restores the matrix of the specified stack.

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::multTf ( const Matrix matrix,
Engine::TFType  category = Engine::modelviewMatrix 
) [virtual]

Multiplies a given matrix on the current top matrix of the specified stack.

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::loadTf ( const Matrix matrix,
Engine::TFType  category = Engine::modelviewMatrix 
) [virtual]

Replaces the top matrix of the specified stack.

Reimplemented from VRS::Engine.

virtual Matrix VRS::EngineGL::currentTf ( Engine::TFType  category = Engine::modelviewMatrix  )  const [virtual]

Returns the current top matrix of the specified stack.

Reimplemented from VRS::Engine.

virtual Matrix VRS::EngineGL::currentNormalizedDeviceCoordsTf (  )  const [virtual]

Returns the current normalized device coords transformation.

Reimplemented from VRS::Engine.

virtual Matrix VRS::EngineGL::currentPureProjectionTf (  )  const [virtual]

Reimplemented from VRS::Engine.

virtual Matrix VRS::EngineGL::currentPureProjectionTfInv (  )  const [virtual]

Returns the current projectiopn matrix excluding the ndcTf.

Reimplemented from VRS::Engine.

PBufferManagerGL* VRS::EngineGL::pbufferManager (  )  const

The pbuffer manager provides an interface for opengl techniques and shaders, that need to use pbuffers. It holds a set of pbuffers; and when techniques and shaders ask for a pbuffer with certain properties, it returns the best matching pbuffer. To make this pbuffer management work for different techniques and shader used in different engines, the pbuffer manager is created by the shared context and can be requested by the engine only for convenience.

SharedContextGL* VRS::EngineGL::sharedContext (  )  const

void VRS::EngineGL::setSharedContext ( SharedContextGL sctx  ) 

The shared context can be used by one or more engines in order to share display lists and texture objects. The 'setSharedContext' method is called implicitly by GUI-specific canvas classes if they are sure that the OpenGL contexts can actually be shared. OpenGL has a few restrictions to that.

GLuint VRS::EngineGL::getDisplayList ( SharedObj obj  ) 

GLuint VRS::EngineGL::newDisplayList ( SharedObj obj  ) 

The shared context stores a dictionary of display lists, indexed by shapes. This functions provide access to it. This calls are forwarded to the shared context.

GLuint VRS::EngineGL::getTextureObject ( SharedObj obj,
GLenum  target 
)

GLuint VRS::EngineGL::newTextureObject ( SharedObj obj,
GLenum  target 
)

The shared context stores a dictionary of texture objects, indexed by textures. This functions provide access to it. This calls are forwarded to the shared context.

unsigned int VRS::EngineGL::maxTextureUnits (  )  const

Returns the number of texture units usable by this OpenGL canvas.

unsigned int VRS::EngineGL::maxVertexTextureUnits (  )  const

Returns the number of vertex texture units usable by this OpenGL canvas.

unsigned int VRS::EngineGL::maxFragmentTextureUnits (  )  const

Returns the number of fragment texture units usable by this OpenGL canvas.

unsigned int VRS::EngineGL::maxCombinedTextureUnits (  )  const

Returns the number of combined fragment and vertex texture units usable by this OpenGL canvas.

void VRS::EngineGL::cleanUp (  ) 

`cleanUp' deletes unused display lists and texture objects. This method must be called by the engines using this context in every frame, before any cache is rendered, i.e. in start. The method assumes that the context is current. This call is forwarded to the shared context.

static bool VRS::EngineGL::registerHandler ( Handler handler  )  [static]

Registeres a handler.

Reimplemented from VRS::Engine.

std::string VRS::EngineGL::glInfo ( int  info  )  const

int VRS::EngineGL::majorVersion (  )  const

int VRS::EngineGL::minorVersion (  )  const

int VRS::EngineGL::version (  )  const

bool VRS::EngineGL::isVersion ( int  major,
int  minor 
) const

returns the major/minor version number of the OpenGL server. version() == 10*majorVersion() + minorVersion().

bool VRS::EngineGL::hasExtension ( const ID extensionID  )  const

Checks for OpenGL extensions.

bool VRS::EngineGL::disableExtension ( const ID extensionID  ) 

Explicitly disables the given extension.

SO<const HashTable<ID> > VRS::EngineGL::enabledExtensions (  )  const

Returns all OpenGL extensions which can be used.

SO<const HashTable<ID> > VRS::EngineGL::disabledExtensions (  )  const

Returns the OpenGL extensions which have been explicitly disabled.

void VRS::EngineGL::allowSoftwareEmulation ( bool  onOff  ) 

Specifies if software emulation is allowed.

bool VRS::EngineGL::isSoftwareEmulationAllowed (  )  const

returns whether software emulation is allowed or not.

static std::string VRS::EngineGL::ErrorString ( GLenum  glErrorCode  )  [static]

Returns a text message for the given error code returned by glGetError().

virtual GLenum VRS::EngineGL::lightNumber ( Light  )  const [virtual]

Each light in the scene graph is assigned a unique number (for the whole scene graph evaluation). This number represent the OpenGL light enum, and is used by light-evaluating handlers and techniques to locally modify the settings of the light.

void VRS::EngineGL::registerCleanUpCallback ( SO< Callback1< SO< EngineGL > > >  callback  ) 

void VRS::EngineGL::unregisterCleanUpCallback ( SO< Callback1< SO< EngineGL > > >  callback  ) 

A cleanup callback is called when the cleanUp() method of the engine finishes. cleanup callbacks can be used to check if a frame has been finished by the engine.

VRS::EngineGL::VRS_TYPEINFO ( EngineGL  ,
Engine   
)

virtual void VRS::EngineGL::push ( Attribute attr  )  [virtual]

Dispatches the given attribute to the appropriate push-method (MonoAttrbite vs. PolyAttribute).

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::push ( MonoAttribute attr  )  [virtual]

Pushes a mono attribute and calls its painter, shader or simplifier.

The painter, shader, or simplifier for an mono attribute are called in every rendering pass (pre, main, and post traversal), if a matching handler is available at all.

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::push ( PolyAttribute attr  )  [virtual]

Pushes a poly attribute and calls its painter or simplifier, if available.

If the poly attribute is global, its painter or simplifier is called during the pre traversal pass. Local poly attributes are applied in the main rendering passes.

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::push ( Handler hdl  )  [virtual]

Pushes a handler.

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::pop ( Attribute attr  )  [virtual]

Dispatches the given attribute to the appropriate pop-method (MonoAttrbite vs. PolyAttribute).

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::pop ( MonoAttribute attr  )  [virtual]

Pops a mono attribute and calls its painter, shader or simplifier.

The painter, shader, or simplifier for an mono attribute are called in every rendering pass.

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::pop ( PolyAttribute attr  )  [virtual]

Pops a poly attribute and calls its painter or simplifier, if available.

If the poly attribute is global, its painter or simplifier is called after the post traversal (see removeGlobalPolyAttributes). Local poly attributes are applied in the main rendering passes.

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::pop ( Handler hdl  )  [virtual]

Pops a handler.

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::pop ( const ID id  )  [virtual]

Pops an attribute from the stack specified by its id.

In case of poly attributes, the attribute that was pushed at last is removed. -- Use this method with caution, the attributes do not not always apply to the stack one expects them to.

Reimplemented from VRS::Engine.

virtual void VRS::EngineGL::eval ( const Shape shape  )  [virtual]

Evaluates a shape using the appropriate painter or simplifier. During the simplification process, also surface attributes and abstract rendering attributes may by pushed. When the shape is evaluated the first time by a painter or a simplifier for which isSimple() is true, techniques and shaders are considered once before further evaluation. After then, each recursive call to eval() is forwarded to finalEval(). At this stage, surface attributes and abstract rendering attributes should not anymore be pushed by simplifiers or painters anymore, since they would be ignored by techniques and shaders.

Reimplemented from VRS::Engine.


Friends And Related Function Documentation

friend class GLCanvas [friend]

friend class TextureUnitSelectorPainterGL [friend]

friend class GL2::ShaderTextureUnitSelectorPainter [friend]


The documentation for this class was generated from the following file:

Generated on Mon May 21 06:00:20 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact