PeriDyno 1.0.0
Loading...
Searching...
No Matches
Qt::SceneGraph Class Reference

#include <SceneGraph.h>

Inheritance diagram for Qt::SceneGraph:
Collaboration diagram for Qt::SceneGraph:

Public Types

enum  EWorkMode { EDIT_MODE , RUNNING_MODE }
 
typedef NodeIterator Iterator
 
- Public Types inherited from dyno::OBase
typedef std::vector< FBase * > FieldVector
 
typedef std::map< FieldID, FBase * > FieldMap
 

Public Member Functions

 ~SceneGraph ()
 
virtual void advance (float dt)
 
virtual void advanceInAsync ()
 
virtual void takeOneFrame ()
 
virtual void updateGraphicsContext ()
 
virtual void run ()
 
NBoundingBox boundingBox ()
 
void reset ()
 
void reset (std::shared_ptr< Node > node)
 
void printNodeInfo (bool enabled)
 
void printSimulationInfo (bool enabled)
 
void printRenderingInfo (bool enabled)
 
void printValidationInfo (bool enabled)
 
bool isNodeInfoPrintable ()
 
bool isSimulationInfoPrintable ()
 
bool isRenderingInfoPrintable ()
 
bool isValidationInfoPrintable ()
 
virtual bool load (std::string name)
 
virtual void invoke (unsigned char type, unsigned char key, int x, int y)
 
template<class TNode, class ... Args>
std::shared_ptr< TNode > createNewScene (Args &&... args)
 
template<class TNode, class ... Args>
std::shared_ptr< TNode > addNode (Args &&... args)
 
template<class TNode>
std::shared_ptr< TNode > addNode (std::shared_ptr< TNode > tNode)
 
void deleteNode (std::shared_ptr< Node > node)
 
void propagateNode (std::shared_ptr< Node > node)
 
bool isEmpty ()
 
EWorkMode getWorkMode ()
 
void setTotalTime (float t)
 
float getTotalTime ()
 
void setFrameRate (float frameRate)
 
float getFrameRate ()
 
float getTimeCostPerFrame ()
 
float getFrameInterval ()
 
int getFrameNumber ()
 
void setFrameNumber (int n)
 
bool isIntervalAdaptive ()
 
void setAdaptiveInterval (bool adaptive)
 
void setAsynchronousSimulation (bool b)
 
void setGravity (Vec3f g)
 
Vec3f getGravity ()
 
Vec3f getLowerBound ()
 
Vec3f getUpperBound ()
 
void setLowerBound (Vec3f lowerBound)
 
void setUpperBound (Vec3f upperBound)
 
Iterator begin ()
 
Iterator end ()
 
void markQueueUpdateRequired ()
 An interface to tell SceneGraph to update the execuation queue.
 
void onMouseEvent (PMouseEvent event)
 
void onMouseEvent (PMouseEvent event, std::shared_ptr< Node > node)
 
void onKeyboardEvent (PKeyboardEvent event)
 
void traverseBackward (Action *act)
 Depth-first tree traversal.
 
template<class Act, class ... Args>
void traverseBackward (Args &&... args)
 
void traverseForward (Action *act)
 Breadth-first tree traversal.
 
template<class Act, class ... Args>
void traverseForward (Args &&... args)
 
void traverseForward (std::shared_ptr< Node > node, Action *act)
 Breadth-first tree traversal starting from a specific node.
 
template<class Act, class ... Args>
void traverseForward (std::shared_ptr< Node > node, Args &&... args)
 
void traverseForwardWithAutoSync (std::shared_ptr< Node > node, Action *act)
 Breadth-first tree traversal starting from a specific node, only those whose mAutoSync turned-on will be visited.
 
template<class Act, class ... Args>
void traverseForwardWithAutoSync (std::shared_ptr< Node > node, Args &&... args)
 
 SceneGraph ()
 
 SceneGraph (const SceneGraph &)=delete
 
SceneGraphoperator= (const SceneGraph &)=delete
 
- Public Member Functions inherited from dyno::OBase
 OBase ()
 
 ~OBase () override
 
virtual std::string caption ()
 Return the caption.
 
virtual bool captionVisible ()
 Whether to hide the caption in the GUI.
 
virtual std::string description ()
 Return a description for the node or module, override this function to support user-defined description.
 
