Script
Public Slots | List of all members
scene Class Reference

With the Scene functions, you can retrieve and set global scene attributes, like the aspect ratio of the cells in the scene grid. More...

#include <sceneinterface.h>

Inheritance diagram for scene:
Inheritance graph
[legend]
Collaboration diagram for scene:
Collaboration graph
[legend]

Public Slots

int currentVersion () const
 returns the ID of the current version.
 
QString currentVersionName () const
 returns the name or the number of the current scene version.
 
QString currentEnvironment () const
 returns the name of the current environment.
 
QString currentJob () const
 returns the name of the current job.
 
QString currentScene () const
 returns the name of the current scene.
 
QString currentProjectPath () const
 Return the current project path.
 
QString currentProjectPathRemapped () const
 For windows, returns the remapped path.
 
QString tempProjectPath () const
 Return the temporary project path.
 
QString tempProjectPathRemapped () const
 For windows, returns the remapped temporary project path.
 
Undo / Redo

Functions will generate only one Undo/Redo entry if sandwiched by these two functions.

void beginUndoRedoAccum (QString commandName)
 This function starts the accumulation of all of the functions between it and the endUndoRedoAccum function as one command that will appear in the undo/redo list. If you do not use this function with endUndoRedoAccum, each function in the script generates a separate undo/redo entry.
 
void endUndoRedoAccum ()
 This function ends the accumulation all of the functions between it and the beginUndoRedoAccum function as one command that will appear in the undo/redo list. If you do not use this function with beginUndoRedoAccum, each function in the script generates a separate undo/redo entry.
 
void cancelUndoRedoAccum ()
 This function cancels the accumulation of undo/redo commands. No command will be added to the undo/redo list and all commands that have already been executed will be rolled-back (undone).
 
void undo (int depth=1)
 undoes the last n operation. If n is not specified, it will be 1
 
void redo (int depth=1)
 redoes the last n operation. If n is not specified, it will be 1
 
void clearHistory ()
 Clear command history.
 
Global Scene Data.
double unitsAspectRatioX () const
 returns the X value of the aspect ratio of the cells in the scene grid.
 
double unitsAspectRatioY () const
 returns the Y value of the aspect ratio of the cells in the scene grid.
 
int numberOfUnitsX () const
 returns the number of units in the X axis of the scene grid.
 
int numberOfUnitsY () const
 returns the number of units in the Y axis of the scene grid.
 
int numberOfUnitsZ () const
 returns the number of units in the Z axis of the scene grid.
 
int coordAtCenterX () const
 returns the X value of the centre coordinate of the scene grid.
 
int coordAtCenterY () const
 returns the Y value of the centre coordinate of the scene grid.
 
int currentResolutionX () const
 returns the current preview resolution. For example, when the current resolution is 720x540 pixels this function will return 720.
 
int currentResolutionY () const
 returns the current preview resolution. For example, when the current resolution is 720x540 pixels this function will return 540.
 
QString defaultResolutionName () const
 returns the default resolution name. The resolution name is a global parameter saved with the project. It may be empty when the project is used as a custom resolution, which is not one of the pre-defined resolutions.
 
int defaultResolutionX () const
 returns the default resolution. This resolution is a global parameter saved with the project, not the current preview resolution. For example, when the default scene resolution is 720x540 pixels this function will return 720.
 
int defaultResolutionY () const
 returns the default resolution. This resolution is a global parameter saved with the project, not the current preview resolution. For example, when the default scene resolution is 720x540 pixels this function will return 540.
 
double defaultResolutionFOV () const
 returns the default resolution field of view (FOV). The default FOV is a global scene parameter.
 
int getFrameRate () const
 returns the frame rate, as frame per seconds.
 
Saving functions
bool saveAll ()
 performs the " save all " command. Effectively, this saves the entire project and all modified files.
 
bool saveAsNewVersion (QString name, bool markAsDefault)
 saves the project as a new version.
 
Global Scene Edition.
bool setUnitsAspectRatio (double x, double y)
 sets the aspect ratio of the scene. The scene's final aspect ratio will be: X * numberOfUnitsX()/Y * numberOfUnitsY()
 
bool setNumberOfUnits (int x, int y, int z)
 sets the number of X, Y, and Z units in the scene grid.
 
