MeVisLab Resolution Independence API
SoRenderArea Class Reference

SoRenderArea encapsulates the features of SoQtRenderArea in an Inventor Node. More...

#include <SoRenderArea.h>

Inheritance diagram for SoRenderArea:
SoViewerNode SoFullViewer SoExaminerViewer

Public Member Functions

 SoRenderArea ()
 constructor
 
void * createViewer (void *hwnd, SoNode *scene) override
 create a viewer in the given window void pointer is used to be compatible to any windows system
 
void deleteViewer (void *viewer) override
 delete the previously created viewer
 
virtual void setupViewer ()
 sets all values from fields
 
virtual void setScene (SoNode *scene)
 This method gets called by createViewer.
 
virtual void fieldChanged (SoSensor *sensor)
 priority 0 sensor call for all fields:
 
virtual void recordChanged (SoSensor *sensor)
 timer sensor call:
 
virtual void startRecordingChanged (SoField *)
 start recording:
 
virtual void stopRecordingChanged (SoField *)
 stop recording:
 
virtual void snapshotChanged (SoField *)
 doSnapshot changed
 
virtual void updateMLOutputChanged (SoField *)
 updateMLOutput changed
 
virtual void createAviChanged (SoField *)
 createAvi:
 
virtual void enableKeyCommandsChanged (SoField *)
 
MLuint8 * readBuffer (int &w, int &h)
 read the gl back buffer (ownership is passed to caller, memory needs to be cleared by delete)
 
bool getBufferSize (int &w, int &h)
 returns current size of image (returns FALSE if there is no viewer)
 
virtual SbBool handleEvent (QEvent *anyevent)
 called by handleEventCB for each event in viewer
 
virtual SbBool shouldChangeCursor ()
 
void syncFromViewerNode (SoViewerNode *node) override
 sync from given src viewer node
 
virtual void getSyncFieldNames (SbStringList &list)
 collect the fields that should be synced on cloned viewers if you derive this method, make sure to call the super class implementation too
 
void setStatus (const char *str)
 set the status in status field and also with progress CB
 
- Public Member Functions inherited from SoViewerNode
 SoViewerNode ()
 
virtual void * getCurrentViewer ()
 returns the currently viewer (or NULL, if none was created)
 
void setKeyPressedCB (InvKeyPressedCB *cb, void *data)
 set a keypressed callback
 
bool keyPressedNotify (void *message)
 run keypressed cb
 
void setHandleEventCB (InvHandleEventCB *cb, void *data)
 set a handle event callback
 
bool handleEventNotify (void *message)
 run handle event cb
 
void setGenerateMovieCB (InvGenerateMovieCB *cb, void *data)
 set movie generation callback
 
void generateMovie (const char *name, const char *extension, int count, float framerate, const char *targetFile=nullptr)
 run move generation
 

Static Public Member Functions

static void initClass ()
 inventor runtime type system
 
static void fieldChangedCB (void *userData, SoSensor *s)
 
static void recordChangedCB (void *userData, SoSensor *s)
 
static SbBool handleEventCB (void *userData, QEvent *anyevent)
 needed for key focus grabbing
 
- Static Public Member Functions inherited from SoViewerNode
static void initClass ()
 

Public Attributes

SoSFString inputDevicesList
 space separated list of input device type names
 
SoSFColor background
 Appearance Fields.
 
SoSFEnum transparency
 transparency type
 
SoSFBool antialiasing
 turn antialiasing on/off
 
SoSFInt32 antialiasingNumPasses
 number of antialiasing passes
 
SoSFBool useSampleBuffers
 turn sample buffers on/off
 
SoSFInt32 numSamples
 number of samples (0 = maximum number of samplers)
 
SoSFBool border
 show a 3D border
 
SoSFBool grabKeyFocus
 grab the key focus when the mouse moves onto the viewer window
 
SoSFBool enableKeyCommands
 enable the keyboard commands for snapshots and movie generation
 
SoSFTrigger doSnapshot
 Screenshot feature Fields.
 
