Gui::SoFCOffscreenRenderer Class Reference

The SoFCOffscreenRenderer class is used for rendering scenes in offscreen buffers. More...

#include <SoFCOffscreenRenderer.h>

List of all members.

Public Member Functions

std::string createMIBA () const
QStringList getWriteImageFiletypeInfo ()
 This method returns all image file formats supported by Coin3D (see getWriteFiletypeInfo()) with all QImage file formats that are not directly supported by Coin3D, if so.
void writeToImage (QImage &) const
 Writes the rendered image buffer directly into a QImage object instead of an image file.
void writeToImageFile (const char *filename, const char *comment) const
 Saves the buffer to filename, in the filetype specified by filetypeextensions.

Static Public Member Functions

static SoFCOffscreenRendererinstance ()
 The SoOffscreenRenderer base class seems to have a huge memory leak.

Public Attributes

SbMatrix _Matrix

Protected Member Functions

 SoFCOffscreenRenderer (SoGLRenderAction *action)
 Constructor.
 SoFCOffscreenRenderer (const SbViewportRegion &viewportregion)
 Constructor.
 ~SoFCOffscreenRenderer ()
 Destructor.

Detailed Description

The SoFCOffscreenRenderer class is used for rendering scenes in offscreen buffers.

Author:
Werner Mayer

Definition at line 39 of file SoFCOffscreenRenderer.h.


Constructor & Destructor Documentation

SoFCOffscreenRenderer::SoFCOffscreenRenderer ( const SbViewportRegion &  viewportregion  )  [protected]

Constructor.

Argument is the viewportregion we should use when rendering. An internal SoGLRenderAction will be constructed.

Definition at line 63 of file SoFCOffscreenRenderer.cpp.

SoFCOffscreenRenderer::SoFCOffscreenRenderer ( SoGLRenderAction *  action  )  [protected]

Constructor.

Argument is the action we should apply to the scene graph when rendering the scene. Information about the viewport is extracted from the action.

Definition at line 68 of file SoFCOffscreenRenderer.cpp.

SoFCOffscreenRenderer::~SoFCOffscreenRenderer (  )  [protected]

Destructor.

Definition at line 73 of file SoFCOffscreenRenderer.cpp.


Member Function Documentation

std::string SoFCOffscreenRenderer::createMIBA (  )  const

Definition at line 252 of file SoFCOffscreenRenderer.cpp.

References _Matrix.

Referenced by writeToImageFile().

QStringList SoFCOffscreenRenderer::getWriteImageFiletypeInfo (  ) 

This method returns all image file formats supported by Coin3D (see getWriteFiletypeInfo()) with all QImage file formats that are not directly supported by Coin3D, if so.

Definition at line 204 of file SoFCOffscreenRenderer.cpp.

References Mesh2Shape::ext.

Referenced by StdViewScreenShot::activated().

SoFCOffscreenRenderer & SoFCOffscreenRenderer::instance ( void   )  [static]

The SoOffscreenRenderer base class seems to have a huge memory leak.

Whenever an instance is created internal memory doesn't get freed when destroying it. Thus, SoFCOffscreenRenderer is implemented as singleton to allow to create only one global instance. So, the memory is leaking for this instance only.

Definition at line 56 of file SoFCOffscreenRenderer.cpp.

Referenced by MeshGui::ViewProviderMesh::getVisibleFacets(), and Gui::View3DInventorViewer::savePicture().

void SoFCOffscreenRenderer::writeToImage ( QImage &  img  )  const

Writes the rendered image buffer directly into a QImage object instead of an image file.

Definition at line 77 of file SoFCOffscreenRenderer.cpp.

References Gui::BitmapFactory(), Gui::BitmapFactoryInst::convert(), and Py::int.

Referenced by MeshGui::ViewProviderMesh::getVisibleFacets(), Gui::View3DInventorViewer::savePicture(), and writeToImageFile().

void SoFCOffscreenRenderer::writeToImageFile ( const char *  filename,
const char *  comment 
) const

Saves the buffer to filename, in the filetype specified by filetypeextensions.

Note that you must still specify the full filename for the first argument, i.e. the second argument will not automatically be attached to the filename -- it is only used to decide the filetype.

This does basically the same as writeToFile() unless that all QImage file formats are supported if not directly supported by Coin3D.

Definition at line 88 of file SoFCOffscreenRenderer.cpp.

References buffer, createMIBA(), Base::FileInfo::extension(), SketcherExample::f, DrawingExample::file, format, App::GetApplication(), Base::FileInfo::hasExtension(), Base::FileInfo::toStdWString(), writeJPEGComment(), and writeToImage().

Referenced by Gui::View3DInventorViewer::savePicture().


Member Data Documentation

Definition at line 94 of file SoFCOffscreenRenderer.h.

Referenced by createMIBA(), and Gui::View3DInventorViewer::savePicture().


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

Generated on Wed Nov 23 19:02:03 2011 for FreeCAD by  doxygen 1.6.1