virtual std::string getName ()
 
bool addField (FBase *data)
 Add a field to Base FieldID will be set to the name of Field by default.
 
bool addField (FieldID name, FBase *data)
 Add a field to Base.
 
bool addFieldAlias (FieldID name, FBase *data)
 
bool addFieldAlias (FieldID name, FBase *data, FieldMap &fieldAlias)
 
bool findField (FBase *data)
 Find a field by its pointer.
 
bool findFieldAlias (const FieldID name)
 Find a field by its name.
 
bool findFieldAlias (const FieldID name, FieldMap &fieldAlias)
 Find a field in fieldAlias by its name This function is typically called by other functions.
 
bool removeField (FBase *data)
 Remove a field by its pointer.
 
bool removeFieldAlias (const FieldID name)
 Remove a field by its name.
 
bool removeFieldAlias (const FieldID name, FieldMap &fieldAlias)
 
FBasegetField (const FieldID name)
 Return a field by its name.
 
std::vector< FBase * > & getAllFields ()
 
virtual bool attachField (FBase *field, std::string name, std::string desc, bool autoDestroy=true)
 Attach a field to Base.
 
template<typename T>
TgetField (FieldID name)
 
bool isAllFieldsReady ()
 Check the completeness of all required fields.
 
std::vector< FieldIDgetFieldAlias (FBase *data)
 
int getFieldAliasCount (FBase *data)
 
void setBlockCoord (float x, float y)
 
float bx ()
 
float by ()
 
bool findInputField (FBase *field)
 
bool addInputField (FBase *field)
 
bool removeInputField (FBase *field)
 
std::vector< FBase * > & getInputFields ()
 
bool findOutputField (FBase *field)
 
bool addOutputField (FBase *field)
 
bool addToOutput (FBase *field)
 
bool removeOutputField (FBase *field)
 
bool removeFromOutput (FBase *field)
 
std::vector< FBase * > & getOutputFields ()
 
bool findParameter (FBase *field)
 
bool addParameter (FBase *field)
 
bool removeParameter (FBase *field)
 
std::vector< FBase * > & getParameters ()
 
- Public Member Functions inherited from dyno::Object
 Object ()
 
virtual ~Object ()
 
ObjectId objectId ()
 

Static Public Member Functions

static SceneGraphgetInstance ()
 
- Static Public Member Functions inherited from dyno::Object
static bool registerClass (ClassInfo *ci)
 
static ObjectcreateObject (std::string name)
 
static std::map< std::string, ClassInfo * > * getClassMap ()
 
static ObjectId baseId ()
 Base Id.
 

Protected Member Functions

void updateExecutionQueue ()
 

Private Attributes

bool mAdvativeInterval = true
 
float mElapsedTime
 
float mMaxTime
 
float mFrameRate
 
float mFrameCost
 
int mFrameNumber
 
Vec3f mGravity
 
Vec3f mLowerBound
 
Vec3f mUpperBound
 
bool mQueueUpdateRequired = false
 
bool mAsynchronousSimulation = false
 
NodeMap mNodeMap
 
NodeList mNodeQueue
 
bool mNodeTiming = false
 
bool mSimulationTiming = false
 
bool mRenderingTiming = false
 
bool mValidationInfo = false
 
EWorkMode mWorkMode = EDIT_MODE
 

Additional Inherited Members

- Protected Attributes inherited from dyno::OBase
std::vector< FBase * > fields_input
 
std::vector< FBase * > fields_output
 
std::vector< FBase * > fields_param
 

Detailed Description

Definition at line 31 of file SceneGraph.h.

Member Typedef Documentation

◆ Iterator

typedef NodeIterator dyno::SceneGraph::Iterator

Definition at line 34 of file SceneGraph.h.

Member Enumeration Documentation

◆ EWorkMode

Enumerator
EDIT_MODE 
RUNNING_MODE 

Definition at line 38 of file SceneGraph.h.

Constructor & Destructor Documentation

◆ ~SceneGraph()

dyno::SceneGraph::~SceneGraph ( )

Definition at line 71 of file SceneGraph.cpp.

◆ SceneGraph() [1/2]

dyno::SceneGraph::SceneGraph ( )
inline

Definition at line 223 of file SceneGraph.h.

◆ SceneGraph() [2/2]

