177 this->stateElapsedTime()->setValue(0.0f);
178 this->stateFrameNumber()->setValue(0);
215 if (!f_in->isOptional() && f_in->isEmpty())
217 std::string errMsg = std::string(
"The field ") + f_in->getObjectName() +
218 std::string(
" in Node ") + this->getClassInfo()->getClassName() + std::string(
" is not set!");
235 bool modified =
false;
245 modified |= f_in->isModified();
251 modified |= var->isModified();
260 for(
FBase * var : fields)
262 if (var !=
nullptr) {
406 std::string capIn = node->
caption();
407 std::string capOut = pOut !=
nullptr ? pOut->
caption() :
"";
409 std::string nameIn = node->
getName();
410 std::string nameOut = port !=
nullptr ? port->
getPortName() :
"";
414 std::string message1 = capIn +
":" + nameIn +
" is connected to " + capOut +
":" + nameOut;
415 std::string message2 = capIn +
":" + nameIn +
" cannot be connected to " + capOut +
":" + nameOut;
416 return succeeded ? message1 : message2;
420 std::string message1 = capIn +
":" + nameIn +
" is disconnected from " + capOut +
":" + nameOut;
421 std::string message2 = capIn +
":" + nameIn +
" cannot be disconnected from " + capOut +
":" + nameOut;
422 return succeeded ? message1 : message2;
441 return nodePort->
addNode(
this);
529 n += port->getNodes().size();
615 std::shared_ptr<Module> base =
nullptr;
616 std::list<std::shared_ptr<Module>>::iterator iter;
619 if ((*iter)->getName() == name)
654 module->setParentNode(this);
FieldTypeEnum getFieldType()
void setParent(OBase *owner)
void setObjectName(std::string name)
void setAutoDestroy(bool autoDestroy)
void setDescription(std::string description)
@ Info
Information to user.
@ 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
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 addNodePort(NodePort *port)
std::shared_ptr< Pipeline > mResetPipeline
Pointer of the pipeline.
virtual std::string getNodeType()
virtual bool requireUpdate()
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)
std::shared_ptr< TModule > getModule()
Get the Module by the module class name.
std::shared_ptr< AnimationPipeline > animationPipeline()
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.
bool connect(NodePort *nPort)
Depth-first tree traversal.
void setAutoHidden(bool con)
virtual bool isVisible()
Check the visibility of context.
virtual void postUpdateStates()
bool hasModule(std::string name)
virtual bool removeNode(Node *node)=0
virtual bool addNode(Node *node)=0
virtual std::string getPortName()
std::vector< FBase * > & getAllFields()
std::vector< FBase * > fields_param
bool addField(FBase *data)
Add a field to Base FieldID will be set to the name of Field by default.
virtual std::string caption()
Return the caption.
bool addParameter(FBase *field)
std::vector< FBase * > fields_output
std::vector< FBase * > fields_input
bool addOutputField(FBase *field)
bool addInputField(FBase *field)
This is an implementation of AdditiveCCD based on peridyno.
std::string FormatConnectionInfo(FBase *fin, FBase *fout, bool connecting, bool succeeded)