72 using SPtr = std::shared_ptr<T>;
125 bool addModule(std::shared_ptr<Module> module);
136 template<
class TModule>
139 std::shared_ptr<Module> module = std::dynamic_pointer_cast<Module>(tModule);
142 template<
class TModule>
145 std::shared_ptr<Module> module = std::dynamic_pointer_cast<Module>(tModule);
159 std::shared_ptr<Module>
getModule(std::string name);
167 template<
class TModule>
170 TModule* tmp =
new TModule;
171 std::shared_ptr<Module> base;
172 std::list<std::shared_ptr<Module>>::iterator iter;
175 if ((*iter)->getClassInfo() == tmp->getClassInfo())
185 template<
class TModule>
188 std::shared_ptr<Module> base =
getModule(name);
197 template<
class TModule>
205 std::shared_ptr<TModule> module = std::make_shared<TModule>();
206 module->setName(name);
259 bool attachField(
FBase* field, std::string name, std::string desc,
bool autoDestroy =
true)
override;
@ Error
Error information while executing something.
static void sendMessage(MessageType type, const std::string &text)
Add a new message to log.
uint sizeOfImportNodes() const
bool attachField(FBase *field, std::string name, std::string desc, bool autoDestroy=true) override
Attach a field to Node.
bool appendExportNode(NodePort *nodePort)
std::shared_ptr< GraphicsPipeline > graphicsPipeline()
std::vector< NodePort * > mExportNodes
std::list< std::shared_ptr< Module > > & getModuleList()
virtual void updateTopology()
bool addModule(std::shared_ptr< Module > module)
Add a module to m_module_list and other special module lists.
virtual void resetStates()
virtual bool isActive()
Check the state of dynamics.
virtual void setActive(bool active)
Set the state of dynamics.
void setForceUpdate(bool b)
void setAutoSync(bool con)
Whether the node can be automatically synchronized when its ancestor is updated.
virtual Real getDt()
Simulation timestep.
bool disconnect(NodePort *nPort)
virtual void updateStates()
bool addModule(std::shared_ptr< TModule > tModule)
Add a speical kind of module.
DEF_VAR_STATE(Real, TimeStep, Real(0.033), "Time step size")
uint sizeOfExportNodes() const
bool addNodePort(NodePort *port)
std::shared_ptr< Pipeline > mResetPipeline
Pointer of the pipeline.
virtual std::string getNodeType()
virtual bool requireUpdate()
std::shared_ptr< TModule > addModule(std::string name)
bool removeExportNode(NodePort *nodePort)
bool addToModuleList(std::shared_ptr< Module > module)
std::shared_ptr< AnimationPipeline > mAnimationPipeline
void update()
Called every time interval.
void setSceneGraph(SceneGraph *scn)
virtual void preUpdateStates()
std::shared_ptr< Pipeline > resetPipeline()
void updateGraphicsContext()
void tick()
notify all state and output fields are updated
bool mAutoSync
A parameter to control whether the node can be updated automatically by its ancestor.
SceneGraph * getSceneGraph()
virtual NBoundingBox boundingBox()
bool deleteFromModuleList(std::shared_ptr< Module > module)
bool deleteModule(std::shared_ptr< Module > module)
std::list< std::shared_ptr< Module > > mModuleList
A module list containing all modules.
void setName(std::string name)
DEF_VAR_STATE(Real, ElapsedTime, 0, "Elapsed Time")
std::shared_ptr< T > SPtr
std::shared_ptr< TModule > getModule()
Get the Module by the module class name.
std::shared_ptr< AnimationPipeline > animationPipeline()
bool deleteModule(std::shared_ptr< TModule > tModule)
std::shared_ptr< TModule > getModule(std::string name)
virtual bool validateInputs()
std::string getName() override
std::shared_ptr< GraphicsPipeline > mGraphicsPipeline
std::vector< NodePort * > mImportNodes
virtual void setVisible(bool visible)
Set the visibility of context.
std::vector< NodePort * > & getExportNodes()
bool connect(NodePort *nPort)
Depth-first tree traversal.
void setAutoHidden(bool con)
DEF_VAR_STATE(uint, FrameNumber, 0, "Frame number")
virtual bool isVisible()
Check the visibility of context.
virtual void postUpdateStates()
std::vector< NodePort * > & getAllNodePorts()
bool hasModule(std::string name)
std::vector< NodePort * > & getImportNodes()
This is an implementation of AdditiveCCD based on peridyno.
NBoundingBox(Vec3f lo, Vec3f hi)
NBoundingBox & intersect(const NBoundingBox box)
NBoundingBox & join(const NBoundingBox box)