SoSFString outputSnapshotFile
 filename of the screenshot (without file extension)
 
SoSFString outputSnapshotFileWritten
 filename that was written on doScreenshot
 
SoSFBool autoIncreaseFile
 set if filename should be autoincreased
 
SoSFInt32 snapCount
 count of screenshots taken used for autoIncreaseFile
 
SoSFBool showSnapshotWithShell
 start external program when screenshot was saved (Windows only)
 
SoSFMLConnector outputImage
 ML Output of Viewer screenshot.
 
SoSFEnum snapshotFormat
 format of the output, may be RGB or GREY
 
SoSFTrigger updateMLOutput
 trigger the update of the ML output
 
SoSFTrigger startRecording
 Recorder feature Fields.
 
SoSFTrigger cancelRecording
 cancel recording
 
SoSFTrigger continueRecording
 continue recording
 
SoSFTrigger stopRecording
 stop recording
 
SoSFTrigger singleFrame
 record a single frame, recording is started if it was not running
 
SoSFTrigger createAvi
 create an AVI of the movie (by running a createMovie callback)
 
SoSFBool autoRedrawWhenRecording
 advanced setting if autoredraw of viewer is enabled or if the rendering is done explicitly when saving each frame
 
SoSFFloat frameRate
 frame rate which the recorder uses to grab the screen
 
SoSFFloat frameRateAvi
 frame rate that is used in the generated AVI
 
SoSFString status
 current status of the recorder
 
SoSFString outputAviFile
 filename (including path) of the avi that will be written.
 
SoSFString miSelectedPointingAction
 Managed Interaction support.
 
SoSFString miSelectedPointingActionProvider
 
SoSFBool miSelectedPointingActionActive
 

Protected Member Functions

void setRecordingFlag (bool flag)
 sets the recording flag and starts/stops the recording timer
 
 ~SoRenderArea () override
 
void borderChanged (SoField *)
 further field change callbacks:
 
void antialiasingChanged (SoField *)
 
void sampleBufferChanged (SoField *)
 
void backgroundChanged (SoField *)
 
void transparencyChanged (SoField *)
 
void singleFrameChanged (SoField *)
 
void continueRecordingChanged (SoField *)
 
void cancelRecordingChanged (SoField *)
 
void frameRateChanged (SoField *)
 
void inputDevicesListChanged (SoField *)
 
- Protected Member Functions inherited from SoViewerNode
 ~SoViewerNode () override
 

Protected Attributes

SoNodeSensor * _sensor
 
FrameGrabber _writer
 
ml::MLSnapshot_snapshot
 
SoTimerSensor * _recordSensor
 
bool _isRecording
 
bool _sceneChanged
 
FieldSync_fieldSync
 
SoSceneSetupHelper_sceneSetupHelper
 
QCursor _oldCursor
 remember old cursor shape:
 
- Protected Attributes inherited from SoViewerNode
void * _currentViewer
 pointer to the current viewer (void, because the concrete type is unkown)
 
SoViewerProxy_viewerProxy
 pointer to the proxy for this viewer
 
InvGenerateMovieCB_movieCB
 callback for movie generation
 
void * _movieCBData
 callback data for movie generation
 
InvKeyPressedCB_keyPressedCB
 callback for key pressed
 
void * _keyPressedCBData
 callback data for key pressed
 
InvHandleEventCB_handleEventCB
 callback for handleEvent
 
void * _handleEventCBData
 callback data for handleEvent
 

Detailed Description

SoRenderArea encapsulates the features of SoQtRenderArea in an Inventor Node.

SoRenderArea is used standalone and as a base class to the more complex viewers SoFullViewer, SoExaminerViewer, ... SoRenderArea implements a Movie Recorder, this is extended in the more complex viewers where there is a notion of a camera. For additional details, see the html documentation of SoRenderArea in MeVisLab.

Definition at line 46 of file SoRenderArea.h.

Constructor & Destructor Documentation

◆ SoRenderArea()

SoRenderArea::SoRenderArea ( )

