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

#include <SoFCOffscreenRenderer.h>

Public Member Functions

std::string createMIBA (const SbMatrix &mat) 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. More...
 
void writeToImage (QImage &) const
 Writes the rendered image buffer directly into a QImage object instead of an image file. More...
 
void writeToImageFile (const char *filename, const char *comment, const SbMatrix &mat, const QImage &img)
 Saves the buffer to filename, in the filetype specified by filetypeextensions. More...
 

Static Public Member Functions

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

Protected Member Functions

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

Detailed Description

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

Author
Werner Mayer

Constructor & Destructor Documentation

◆ SoFCOffscreenRenderer() [1/2]

SoFCOffscreenRenderer::SoFCOffscreenRenderer ( const SbViewportRegion &  viewportregion)
protected

Constructor.

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

◆ SoFCOffscreenRenderer() [2/2]

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.

◆ ~SoFCOffscreenRenderer()

SoFCOffscreenRenderer::~SoFCOffscreenRenderer ( )
protected

Destructor.

Member Function Documentation

◆ createMIBA()

std::string SoFCOffscreenRenderer::createMIBA ( const SbMatrix &  mat) const

◆ getWriteImageFiletypeInfo()

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.

◆ instance()

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.

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

◆ writeToImage()

void SoFCOffscreenRenderer::writeToImage ( QImage &  img) const

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

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

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

◆ writeToImageFile()

void SoFCOffscreenRenderer::writeToImageFile ( const char *  filename,
const char *  comment,
const SbMatrix &  mat,
const QImage &  img 
)

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.

If comment is set to '$MIBA' information regarding the MIBA standard is embedded to the picture, otherwise the comment is embedded as is. The appropriate file format must support embedding meta information which is provided by JPEG or PNG.

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

References createMIBA(), App::GetApplication(), and DraftVecUtils::toString().

Referenced by Gui::View3DInventorPy::saveImage().


The documentation for this class was generated from the following files:
  • Sources/FreeCAD/src/Gui/SoFCOffscreenRenderer.h
  • Sources/FreeCAD/src/Gui/SoFCOffscreenRenderer.cpp