#include <SofaComponentNodeModel.h>
This Class is a NodeDataModel specialisation to represent a Sofa component on the QtNodes graph. It will take a SOFA BaseObject as target and parse all Data, storing Data, Links and connections with parents components.
Protected Attributes | |
QString | m_caption |
caption to be display on the Graph More... | |
QString | m_uniqName |
unique name to refer to this node More... | |
bool | debugNodeGraph |
parameter to activate graph logs. False by default. More... | |
std::vector< std::pair< QString, QString > > | m_data |
Vector of Data/port hold by this component/Node. vector of pair{DataName, DataType}. More... | |
std::vector< std::shared_ptr< SofaComponentNodeData > > | m_Nodedata |
vector of SofaComponentNodeData class holding pointer to the Data. To replace More... | |
std::map< QString, std::pair< QString, QString > > | m_dataConnections |
Map to store all connection between this node and other. map.key = this data name, map.value = pair{ComponentName, DataName}. More... | |
sofa::core::objectmodel::BaseObject * | m_SofaObject |
Pointer to the sofa object. More... | |
Public Member Functions | |
SofaComponentNodeModel (std::string name="EmptyNode") | |
Default empty Object constructor with 0 Data. More... | |
SofaComponentNodeModel (sofa::core::objectmodel::BaseObject *_sofaObject, bool debugMode=false) | |
constructor with a Sofa BaseObject as target More... | |
virtual | ~SofaComponentNodeModel () |
QString | caption () const override |
Interface for caption. More... | |
void | setCaption (std::string str) |
QString | name () const override |
Interface for name. More... | |
size_t | getNbrData () |
Return the number of Data. More... | |
size_t | getNbrConnections () |
Return the number of connection with other Node components. More... | |
const std::map< QString, std::pair< QString, QString > > & | getDataConnections () |
return the list of connections More... | |
QtNodes::PortIndex | getDataInputId (const QString &dataName) |
Return the PortIndex of a Data given its Name. More... | |
unsigned int | nPorts (PortType portType) const override |
NodeDataType | dataType (PortType portType, PortIndex portIndex) const override |
Override method to give the type of Data per Port. More... | |
std::shared_ptr< NodeData > | outData (PortIndex port) override |
Override method to return the NodeData given a port. More... | |
void | setInData (std::shared_ptr< NodeData > data, int port) override |
Override method to set input Data. More... | |
QWidget * | embeddedWidget () override |
Override method for more advance node gui. Not yet used. More... | |
Protected Member Functions | |
void | parseSofaObjectData () |
} More... | |
|
protected |
parameter to activate graph logs. False by default.
|
protected |
caption to be display on the Graph
|
protected |
Vector of Data/port hold by this component/Node. vector of pair{DataName, DataType}.
|
protected |
Map to store all connection between this node and other. map.key = this data name, map.value = pair{ComponentName, DataName}.
|
protected |
vector of SofaComponentNodeData class holding pointer to the Data. To replace
|
protected |
Pointer to the sofa object.
|
protected |
unique name to refer to this node
SofaComponentNodeModel::SofaComponentNodeModel | ( | std::string | name = "EmptyNode" | ) |
Default empty Object constructor with 0 Data.
SofaComponentNodeModel::SofaComponentNodeModel | ( | sofa::core::objectmodel::BaseObject * | _sofaObject, |
bool | debugMode = false |
||
) |
constructor with a Sofa BaseObject as target
|
inlinevirtual |
|
inlineoverride |
Interface for caption.
|
override |
Override method to give the type of Data per Port.
|
inlineoverride |
Override method for more advance node gui. Not yet used.
|
inline |
return the list of connections
QtNodes::PortIndex SofaComponentNodeModel::getDataInputId | ( | const QString & | dataName | ) |
Return the PortIndex of a Data given its Name.
|
inline |
Return the number of connection with other Node components.
|
inline |
Return the number of Data.
|
inlineoverride |
Interface for name.
|
override |
Interface for QtNodes { Override method to return the number of ports
|
override |
Override method to return the NodeData given a port.
|
protected |
}
Internal method to parse all Data of a Sofa component and create the corresponding ports
|
inline |
|
override |
Override method to set input Data.