constructor

◆ ~SoRenderArea()

SoRenderArea::~SoRenderArea ( )
overrideprotected

Member Function Documentation

◆ antialiasingChanged()

void SoRenderArea::antialiasingChanged ( SoField * )
protected

◆ backgroundChanged()

void SoRenderArea::backgroundChanged ( SoField * )
protected

◆ borderChanged()

void SoRenderArea::borderChanged ( SoField * )
protected

further field change callbacks:

◆ cancelRecordingChanged()

void SoRenderArea::cancelRecordingChanged ( SoField * )
protected

◆ continueRecordingChanged()

void SoRenderArea::continueRecordingChanged ( SoField * )
protected

◆ createAviChanged()

virtual void SoRenderArea::createAviChanged ( SoField * )
virtual

createAvi:

◆ createViewer()

void * SoRenderArea::createViewer ( void * hwnd,
SoNode * scene )
overridevirtual

create a viewer in the given window void pointer is used to be compatible to any windows system

Reimplemented from SoViewerNode.

◆ deleteViewer()

void SoRenderArea::deleteViewer ( void * viewer)
overridevirtual

delete the previously created viewer

Reimplemented from SoViewerNode.

◆ enableKeyCommandsChanged()

virtual void SoRenderArea::enableKeyCommandsChanged ( SoField * )
inlinevirtual

Reimplemented in SoFullViewer.

Definition at line 182 of file SoRenderArea.h.

◆ fieldChanged()

virtual void SoRenderArea::fieldChanged ( SoSensor * sensor)
virtual

priority 0 sensor call for all fields:

◆ fieldChangedCB()

static void SoRenderArea::fieldChangedCB ( void * userData,
SoSensor * s )
static

◆ frameRateChanged()

void SoRenderArea::frameRateChanged ( SoField * )
protected

◆ getBufferSize()

bool SoRenderArea::getBufferSize ( int & w,
int & h )

returns current size of image (returns FALSE if there is no viewer)

◆ getSyncFieldNames()

virtual void SoRenderArea::getSyncFieldNames ( SbStringList & list)
virtual

collect the fields that should be synced on cloned viewers if you derive this method, make sure to call the super class implementation too

Reimplemented in SoExaminerViewer, and SoFullViewer.

◆ handleEvent()

virtual SbBool SoRenderArea::handleEvent ( QEvent * anyevent)
virtual

called by handleEventCB for each event in viewer

Reimplemented in SoFullViewer.

◆ handleEventCB()

static SbBool SoRenderArea::handleEventCB ( void * userData,
QEvent * anyevent )
static

needed for key focus grabbing

◆ initClass()

static void SoRenderArea::initClass ( )
static

inventor runtime type system

◆ inputDevicesListChanged()

void SoRenderArea::inputDevicesListChanged ( SoField * )
protected

◆ readBuffer()

MLuint8 * SoRenderArea::readBuffer ( int & w,
int & h )

read the gl back buffer (ownership is passed to caller, memory needs to be cleared by delete)

◆ recordChanged()

virtual void SoRenderArea::recordChanged ( SoSensor * sensor)
virtual

timer sensor call:

◆ recordChangedCB()

static void SoRenderArea::recordChangedCB ( void * userData,
SoSensor * s )
static

◆ sampleBufferChanged()

void SoRenderArea::sampleBufferChanged ( SoField * )
protected

◆ setRecordingFlag()

void SoRenderArea::setRecordingFlag ( bool flag)
protected

sets the recording flag and starts/stops the recording timer

◆ setScene()

virtual void SoRenderArea::setScene ( SoNode * scene)
virtual

This method gets called by createViewer.

◆ setStatus()

void SoRenderArea::setStatus ( const char * str)

set the status in status field and also with progress CB

◆ setupViewer()

virtual void SoRenderArea::setupViewer ( )
virtual

sets all values from fields

Reimplemented in SoExaminerViewer, and SoFullViewer.

◆ shouldChangeCursor()

