cherish
|
A class to describe the current state of the scene, e.g., state of switches. More...
#include <SceneState.h>
Public Member Functions | |
SceneState () | |
SceneState (const SceneState &parent, osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY) | |
META_Node (entity, SceneState) void setAxisFlag(bool flag) | |
bool | getAxisFlag () const |
void | setBookmarksFlag (bool flag) |
bool | getBookmarksFlag () const |
void | setCanvasDataFlags (const std::vector< bool > &flags) |
const std::vector< bool > & | getCanvasDataFlags () const |
void | setCanvasToolFlags (const std::vector< bool > &flags) |
const std::vector< bool > & | getCanvasToolFlags () const |
void | setPhotoTransparencies (const std::vector< float > &transparencies) |
const std::vector< float > & | getPhotoTransparencies () const |
void | stripDataFrom (RootScene *scene) |
bool | isEmpty () const |
void | clear () |
void | pushDataFlag (bool flag) |
void | popBackDataFlag () |
void | pushToolFlag (bool flag) |
void | popBackToolFlag () |
void | pushTransparency (float t) |
void | popBackTransparency () |
void | insertDataFlag (int index, bool flag) |
void | eraseDataFlag (int index) |
void | insertToolFlag (int index, bool flag) |
void | eraseToolFlag (int index) |
void | insertTransparency (int index, float t) |
void | eraseTransparency (int start, int number) |
void | resetTransparency (int index, float t) |
bool | addSVMData (const osg::Matrix &wall, const osg::Matrix &floor) |
bool | addCamPoseData (const osg::Matrix &matrix, double fov) |
entity::SVMData * | getSVMData () |
entity::CamPoseData * | getCamPoseData () |
osg::ProtectedGroup * | getChildData () |
![]() | |
ProtectedGroup (const ProtectedGroup &group, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
A class to describe the current state of the scene, e.g., state of switches.
It is mostly used when dealing with entity::Bookmarks and taking bookmark snapshots from GlWidget. The scene state helps to preserve and use later values like switches values that define visibility flags for data, construction tools; and also photo transparencies.
It inherits osg::ProtectedGroup so that to be able to take advantage of OSG serialization since the scene state is saved together with each bookmark data.
The SceneState normally does not form any scene graphs, i.e., no children are added. However, when later entity::SVMData added, the user can add them as a child when using SVM methods.
entity::SceneState::SceneState | ( | ) |
Default constructor. Creates an empty scene state.
entity::SceneState::SceneState | ( | const SceneState & | parent, |
osg::CopyOp | copyop = osg::CopyOp::SHALLOW_COPY |
||
) |
Constructor by copy. This method is used solely by OSG serializer and should never be called from within the application.
parent | is the copy-from object |
copyop | is the copy method, i.e., deep vs. shallow copy |
bool entity::SceneState::addCamPoseData | ( | const osg::Matrix & | matrix, |
double | fov | ||
) |
A method to create new instance of entity::CamPoseData and add it as a child to the scene state.
matrix | is matrix transform for the camera pose wires. |
bool entity::SceneState::addSVMData | ( | const osg::Matrix & | wall, |
const osg::Matrix & | floor | ||
) |
A method to create a new instance of entity::SVMData and add it as a child to the scene state.
wall | is matrix transform for the current canvas, |
floor | is matrix transdorm for the previous canvas. |
void entity::SceneState::clear | ( | ) |
A method that clear all the vector containers.
void entity::SceneState::eraseDataFlag | ( | int | index | ) |
A method to erase from vector with canvas data flags.
index | is specified index which needs to be erased |
void entity::SceneState::eraseToolFlag | ( | int | index | ) |
A method to erase from vector with canvas tool flags.
index | is specified index which needs to be erased |
void entity::SceneState::eraseTransparency | ( | int | start, |
int | number | ||
) |
A method to erase from vector with photo transparencies.
start | is specified start index from which needs to be erased (inclusive) |
number | is the number of consequtive elements to erase |
bool entity::SceneState::getAxisFlag | ( | ) | const |
A getter method to be used within OSG serialization procedures.
bool entity::SceneState::getBookmarksFlag | ( | ) | const |
A getter method to be used within OSG serialization procedures.
const std::vector< bool > & entity::SceneState::getCanvasDataFlags | ( | ) | const |
A getter method to be used within OSG serialization procedures.
const std::vector< bool > & entity::SceneState::getCanvasToolFlags | ( | ) | const |
A getter method to be used within OSG serialization procedures.
const std::vector< float > & entity::SceneState::getPhotoTransparencies | ( | ) | const |
A getter method to be used within OSG serialization procedures.
entity::SVMData * entity::SceneState::getSVMData | ( | ) |
void entity::SceneState::insertDataFlag | ( | int | index, |
bool | flag | ||
) |
A method to insert into vector with canvas data flags.
index | is specified index at which needed to be inserted |
flag | is the value to be inserted |
void entity::SceneState::insertToolFlag | ( | int | index, |
bool | flag | ||
) |
A method to insert into vector with canvas tool flags.
index | is specified index at which needed to be inserted |
flag | is the value to be inserted |
void entity::SceneState::insertTransparency | ( | int | index, |
float | t | ||
) |
A method to insert into vector with photo transparency values.
index | is specified index at which needed to be inserted |
t | is the value to be inserted |
bool entity::SceneState::isEmpty | ( | ) | const |
A method to check whether internals are already loaded or not.
entity::SceneState::META_Node | ( | entity | , |
SceneState | |||
) |
A setter method to be used within OSG serialization procedures.
void entity::SceneState::popBackDataFlag | ( | ) |
A method to pop out from vector with canvas data flags.
void entity::SceneState::popBackToolFlag | ( | ) |
A method to pop out from vector with canvas tool flags.
void entity::SceneState::popBackTransparency | ( | ) |
A method to pop out from the vector container of photo transparency values.
void entity::SceneState::pushDataFlag | ( | bool | flag | ) |
A method to push into vector container a canvas data flag.
flag | is true for visible and false for invisible |
void entity::SceneState::pushToolFlag | ( | bool | flag | ) |
A method to push into vector container a canvas tool flag.
flag | is true for visible and false for invisible |
void entity::SceneState::pushTransparency | ( | float | t | ) |
A method to push into vector container a photo transparency value.
t | is within range from 0 to 1 |
void entity::SceneState::resetTransparency | ( | int | index, |
float | t | ||
) |
A method to reset a vector value with photo transparencies.
index | is specified index which needs to be reset |
t | is the new transparency value |
void entity::SceneState::setBookmarksFlag | ( | bool | flag | ) |
A setter method to be used within OSG serialization procedures.
void entity::SceneState::setCanvasDataFlags | ( | const std::vector< bool > & | flags | ) |
A setter method to be used within OSG serialization procedures.
void entity::SceneState::setCanvasToolFlags | ( | const std::vector< bool > & | flags | ) |
A setter method to be used within OSG serialization procedures.
void entity::SceneState::setPhotoTransparencies | ( | const std::vector< float > & | transparencies | ) |
A setter method to be used within OSG serialization procedures.
void entity::SceneState::stripDataFrom | ( | RootScene * | scene | ) |
A method that translates all the necessary RootScene settings into internals of SceneState.
scene | is the pointer on RootScene variable |