/*\r
* Class to pass a feature entry extracted from xml file.\r
* Example of the feature entry:\r
- * <feature id="new_part" text="Part" tooltip="Creates a new part" icon=":pictures/part_ico.png"/>\r
+ * <feature id="Part" text="New part" tooltip="Creates a new part" icon=":pictures/part_ico.png"/>\r
*/\r
class CONFIG_EXPORT Config_FeatureMessage: public Event_Message\r
{\r
<plugin>
<workbench id="Part">
<group id="Operations">
- <feature id="new_part" text="Part" tooltip="Creates a new part" icon=":pictures/part_ico.png"/>
+ <feature id="Part" text="New part" tooltip="Creates a new part" icon=":pictures/part_ico.png"/>
<feature id="duplicate" text="Duplicate" tooltip="Duplicate selected object" icon=":icons/duplicate.png"/>
<feature id="remove" text="Remove" tooltip="Remove selected object" icon=":icons/remove.png"/>
</group>
</workbench>
<workbench id="Construction">
<group id="Basic">
- <feature id="new_point" text="Point" tooltip="Create a new point" icon=":icons/point.png">
+ <feature id="Point" text="Point" tooltip="Create a new point" icon=":icons/point.png">
<value id="x" type="double" label="X:" min="0" max="" step="0.1" default="0"/>
<value id="y" type="double" label="Y:" min="0" max="" step="0.1" default="0"/>
<value id="z" type="double" label="Z:" min="0" max="" step="0.1" default="0"/>
</feature>
- <feature id="new_axis" text="Axis" tooltip="Create a new axis" icon=":icons/axis.png" keysequence=""/>
- <feature id="new_plane" text="Plane" tooltip="Create a new plane" icon=":icons/plane.png" keysequence=""/>
+ <feature id="Axis" text="Axis" tooltip="Create a new axis" icon=":icons/axis.png" keysequence=""/>
+ <feature id="Plane" text="Plane" tooltip="Create a new plane" icon=":icons/plane.png" keysequence=""/>
</group>
</workbench>
-</plugin>
\ No newline at end of file
+</plugin>
Model_PluginManager.h
Model_Object.h
Model_Iterator.h
+ Model_AttributeDouble.h
Model_AttributeDocRef.h
)
Model_PluginManager.cxx
Model_Object.cxx
Model_Iterator.cxx
+ Model_AttributeDouble.cxx
Model_AttributeDocRef.cxx
)
--- /dev/null
+// File: ModelAPI_AttributeDouble.cxx
+// Created: 2 Apr 2014
+// Author: Mikhail PONIKAROV
+
+#include "Model_AttributeDouble.h"
+
+using namespace std;
+
+void Model_AttributeDouble::setValue(const double theValue)
+{
+ myReal->Set(theValue);
+}
+
+double Model_AttributeDouble::value()
+{
+ return myReal->Get();
+}
+
+Model_AttributeDouble::Model_AttributeDouble(TDF_Label& theLabel)
+{
+ // check the attribute could be already presented in this doc (after load document)
+ if (!theLabel.FindAttribute(TDataStd_Real::GetID(), myReal)) {
+ // create attribute: not initialized by value yet, just zero
+ myReal = TDataStd_Real::Set(theLabel, 0.);
+ }
+}
+
--- /dev/null
+// File: Model_AttributeDouble.h
+// Created: 2 Apr 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef Model_AttributeDouble_HeaderFile
+#define Model_AttributeDouble_HeaderFile
+
+#include "Model.h"
+#include "ModelAPI_AttributeDouble.h"
+#include <TDataStd_Real.hxx>
+#include <TDF_Label.hxx>
+
+/**\class Model_AttributeDouble
+ * \ingroup DataModel
+ * \brief Attribute that contains real value with double precision.
+ */
+
+class MODEL_EXPORT Model_AttributeDouble : public ModelAPI_AttributeDouble
+{
+ Handle_TDataStd_Real myReal; ///< double is Real attribute
+public:
+ /// Defines the double value
+ virtual void setValue(const double theValue);
+
+ /// Returns the double value
+ virtual double value();
+
+protected:
+ /// Initializes attibutes
+ Model_AttributeDouble(TDF_Label& theLabel);
+
+ friend class Model_Object;
+};
+
+#endif
// first count all objects of such kind to start with index = count + 1
int aNumObjects = 0;
shared_ptr<ModelAPI_Iterator> anIter = featuresIterator(theGroupID);
- for(; anIter->More(); anIter->Next()) {
- if (anIter->CurrentKind() == theFeature->getKind())
+ for(; anIter->more(); anIter->next()) {
+ if (anIter->currentKind() == theFeature->getKind())
aNumObjects++;
}
// generate candidate name
aNameStream<<theFeature->getKind()<<"_"<<aNumObjects + 1;
string aName = aNameStream.str();
// check this is unique, if not, increase index by 1
- for(anIter = featuresIterator(theGroupID); anIter->More();) {
- if (anIter->CurrentName() == aName) {
+ for(anIter = featuresIterator(theGroupID); anIter->more();) {
+ if (anIter->currentName() == aName) {
aNumObjects++;
stringstream aNameStream;
aNameStream<<theFeature->getKind()<<"_"<<aNumObjects + 1;
// reinitialize iterator to make sure a new name is unique
anIter = featuresIterator(theGroupID);
- } else anIter->Next();
+ } else anIter->next();
}
theFeature->data()->setName(aName);
using namespace std;
-void Model_Iterator::Next()
+void Model_Iterator::next()
{
return myIter.Next();
}
-bool Model_Iterator::More()
+bool Model_Iterator::more()
{
return myIter.More();
}
-shared_ptr<ModelAPI_Feature> Model_Iterator::Current()
+shared_ptr<ModelAPI_Feature> Model_Iterator::current()
{
TDF_Label aLab = myIter.Value()->Label();
return myDoc->feature(aLab);
}
-string Model_Iterator::CurrentKind()
+string Model_Iterator::currentKind()
{
return string(TCollection_AsciiString(
Handle(TDataStd_Comment)::DownCast(myIter.Value())->Get()).ToCString());
}
-string Model_Iterator::CurrentName()
+string Model_Iterator::currentName()
{
TDF_Label aLab = myIter.Value()->Label();
Handle(TDataStd_Name) aName;
return ""; // name is not found
}
+int Model_Iterator::numIterationsLeft()
+{
+ int aResult = 0;
+ TDF_ChildIDIterator aTempIter(myIter);
+ for(; aTempIter.More(); aTempIter.Next())
+ aResult++;
+ return aResult;
+}
+
Model_Iterator::Model_Iterator(std::shared_ptr<Model_Document> theDoc, TDF_Label theLab)
: myDoc(theDoc), myIter(theLab, TDataStd_Comment::GetID(), Standard_False)
{}
TDF_ChildIDIterator myIter; ///< iterator of the features-labels
public:
/// Iterates to the next feature
- virtual void Next();
+ virtual void next();
/// Returns true if the current iteration is valid and next iteration is possible
- virtual bool More();
+ virtual bool more();
/// Returns the currently iterated feature
- virtual std::shared_ptr<ModelAPI_Feature> Current();
+ virtual std::shared_ptr<ModelAPI_Feature> current();
/// Returns the kind of the current feature (faster than Current()->getKind())
- virtual std::string CurrentKind();
+ virtual std::string currentKind();
/// Returns the name of the current feature (faster than Current()->getName())
- virtual std::string CurrentName();
+ virtual std::string currentName();
+ /// Don't changes the current position of iterator. Not fast: iterates the left items.
+ /// \returns number of left iterations
+ virtual int numIterationsLeft();
protected:
/// Initializes iterator
#include <Model_Object.h>
#include <Model_AttributeDocRef.h>
+#include <Model_AttributeDouble.h>
#include <TDataStd_Name.hxx>
using namespace std;
ModelAPI_Attribute* anAttr = 0;
if (theAttrType == ModelAPI_AttributeDocRef::type())
anAttr = new Model_AttributeDocRef(anAttrLab);
+ else if (theAttrType == ModelAPI_AttributeDouble::type())
+ anAttr = new Model_AttributeDouble(anAttrLab);
+
if (anAttr)
myAttrs[theID] = std::shared_ptr<ModelAPI_Attribute>(anAttr);
else
}
return aRes;
}
+
+shared_ptr<ModelAPI_AttributeDouble> Model_Object::real(const string theID)
+{
+ map<string, shared_ptr<ModelAPI_Attribute> >::iterator aFound = myAttrs.find(theID);
+ if (aFound == myAttrs.end()) {
+ // TODO: generate error on unknown attribute request and/or add mechanism for customization
+ return std::shared_ptr<ModelAPI_AttributeDouble>();
+ }
+ shared_ptr<ModelAPI_AttributeDouble> aRes =
+ dynamic_pointer_cast<ModelAPI_AttributeDouble>(aFound->second);
+ if (!aRes) {
+ // TODO: generate error on invalid attribute type request
+ }
+ return aRes;
+}
/// Defines the name of the feature visible by the user in the object browser
virtual void setName(std::string theName);
/// Returns the attribute that references to another document
- std::shared_ptr<ModelAPI_AttributeDocRef> docRef(const std::string theID);
+ virtual std::shared_ptr<ModelAPI_AttributeDocRef> docRef(const std::string theID);
+ /// Returns the attribute that contains real value with double precision
+ virtual std::shared_ptr<ModelAPI_AttributeDouble> real(const std::string theID);
/// Initializes object by the attributes: must be called just after the object is created
/// for each attribute of the object
Model_Application::getApplication()->getDocument("root"));
}
+shared_ptr<ModelAPI_Document> Model_PluginManager::currentDocument()
+{
+ if (!myCurrentDoc)
+ myCurrentDoc = rootDocument();
+ return myCurrentDoc;
+}
+
+void Model_PluginManager::setCurrentDocument(shared_ptr<ModelAPI_Document> theDoc)
+{
+ myCurrentDoc = theDoc;
+}
Model_PluginManager::Model_PluginManager()
{
std::map<std::string, std::string> myPlugins;
std::map<std::string, ModelAPI_Plugin*> myPluginObjs; ///< instances of the already plugins
std::string myCurrentPluginName; ///< name of the plugin that must be loaded currently
+ std::shared_ptr<ModelAPI_Document> myCurrentDoc; ///< current working document
public:
/// Creates the feature object using plugins functionality
MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID);
/// Returns the root document of the application (that may contains sub-documents)
- virtual std::shared_ptr<ModelAPI_Document> rootDocument();
+ MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Document> rootDocument();
+
+ /// Returns the current document that used for current work in the application
+ MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Document> currentDocument();
+
+ /// Defines the current document that used for current work in the application
+ MODEL_EXPORT virtual void setCurrentDocument(std::shared_ptr<ModelAPI_Document> theDoc);
/// Registers the plugin that creates features.
/// It is obligatory for each plugin to call this function on loading to be found by
/// the plugin manager on call of the feature)
- virtual void registerPlugin(ModelAPI_Plugin* thePlugin);
+ MODEL_EXPORT virtual void registerPlugin(ModelAPI_Plugin* thePlugin);
/// Processes the configuration file reading
MODEL_EXPORT virtual void processEvent(const Event_Message* theMessage);
ModelAPI_Object.h
ModelAPI_Document.h
ModelAPI_Attribute.h
+ ModelAPI_AttributeDouble.h
ModelAPI_AttributeDocRef.h
)
#include "ModelAPI_PluginManager.h"
#include "ModelAPI_Feature.h"
#include "ModelAPI_Object.h"
+ #include "ModelAPI_Attribute.h"
+ #include "ModelAPI_AttributeDocRef.h"
+ #include "ModelAPI_AttributeDouble.h"
%}
// to avoid error on this
%shared_ptr(ModelAPI_PluginManager)
%shared_ptr(ModelAPI_Feature)
%shared_ptr(ModelAPI_Object)
+%shared_ptr(ModelAPI_Attribute)
+%shared_ptr(ModelAPI_AttributeDocRef)
+%shared_ptr(ModelAPI_AttributeDouble)
// all supported interfaces
%include "ModelAPI_Document.h"
%include "ModelAPI_PluginManager.h"
%include "ModelAPI_Feature.h"
%include "ModelAPI_Object.h"
+%include "ModelAPI_Attribute.h"
+%include "ModelAPI_AttributeDocRef.h"
+%include "ModelAPI_AttributeDouble.h"
--- /dev/null
+// File: ModelAPI_AttributeDouble.h
+// Created: 2 Apr 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef ModelAPI_AttributeDouble_HeaderFile
+#define ModelAPI_AttributeDouble_HeaderFile
+
+#include "ModelAPI_Attribute.h"
+
+/**\class ModelAPI_AttributeDouble
+ * \ingroup DataModel
+ * \brief Attribute that contains real value with double precision.
+ */
+
+class MODELAPI_EXPORT ModelAPI_AttributeDouble : public ModelAPI_Attribute
+{
+public:
+ /// Defines the double value
+ virtual void setValue(double theValue) = 0;
+
+ /// Returns the double value
+ virtual double value() = 0;
+
+ /// Returns the type of this class of attributes
+ static std::string type() {return "Double";}
+
+ /// Returns the type of this class of attributes, not static method
+ virtual std::string attributeType() {return type();}
+
+protected:
+ /// Objects are created for features automatically
+ ModelAPI_AttributeDouble()
+ {}
+};
+
+#endif
{
public:
/// Iterates to the next feature
- virtual void Next() = 0;
+ virtual void next() = 0;
/// Returns true if the current iteration is valid and next iteration is possible
- virtual bool More() = 0;
+ virtual bool more() = 0;
/// Returns the currently iterated feature
- virtual std::shared_ptr<ModelAPI_Feature> Current() = 0;
+ virtual std::shared_ptr<ModelAPI_Feature> current() = 0;
/// Returns the kind of the current feature (faster than Current()->getKind())
- virtual std::string CurrentKind() = 0;
+ virtual std::string currentKind() = 0;
/// Returns the name of the current feature (faster than Current()->getName())
- virtual std::string CurrentName() = 0;
+ virtual std::string currentName() = 0;
+ /// Don't changes the current position of iterator. Not fast: iterates the left items.
+ /// \returns number of left iterations
+ virtual int numIterationsLeft() = 0;
protected:
/// Use plugin manager for features creation: this method is
#include <memory>
class ModelAPI_AttributeDocRef;
+class ModelAPI_AttributeDouble;
/**\class ModelAPI_Object
* \ingroup DataModel
/// Returns the attribute that references to another document
virtual std::shared_ptr<ModelAPI_AttributeDocRef> docRef(const std::string theID) = 0;
+ /// Returns the attribute that contains real value with double precision
+ virtual std::shared_ptr<ModelAPI_AttributeDouble> real(const std::string theID) = 0;
/// Initializes object by the attributes: must be called just after the object is created
/// for each attribute of the object
#include <ModelAPI_Iterator.h>
// to avoid unresolved ModelAPI_Iterator()
#include <ModelAPI_Iterator.h>
-// to avoid unresolved ModelAPI_Attribute()
#include <ModelAPI_Attribute.h>
-// to avoid unresolved ModelAPI_AttributeDocRef()
#include <ModelAPI_AttributeDocRef.h>
+#include <ModelAPI_AttributeDouble.h>
#ifdef WIN32
#include <windows.h>
/// Returns the root document of the application (that may contains sub-documents)
virtual std::shared_ptr<ModelAPI_Document> rootDocument() = 0;
+ /// Returns the current document that used for current work in the application
+ virtual std::shared_ptr<ModelAPI_Document> currentDocument() = 0;
+
+ /// Defines the current document that used for current work in the application
+ virtual void setCurrentDocument(std::shared_ptr<ModelAPI_Document> theDoc) = 0;
+
/// loads the library with specific name, appends "lib*.dll" or "*.so" depending on the platform
static void ModelAPI_PluginManager::loadLibrary(const std::string theLibName);
SET(PROJECT_HEADERS
PartSetPlugin.h
PartSetPlugin_Plugin.h
- PartSetPlugin_NewPart.h
+ PartSetPlugin_Part.h
+ PartSetPlugin_Point.h
)
SET(PROJECT_SOURCES
PartSetPlugin_Plugin.cxx
- PartSetPlugin_NewPart.cxx
+ PartSetPlugin_Part.cxx
+ PartSetPlugin_Point.cxx
)
ADD_DEFINITIONS(-DPARTSETPLUGIN_EXPORTS ${BOOST_DEFINITIONS})
+++ /dev/null
-// File: PartSetPlugin_NewPart.cxx
-// Created: 27 Mar 2014
-// Author: Mikhail PONIKAROV
-
-#include "PartSetPlugin_NewPart.h"
-#include "ModelAPI_PluginManager.h"
-#include "ModelAPI_Document.h"
-#include "ModelAPI_Object.h"
-#include "ModelAPI_AttributeDocRef.h"
-
-using namespace std;
-
-PartSetPlugin_NewPart::PartSetPlugin_NewPart()
-{
-}
-
-void PartSetPlugin_NewPart::initAttributes()
-{
- data()->addAttribute(ModelAPI_AttributeDocRef::type(), PART_DOC_REF);
-}
-
-void PartSetPlugin_NewPart::execute()
-{
- shared_ptr<ModelAPI_Document> aPartSetDoc = ModelAPI_PluginManager::get()->rootDocument();
- data()->setName(string("Part_") + "1");
- aPartSetDoc->subDocument(string("Part_") + "1");
-}
+++ /dev/null
-// File: PartSetPlugin_NewPart.hxx
-// Created: 27 Mar 2014
-// Author: Mikhail PONIKAROV
-
-#ifndef PartSetPlugin_NewPart_HeaderFile
-#define PartSetPlugin_NewPart_HeaderFile
-
-#include "PartSetPlugin.h"
-#include <ModelAPI_Feature.h>
-
-/// part reference attribute
-const std::string PART_DOC_REF = "PartDocument";
-
-/**\class PartSetPlugin_NewPart
- * \ingroup DataModel
- * \brief Feature for creation of the new part in PartSet.
- */
-class PartSetPlugin_NewPart: public ModelAPI_Feature
-{
-public:
- /// Returns the kind of a feature
- PARTSETPLUGIN_EXPORT virtual std::string getKind() {return "new_part";}
-
- /// Creates a new part document if needed
- PARTSETPLUGIN_EXPORT virtual void execute();
-
- /// Request for initialization of data model of the feature: adding all attributes
- PARTSETPLUGIN_EXPORT virtual void initAttributes();
-
- /// Use plugin manager for features creation
- PartSetPlugin_NewPart();
-};
-
-#endif
+++ /dev/null
-// File: PartSetPlugin_NewPart.hxx
-// Created: 27 Mar 2014
-// Author: Mikhail PONIKAROV
-
-#ifndef PartSetPlugin_NewPart_HeaderFile
-#define PartSetPlugin_NewPart_HeaderFile
-
-#include "PartSetPlugin.h"
-#include <ModelAPI_Feature.h>
-
-/**\class PartSetPlugin_NewPart
- * \ingroup DataModel
- * \brief Feature for creation of the new part in PartSet.
- */
-
-class PartSetPlugin_NewPart: public ModelAPI_Feature
-{
-public:
- /// Returns the kind of a feature
- PARTSETPLUGIN_EXPORT virtual std::string GetKind() {return "new_part";}
-
- /// Use plugin manager for features creation
- PartSetPlugin_NewPart();
-};
-
-#endif
--- /dev/null
+// File: PartSetPlugin_Part.cxx
+// Created: 27 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#include "PartSetPlugin_Part.h"
+#include "ModelAPI_PluginManager.h"
+#include "ModelAPI_Document.h"
+#include "ModelAPI_Object.h"
+#include "ModelAPI_Iterator.h"
+#include "ModelAPI_AttributeDocRef.h"
+
+using namespace std;
+
+PartSetPlugin_Part::PartSetPlugin_Part()
+{
+}
+
+void PartSetPlugin_Part::initAttributes()
+{
+ data()->addAttribute(PART_ATTR_DOC_REF, ModelAPI_AttributeDocRef::type());
+}
+
+void PartSetPlugin_Part::execute()
+{
+ shared_ptr<ModelAPI_AttributeDocRef> aDocRef = data()->docRef(PART_ATTR_DOC_REF);
+ if (!aDocRef->value()) { // create a document if not yet created
+ shared_ptr<ModelAPI_Document> aPartSetDoc = ModelAPI_PluginManager::get()->rootDocument();
+ aDocRef->setValue(aPartSetDoc->subDocument(data()->getName()));
+ }
+}
--- /dev/null
+// File: PartSetPlugin_Part.h
+// Created: 27 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef PartSetPlugin_Part_HeaderFile
+#define PartSetPlugin_Part_HeaderFile
+
+#include "PartSetPlugin.h"
+#include <ModelAPI_Feature.h>
+
+/// part reference attribute
+const std::string PART_ATTR_DOC_REF = "PartDocument";
+
+/**\class PartSetPlugin_Part
+ * \ingroup DataModel
+ * \brief Feature for creation of the new part in PartSet.
+ */
+class PartSetPlugin_Part: public ModelAPI_Feature
+{
+public:
+ /// Returns the kind of a feature
+ PARTSETPLUGIN_EXPORT virtual std::string getKind() {return "Part";}
+
+ /// Creates a new part document if needed
+ PARTSETPLUGIN_EXPORT virtual void execute();
+
+ /// Request for initialization of data model of the feature: adding all attributes
+ PARTSETPLUGIN_EXPORT virtual void initAttributes();
+
+ /// Use plugin manager for features creation
+ PartSetPlugin_Part();
+};
+
+#endif
#include "PartSetPlugin_Plugin.h"
-#include "PartSetPlugin_NewPart.h"
+#include "PartSetPlugin_Part.h"
+#include "PartSetPlugin_Point.h"
#include <ModelAPI_PluginManager.h>
#include <ModelAPI_Document.h>
std::shared_ptr<ModelAPI_Feature> PartSetPlugin_Plugin::createFeature(string theFeatureID)
{
std::shared_ptr<ModelAPI_Feature> aCreated;
- if (theFeatureID == "new_part") {
- aCreated = std::shared_ptr<ModelAPI_Feature>(new PartSetPlugin_NewPart);
+ bool isCurrent = true; // to create a feature in the current document
+ if (theFeatureID == "Part") {
+ aCreated = std::shared_ptr<ModelAPI_Feature>(new PartSetPlugin_Part);
+ isCurrent = false; // allways create in the root document
+ } else if (theFeatureID == "Point") {
+ aCreated = std::shared_ptr<ModelAPI_Feature>(new PartSetPlugin_Point);
}
+
// add to a root document for the current moment
- if (aCreated)
- ModelAPI_PluginManager::get()->rootDocument()->addFeature(aCreated, PARTS_GROUP);
+ if (aCreated) {
+ shared_ptr<ModelAPI_Document> aDoc = isCurrent ?
+ ModelAPI_PluginManager::get()->currentDocument() :
+ ModelAPI_PluginManager::get()->rootDocument();
+ aDoc->addFeature(aCreated, PARTS_GROUP);
+ }
// feature of such kind is not found
return aCreated;
}
--- /dev/null
+// File: PartSetPlugin_Point.cxx
+// Created: 27 Mar 2014
+// Author: Mikhail PONIKAROV
+
+#include "PartSetPlugin_Point.h"
+#include "ModelAPI_PluginManager.h"
+#include "ModelAPI_Document.h"
+#include "ModelAPI_Object.h"
+#include "ModelAPI_AttributeDouble.h"
+
+using namespace std;
+
+PartSetPlugin_Point::PartSetPlugin_Point()
+{
+}
+
+void PartSetPlugin_Point::initAttributes()
+{
+ data()->addAttribute(POINT_ATTR_X, ModelAPI_AttributeDouble::type());
+ data()->addAttribute(POINT_ATTR_Y, ModelAPI_AttributeDouble::type());
+ data()->addAttribute(POINT_ATTR_Z, ModelAPI_AttributeDouble::type());
+}
+
+// this is for debug only
+#include <iostream>
+void PartSetPlugin_Point::execute()
+{
+ // TODO: create a real shape for the point using OCC layer
+ cout<<"X="<<data()->real(POINT_ATTR_X)->value()<<" Y="<<data()->real(POINT_ATTR_Y)->value()
+ <<" Z="<<data()->real(POINT_ATTR_Z)->value()<<endl;
+}
--- /dev/null
+// File: PartSetPlugin_Point.h
+// Created: 3 Apr 2014
+// Author: Mikhail PONIKAROV
+
+#ifndef PartSetPlugin_Point_HeaderFile
+#define PartSetPlugin_Point_HeaderFile
+
+#include "PartSetPlugin.h"
+#include <ModelAPI_Feature.h>
+
+/// attribute name for X coordinate
+const std::string POINT_ATTR_X = "x";
+/// attribute name for Y coordinate
+const std::string POINT_ATTR_Y = "y";
+/// attribute name for Z coordinate
+const std::string POINT_ATTR_Z = "z";
+
+/**\class PartSetPlugin_Point
+ * \ingroup DataModel
+ * \brief Feature for creation of the new part in PartSet.
+ */
+class PartSetPlugin_Point: public ModelAPI_Feature
+{
+public:
+ /// Returns the kind of a feature
+ PARTSETPLUGIN_EXPORT virtual std::string getKind() {return "Point";}
+
+ /// Creates a new part document if needed
+ PARTSETPLUGIN_EXPORT virtual void execute();
+
+ /// Request for initialization of data model of the feature: adding all attributes
+ PARTSETPLUGIN_EXPORT virtual void initAttributes();
+
+ /// Use plugin manager for features creation
+ PartSetPlugin_Point();
+};
+
+#endif