bool setCoordAtCenter (int x, int y)
 sets the value of the centre (X, Y) coordinates.
 
bool setDefaultResolution (int x, int y, double fov)
 allows the default scene resolution and field of view to be changed.
 
bool setDefaultResolutionName (QString name)
 This function allows the default scene resolution and field of view to be changed.
 
bool setFrameRate (int frameRate)
 This function allows the default frame rate of the project to be changed. The frame rate is expressed as frame per second. Typical value is 12, 24 or 30.
 
QObject * getCameraMatrix (int frame)
 returns the model matrix for the default camera.
 
QObject * toOGL (QObject *pointOrVector)
 converts a field coordinate into an OGL coordinate
 
QObject * fromOGL (QObject *pointOrVector)
 converts an OGL coordinate into a field coordinate.
 
void closeScene ()
 closes the current scene.
 
void closeSceneAndExit ()
 closes the current scene and exits.
 
bool closeSceneAndOpen (const QString &envName, const QString &jobName, const QString &sceneName, const QString &versionName)
 closes the current scene and open the scene specified by env, job, scene and version
 
QStringList getMissingPalettes (bool unrecovered, bool recoveredNotYetSaved)
 returns all palettes that were either unrecovered or recovered but not yet saved, depending on the arguments of the function.
 

Detailed Description

With the Scene functions, you can retrieve and set global scene attributes, like the aspect ratio of the cells in the scene grid.

function setScene()
{
// Sets the beginning of the undo/redo command wrapper
scene.beginUndoRedoAccum("Set Scene");
// Sets the aspect ratio of the scene to 4, 3
// Sets the number of units in the scene
scene.setNumberOfUnits(1200, 900, 12);
// Sets the value of the center coordinate
scene.setCoordAtCenter(5000, 5000);
// Terminates the undo/redo command wrapper
}

Member Function Documentation

void scene::beginUndoRedoAccum ( QString  commandName)
slot

This function starts the accumulation of all of the functions between it and the endUndoRedoAccum function as one command that will appear in the undo/redo list. If you do not use this function with endUndoRedoAccum, each function in the script generates a separate undo/redo entry.

void scene::cancelUndoRedoAccum ( )
slot

This function cancels the accumulation of undo/redo commands. No command will be added to the undo/redo list and all commands that have already been executed will be rolled-back (undone).

void scene::clearHistory ( )
slot

Clear command history.

void scene::closeScene ( )
slot

closes the current scene.

Exiting functions Anyone of these is final and absolute. Nothing in the script will be executed after these calls.

void scene::closeSceneAndExit ( )
slot

closes the current scene and exits.

bool scene::closeSceneAndOpen ( const QString &  envName,
const QString &  jobName,
const QString &  sceneName,
const QString &  versionName 
)
slot

closes the current scene and open the scene specified by env, job, scene and version

int scene::coordAtCenterX ( ) const
slot

returns the X value of the centre coordinate of the scene grid.

int scene::coordAtCenterY ( ) const
slot

returns the Y value of the centre coordinate of the scene grid.

QString scene::currentEnvironment ( ) const
slot

returns the name of the current environment.

QString scene::currentJob ( ) const
slot

returns the name of the current job.

QString scene::currentProjectPath ( ) const
slot

Return the current project path.

QString scene::currentProjectPathRemapped ( ) const
slot

For windows, returns the remapped path.

int scene::currentResolutionX ( ) const
slot

returns the current preview resolution. For example, when the current resolution is 720x540 pixels this function will return 720.

int scene::currentResolutionY ( ) const
slot

returns the current preview resolution. For example, when the current resolution is 720x540 pixels this function will return 540.

QString scene::currentScene ( ) const
slot

returns the name of the current scene.

int scene::currentVersion ( ) const
slot

returns the ID of the current version.

QString scene::currentVersionName ( ) const
slot

returns the name or the number of the current scene version.

double scene::defaultResolutionFOV ( ) const
slot

returns the default resolution field of view (FOV). The default FOV is a global scene parameter.

QString scene::defaultResolutionName ( ) const
slot

returns the default resolution name. The resolution name is a global parameter saved with the project. It may be empty when the project is used as a custom resolution, which is not one of the pre-defined resolutions.

int scene::defaultResolutionX ( ) const
slot

