13 OBase* pIn = fin !=
nullptr ? fin->
parent() :
nullptr;
14 OBase* pOut = fout !=
nullptr ? fout->
parent() :
nullptr;
16 std::string capIn = pIn !=
nullptr ? pIn->
caption() :
"";
17 std::string capOut = pOut !=
nullptr ? pOut->
caption() :
"";
19 std::string nameIn = pIn !=
nullptr ? pIn->
getName() :
"";
20 std::string nameOut = pOut !=
nullptr ? pOut->
getName() :
"";
24 std::string message1 = capIn +
":" + nameIn +
" is connected to " + capOut +
":" + nameOut;
25 std::string message2 = capIn +
":" + nameIn +
" cannot be connected to " + capOut +
":" + nameOut;
26 return succeeded ? message1 : message2;
30 std::string message1 = capIn +
":" + nameIn +
" is disconnected from " + capOut +
":" + nameOut;
31 std::string message2 = capIn +
":" + nameIn +
" cannot be disconnected from " + capOut +
":" + nameOut;
32 return succeeded ? message1 : message2;
48 m_derived = source ==
nullptr ? false :
true;
62 if (!
mOwner->findOutputField(
this)) {
74 if (!
mOwner->findInputField(
this)) {
75 mOwner->addInputField(
this);
86 if (
mOwner->findOutputField(
this)) {
87 mOwner->removeFromOutput(
this);
98 if (
mOwner->findInputField(
this)) {
99 mOwner->removeInputField(
this);
213 for(
auto var : sinks)
225 func->addInput(
this);
278 parent->attachField(
this, name, description,
false);
286 if (src !=
nullptr) {
291 auto sink =
mSinks.back();
292 sink->setSource(
nullptr);
virtual bool disconnect(FBase *dst)
void setSource(FBase *source)
FieldTypeEnum getFieldType()
void tagOptional(bool optional)
std::string m_description
void attach(std::shared_ptr< FCallBackFunc > func)
FBase * promoteOuput()
Display a state field as an ouput field.
void setDerived(bool derived)
std::vector< std::shared_ptr< FCallBackFunc > > mCallbackFunc
std::vector< FBase * > & getSinks()
void detach(std::shared_ptr< FCallBackFunc > func)
void setParent(OBase *owner)
FBase * demoteInput()
Hide a state field from inputs.
std::vector< FBase * > mSinks
void setAutoDestroy(bool autoDestroy)
bool disconnectField(FBase *dst)
FBase * promoteInput()
Display a state field as an input field.
FBase * demoteOuput()
Hide a state field from outputs.
bool removeSink(FBase *f)
bool connectField(FBase *dst)
@ Info
Information to user.
static void sendMessage(MessageType type, const std::string &text)
Add a new message to log.
virtual std::string caption()
Return the caption.
virtual std::string getName()
This is an implementation of AdditiveCCD based on peridyno.
std::string FormatConnectionInfo(FBase *fin, FBase *fout, bool connecting, bool succeeded)