virtual SbBool SoRenderArea::shouldChangeCursor ( )
virtual

Reimplemented in SoFullViewer.

◆ singleFrameChanged()

void SoRenderArea::singleFrameChanged ( SoField * )
protected

◆ snapshotChanged()

virtual void SoRenderArea::snapshotChanged ( SoField * )
virtual

doSnapshot changed

◆ startRecordingChanged()

virtual void SoRenderArea::startRecordingChanged ( SoField * )
virtual

start recording:

◆ stopRecordingChanged()

virtual void SoRenderArea::stopRecordingChanged ( SoField * )
virtual

stop recording:

◆ syncFromViewerNode()

void SoRenderArea::syncFromViewerNode ( SoViewerNode * node)
overridevirtual

sync from given src viewer node

Reimplemented from SoViewerNode.

◆ transparencyChanged()

void SoRenderArea::transparencyChanged ( SoField * )
protected

◆ updateMLOutputChanged()

virtual void SoRenderArea::updateMLOutputChanged ( SoField * )
virtual

updateMLOutput changed

Member Data Documentation

◆ _fieldSync

FieldSync* SoRenderArea::_fieldSync
protected

Definition at line 234 of file SoRenderArea.h.

◆ _isRecording

bool SoRenderArea::_isRecording
protected

Definition at line 231 of file SoRenderArea.h.

◆ _oldCursor

QCursor SoRenderArea::_oldCursor
protected

remember old cursor shape:

Definition at line 239 of file SoRenderArea.h.

◆ _recordSensor

SoTimerSensor* SoRenderArea::_recordSensor
protected

Definition at line 230 of file SoRenderArea.h.

◆ _sceneChanged

bool SoRenderArea::_sceneChanged
protected

Definition at line 232 of file SoRenderArea.h.

◆ _sceneSetupHelper

SoSceneSetupHelper* SoRenderArea::_sceneSetupHelper
protected

Definition at line 236 of file SoRenderArea.h.

◆ _sensor

SoNodeSensor* SoRenderArea::_sensor
protected

Definition at line 226 of file SoRenderArea.h.

◆ _snapshot

ml::MLSnapshot* SoRenderArea::_snapshot
protected

Definition at line 229 of file SoRenderArea.h.

◆ _writer

FrameGrabber SoRenderArea::_writer
protected

Definition at line 228 of file SoRenderArea.h.

◆ antialiasing

SoSFBool SoRenderArea::antialiasing

turn antialiasing on/off

Definition at line 58 of file SoRenderArea.h.

◆ antialiasingNumPasses

SoSFInt32 SoRenderArea::antialiasingNumPasses

number of antialiasing passes

Definition at line 60 of file SoRenderArea.h.

◆ autoIncreaseFile

SoSFBool SoRenderArea::autoIncreaseFile

set if filename should be autoincreased

Definition at line 85 of file SoRenderArea.h.

◆ autoRedrawWhenRecording

SoSFBool SoRenderArea::autoRedrawWhenRecording

advanced setting if autoredraw of viewer is enabled or if the rendering is done explicitly when saving each frame

Definition at line 117 of file SoRenderArea.h.

◆ background

SoSFColor SoRenderArea::background

Appearance Fields.

background color

Definition at line 54 of file SoRenderArea.h.

◆ border

SoSFBool SoRenderArea::border

show a 3D border

Definition at line 68 of file SoRenderArea.h.

◆ cancelRecording

SoSFTrigger SoRenderArea::cancelRecording

cancel recording

Definition at line 106 of file SoRenderArea.h.

◆ continueRecording

SoSFTrigger SoRenderArea::continueRecording

continue recording

Definition at line 108 of file SoRenderArea.h.

◆ createAvi

SoSFTrigger SoRenderArea::createAvi

create an AVI of the movie (by running a createMovie callback)

Definition at line 114 of file SoRenderArea.h.

◆ doSnapshot

SoSFTrigger SoRenderArea::doSnapshot

Screenshot feature Fields.

save a screenshot to disk