dyno::SceneGraph::SceneGraph ( const SceneGraph & )
delete

To avoid erroneous operations

Member Function Documentation

◆ addNode() [1/2]

template<class TNode, class ... Args>
std::shared_ptr< TNode > dyno::SceneGraph::addNode ( Args &&... args)
inline

Definition at line 82 of file SceneGraph.h.

◆ addNode() [2/2]

template<class TNode>
std::shared_ptr< TNode > dyno::SceneGraph::addNode ( std::shared_ptr< TNode > tNode)
inline

Definition at line 90 of file SceneGraph.h.

◆ advance()

void dyno::SceneGraph::advance ( float dt)
virtual

Definition at line 77 of file SceneGraph.cpp.

◆ advanceInAsync()

void dyno::SceneGraph::advanceInAsync ( )
virtual

Definition at line 135 of file SceneGraph.cpp.

◆ begin()

Iterator dyno::SceneGraph::begin ( )
inline

Definition at line 142 of file SceneGraph.h.

◆ boundingBox()

NBoundingBox dyno::SceneGraph::boundingBox ( )

Definition at line 283 of file SceneGraph.cpp.

◆ createNewScene()

template<class TNode, class ... Args>
std::shared_ptr< TNode > dyno::SceneGraph::createNewScene ( Args &&... args)
inline

Definition at line 71 of file SceneGraph.h.

◆ deleteNode()

void dyno::SceneGraph::deleteNode ( std::shared_ptr< Node > node)

Definition at line 769 of file SceneGraph.cpp.

◆ end()

Iterator dyno::SceneGraph::end ( )
inline

Definition at line 149 of file SceneGraph.h.

◆ getFrameInterval()

float dyno::SceneGraph::getFrameInterval ( )
inline

Definition at line 123 of file SceneGraph.h.

◆ getFrameNumber()

int dyno::SceneGraph::getFrameNumber ( )
inline

Definition at line 125 of file SceneGraph.h.

◆ getFrameRate()

float dyno::SceneGraph::getFrameRate ( )
inline

Definition at line 121 of file SceneGraph.h.

◆ getGravity()

Vec3f dyno::SceneGraph::getGravity ( )

Definition at line 66 of file SceneGraph.cpp.

◆ getInstance()

SceneGraph & dyno::SceneGraph::getInstance ( )
static

Definition at line 40 of file SceneGraph.cpp.

◆ getLowerBound()

Vec3f dyno::SceneGraph::getLowerBound ( )

Definition at line 354 of file SceneGraph.cpp.

◆ getTimeCostPerFrame()

float dyno::SceneGraph::getTimeCostPerFrame ( )
inline

Definition at line 122 of file SceneGraph.h.

◆ getTotalTime()

float dyno::SceneGraph::getTotalTime ( )
inline

Definition at line 118 of file SceneGraph.h.

◆ getUpperBound()

Vec3f dyno::SceneGraph::getUpperBound ( )

Definition at line 359 of file SceneGraph.cpp.

◆ getWorkMode()

EWorkMode dyno::SceneGraph::getWorkMode ( )
inline

Definition at line 112 of file SceneGraph.h.

◆ invoke()

virtual void dyno::SceneGraph::invoke ( unsigned char type,
unsigned char key,
int x,
int y )
inlinevirtual

Definition at line 68 of file SceneGraph.h.

◆ isEmpty()

bool dyno::SceneGraph::isEmpty ( )
inline

Definition at line 108 of file SceneGraph.h.

◆ isIntervalAdaptive()

bool dyno::SceneGraph::isIntervalAdaptive ( )

Definition at line 46 of file SceneGraph.cpp.

◆ isNodeInfoPrintable()

bool dyno::SceneGraph::isNodeInfoPrintable ( )
inline

Definition at line 61 of file SceneGraph.h.

◆ isRenderingInfoPrintable()

bool dyno::SceneGraph::isRenderingInfoPrintable ( )
inline

Definition at line 63 of file SceneGraph.h.

◆ isSimulationInfoPrintable()

bool dyno::SceneGraph::isSimulationInfoPrintable ( )
inline

Definition at line 62 of file SceneGraph.h.

◆ isValidationInfoPrintable()

bool dyno::SceneGraph::isValidationInfoPrintable ( )
inline

Definition at line 64 of file SceneGraph.h.