returns the default resolution. This resolution is a global parameter saved with the project, not the current preview resolution. For example, when the default scene resolution is 720x540 pixels this function will return 720.

int scene::defaultResolutionY ( ) const
slot

returns the default resolution. This resolution is a global parameter saved with the project, not the current preview resolution. For example, when the default scene resolution is 720x540 pixels this function will return 540.

void scene::endUndoRedoAccum ( )
slot

This function ends the accumulation all of the functions between it and the beginUndoRedoAccum function as one command that will appear in the undo/redo list. If you do not use this function with beginUndoRedoAccum, each function in the script generates a separate undo/redo entry.

QObject* scene::fromOGL ( QObject *  pointOrVector)
slot

converts an OGL coordinate into a field coordinate.

Parameters
pointOrVector,:can be either a 2D point or a 3D point or a vector object.
QObject* scene::getCameraMatrix ( int  frame)
slot

returns the model matrix for the default camera.

Parameters
frame: at which frame
int scene::getFrameRate ( ) const
slot

returns the frame rate, as frame per seconds.

QStringList scene::getMissingPalettes ( bool  unrecovered,
bool  recoveredNotYetSaved 
)
slot

returns all palettes that were either unrecovered or recovered but not yet saved, depending on the arguments of the function.

int scene::numberOfUnitsX ( ) const
slot

returns the number of units in the X axis of the scene grid.

int scene::numberOfUnitsY ( ) const
slot

returns the number of units in the Y axis of the scene grid.

int scene::numberOfUnitsZ ( ) const
slot

returns the number of units in the Z axis of the scene grid.

void scene::redo ( int  depth = 1)
slot

redoes the last n operation. If n is not specified, it will be 1

bool scene::saveAll ( )
slot

performs the " save all " command. Effectively, this saves the entire project and all modified files.

bool scene::saveAsNewVersion ( QString  name,
bool  markAsDefault 
)
slot

saves the project as a new version.

Parameters
name,:The name of the version.
markAsDefault,:This is boolean to indicate to mark this version as the default version.
bool scene::setCoordAtCenter ( int  x,
int  y 
)
slot

sets the value of the centre (X, Y) coordinates.

Parameters
X,Y,:The value of the X and Y coordinate at the centre of the grid.
bool scene::setDefaultResolution ( int  x,
int  y,
double  fov 
)
slot

allows the default scene resolution and field of view to be changed.

Parameters
X,Y,:Set the X and Y resolution for the scene in pixels.
fov,:Set the field of view in degree. Typical value is 41.112.
bool scene::setDefaultResolutionName ( QString  name)
slot

This function allows the default scene resolution and field of view to be changed.

Parameters
X,Y,:Set the X and Y resolution for the scene in pixels.
fov,:Set the field of view in degree. Typical value is 41.112.
bool scene::setFrameRate ( int  frameRate)
slot

This function allows the default frame rate of the project to be changed. The frame rate is expressed as frame per second. Typical value is 12, 24 or 30.

Parameters
frameRate: frame rate
bool scene::setNumberOfUnits ( int  x,
int  y,
int  z 
)
slot

sets the number of X, Y, and Z units in the scene grid.

Parameters
X,Y,Z,:The X, Y and Z values of the scene grid.
bool scene::setUnitsAspectRatio ( double  x,
double  y 
)
slot

sets the aspect ratio of the scene. The scene's final aspect ratio will be: X * numberOfUnitsX()/Y * numberOfUnitsY()

Parameters
x,Y: The X, Y value of the new aspect ratio.
QString scene::tempProjectPath ( ) const
slot

Return the temporary project path.

QString scene::tempProjectPathRemapped ( ) const
slot

For windows, returns the remapped temporary project path.

QObject* scene::toOGL ( QObject *  pointOrVector)
slot

converts a field coordinate into an OGL coordinate

Parameters
pointOrVector,:can be either a 2D point or a 3D point or a vector object.
void scene::undo ( int  depth = 1)
slot

undoes the last n operation. If n is not specified, it will be 1

double scene::unitsAspectRatioX ( ) const
slot

returns the X value of the aspect ratio of the cells in the scene grid.

double scene::unitsAspectRatioY ( ) const
slot

returns the Y value of the aspect ratio of the cells in the scene grid.


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