cherish
Public Member Functions | List of all members
entity::SceneState Class Reference

A class to describe the current state of the scene, e.g., state of switches. More...

#include <SceneState.h>

Inheritance diagram for entity::SceneState:
osg::ProtectedGroup

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::SVMDatagetSVMData ()
 
entity::CamPoseDatagetCamPoseData ()
 
osg::ProtectedGroupgetChildData ()
 
- Public Member Functions inherited from osg::ProtectedGroup
 ProtectedGroup (const ProtectedGroup &group, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 

Detailed Description

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.

Constructor & Destructor Documentation

§ SceneState() [1/2]

entity::SceneState::SceneState ( )

Default constructor. Creates an empty scene state.

§ SceneState() [2/2]

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.

Parameters
parentis the copy-from object
copyopis the copy method, i.e., deep vs. shallow copy

Member Function Documentation

§ addCamPoseData()

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.

Parameters
matrixis matrix transform for the camera pose wires.

§ addSVMData()

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.

Parameters
wallis matrix transform for the current canvas,
flooris matrix transdorm for the previous canvas.

§ clear()

void entity::SceneState::clear ( )

A method that clear all the vector containers.

§ eraseDataFlag()

void entity::SceneState::eraseDataFlag ( int  index)

A method to erase from vector with canvas data flags.

Parameters
indexis specified index which needs to be erased

§ eraseToolFlag()

void entity::SceneState::eraseToolFlag ( int  index)

A method to erase from vector with canvas tool flags.

Parameters
indexis specified index which needs to be erased

§ eraseTransparency()

void entity::SceneState::eraseTransparency ( int  start,
int  number 
)

A method to erase from vector with photo transparencies.

Parameters
startis specified start index from which needs to be erased (inclusive)
numberis the number of consequtive elements to erase

§ getAxisFlag()

bool entity::SceneState::getAxisFlag ( ) const

A getter method to be used within OSG serialization procedures.

§ getBookmarksFlag()

bool entity::SceneState::getBookmarksFlag ( ) const

A getter method to be used within OSG serialization procedures.

§ getCanvasDataFlags()

const std::vector< bool > & entity::SceneState::getCanvasDataFlags ( ) const

A getter method to be used within OSG serialization procedures.

§ getCanvasToolFlags()

const std::vector< bool > & entity::SceneState::getCanvasToolFlags ( ) const

A getter method to be used within OSG serialization procedures.

§ getPhotoTransparencies()

const std::vector< float > & entity::SceneState::getPhotoTransparencies ( ) const

A getter method to be used within OSG serialization procedures.

§ getSVMData()

entity::SVMData * entity::SceneState::getSVMData ( )
Returns
modifiable pointer on entity::SVMData.

§ insertDataFlag()

void entity::SceneState::insertDataFlag ( int  index,
bool  flag 
)

A method to insert into vector with canvas data flags.

Parameters
indexis specified index at which needed to be inserted
flagis the value to be inserted

§ insertToolFlag()

void entity::SceneState::insertToolFlag ( int  index,
bool  flag 
)

A method to insert into vector with canvas tool flags.

Parameters
indexis specified index at which needed to be inserted
flagis the value to be inserted

§ insertTransparency()

void entity::SceneState::insertTransparency ( int  index,
float  t 
)

A method to insert into vector with photo transparency values.

Parameters
indexis specified index at which needed to be inserted
tis the value to be inserted

§ isEmpty()

bool entity::SceneState::isEmpty ( ) const

A method to check whether internals are already loaded or not.

Returns
true if internals are set, and false - otherwise.

§ META_Node()

entity::SceneState::META_Node ( entity  ,
SceneState   
)

A setter method to be used within OSG serialization procedures.

§ popBackDataFlag()

void entity::SceneState::popBackDataFlag ( )

A method to pop out from vector with canvas data flags.

§ popBackToolFlag()

void entity::SceneState::popBackToolFlag ( )

A method to pop out from vector with canvas tool flags.

§ popBackTransparency()

void entity::SceneState::popBackTransparency ( )

A method to pop out from the vector container of photo transparency values.

§ pushDataFlag()

void entity::SceneState::pushDataFlag ( bool  flag)

A method to push into vector container a canvas data flag.

Parameters
flagis true for visible and false for invisible

§ pushToolFlag()

void entity::SceneState::pushToolFlag ( bool  flag)

A method to push into vector container a canvas tool flag.

Parameters
flagis true for visible and false for invisible

§ pushTransparency()

void entity::SceneState::pushTransparency ( float  t)

A method to push into vector container a photo transparency value.

Parameters
tis within range from 0 to 1

§ resetTransparency()

void entity::SceneState::resetTransparency ( int  index,
float  t 
)

A method to reset a vector value with photo transparencies.

Parameters
indexis specified index which needs to be reset
tis the new transparency value

§ setBookmarksFlag()

void entity::SceneState::setBookmarksFlag ( bool  flag)

A setter method to be used within OSG serialization procedures.

§ setCanvasDataFlags()

void entity::SceneState::setCanvasDataFlags ( const std::vector< bool > &  flags)

A setter method to be used within OSG serialization procedures.

§ setCanvasToolFlags()

void entity::SceneState::setCanvasToolFlags ( const std::vector< bool > &  flags)

A setter method to be used within OSG serialization procedures.

§ setPhotoTransparencies()

void entity::SceneState::setPhotoTransparencies ( const std::vector< float > &  transparencies)

A setter method to be used within OSG serialization procedures.

§ stripDataFrom()

void entity::SceneState::stripDataFrom ( RootScene scene)

A method that translates all the necessary RootScene settings into internals of SceneState.

Parameters
sceneis the pointer on RootScene variable
See also
RootScene::createSceneState()

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