21 return this->getClassInfo()->getClassName();
31 auto cls = this->getClassInfo();
33 std::string tip =
"Class Name: ";
34 tip += cls->getClassName() +
"\n";
35 tip +=
"Description: none \n";
58 std::cout <<
"Data field " << name
59 <<
" already exists in this class !"
79 std::cout <<
"Field name " << name
80 <<
" conflicts with existing fields!"
93 fieldAlias.insert(std::make_pair(name, data));
99 std::cout <<
"Field name " << name
100 <<
" conflicts with existing fields!"
111 FieldVector::iterator result = find(
m_field.begin(),
m_field.end(), data);
133 FieldMap::iterator result = fieldAlias.find(name);
135 if (result == fieldAlias.end())
144 FieldVector::iterator result = find(
m_field.begin(),
m_field.end(), data);
152 FieldMap::iterator iter;
155 if (iter->second == data)
175 FieldMap::iterator iter = fieldAlias.find(name);
176 if (iter != fieldAlias.end())
178 FBase* data = iter->second;
180 fieldAlias.erase(iter);
210 for (
int i = 0; i <
m_field.size(); i++)
212 bReady = bReady & !
m_field[i]->isEmpty();
224 std::vector<FieldID> names;
225 FieldMap::iterator iter;
228 if (iter->second == field)
230 names.push_back(iter->first);
239 FieldMap::iterator iter;
242 if (iter->second == data)
423 std::shared_ptr<VkProgram> OBase::addKernel(
ProgramID programId, std::shared_ptr<VkProgram> prog)
425 ProgramMap::iterator result = Kernels.find(programId);
426 assert(result == Kernels.end());
428 Kernels[programId] = prog;
433 VkMultiProgram& OBase::createKernelGroup(
ProgramID programId)
436 MultiProgramMap::iterator result = MultiKernels.find(programId);
437 if (result != MultiKernels.end())
439 std::cout <<
"Warning: Kernel " << programId <<
" already exists, be sure you want to replace the original with a new one" << std::endl;
443 std::shared_ptr<VkMultiProgram> prog = std::make_shared<VkMultiProgram>();
444 MultiKernels[programId] = prog;
446 return *MultiKernels[programId];
451 return *MultiKernels[programId];
454 std::shared_ptr<VkProgram> OBase::kernel(
ProgramID programId)
456 return Kernels[programId];
std::string getObjectName()
void setParent(OBase *owner)
void setObjectName(std::string name)
void setAutoDestroy(bool autoDestroy)
void setDescription(std::string description)
@ Error
Error information while executing something.
static void sendMessage(MessageType type, const std::string &text)
Add a new message to log.
std::vector< FieldID > getFieldAlias(FBase *data)
bool findOutputField(FBase *field)
bool removeParameter(FBase *field)
bool removeFieldAlias(const FieldID name)
Remove a field by its name.
virtual bool attachField(FBase *field, std::string name, std::string desc, bool autoDestroy=true)
Attach a field to Base.
std::vector< FBase * > & getAllFields()
bool findFieldAlias(const FieldID name)
Find a field by its name.
std::vector< FBase * > fields_param
virtual bool captionVisible()
Whether to hide the caption in the GUI.
bool removeInputField(FBase *field)
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)
bool addFieldAlias(FieldID name, FBase *data)
int getFieldAliasCount(FBase *data)
bool removeOutputField(FBase *field)
virtual std::string getName()
FBase * getField(const FieldID name)
Return a field by its name.
bool findField(FBase *data)
Find a field by its pointer.
std::vector< FBase * > fields_output
bool findParameter(FBase *field)
std::map< FieldID, FBase * > FieldMap
virtual std::string description()
Return a description for the node or module, override this function to support user-defined descripti...
std::vector< FBase * > fields_input
bool addOutputField(FBase *field)
bool findInputField(FBase *field)
bool removeFromOutput(FBase *field)
bool addInputField(FBase *field)
bool isAllFieldsReady()
Check the completeness of all required fields.
bool removeField(FBase *data)
Remove a field by its pointer.
bool addToOutput(FBase *field)
static VkSystem * instance()
This is an implementation of AdditiveCCD based on peridyno.
std::string FieldID
Base class for modules.