◆ load()

bool dyno::SceneGraph::load ( std::string name)
virtual

Definition at line 342 of file SceneGraph.cpp.

◆ markQueueUpdateRequired()

void dyno::SceneGraph::markQueueUpdateRequired ( )

An interface to tell SceneGraph to update the execuation queue.

Definition at line 374 of file SceneGraph.cpp.

◆ onKeyboardEvent()

void dyno::SceneGraph::onKeyboardEvent ( PKeyboardEvent event)

Definition at line 444 of file SceneGraph.cpp.

◆ onMouseEvent() [1/2]

void dyno::SceneGraph::onMouseEvent ( PMouseEvent event)

Definition at line 379 of file SceneGraph.cpp.

◆ onMouseEvent() [2/2]

void dyno::SceneGraph::onMouseEvent ( PMouseEvent event,
std::shared_ptr< Node > node )

Definition at line 420 of file SceneGraph.cpp.

◆ operator=()

SceneGraph & dyno::SceneGraph::operator= ( const SceneGraph & )
delete

◆ printNodeInfo()

void dyno::SceneGraph::printNodeInfo ( bool enabled)

Definition at line 322 of file SceneGraph.cpp.

◆ printRenderingInfo()

void dyno::SceneGraph::printRenderingInfo ( bool enabled)

Definition at line 332 of file SceneGraph.cpp.

◆ printSimulationInfo()

void dyno::SceneGraph::printSimulationInfo ( bool enabled)

Definition at line 327 of file SceneGraph.cpp.

◆ printValidationInfo()

void dyno::SceneGraph::printValidationInfo ( bool enabled)

Definition at line 337 of file SceneGraph.cpp.

◆ propagateNode()

void dyno::SceneGraph::propagateNode ( std::shared_ptr< Node > node)

Definition at line 779 of file SceneGraph.cpp.

◆ reset() [1/2]

void dyno::SceneGraph::reset ( )

Definition at line 294 of file SceneGraph.cpp.

◆ reset() [2/2]

void dyno::SceneGraph::reset ( std::shared_ptr< Node > node)

Definition at line 317 of file SceneGraph.cpp.

◆ run()

void dyno::SceneGraph::run ( )
virtual

Definition at line 278 of file SceneGraph.cpp.

◆ setAdaptiveInterval()

void dyno::SceneGraph::setAdaptiveInterval ( bool adaptive)

Definition at line 51 of file SceneGraph.cpp.

◆ setAsynchronousSimulation()

void dyno::SceneGraph::setAsynchronousSimulation ( bool b)

Definition at line 56 of file SceneGraph.cpp.

◆ setFrameNumber()

void dyno::SceneGraph::setFrameNumber ( int n)
inline

Definition at line 126 of file SceneGraph.h.

◆ setFrameRate()

void dyno::SceneGraph::setFrameRate ( float frameRate)
inline

Definition at line 120 of file SceneGraph.h.

◆ setGravity()

void dyno::SceneGraph::setGravity ( Vec3f g)

Definition at line 61 of file SceneGraph.cpp.

◆ setLowerBound()

void dyno::SceneGraph::setLowerBound ( Vec3f lowerBound)

Definition at line 364 of file SceneGraph.cpp.

◆ setTotalTime()

void dyno::SceneGraph::setTotalTime ( float t)
inline

Definition at line 117 of file SceneGraph.h.

◆ setUpperBound()

void dyno::SceneGraph::setUpperBound ( Vec3f upperBound)

Definition at line 369 of file SceneGraph.cpp.

◆ takeOneFrame()

void dyno::SceneGraph::takeOneFrame ( )
virtual

Definition at line 195 of file SceneGraph.cpp.

◆ traverseBackward() [1/2]

void dyno::SceneGraph::traverseBackward ( Action * act)

Depth-first tree traversal.

Parameters
actOperation on the node

Definition at line 657 of file SceneGraph.cpp.

◆ traverseBackward() [2/2]

template<class Act, class ... Args>
void dyno::SceneGraph::traverseBackward ( Args &&... args)
inline

Definition at line 171 of file SceneGraph.h.

◆ traverseForward() [1/4]

void dyno::SceneGraph::traverseForward ( Action * act)

Breadth-first tree traversal.

Parameters
actOperation on the node

Definition at line 671 of file SceneGraph.cpp.

