Inviwo  0.9.10.1
Inviwo documentation
inviwo::CanvasGL Class Referenceabstract
+ Inheritance diagram for inviwo::CanvasGL:

Public Member Functions

 CanvasGL (size2_t dimensions)
 
virtual void render (std::shared_ptr< const Image > image, LayerType layerType=LayerType::Color, size_t idx=0) override
 
virtual void resize (size2_t size) override
 
virtual void glSwapBuffers ()=0
 
virtual void update () override
 
virtual void setProcessorWidgetOwner (ProcessorWidget *) override
 
virtual size2_t getImageDimensions () const override
 
double getDepthValueAtCoord (ivec2 canvasCoordinate) const
 Retrieve depth value in normalized device coordinates at screen coordinate. More...
 
double getDepthValueAtNormalizedCoord (dvec2 normalizedScreenCoordinate) const
 
- Public Member Functions inherited from inviwo::Canvas
 Canvas (size2_t dimensions)
 
size2_t getCanvasDimensions () const
 
virtual void activate ()=0
 
void setEventPropagator (EventPropagator *propagator)
 
virtual ProcessorWidgetgetProcessorWidgetOwner () const
 
virtual std::unique_ptr< CanvascreateHiddenCanvas ()=0
 
virtual ContextID activeContext () const =0
 
virtual ContextID contextId () const =0
 
virtual void releaseContext ()=0
 
bool isFullScreen () const
 
void setFullScreen (bool fullscreen)
 
void propagateEvent (Event *e)
 

Static Public Member Functions

static void defaultGLState ()
 

Protected Member Functions

void renderLayer (size_t idx=0)
 
void renderNoise ()
 
void drawSquare ()
 
void renderTexture (int)
 
bool ready ()
 
- Protected Member Functions inherited from inviwo::Canvas
virtual void setFullScreenInternal (bool fullscreen)=0
 

Protected Attributes

std::shared_ptr< const Imageimage_
 
const ImageGLimageGL_ = nullptr
 
std::unique_ptr< Meshsquare_
 
const MeshGLsquareGL_ = nullptr
 Non-owning reference. More...
 
bool ready_ = false
 
LayerType layerType_ = LayerType::Color
 
ShadertextureShader_ = nullptr
 non-owning reference
 
ShadernoiseShader_ = nullptr
 non-owning reference
 
size_t activeRenderLayerIdx_ = 0
 
- Protected Attributes inherited from inviwo::Canvas
size2_t screenDimensions_
 
EventPropagatorpropagator_
 
PickingController pickingController_
 
ProcessorWidgetownerWidget_
 
bool isFullScreen_ = false
 

Additional Inherited Members

- Public Types inherited from inviwo::Canvas
using ContextID = const void *
 

Member Function Documentation

◆ getDepthValueAtCoord()

double inviwo::CanvasGL::getDepthValueAtCoord ( ivec2  canvasCoordinate) const

Retrieve depth value in normalized device coordinates at screen coordinate.

Depth is defined in [-1 1], where -1 is the near plane and 1 is the far plane. Will be 1 if no depth value is available.

Parameters
canvasCoordinateCanvas coordinates [0 dim-1]^2
Returns
NDC depth in [-1 1], 1 if no depth value exist.

◆ ready()

bool inviwo::CanvasGL::ready ( )
protected

Sometime on OSX in renderNoise when on the first time using a canvas we get a INVALID_FRAMEBUFFER_OPERATION error to avoid this we have this ready flag to check that the frame buffer is complete.

Member Data Documentation

◆ squareGL_

const MeshGL* inviwo::CanvasGL::squareGL_ = nullptr
protected

Non-owning reference.

Each canvas must have its own MeshGL since QT uses a context per canvas and the vertex array in MeshGL cannot be shared.


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