Definition at line 79 of file SoRenderArea.h.

◆ enableKeyCommands

SoSFBool SoRenderArea::enableKeyCommands

enable the keyboard commands for snapshots and movie generation

Definition at line 72 of file SoRenderArea.h.

◆ frameRate

SoSFFloat SoRenderArea::frameRate

frame rate which the recorder uses to grab the screen

Definition at line 119 of file SoRenderArea.h.

◆ frameRateAvi

SoSFFloat SoRenderArea::frameRateAvi

frame rate that is used in the generated AVI

Definition at line 121 of file SoRenderArea.h.

◆ grabKeyFocus

SoSFBool SoRenderArea::grabKeyFocus

grab the key focus when the mouse moves onto the viewer window

Definition at line 70 of file SoRenderArea.h.

◆ inputDevicesList

SoSFString SoRenderArea::inputDevicesList

space separated list of input device type names

Definition at line 132 of file SoRenderArea.h.

◆ miSelectedPointingAction

SoSFString SoRenderArea::miSelectedPointingAction

Managed Interaction support.

Definition at line 136 of file SoRenderArea.h.

◆ miSelectedPointingActionActive

SoSFBool SoRenderArea::miSelectedPointingActionActive

Definition at line 138 of file SoRenderArea.h.

◆ miSelectedPointingActionProvider

SoSFString SoRenderArea::miSelectedPointingActionProvider

Definition at line 137 of file SoRenderArea.h.

◆ numSamples

SoSFInt32 SoRenderArea::numSamples

number of samples (0 = maximum number of samplers)

Definition at line 65 of file SoRenderArea.h.

◆ outputAviFile

SoSFString SoRenderArea::outputAviFile

filename (including path) of the avi that will be written.

If no file is given, the MeVisLab screenshot gallery will automatically be used

Definition at line 127 of file SoRenderArea.h.

◆ outputImage

SoSFMLConnector SoRenderArea::outputImage

ML Output of Viewer screenshot.

Definition at line 93 of file SoRenderArea.h.

◆ outputSnapshotFile

SoSFString SoRenderArea::outputSnapshotFile

filename of the screenshot (without file extension)

Definition at line 81 of file SoRenderArea.h.

◆ outputSnapshotFileWritten

SoSFString SoRenderArea::outputSnapshotFileWritten

filename that was written on doScreenshot

Definition at line 83 of file SoRenderArea.h.

◆ showSnapshotWithShell

SoSFBool SoRenderArea::showSnapshotWithShell

start external program when screenshot was saved (Windows only)

Definition at line 89 of file SoRenderArea.h.

◆ singleFrame

SoSFTrigger SoRenderArea::singleFrame

record a single frame, recording is started if it was not running

Definition at line 112 of file SoRenderArea.h.

◆ snapCount

SoSFInt32 SoRenderArea::snapCount

count of screenshots taken used for autoIncreaseFile

Definition at line 87 of file SoRenderArea.h.

◆ snapshotFormat

SoSFEnum SoRenderArea::snapshotFormat

format of the output, may be RGB or GREY

Definition at line 95 of file SoRenderArea.h.

◆ startRecording

SoSFTrigger SoRenderArea::startRecording

Recorder feature Fields.

start recording

Definition at line 104 of file SoRenderArea.h.

◆ status

SoSFString SoRenderArea::status

current status of the recorder

Definition at line 123 of file SoRenderArea.h.

◆ stopRecording

SoSFTrigger SoRenderArea::stopRecording

stop recording

Definition at line 110 of file SoRenderArea.h.

◆ transparency

SoSFEnum SoRenderArea::transparency

transparency type

Definition at line 56 of file SoRenderArea.h.

◆ updateMLOutput

SoSFTrigger SoRenderArea::updateMLOutput

trigger the update of the ML output

Definition at line 97 of file SoRenderArea.h.

◆ useSampleBuffers

SoSFBool SoRenderArea::useSampleBuffers

turn sample buffers on/off

Definition at line 63 of file SoRenderArea.h.


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