#include "ConstructionPlugin.h"
#include <ModelAPI_Feature.h>
+/// Extrusion kind
+const std::string CONSTRUCTION_EXTRUSION_KIND("Extrusion");
+
/// attribute name of referenced face
const std::string EXTRUSION_FACE = "extrusion_face";
public:
/// Returns the kind of a feature
CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getKind()
- { static std::string MY_KIND = "Extrusion"; return MY_KIND; }
+ { static std::string MY_KIND = CONSTRUCTION_EXTRUSION_KIND; return MY_KIND; }
/// Returns to which group in the document must be added feature
CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getGroup()
FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID)
{
- if (theFeatureID == "Point") {
+ if (theFeatureID == CONSTRUCTION_POINT_KIND) {
return FeaturePtr(new ConstructionPlugin_Point);
- } else if (theFeatureID == "Extrusion") {
+ } else if (theFeatureID == CONSTRUCTION_EXTRUSION_KIND) {
return FeaturePtr(new ConstructionPlugin_Extrusion);
}
// feature of such kind is not found
#include "ConstructionPlugin.h"
#include <ModelAPI_Feature.h>
+/// Point kind
+const std::string CONSTRUCTION_POINT_KIND("Point");
+
/// attribute name for X coordinate
const std::string POINT_ATTR_X = "x";
/// attribute name for Y coordinate
public:
/// Returns the kind of a feature
CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getKind()
- {static std::string MY_KIND = "Point"; return MY_KIND;}
+ {static std::string MY_KIND = CONSTRUCTION_POINT_KIND; return MY_KIND;}
/// Returns to which group in the document must be added feature
CONSTRUCTIONPLUGIN_EXPORT virtual const std::string& getGroup()
#include "PartSetPlugin.h"
#include <ModelAPI_Feature.h>
+/// Part kind
+const std::string PARTSET_PART_KIND("Part");
+
/// part reference attribute
const std::string PART_ATTR_DOC_REF = "PartDocument";
public:
/// Returns the kind of a feature
PARTSETPLUGIN_EXPORT virtual const std::string& getKind()
- {static std::string MY_KIND = "Part"; return MY_KIND;}
+ {static std::string MY_KIND = PARTSET_PART_KIND; return MY_KIND;}
/// Returns to which group in the document must be added feature
PARTSETPLUGIN_EXPORT virtual const std::string& getGroup()
FeaturePtr PartSetPlugin_Plugin::createFeature(string theFeatureID)
{
- if (theFeatureID == "Part") {
+ if (theFeatureID == PARTSET_PART_KIND) {
return FeaturePtr(new PartSetPlugin_Part);
}
if (theFeatureID == "duplicate") {
boost::shared_ptr<PartSetPlugin_Part> a;
for(int a = aRoot->size(getGroup()) - 1; a >= 0; a--) {
FeaturePtr aFeature = aRoot->feature(getGroup(), a, true);
- if (aFeature->getKind() == "Part") {
+ if (aFeature->getKind() == PARTSET_PART_KIND) {
boost::shared_ptr<PartSetPlugin_Part> aPart =
boost::static_pointer_cast<PartSetPlugin_Part>(aFeature);
if (aPart->data()->docRef(PART_ATTR_DOC_REF)->value() == aPManager->currentDocument()) {
#include "PartSetPlugin.h"
#include <ModelAPI_Feature.h>
+/// Extrusion kind
+const std::string PARTSET_REMOVE_KIND("Remove");
+
/**\class PartSetPlugin_Remove
* \ingroup DataModel
* \brief Feature for creation of the new part in PartSet.
public:
/// Returns the kind of a feature
PARTSETPLUGIN_EXPORT virtual const std::string& getKind()
- {static std::string MY_KIND = "Remove"; return MY_KIND;}
+ {static std::string MY_KIND = PARTSET_REMOVE_KIND; return MY_KIND;}
/// Returns to which group in the document must be added feature
PARTSETPLUGIN_EXPORT virtual const std::string& getGroup()
FeaturePtr aFeature = aFeatures.first();
//Process Feature
if (aFeature) {
- if (aFeature->getKind() == "Part") {
+ if (aFeature->getKind() == PARTSET_PART_KIND) {
ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature);
DocumentPtr aFeaDoc = aObject->featureRef()->data()->docRef("PartDocument")->value();
if (aMgr->currentDocument() == aFeaDoc)
bool aHasPart = false;
for (aIt = aFeatures.begin(); aIt != aFeatures.end(); ++aIt) {
FeaturePtr aFeature = (*aIt);
- if (aFeature->getKind() == "Part") {
+ if (aFeature->getKind() == PARTSET_PART_KIND) {
aHasPart = true;
break;
}
PluginManagerPtr aMgr = ModelAPI_PluginManager::get();
aMgr->rootDocument()->startOperation();
foreach (FeaturePtr aFeature, theList) {
- if (aFeature->getKind() == "Part") {
+ if (aFeature->getKind() == PARTSET_PART_KIND) {
DocumentPtr aDoc;
if (!XGUI_Tools::isModelObject(aFeature)) {
aDoc = aFeature->data()->docRef("PartDocument")->value();