Loading...
Searching...
No Matches
GLRenderer Class Reference

Render the scene using OpenGL calls. More...

`#include <avogadro/rendering/glrenderer.h>`

## Public Member Functions

void | initialize ()
void | resize (int width, int height)
void | setPixelRatio (float ratio)
void | render ()
void | resetCamera ()
void | resetGeometry ()
std::multimap< float, Identifier > | hits (int x, int y) const
Identifier | hit (int x, int y) const
float | hit (const Vector3f &rayOrigin, const Vector3f &rayEnd, const Vector3f &rayDirection) const
Core::Array< Identifier > | hits (int x1, int y1, int x2, int y2) const
bool | isValid () const
std::string | error () const
const Camera & | camera () const
Camera & | camera ()
const Camera & | overlayCamera () const
Camera & | overlayCamera ()
const Scene & | scene () const
Scene & | scene ()
const SolidPipeline & | solidPipeline () const
SolidPipeline & | solidPipeline ()
const VolumeGeometry & | volume () const
VolumeGeometry & | volume ()
const TextRenderStrategy * | textRenderStrategy () const
TextRenderStrategy * | textRenderStrategy ()
void | setTextRenderStrategy (TextRenderStrategy *tren)

## Public Attributes

std::array< float, 6 > | m_perspectiveFrustum
std::array< float, 6 > | m_orthographicFrustum

## Detailed Description

Author
  Marcus D. Hanwell

## Member Function Documentation

## initialize()

void initialize | ( |  | ) |

Initialize the OpenGL context for rendering.

## resize()

void resize | ( | int | width,
|  | int | height )

Resize the context in response to window management events.

## setPixelRatio()

void setPixelRatio | ( | float | ratio | ) |

Set the ratio of physical to logical pixels.

## render()

void render | ( |  | ) |

Take care of rendering the scene, requires that the context is current.

## resetCamera()

void resetCamera | ( |  | ) |

Reset the view to fit the entire scene.

## resetGeometry()

void resetGeometry | ( |  | ) |

Reset the scene geometry, this should be done when the scene geometry has changed in order to ensure correct clipping.

## hits() [1/2]

std::multimap< float, Identifier > hits | ( | int | x,
|  | int | y ) const

Return the primitives under the display coordinate (x,y), mapped by depth.

## hit() [1/2]

Identifier hit | ( | int | x,
|  | int | y ) const

Return the top primitive under the display coordinate (x,y).

## hit() [2/2]

float hit | ( | const Vector3f & | rayOrigin,
|  | const Vector3f & | rayEnd,
|  | const Vector3f & | rayDirection ) const

Return the depth of provided ray - geometry hit test.

## hits() [2/2]

Core::Array< Identifier > hits | ( | int | x1,
|  | int | y1,
|  | int | x2,
|  | int | y2 ) const

Return the primitives in the rectangular area provided.

## isValid()

bool isValid | ( |  | ) | const

Check whether the GL context is valid and supports required features.

See also
  error() to get more information if the context is not valid.

## error()

std::string error | ( |  | ) | const

Get the error message if the context is not valid. Empty if valid.

## camera()

const Camera & camera | ( |  | ) | const

Get the camera for this renderer.

## overlayCamera()

const Camera & overlayCamera | ( |  | ) | const

Get the overlay camera.

## scene()

const Scene & scene | ( |  | ) | const

Get the scene for this renderer.

## solidPipeline()

const SolidPipeline & solidPipeline | ( |  | ) | const

Get the solid pipeline for this renderer.

## textRenderStrategy() [1/2]

const TextRenderStrategy * textRenderStrategy | ( |  | ) | const

Get/set the text rendering strategy for this object. The renderer takes ownership of the strategy object.

## textRenderStrategy() [2/2]

TextRenderStrategy * textRenderStrategy | ( |  | ) |

Get/set the text rendering strategy for this object. The renderer takes ownership of the strategy object.

## setTextRenderStrategy()

void setTextRenderStrategy | ( | TextRenderStrategy * | tren | ) |

Get/set the text rendering strategy for this object. The renderer takes ownership of the strategy object.

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

- glrenderer.h