BALL
1.4.79
|
#include <BALL/VIEW/RENDERING/RENDERERS/glRenderer.h>
Classes | |
class | WrongModes |
Public Types | |
enum | RenderMode { RENDER_MODE_UNDEFINED = 0, RENDER_MODE_SOLID, RENDER_MODE_TRANSPARENT, RENDER_MODE_ALWAYS_FRONT } |
enum | BufferMode { DIRECT_RENDERING = 0, DISPLAY_LISTS_RENDERING, REBUILD_DISPLAY_LISTS } |
typedef unsigned int | Name |
Typedef for OPENGL names. More... | |
Public Types inherited from BALL::VIEW::Renderer | |
enum | StereoMode { NO_STEREO = 0, ACTIVE_STEREO, DUAL_VIEW_STEREO, DUAL_VIEW_DIFFERENT_DISPLAY_STEREO, TOP_BOTTOM_STEREO, INTERLACED_STEREO } |
Public Member Functions | |
GLRenderer () | |
Default Constructor. More... | |
virtual | ~GLRenderer () |
Destructor. More... | |
virtual void | clear () |
Explicit default initialization. More... | |
void | dump (std::ostream &s, Size depth) const |
Name | getName (const GeometricObject &object) |
GeometricObject * | getObject (GLRenderer::Name name) const |
virtual bool | init (const Stage &stage, float width, float height) |
Initialise the renderer, e.g. the display lists. More... | |
virtual void | setLights (bool reset_all=false) |
Set the light sources according to the stage. More... | |
virtual void | setSmoothLines (bool smooth_lines) |
virtual bool | getSmoothLines () |
virtual void | pickObjects (Position x1, Position y1, Position x2, Position y2, std::list< GeometricObject * > &objects) |
void | pickObjects1 (Position x1, Position y1, Position x2, Position y2) |
void | pickObjects2 (std::list< GeometricObject * > &objects) |
void | setFogIntensity (float intensity) |
void | enterPickingMode () |
void | exitPickingMode () |
void | setSize (float width, float height) |
Set the size of the display. More... | |
float | getXScale () const |
float | getYScale () const |
virtual void | updateBackgroundColor () |
Update the background color from the stage. More... | |
void | initTransparent () |
void | initSolid () |
void | initAlwaysFront () |
void | setAntialiasing (bool state) |
Enable or disable antialiasing. More... | |
void | removeRepresentation (const Representation &rep) |
Remove all VertexBuffer and DisplayLists for the given Representation. More... | |
void | bufferRepresentation (const Representation &rep) |
Buffer the visualisation for the given Representation into OpenGL VertexBuffer Objects and DisplayLists. More... | |
void | drawBuffered (const Representation &rep) |
Draw the visualisation of the given Representation from the VertexBuffers and a DisplayList. More... | |
bool | hasDisplayListFor (const Representation &rep) const |
Test if a Representation has a DisplayList. More... | |
RenderMode | getRenderMode () const |
void | setRenderMode (RenderMode mode) |
virtual void | renderToBuffer (RenderTarget *renderTarget, BufferMode) |
virtual bool | render (const Representation &representation, bool for_display_list=false) |
virtual void | bufferingDependentRender_ (const Representation &repr, BufferMode mode) |
bool | isExtensionSupported (const String &extension) const |
void | clearVertexBuffersFor (Representation &rep) |
bool | vertexBuffersSupported () const |
String | getVendor () |
String | getRenderer () |
String | getOpenGLVersion () |
vector< String > | getExtensions () |
bool | runningOnVirtualBox () |
bool | enableVertexBuffers (bool state) |
bool | vertexBuffersEnabled () const |
DrawingMode | getDrawingMode () const |
void | initPerspective () |
void | setProjection () |
void | setColorRGBA_ (const ColorRGBA &color) |
void | vertexVector3_ (const Vector3 &v) |
void | updateCamera (const Camera *camera=0) |
void | setupStereo (float eye_separation, float focal_length) |
Position | createTextureFromGrid (const RegularData3D &grid, const ColorMap &map) |
void | removeTextureFor_ (const RegularData3D &grid) |
virtual void | getFrustum (float &near_f, float &far_f, float &left_f, float &right_f, float &top_f, float &bottom_f) |
void | updateMaterialForRepresentation (Representation const *rep) |
Public Member Functions inherited from BALL::VIEW::Renderer | |
Renderer () | |
Renderer (const Renderer &renderer) | |
virtual | ~Renderer () |
virtual bool | init (Scene &scene) |
virtual void | setupEnvironmentMap (const QImage &image) |
Setup an environment map. More... | |
virtual void | useContinuousLoop (bool use_loop) |
bool | isContinuous () |
virtual bool | hasFPScounter () |
virtual double | getFPS () |
virtual bool | finish () |
virtual Vector3 | mapViewportTo3D (Position x, Position y) |
virtual Vector2 | map3DToViewport (const Vector3 &vec) |
virtual bool | renderOneRepresentation (const Representation &representation) |
virtual const Stage & | getStage () const |
virtual void | setStage (const Stage &stage) |
bool | hasStage () const |
Test if a Stage was assigned to the Renderer. More... | |
virtual float | getWidth () const |
virtual float | getHeight () const |
virtual void | setPreviewMode (bool show_preview) |
virtual void | showLightSources (bool show_light_sources) |
virtual void | setStereoMode (StereoMode state) |
virtual StereoMode | getStereoMode () const |
virtual void | setStereoFrustumConversion (int width_factor, int height_factor) |
bool | operator== (const Renderer &) const |
virtual void | render_ (const GeometricObject *object) |
Wrapper for the renderering of special GeometricObjects. More... | |
Protected Types | |
typedef HashMap< const GeometricObject *, Name > | NameHashMap |
typedef HashMap< Name, const GeometricObject * > | GeometricObjectHashMap |
typedef HashMap< const Representation *, GLDisplayList * > | DisplayListHashMap |
typedef HashMap< const Representation *, vector < MeshBuffer * > > | MeshBufferHashMap |
Protected Member Functions | |
bool | mapViewplaneToScreen_ () |
void | renderRepresentation_ (const Representation &representation, bool for_display_list) |
void | renderRepresentations_ (BufferMode mode) |
virtual void | renderLabel_ (const Label &) |
virtual void | renderLine_ (const Line &) |
Render a line. More... | |
virtual void | renderMultiLine_ (const MultiLine &line) |
Render an illuminated line. More... | |
virtual void | renderMesh_ (const Mesh &) |
Render a surface mesh. More... | |
virtual void | renderQuadMesh_ (const QuadMesh &) |
Render a quad mesh. More... | |
void | initDrawingMeshes_ () |
void | initDrawingOthers_ () |
virtual void | renderRuler () |
virtual void | renderPoint_ (const Point &) |
Render a single point. More... | |
virtual void | renderSimpleBox_ (const SimpleBox &) |
Render a simple box (parallel to the axes) More... | |
virtual void | renderBox_ (const Box &) |
Render a box. More... | |
virtual void | renderSphere_ (const Sphere &) |
Render a sphere. More... | |
virtual void | renderDisc_ (const Disc &) |
Render a disc. More... | |
virtual void | renderTube_ (const Tube &) |
Render a tube. More... | |
virtual void | renderTwoColoredLine_ (const TwoColoredLine &) |
Render a line with two colors. More... | |
virtual void | renderTwoColoredTube_ (const TwoColoredTube &) |
Render a tube with two colors. More... | |
virtual void | renderClippingPlane_ (const ClippingPlane &plane) |
virtual void | renderGridVisualisation_ (const GridVisualisation &vol) |
Render a grid slice. More... | |
void | setColor4ub_ (const GeometricObject &object) |
void | createSpheres_ () |
void | createTubes_ () |
void | createBoxes_ () |
void | createDottedSphere_ (int precision) |
void | subdivideTriangle_ (Vector3 &v1, Vector3 &v2, Vector3 &v3, int precision) |
void | createLineBox_ () |
void | createDotBox_ () |
void | createSolidBox_ () |
void | clearNames_ () |
void | normalVector3_ (const Vector3 &v) |
void | translateVector3_ (const Vector3 &v) |
void | texCoordVector3_ (const Vector3 &v) |
void | scaleVector3_ (const Vector3 &v) |
void | rotateVector3Angle_ (const Vector3 &v, Real angle) |
void | scale_ (float f) |
void | initGLU_ (DrawingMode mode) |
void | setOrthographicZoom (float orthographic_zoom) |
float | getOrthographicZoom (void) |
void | generateIlluminationTexture_ (float ka, float kd, float kr, float shininess) |
Position | getTextureIndex_ (Position x, Position y, Position z, Size width, Size height) |
void | setupGridClipPlanes_ (const GridVisualisation &slice) |
void | setMaterial_ (const Stage::Material &mat) |
Protected Member Functions inherited from BALL::VIEW::Renderer |
Friends | |
class | Scene |
GLRenderer Renderer which provides hardware accelerated OPENGL rendering.
Definition at line 63 of file glRenderer.h.
|
protected |
Definition at line 460 of file glRenderer.h.
|
protected |
Definition at line 459 of file glRenderer.h.
|
protected |
Definition at line 461 of file glRenderer.h.
typedef unsigned int BALL::VIEW::GLRenderer::Name |
Typedef for OPENGL names.
Definition at line 113 of file glRenderer.h.
|
protected |
Definition at line 458 of file glRenderer.h.
Enumerator | |
---|---|
DIRECT_RENDERING |
Render without display lists, directly to the Scene. |
DISPLAY_LISTS_RENDERING |
Render the contents of the display lists. |
REBUILD_DISPLAY_LISTS |
Rebuild the contents of the display lists and redraw them. |
Definition at line 87 of file glRenderer.h.
Enumerator | |
---|---|
RENDER_MODE_UNDEFINED | |
RENDER_MODE_SOLID | |
RENDER_MODE_TRANSPARENT | |
RENDER_MODE_ALWAYS_FRONT |
Definition at line 70 of file glRenderer.h.
BALL::VIEW::GLRenderer::GLRenderer | ( | ) |
Default Constructor.
|
virtual |
Destructor.
|
virtual |
|
virtual |
Buffer the visualisation for the given Representation into OpenGL VertexBuffer Objects and DisplayLists.
Reimplemented from BALL::VIEW::Renderer.
|
virtual |
Explicit default initialization.
Reimplemented from BALL::VIEW::Renderer.
|
protected |
void BALL::VIEW::GLRenderer::clearVertexBuffersFor | ( | Representation & | rep | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Position BALL::VIEW::GLRenderer::createTextureFromGrid | ( | const RegularData3D & | grid, |
const ColorMap & | map | ||
) |
|
protected |
void BALL::VIEW::GLRenderer::drawBuffered | ( | const Representation & | rep | ) |
Draw the visualisation of the given Representation from the VertexBuffers and a DisplayList.
void BALL::VIEW::GLRenderer::dump | ( | std::ostream & | s, |
Size | depth | ||
) | const |
void BALL::VIEW::GLRenderer::enterPickingMode | ( | ) |
void BALL::VIEW::GLRenderer::exitPickingMode | ( | ) |
|
protected |
DrawingMode BALL::VIEW::GLRenderer::getDrawingMode | ( | ) | const |
vector<String> BALL::VIEW::GLRenderer::getExtensions | ( | ) |
|
virtual |
Return the frustum used by this renderer.
Reimplemented from BALL::VIEW::Renderer.
|
inline |
GeometricObject* BALL::VIEW::GLRenderer::getObject | ( | GLRenderer::Name | name | ) | const |
String BALL::VIEW::GLRenderer::getOpenGLVersion | ( | ) |
|
protected |
String BALL::VIEW::GLRenderer::getRenderer | ( | ) |
RenderMode BALL::VIEW::GLRenderer::getRenderMode | ( | ) | const |
|
virtual |
|
inlineprotected |
String BALL::VIEW::GLRenderer::getVendor | ( | ) |
float BALL::VIEW::GLRenderer::getXScale | ( | ) | const |
float BALL::VIEW::GLRenderer::getYScale | ( | ) | const |
bool BALL::VIEW::GLRenderer::hasDisplayListFor | ( | const Representation & | rep | ) | const |
Test if a Representation has a DisplayList.
|
virtual |
Initialise the renderer, e.g. the display lists.
Reimplemented from BALL::VIEW::Renderer.
void BALL::VIEW::GLRenderer::initAlwaysFront | ( | ) |
|
protected |
|
protected |
|
protected |
void BALL::VIEW::GLRenderer::initPerspective | ( | ) |
void BALL::VIEW::GLRenderer::initSolid | ( | ) |
void BALL::VIEW::GLRenderer::initTransparent | ( | ) |
Test if a given opengl extension is supported by the current driver. Call this only after Scene::initializeGL();
|
protected |
Maps the current viewplane to screen coordinates. Returns false if the projection matrix is not correctly initialized.
|
protected |
|
virtual |
Pick all objects in the given screen rectangle.
Reimplemented from BALL::VIEW::Renderer.
Pick geometric objects
x1,y1,x2,y2 | the rectangle of the selection |
void BALL::VIEW::GLRenderer::pickObjects2 | ( | std::list< GeometricObject * > & | objects | ) |
Pick geometric objects method2. Call this method after pickObjects1 and rendering the representations.
objects | returns the picked objects |
|
virtual |
Remove all VertexBuffer and DisplayLists for the given Representation.
Reimplemented from BALL::VIEW::Renderer.
void BALL::VIEW::GLRenderer::removeTextureFor_ | ( | const RegularData3D & | grid | ) |
|
virtual |
|
protectedvirtual |
Render a box.
Reimplemented from BALL::VIEW::Renderer.
|
protectedvirtual |
Reimplemented from BALL::VIEW::Renderer.
|
protectedvirtual |
Render a disc.
Reimplemented from BALL::VIEW::Renderer.
|
protectedvirtual |
Render a grid slice.
Reimplemented from BALL::VIEW::Renderer.
|
protectedvirtual |
Reimplemented from BALL::VIEW::Renderer.
|
protectedvirtual |
Render a line.
Reimplemented from BALL::VIEW::Renderer.
|
protectedvirtual |
Render a surface mesh.
Reimplemented from BALL::VIEW::Renderer.
|
protectedvirtual |
Render an illuminated line.
Reimplemented from BALL::VIEW::Renderer.
|
protectedvirtual |
Render a single point.
Reimplemented from BALL::VIEW::Renderer.
|
protectedvirtual |
Render a quad mesh.
Reimplemented from BALL::VIEW::Renderer.
|
protected |
|
protected |
|
protectedvirtual |
Render a ruler.
If supported by the renderer implementation, this function will produce a simple ruler that is rendered together with the other representations. The main use of this function is in the edit mode, where it can help to straighten-up structures and to correctly estimate angles and distances.
Reimplemented from BALL::VIEW::Renderer.
|
protectedvirtual |
Render a simple box (parallel to the axes)
Reimplemented from BALL::VIEW::Renderer.
|
protectedvirtual |
Render a sphere.
Reimplemented from BALL::VIEW::Renderer.
|
virtual |
This function renders into the buffer of the RenderTarget which has to be made current before this function is called. Buffers are not automatically swapped afterwards!
|
protectedvirtual |
Render a tube.
Reimplemented from BALL::VIEW::Renderer.
|
protectedvirtual |
Render a line with two colors.
Reimplemented from BALL::VIEW::Renderer.
|
protectedvirtual |
Render a tube with two colors.
Reimplemented from BALL::VIEW::Renderer.
bool BALL::VIEW::GLRenderer::runningOnVirtualBox | ( | ) |
|
protected |
|
protected |
void BALL::VIEW::GLRenderer::setAntialiasing | ( | bool | state | ) |
Enable or disable antialiasing.
|
protected |
void BALL::VIEW::GLRenderer::setColorRGBA_ | ( | const ColorRGBA & | color | ) |
void BALL::VIEW::GLRenderer::setFogIntensity | ( | float | intensity | ) |
Set the GL_FOG intensity
|
virtual |
Set the light sources according to the stage.
Reimplemented from BALL::VIEW::Renderer.
|
protected |
|
protected |
void BALL::VIEW::GLRenderer::setProjection | ( | ) |
|
inline |
Definition at line 212 of file glRenderer.h.
Set the size of the display.
Reimplemented from BALL::VIEW::Renderer.
|
virtual |
Should the lines in the line representation and the wireframe models be smoothed?
|
protected |
Sets this renderer as a part of a stereo setup.
eye_separation denotes the distance along the right vector used by this "eye".
Reimplemented from BALL::VIEW::Renderer.
|
protected |
|
inlineprotected |
Definition at line 395 of file glRenderer.h.
|
protected |
|
virtual |
Update the background color from the stage.
Reimplemented from BALL::VIEW::Renderer.
|
virtual |
Update the camera position either from a given Camera, or from the default Stage.
Reimplemented from BALL::VIEW::Renderer.
|
inlinevirtual |
Updates the material for the current representation
Reimplemented from BALL::VIEW::Renderer.
Definition at line 283 of file glRenderer.h.
bool BALL::VIEW::GLRenderer::vertexBuffersEnabled | ( | ) | const |
bool BALL::VIEW::GLRenderer::vertexBuffersSupported | ( | ) | const |
void BALL::VIEW::GLRenderer::vertexVector3_ | ( | const Vector3 & | v | ) |
|
friend |
Definition at line 66 of file glRenderer.h.
|
protected |
Definition at line 467 of file glRenderer.h.
|
protected |
Definition at line 441 of file glRenderer.h.
|
protected |
Definition at line 483 of file glRenderer.h.
|
protected |
Definition at line 465 of file glRenderer.h.
|
protected |
Definition at line 477 of file glRenderer.h.
|
protected |
Definition at line 480 of file glRenderer.h.
|
protected |
Definition at line 479 of file glRenderer.h.
|
protected |
Definition at line 425 of file glRenderer.h.
|
protected |
Definition at line 428 of file glRenderer.h.
|
protected |
Definition at line 433 of file glRenderer.h.
|
protected |
Definition at line 451 of file glRenderer.h.
|
protected |
Definition at line 449 of file glRenderer.h.
|
protected |
Definition at line 450 of file glRenderer.h.
|
protected |
Definition at line 481 of file glRenderer.h.
|
protected |
Definition at line 482 of file glRenderer.h.
|
protected |
Definition at line 435 of file glRenderer.h.
|
protected |
Definition at line 453 of file glRenderer.h.
|
protected |
Definition at line 455 of file glRenderer.h.
|
protected |
Definition at line 454 of file glRenderer.h.
|
protected |
Definition at line 476 of file glRenderer.h.
|
protected |
Definition at line 463 of file glRenderer.h.
|
protected |
Definition at line 431 of file glRenderer.h.
|
protected |
Definition at line 469 of file glRenderer.h.
|
protected |
Definition at line 468 of file glRenderer.h.
|
protected |
Definition at line 464 of file glRenderer.h.
|
protected |
Definition at line 485 of file glRenderer.h.
|
protected |
Definition at line 475 of file glRenderer.h.
|
protected |
Definition at line 471 of file glRenderer.h.
|
protected |
Definition at line 466 of file glRenderer.h.
|
protected |
Definition at line 437 of file glRenderer.h.
|
protected |
Definition at line 478 of file glRenderer.h.
|
protected |
Definition at line 474 of file glRenderer.h.
|
protected |
Definition at line 452 of file glRenderer.h.
|
protected |
Definition at line 439 of file glRenderer.h.
|
protected |
Definition at line 473 of file glRenderer.h.
|
protected |
Definition at line 444 of file glRenderer.h.
|
protected |
Definition at line 447 of file glRenderer.h.