![]() |
PeriDyno 1.0.0
|
#include <SceneGraph.h>
Public Types | |
enum | EWorkMode { EDIT_MODE , RUNNING_MODE } |
typedef NodeIterator | Iterator |
![]() | |
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 | |
SceneGraph & | operator= (const SceneGraph &)=delete |
![]() | |
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) |
FBase * | getField (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> | |
T * | getField (FieldID name) |
bool | isAllFieldsReady () |
Check the completeness of all required fields. | |
std::vector< FieldID > | getFieldAlias (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 () |
![]() | |
Object () | |
virtual | ~Object () |
ObjectId | objectId () |
Static Public Member Functions | |
static SceneGraph & | getInstance () |
![]() | |
static bool | registerClass (ClassInfo *ci) |
static Object * | createObject (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 | |
![]() | |
std::vector< FBase * > | fields_input |
std::vector< FBase * > | fields_output |
std::vector< FBase * > | fields_param |
Definition at line 31 of file SceneGraph.h.
typedef NodeIterator dyno::SceneGraph::Iterator |
Definition at line 34 of file SceneGraph.h.
Enumerator | |
---|---|
EDIT_MODE | |
RUNNING_MODE |
Definition at line 38 of file SceneGraph.h.
dyno::SceneGraph::~SceneGraph | ( | ) |
Definition at line 71 of file SceneGraph.cpp.
|
inline |
Definition at line 223 of file SceneGraph.h.
|
delete |
To avoid erroneous operations
|
inline |
Definition at line 82 of file SceneGraph.h.
|
inline |
Definition at line 90 of file SceneGraph.h.
|
virtual |
Definition at line 77 of file SceneGraph.cpp.
|
virtual |
Definition at line 135 of file SceneGraph.cpp.
|
inline |
Definition at line 142 of file SceneGraph.h.
NBoundingBox dyno::SceneGraph::boundingBox | ( | ) |
Definition at line 283 of file SceneGraph.cpp.
|
inline |
Definition at line 71 of file SceneGraph.h.
void dyno::SceneGraph::deleteNode | ( | std::shared_ptr< Node > | node | ) |
Definition at line 769 of file SceneGraph.cpp.
|
inline |
Definition at line 149 of file SceneGraph.h.
|
inline |
Definition at line 123 of file SceneGraph.h.
|
inline |
Definition at line 125 of file SceneGraph.h.
|
inline |
Definition at line 121 of file SceneGraph.h.
Vec3f dyno::SceneGraph::getGravity | ( | ) |
Definition at line 66 of file SceneGraph.cpp.
|
static |
Definition at line 40 of file SceneGraph.cpp.
Vec3f dyno::SceneGraph::getLowerBound | ( | ) |
Definition at line 354 of file SceneGraph.cpp.
|
inline |
Definition at line 122 of file SceneGraph.h.
|
inline |
Definition at line 118 of file SceneGraph.h.
Vec3f dyno::SceneGraph::getUpperBound | ( | ) |
Definition at line 359 of file SceneGraph.cpp.
|
inline |
Definition at line 112 of file SceneGraph.h.
|
inlinevirtual |
Definition at line 68 of file SceneGraph.h.
|
inline |
Definition at line 108 of file SceneGraph.h.
bool dyno::SceneGraph::isIntervalAdaptive | ( | ) |
Definition at line 46 of file SceneGraph.cpp.
|
inline |
Definition at line 61 of file SceneGraph.h.
|
inline |
Definition at line 63 of file SceneGraph.h.
|
inline |
Definition at line 62 of file SceneGraph.h.
|
inline |
Definition at line 64 of file SceneGraph.h.
|
virtual |
Definition at line 342 of file SceneGraph.cpp.
void dyno::SceneGraph::markQueueUpdateRequired | ( | ) |
An interface to tell SceneGraph to update the execuation queue.
Definition at line 374 of file SceneGraph.cpp.
void dyno::SceneGraph::onKeyboardEvent | ( | PKeyboardEvent | event | ) |
Definition at line 444 of file SceneGraph.cpp.
void dyno::SceneGraph::onMouseEvent | ( | PMouseEvent | event | ) |
Definition at line 379 of file SceneGraph.cpp.
void dyno::SceneGraph::onMouseEvent | ( | PMouseEvent | event, |
std::shared_ptr< Node > | node ) |
Definition at line 420 of file SceneGraph.cpp.
|
delete |
void dyno::SceneGraph::printNodeInfo | ( | bool | enabled | ) |
Definition at line 322 of file SceneGraph.cpp.
void dyno::SceneGraph::printRenderingInfo | ( | bool | enabled | ) |
Definition at line 332 of file SceneGraph.cpp.
void dyno::SceneGraph::printSimulationInfo | ( | bool | enabled | ) |
Definition at line 327 of file SceneGraph.cpp.
void dyno::SceneGraph::printValidationInfo | ( | bool | enabled | ) |
Definition at line 337 of file SceneGraph.cpp.
void dyno::SceneGraph::propagateNode | ( | std::shared_ptr< Node > | node | ) |
Definition at line 779 of file SceneGraph.cpp.
void dyno::SceneGraph::reset | ( | ) |
Definition at line 294 of file SceneGraph.cpp.
void dyno::SceneGraph::reset | ( | std::shared_ptr< Node > | node | ) |
Definition at line 317 of file SceneGraph.cpp.
|
virtual |
Definition at line 278 of file SceneGraph.cpp.
void dyno::SceneGraph::setAdaptiveInterval | ( | bool | adaptive | ) |
Definition at line 51 of file SceneGraph.cpp.
void dyno::SceneGraph::setAsynchronousSimulation | ( | bool | b | ) |
Definition at line 56 of file SceneGraph.cpp.
|
inline |
Definition at line 126 of file SceneGraph.h.
|
inline |
Definition at line 120 of file SceneGraph.h.
void dyno::SceneGraph::setGravity | ( | Vec3f | g | ) |
Definition at line 61 of file SceneGraph.cpp.
void dyno::SceneGraph::setLowerBound | ( | Vec3f | lowerBound | ) |
Definition at line 364 of file SceneGraph.cpp.
|
inline |
Definition at line 117 of file SceneGraph.h.
void dyno::SceneGraph::setUpperBound | ( | Vec3f | upperBound | ) |
Definition at line 369 of file SceneGraph.cpp.
|
virtual |
Definition at line 195 of file SceneGraph.cpp.
void dyno::SceneGraph::traverseBackward | ( | Action * | act | ) |
Depth-first tree traversal.
act | Operation on the node |
Definition at line 657 of file SceneGraph.cpp.
|
inline |
Definition at line 171 of file SceneGraph.h.
void dyno::SceneGraph::traverseForward | ( | Action * | act | ) |
Breadth-first tree traversal.
act | Operation on the node |
Definition at line 671 of file SceneGraph.cpp.
|
inline |
Definition at line 184 of file SceneGraph.h.
void dyno::SceneGraph::traverseForward | ( | std::shared_ptr< Node > | node, |
Action * | act ) |
Breadth-first tree traversal starting from a specific node.
node | Root node |
act | Operation on the node |
Definition at line 685 of file SceneGraph.cpp.
|
inline |
Definition at line 198 of file SceneGraph.h.
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.
node | Root node |
act | Operation on the node |
Definition at line 746 of file SceneGraph.cpp.
|
inline |
Definition at line 212 of file SceneGraph.h.
|
protected |
Definition at line 594 of file SceneGraph.cpp.
|
virtual |
Definition at line 261 of file SceneGraph.cpp.
|
private |
Definition at line 243 of file SceneGraph.h.
|
private |
Definition at line 261 of file SceneGraph.h.
|
private |
Definition at line 245 of file SceneGraph.h.
|
private |
Definition at line 248 of file SceneGraph.h.
|
private |
Definition at line 250 of file SceneGraph.h.
|
private |
Definition at line 247 of file SceneGraph.h.
|
private |
Definition at line 252 of file SceneGraph.h.
|
private |
Definition at line 254 of file SceneGraph.h.
|
private |
Definition at line 246 of file SceneGraph.h.
|
private |
Definition at line 263 of file SceneGraph.h.
|
private |
Definition at line 265 of file SceneGraph.h.
|
private |
Definition at line 267 of file SceneGraph.h.
|
private |
Definition at line 260 of file SceneGraph.h.
|
private |
Definition at line 269 of file SceneGraph.h.
|
private |
Definition at line 268 of file SceneGraph.h.
|
private |
Definition at line 255 of file SceneGraph.h.
|
private |
Definition at line 271 of file SceneGraph.h.
Definition at line 273 of file SceneGraph.h.