Shortcut for setting name of feature by ModelHighAPI_Interface
#ifdef DUMP_USER_DEFINED_NAMES
const std::string& aName = name(myLastEntityWithName);
- myDumpBuffer << aName;
- FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(myLastEntityWithName);
- if (aFeature)
- myDumpBuffer << ".feature()";
- myDumpBuffer << ".data().setName(\"" << aName << "\")" << std::endl;
+ myDumpBuffer << aName << ".setName(\"" << aName << "\")" << std::endl;
#endif
myNames[myLastEntityWithName].second = false; // don't dump "setName" for the entity twice
myLastEntityWithName = EntityPtr();
}
}
+void ModelHighAPI_Interface::setName(const std::string& theName)
+{
+ feature()->data()->setName(theName);
+}
+
std::list<ModelHighAPI_Selection> ModelHighAPI_Interface::result() const
{
// TODO(spo): should I use more common function for the whole model to prepare results?
MODELHIGHAPI_EXPORT
void execute();
+ /// Shortcut for feature()->data()->setName()
+ MODELHIGHAPI_EXPORT
+ void setName(const std::string& theName);
+
// TODO(spo): rename to selectAll()
/// Return all objects of the feature
MODELHIGHAPI_EXPORT