186 this->stateElapsedTime()->setValue(0.0f);
187 this->stateFrameNumber()->setValue(0);
224 if (!f_in->isOptional() && f_in->isEmpty())
226 std::string errMsg = std::string(
"The field ") + f_in->getObjectName() +
227 std::string(
" in Node ") + this->getClassInfo()->getClassName() + std::string(
" is not set!");
244 bool modified =
false;
254 modified |= f_in->isModified();
260 modified |= var->isModified();
269 for(
FBase * var : fields)
271 if (var !=
nullptr) {
415 std::string capIn = node->
caption();
416 std::string capOut = pOut !=
nullptr ? pOut->
caption() :
"";
418 std::string nameIn = node->
getName();
419 std::string nameOut = port !=
nullptr ? port->
getPortName() :
"";
423 std::string message1 = capIn +
":" + nameIn +
" is connected to " + capOut +
":" + nameOut;
424 std::string message2 = capIn +
":" + nameIn +
" cannot be connected to " + capOut +
":" + nameOut;
425 return succeeded ? message1 : message2;
429 std::string message1 = capIn +
":" + nameIn +
" is disconnected from " + capOut +
":" + nameOut;
430 std::string message2 = capIn +
":" + nameIn +
" cannot be disconnected from " + capOut +
":" + nameOut;
431 return succeeded ? message1 : message2;
450 return nodePort->
addNode(
this);
538 n += port->getNodes().size();
624 std::shared_ptr<Module> base =
nullptr;
625 std::list<std::shared_ptr<Module>>::iterator iter;
628 if ((*iter)->getName() == name)
663 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)