◆ traverseForward() [2/4]

template<class Act, class ... Args>
void dyno::SceneGraph::traverseForward ( Args &&... args)
inline

Definition at line 184 of file SceneGraph.h.

◆ traverseForward() [3/4]

void dyno::SceneGraph::traverseForward ( std::shared_ptr< Node > node,
Action * act )

Breadth-first tree traversal starting from a specific node.

Parameters
nodeRoot node
actOperation on the node

Definition at line 685 of file SceneGraph.cpp.

◆ traverseForward() [4/4]

template<class Act, class ... Args>
void dyno::SceneGraph::traverseForward ( std::shared_ptr< Node > node,
Args &&... args )
inline

Definition at line 198 of file SceneGraph.h.

◆ traverseForwardWithAutoSync() [1/2]

void dyno::SceneGraph::traverseForwardWithAutoSync ( std::shared_ptr< Node > node,
Action * act )

Breadth-first tree traversal starting from a specific node, only those whose mAutoSync turned-on will be visited.

Parameters
nodeRoot node
actOperation on the node

Definition at line 746 of file SceneGraph.cpp.

◆ traverseForwardWithAutoSync() [2/2]

template<class Act, class ... Args>
void dyno::SceneGraph::traverseForwardWithAutoSync ( std::shared_ptr< Node > node,
Args &&... args )
inline

Definition at line 212 of file SceneGraph.h.

◆ updateExecutionQueue()

void dyno::SceneGraph::updateExecutionQueue ( )
protected

Definition at line 594 of file SceneGraph.cpp.

◆ updateGraphicsContext()

void dyno::SceneGraph::updateGraphicsContext ( )
virtual

Definition at line 261 of file SceneGraph.cpp.

Member Data Documentation

◆ mAdvativeInterval

bool dyno::SceneGraph::mAdvativeInterval = true
private

Definition at line 243 of file SceneGraph.h.

◆ mAsynchronousSimulation

bool dyno::SceneGraph::mAsynchronousSimulation = false
private

Definition at line 261 of file SceneGraph.h.

◆ mElapsedTime

float dyno::SceneGraph::mElapsedTime
private

Definition at line 245 of file SceneGraph.h.

◆ mFrameCost

float dyno::SceneGraph::mFrameCost
private

Definition at line 248 of file SceneGraph.h.

◆ mFrameNumber

int dyno::SceneGraph::mFrameNumber
private

Definition at line 250 of file SceneGraph.h.

◆ mFrameRate

float dyno::SceneGraph::mFrameRate
private

Definition at line 247 of file SceneGraph.h.

◆ mGravity

Vec3f dyno::SceneGraph::mGravity
private

Definition at line 252 of file SceneGraph.h.

◆ mLowerBound

Vec3f dyno::SceneGraph::mLowerBound
private

Definition at line 254 of file SceneGraph.h.

◆ mMaxTime

float dyno::SceneGraph::mMaxTime
private

Definition at line 246 of file SceneGraph.h.

◆ mNodeMap

NodeMap dyno::SceneGraph::mNodeMap
private

Definition at line 263 of file SceneGraph.h.

◆ mNodeQueue

NodeList dyno::SceneGraph::mNodeQueue
private

Definition at line 265 of file SceneGraph.h.

◆ mNodeTiming

bool dyno::SceneGraph::mNodeTiming = false
private

Definition at line 267 of file SceneGraph.h.

◆ mQueueUpdateRequired

bool dyno::SceneGraph::mQueueUpdateRequired = false
private

Definition at line 260 of file SceneGraph.h.

◆ mRenderingTiming

bool dyno::SceneGraph::mRenderingTiming = false
private

Definition at line 269 of file SceneGraph.h.

◆ mSimulationTiming

bool dyno::SceneGraph::mSimulationTiming = false
private

Definition at line 268 of file SceneGraph.h.

◆ mUpperBound

Vec3f dyno::SceneGraph::mUpperBound
private

Definition at line 255 of file SceneGraph.h.

◆ mValidationInfo

bool dyno::SceneGraph::mValidationInfo = false
private

Definition at line 271 of file SceneGraph.h.

◆ mWorkMode

EWorkMode dyno::SceneGraph::mWorkMode = EDIT_MODE
private

Definition at line 273 of file SceneGraph.h.


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