]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Replace boost::shared_ptr<ModelAPI_Feature> on FeaturePtr
authornds <natalia.donis@opencascade.com>
Wed, 4 Jun 2014 10:28:22 +0000 (14:28 +0400)
committernds <natalia.donis@opencascade.com>
Wed, 4 Jun 2014 10:28:22 +0000 (14:28 +0400)
70 files changed:
src/ConstructionPlugin/ConstructionPlugin_Plugin.cpp
src/ConstructionPlugin/ConstructionPlugin_Plugin.h
src/Model/Model_AttributeRefAttr.cpp
src/Model/Model_AttributeRefAttr.h
src/Model/Model_AttributeRefList.cpp
src/Model/Model_AttributeRefList.h
src/Model/Model_AttributeReference.cpp
src/Model/Model_AttributeReference.h
src/Model/Model_Data.h
src/Model/Model_Document.cpp
src/Model/Model_Document.h
src/Model/Model_Events.h
src/Model/Model_Object.cpp
src/Model/Model_Object.h
src/Model/Model_PluginManager.cpp
src/Model/Model_PluginManager.h
src/ModelAPI/ModelAPI_AttributeRefAttr.h
src/ModelAPI/ModelAPI_AttributeRefList.h
src/ModelAPI/ModelAPI_AttributeReference.h
src/ModelAPI/ModelAPI_Object.h
src/ModuleBase/ModuleBase_MetaWidget.cpp
src/ModuleBase/ModuleBase_MetaWidget.h
src/ModuleBase/ModuleBase_ModelWidget.h
src/ModuleBase/ModuleBase_Operation.cpp
src/ModuleBase/ModuleBase_Operation.h
src/ModuleBase/ModuleBase_WidgetPoint2D.cpp
src/ModuleBase/ModuleBase_WidgetPoint2D.h
src/PartSet/PartSet_Listener.cpp
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h
src/PartSet/PartSet_OperationConstraint.cpp
src/PartSet/PartSet_OperationConstraint.h
src/PartSet/PartSet_OperationEditLine.cpp
src/PartSet/PartSet_OperationEditLine.h
src/PartSet/PartSet_OperationSketch.cpp
src/PartSet/PartSet_OperationSketch.h
src/PartSet/PartSet_OperationSketchBase.cpp
src/PartSet/PartSet_OperationSketchBase.h
src/PartSet/PartSet_OperationSketchLine.cpp
src/PartSet/PartSet_OperationSketchLine.h
src/PartSet/PartSet_Presentation.cpp
src/PartSet/PartSet_Presentation.h
src/PartSet/PartSet_TestOCC.cpp
src/PartSet/PartSet_Tools.cpp
src/PartSet/PartSet_Tools.h
src/PartSetPlugin/PartSetPlugin_Plugin.cpp
src/PartSetPlugin/PartSetPlugin_Plugin.h
src/PartSetPlugin/PartSetPlugin_Remove.cpp
src/SketchPlugin/SketchPlugin_Arc.h
src/SketchPlugin/SketchPlugin_Circle.h
src/SketchPlugin/SketchPlugin_Constraint.h
src/SketchPlugin/SketchPlugin_Feature.cpp
src/SketchPlugin/SketchPlugin_Feature.h
src/SketchPlugin/SketchPlugin_Line.h
src/SketchPlugin/SketchPlugin_Plugin.cpp
src/SketchPlugin/SketchPlugin_Plugin.h
src/SketchPlugin/SketchPlugin_Point.h
src/SketchPlugin/SketchPlugin_Sketch.cpp
src/SketchPlugin/SketchPlugin_Sketch.h
src/SketchSolver/SketchSolver_ConstraintGroup.cpp
src/SketchSolver/SketchSolver_ConstraintGroup.h
src/SketchSolver/SketchSolver_ConstraintManager.cpp
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_Displayer.h
src/XGUI/XGUI_PropertyPanel.cpp
src/XGUI/XGUI_PropertyPanel.h
src/XGUI/XGUI_Tools.cpp
src/XGUI/XGUI_Tools.h
src/XGUI/XGUI_ViewerPrs.cpp
src/XGUI/XGUI_ViewerPrs.h

index a825c5608e0a96cc95a2a453623bc65088706c6e..4e1bfd19ce1d554d0127b5ebac966731977c8f51 100644 (file)
@@ -16,13 +16,13 @@ ConstructionPlugin_Plugin::ConstructionPlugin_Plugin()
   ModelAPI_PluginManager::get()->registerPlugin(this);
 }
 
-boost::shared_ptr<ModelAPI_Feature> ConstructionPlugin_Plugin::createFeature(string theFeatureID)
+FeaturePtr ConstructionPlugin_Plugin::createFeature(string theFeatureID)
 {
   if (theFeatureID == "Point") {
-    return boost::shared_ptr<ModelAPI_Feature>(new ConstructionPlugin_Point);
+    return FeaturePtr(new ConstructionPlugin_Point);
   } else if (theFeatureID == "Extrusion") {
-    return boost::shared_ptr<ModelAPI_Feature>(new ConstructionPlugin_Extrusion);
+    return FeaturePtr(new ConstructionPlugin_Extrusion);
   }
   // feature of such kind is not found
-  return boost::shared_ptr<ModelAPI_Feature>();
+  return FeaturePtr();
 }
index 0201b40a36715f6cc468e03bc2eaed4e7706c1d4..1c772033befb7f89b1ce13ce01aacbc701919f82 100644 (file)
@@ -8,12 +8,13 @@
 
 #include "ConstructionPlugin.h"
 #include "ModelAPI_Plugin.h"
+#include "ModelAPI_Feature.h"
 
 class CONSTRUCTIONPLUGIN_EXPORT ConstructionPlugin_Plugin: public ModelAPI_Plugin
 {
 public:
   /// Creates the feature object of this plugin by the feature string ID
-  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID);
+  virtual FeaturePtr createFeature(std::string theFeatureID);
 
 public:
   /// Is needed for python wrapping by swig
index 16a86b194f412b4f8e83f927aae7dcbdf3b77afe..39797722609130ae4fc3d7cf42ee4bcb5dcce231 100644 (file)
@@ -34,7 +34,7 @@ void Model_AttributeRefAttr::setAttr(boost::shared_ptr<ModelAPI_Attribute> theAt
 
 boost::shared_ptr<ModelAPI_Attribute> Model_AttributeRefAttr::attr()
 {
-  boost::shared_ptr<ModelAPI_Feature> aFeature = feature();
+  FeaturePtr aFeature = feature();
   if (aFeature) {
     boost::shared_ptr<Model_Data> aData = 
       boost::dynamic_pointer_cast<Model_Data>(aFeature->data());
@@ -44,7 +44,7 @@ boost::shared_ptr<ModelAPI_Attribute> Model_AttributeRefAttr::attr()
   return boost::shared_ptr<ModelAPI_Attribute>();
 }
 
-void Model_AttributeRefAttr::setFeature(boost::shared_ptr<ModelAPI_Feature> theFeature)
+void Model_AttributeRefAttr::setFeature(FeaturePtr theFeature)
 {
   if (myID->Get().Length() != 0 || feature() != theFeature) {
     boost::shared_ptr<Model_Data> aData = 
@@ -58,7 +58,7 @@ void Model_AttributeRefAttr::setFeature(boost::shared_ptr<ModelAPI_Feature> theF
   }
 }
 
-boost::shared_ptr<ModelAPI_Feature> Model_AttributeRefAttr::feature()
+FeaturePtr Model_AttributeRefAttr::feature()
 {
   if (myRef->Get() != myRef->Label()) { // initialized
     boost::shared_ptr<Model_Document> aDoc = 
@@ -70,7 +70,7 @@ boost::shared_ptr<ModelAPI_Feature> Model_AttributeRefAttr::feature()
     }
   }
   // not initialized
-  return boost::shared_ptr<ModelAPI_Feature>();
+  return FeaturePtr();
 }
 
 Model_AttributeRefAttr::Model_AttributeRefAttr(TDF_Label& theLabel)
index f9d2bc42e2ff34f001030855f18c4767ee3ccc6b..69fda0163632dd7a0d858fd7c04c706d73ef4e0d 100644 (file)
@@ -33,10 +33,10 @@ public:
   MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Attribute> attr();
 
   /// Defines the reference to the feature
-  MODEL_EXPORT virtual void setFeature(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  MODEL_EXPORT virtual void setFeature(FeaturePtr theFeature);
 
   /// Returns feature referenced from this attribute
-  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> feature();
+  MODEL_EXPORT virtual FeaturePtr feature();
 
 protected:
   /// Objects are created for features automatically
index f6520fce869300ecaacfa0ee092dd0fece340583..af4cbd3ea6246983a910f4bc3f177540ebe8d1e5 100644 (file)
@@ -12,7 +12,7 @@
 
 using namespace std;
 
-void Model_AttributeRefList::append(boost::shared_ptr<ModelAPI_Feature> theFeature)
+void Model_AttributeRefList::append(FeaturePtr theFeature)
 {
   boost::shared_ptr<Model_Data> aData = 
     boost::dynamic_pointer_cast<Model_Data>(theFeature->data());
@@ -23,7 +23,7 @@ void Model_AttributeRefList::append(boost::shared_ptr<ModelAPI_Feature> theFeatu
   Events_Loop::loop()->send(aMsg);
 }
 
-void Model_AttributeRefList::remove(boost::shared_ptr<ModelAPI_Feature> theFeature)
+void Model_AttributeRefList::remove(FeaturePtr theFeature)
 {
   boost::shared_ptr<Model_Data> aData = 
     boost::dynamic_pointer_cast<Model_Data>(theFeature->data());
@@ -36,9 +36,9 @@ int Model_AttributeRefList::size()
   return myRef->Extent();
 }
 
-list<boost::shared_ptr<ModelAPI_Feature> > Model_AttributeRefList::list()
+list<FeaturePtr > Model_AttributeRefList::list()
 {
-  std::list< boost::shared_ptr<ModelAPI_Feature> > aResult;
+  std::list< FeaturePtr > aResult;
   boost::shared_ptr<Model_Document> aDoc = 
     boost::dynamic_pointer_cast<Model_Document>(owner()->document());
   if (aDoc) {
index bf6290c07ddf7bc64573b2e0e982b6bbc8df49d2..340f5cdf011ad037338248b3a19731b25a8bf46c 100644 (file)
@@ -7,6 +7,8 @@
 
 #include "Model.h"
 #include "ModelAPI_AttributeRefList.h"
+#include "ModelAPI_Feature.h"
+
 #include <TDataStd_ReferenceList.hxx>
 
 /**\class Model_AttributeRefList
@@ -19,16 +21,16 @@ class Model_AttributeRefList : public ModelAPI_AttributeRefList
   Handle_TDataStd_ReferenceList myRef; ///< references to the features labels
 public:
   /// Appends the feature to the end of a list
-  MODEL_EXPORT virtual void append(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  MODEL_EXPORT virtual void append(FeaturePtr theFeature);
 
   /// Erases the first meet of the feature in the list
-  MODEL_EXPORT virtual void remove(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  MODEL_EXPORT virtual void remove(FeaturePtr theFeature);
 
   /// Returns number of features in the list
   MODEL_EXPORT virtual int size();
 
   /// Returns the list of features
-  MODEL_EXPORT virtual std::list<boost::shared_ptr<ModelAPI_Feature> > list();
+  MODEL_EXPORT virtual std::list<FeaturePtr > list();
 
 protected:
   /// Objects are created for features automatically
index 5d7c244665042fe77281ac9ab091a0cb370510ea..adcfe4ab46e0b1d62d038f8408dd7568a029afe7 100644 (file)
@@ -11,7 +11,7 @@
 
 using namespace std;
 
-void Model_AttributeReference::setValue(boost::shared_ptr<ModelAPI_Feature> theFeature)
+void Model_AttributeReference::setValue(FeaturePtr theFeature)
 {
   if (value() != theFeature) {
     boost::shared_ptr<Model_Data> aData = 
@@ -30,7 +30,7 @@ void Model_AttributeReference::setValue(boost::shared_ptr<ModelAPI_Feature> theF
   }
 }
 
-boost::shared_ptr<ModelAPI_Feature> Model_AttributeReference::value()
+FeaturePtr Model_AttributeReference::value()
 {
   if (!myRef.IsNull()) {
     boost::shared_ptr<Model_Document> aDoc = 
@@ -41,7 +41,7 @@ boost::shared_ptr<ModelAPI_Feature> Model_AttributeReference::value()
     }
   }
   // not initialized
-  return boost::shared_ptr<ModelAPI_Feature>();
+  return FeaturePtr();
 }
 
 Model_AttributeReference::Model_AttributeReference(TDF_Label& theLabel)
index e17855e48419ee63c2ae242fc0a15ad376c6c9ab..6406d0bfbfbf0fd8b828ab4fc0dca034c39423ec 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "Model.h"
 #include "ModelAPI_AttributeReference.h"
+#include <ModelAPI_Feature.h>
 #include <TDF_Label.hxx>
 #include <TDF_Reference.hxx>
 
@@ -20,10 +21,10 @@ class Model_AttributeReference : public ModelAPI_AttributeReference
   Handle_TDF_Reference myRef; ///< references to the feature label
 public:
   /// Defines the feature referenced from this attribute
-  MODEL_EXPORT virtual void setValue(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  MODEL_EXPORT virtual void setValue(FeaturePtr theFeature);
 
   /// Returns feature referenced from this attribute
-  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> value();
+  MODEL_EXPORT virtual FeaturePtr value();
 
 protected:
   /// Objects are created for features automatically
index deb7239a583913e9bb0dafdfd422ed0031a89518..6eb34e17c6977415960a2579228116acf6e7984e 100644 (file)
@@ -7,12 +7,12 @@
 
 #include "Model.h"
 #include <ModelAPI_Data.h>
+#include <ModelAPI_Feature.h>
 #include <TDF_Label.hxx>
 
 #include <map>
 
 class ModelAPI_Attribute;
-class ModelAPI_Feature;
 
 /**\class Model_Data
  * \ingroup DataModel
@@ -27,7 +27,7 @@ class Model_Data: public ModelAPI_Data
   std::map<std::string, boost::shared_ptr<ModelAPI_Attribute> > myAttrs;
 
   /// needed here to emit signal that feature changed on change of the attribute
-  boost::shared_ptr<ModelAPI_Feature> myFeature;
+  FeaturePtr myFeature;
 
   Model_Data();
 
@@ -83,7 +83,7 @@ public:
   MODEL_EXPORT void setLabel(TDF_Label& theLab);
 
   /// Sets the feature of this data
-  MODEL_EXPORT virtual void setFeature(boost::shared_ptr<ModelAPI_Feature> theFeature)
+  MODEL_EXPORT virtual void setFeature(FeaturePtr theFeature)
     {myFeature = theFeature;}
 };
 
index 76b72fe0c12b3bcd0e4a5ea26890c25911fff28e..e17a14af55719000c54b58eb0747eb7cb040b5eb 100644 (file)
@@ -319,9 +319,9 @@ void Model_Document::redo()
     subDocument(*aSubIter)->redo();
 }
 
-boost::shared_ptr<ModelAPI_Feature> Model_Document::addFeature(string theID)
+FeaturePtr Model_Document::addFeature(string theID)
 {
-  boost::shared_ptr<ModelAPI_Feature> aFeature = 
+  FeaturePtr aFeature = 
     ModelAPI_PluginManager::get()->createFeature(theID);
   if (aFeature) {
     boost::dynamic_pointer_cast<Model_Document>(aFeature->documentToAdd())->addFeature(aFeature);
@@ -348,7 +348,7 @@ static void AddToRefArray(TDF_Label& theArrayLab, TDF_Label& theReferenced) {
   }
 }
 
-void Model_Document::addFeature(const boost::shared_ptr<ModelAPI_Feature> theFeature)
+void Model_Document::addFeature(const FeaturePtr theFeature)
 {
   if (theFeature->isAction()) return; // do not add action to the data model
 
@@ -421,7 +421,7 @@ static int RemoveFromRefArray(
   return aResult;
 }
 
-void Model_Document::removeFeature(boost::shared_ptr<ModelAPI_Feature> theFeature)
+void Model_Document::removeFeature(FeaturePtr theFeature)
 {
   boost::shared_ptr<Model_Data> aData = boost::static_pointer_cast<Model_Data>(theFeature->data());
   TDF_Label aFeatureLabel = aData->label();
@@ -430,7 +430,7 @@ void Model_Document::removeFeature(boost::shared_ptr<ModelAPI_Feature> theFeatur
   int aRemovedIndex = RemoveFromRefArray(aGroupLabel, aFeatureLabel);
   RemoveFromRefArray(aGroupLabel.FindChild(1), TDF_Label(), aRemovedIndex);
   // remove feature from the myFeatures list
-  std::vector<boost::shared_ptr<ModelAPI_Feature> >::iterator aFIter = myFeatures.begin();
+  std::vector<FeaturePtr >::iterator aFIter = myFeatures.begin();
   while(aFIter != myFeatures.end()) {
     if (*aFIter == theFeature) {
       aFIter = myFeatures.erase(aFIter);
@@ -448,17 +448,17 @@ void Model_Document::removeFeature(boost::shared_ptr<ModelAPI_Feature> theFeatur
   Events_Loop::loop()->send(aMsg);
 }
 
-boost::shared_ptr<ModelAPI_Feature> Model_Document::feature(TDF_Label& theLabel)
+FeaturePtr Model_Document::feature(TDF_Label& theLabel)
 {
   // iterate all features, may be optimized later by keeping labels-map
-  vector<boost::shared_ptr<ModelAPI_Feature> >::iterator aFIter = myFeatures.begin();
+  vector<FeaturePtr >::iterator aFIter = myFeatures.begin();
   for(; aFIter != myFeatures.end(); aFIter++) {
     boost::shared_ptr<Model_Data> aData = 
       boost::dynamic_pointer_cast<Model_Data>((*aFIter)->data());
     if (aData->label().IsEqual(theLabel))
       return *aFIter;
   }
-  return boost::shared_ptr<ModelAPI_Feature>(); // not found
+  return FeaturePtr(); // not found
 }
 
 boost::shared_ptr<ModelAPI_Document> Model_Document::subDocument(string theDocID)
@@ -469,7 +469,7 @@ boost::shared_ptr<ModelAPI_Document> Model_Document::subDocument(string theDocID
   return Model_Application::getApplication()->getDocument(theDocID);
 }
 
-boost::shared_ptr<ModelAPI_Feature> Model_Document::feature(
+FeaturePtr Model_Document::feature(
   const string& theGroupID, const int theIndex, const bool isOperation)
 {
   TDF_Label aGroupLab = groupLabel(theGroupID);
@@ -477,7 +477,7 @@ boost::shared_ptr<ModelAPI_Feature> Model_Document::feature(
   if (aGroupLab.FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs)) {
     if (aRefs->Lower() <= theIndex && aRefs->Upper() >= theIndex) {
       TDF_Label aFeatureLab = aRefs->Value(theIndex);
-      boost::shared_ptr<ModelAPI_Feature> aFeature = feature(aFeatureLab);
+      FeaturePtr aFeature = feature(aFeatureLab);
 
       if (theGroupID == FEATURES_GROUP || isOperation) { // just returns the feature from the history
         return aFeature;
@@ -492,7 +492,7 @@ boost::shared_ptr<ModelAPI_Feature> Model_Document::feature(
   }
 
   // not found
-  return boost::shared_ptr<ModelAPI_Feature>();
+  return FeaturePtr();
 }
 
 int Model_Document::size(const string& theGroupID) 
@@ -534,7 +534,7 @@ TDF_Label Model_Document::groupLabel(const string theGroup)
   return aNew;
 }
 
-void Model_Document::setUniqueName(boost::shared_ptr<ModelAPI_Feature> theFeature)
+void Model_Document::setUniqueName(FeaturePtr theFeature)
 {
   string aName; // result
   // iterate all features but also iterate group of this feature if object is not in history
@@ -571,8 +571,8 @@ void Model_Document::setUniqueName(boost::shared_ptr<ModelAPI_Feature> theFeatur
 }
 
 //! Returns the object by the feature
-boost::shared_ptr<ModelAPI_Feature> Model_Document::objectByFeature(
-  const boost::shared_ptr<ModelAPI_Feature> theFeature)
+FeaturePtr Model_Document::objectByFeature(
+  const FeaturePtr theFeature)
 {
   for(int a = 0; a < size(theFeature->getGroup()); a++) {
     boost::shared_ptr<Model_Object> anObj = 
@@ -581,14 +581,14 @@ boost::shared_ptr<ModelAPI_Feature> Model_Document::objectByFeature(
       return anObj;
     }
   }
-  return boost::shared_ptr<ModelAPI_Feature>(); // not found
+  return FeaturePtr(); // not found
 }
 
 void Model_Document::synchronizeFeatures(const bool theMarkUpdated)
 {
   boost::shared_ptr<ModelAPI_Document> aThis = Model_Application::getApplication()->getDocument(myID);
   // update features
-  vector<boost::shared_ptr<ModelAPI_Feature> >::iterator aFIter = myFeatures.begin();
+  vector<FeaturePtr >::iterator aFIter = myFeatures.begin();
   // and in parallel iterate labels of features
   TDF_ChildIDIterator aFLabIter(groupLabel(FEATURES_GROUP), TDataStd_Comment::GetID());
   while(aFIter != myFeatures.end() || aFLabIter.More()) {
@@ -614,7 +614,7 @@ void Model_Document::synchronizeFeatures(const bool theMarkUpdated)
       Events_Loop::loop()->send(aMsg2);
     } else if (aDSTag < aFeatureTag) { // a new feature is inserted
       // create a feature
-      boost::shared_ptr<ModelAPI_Feature> aFeature = ModelAPI_PluginManager::get()->createFeature(
+      FeaturePtr aFeature = ModelAPI_PluginManager::get()->createFeature(
         TCollection_AsciiString(Handle(TDataStd_Comment)::DownCast(
         aFLabIter.Value())->Get()).ToCString());
 
@@ -637,7 +637,7 @@ void Model_Document::synchronizeFeatures(const bool theMarkUpdated)
       static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_CREATED);
       Model_FeatureUpdatedMessage aMsg1(aFeature, anEvent);
       Events_Loop::loop()->send(aMsg1);
-      boost::shared_ptr<ModelAPI_Feature> anObj = objectByFeature(aFeature);
+      FeaturePtr anObj = objectByFeature(aFeature);
       if (anObj) {
         Model_FeatureUpdatedMessage aMsg2(anObj, anEvent);
         Events_Loop::loop()->send(aMsg2);
index 41f7d51f6a54bbdd828176d9d49d3a0e3b3902dd..adc4846eccd0520a6eeb8bfe69aea132557342c8 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <Model.h>
 #include <ModelAPI_Document.h>
+#include <ModelAPI_Feature.h>
 
 #include <TDocStd_Document.hxx>
 #include <map>
@@ -61,14 +62,14 @@ public:
 
   //! Adds to the document the new feature of the given feature id
   //! \param creates feature and puts it in the document
-  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> addFeature(std::string theID);
+  MODEL_EXPORT virtual FeaturePtr addFeature(std::string theID);
 
   //! Removes the feature from the document
-  MODEL_EXPORT virtual void removeFeature(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  MODEL_EXPORT virtual void removeFeature(FeaturePtr theFeature);
 
   //! Returns the existing feature by the label
   //! \param theLabel base label of the feature
-  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> feature(TDF_Label& theLabel);
+  MODEL_EXPORT virtual FeaturePtr feature(TDF_Label& theLabel);
 
   //! Adds a new sub-document by the identifier, or returns existing one if it is already exist
   MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Document> subDocument(std::string theDocID);
@@ -80,7 +81,7 @@ public:
   //! \param theGroupID group that contains a feature
   //! \param theIndex zero-based index of feature in the group
   //! \param isOperation if it is true, returns feature (not Object)
-  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> 
+  MODEL_EXPORT virtual FeaturePtr 
     feature(const std::string& theGroupID, const int theIndex, const bool isOperation = false);
 
   //! Returns the number of features in the group
@@ -93,14 +94,14 @@ protected:
 
   //! Initializes feature with a unique name in this group (unique name is generated as 
   //! feature type + "_" + index
-  void setUniqueName(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  void setUniqueName(FeaturePtr theFeature);
 
   //! Adds to the document the new feature
-  void addFeature(const boost::shared_ptr<ModelAPI_Feature> theFeature);
+  void addFeature(const FeaturePtr theFeature);
 
   //! Returns the object by the feature
-  boost::shared_ptr<ModelAPI_Feature> objectByFeature(
-    const boost::shared_ptr<ModelAPI_Feature> theFeature);
+  FeaturePtr objectByFeature(
+    const FeaturePtr theFeature);
 
   //! Synchronizes myFeatures list with the updated document
   void synchronizeFeatures(const bool theMarkUpdated = false);
@@ -124,7 +125,7 @@ private:
   /// number of nested transactions performed (or -1 if not nested)
   int myNestedNum;
   /// All features managed by this document (not only in history of OB)
-  std::vector<boost::shared_ptr<ModelAPI_Feature> > myFeatures;
+  std::vector<FeaturePtr > myFeatures;
 
   ///< set of identifiers of sub-documents of this document
   std::set<std::string> mySubs;
index 0bce1c980bc508eed36659bb9a3504a12d50e8c0..1fbf1980e1481b40ab2c1ef50340bf6131fc09f7 100644 (file)
@@ -12,7 +12,8 @@
 #include <string>
 #include <set>
 
-class ModelAPI_Feature;
+#include "ModelAPI_Feature.h"
+
 class ModelAPI_Document;
 
 /// Event ID that feature is created (comes with Model_FeatureUpdatedMessage)
@@ -26,27 +27,27 @@ static const char * EVENT_FEATURE_MOVED = "FeaturesMoved";
 
 /// Message that feature was changed (used for Object Browser update): moved, updated and deleted
 class Model_FeatureUpdatedMessage : public Events_MessageGroup {
-  std::set<boost::shared_ptr<ModelAPI_Feature> > myFeatures; ///< which feature is changed
+  std::set<FeaturePtr > myFeatures; ///< which feature is changed
 public:
   /// sender is not important, all information is located in the feature
   Model_FeatureUpdatedMessage(
-    const boost::shared_ptr<ModelAPI_Feature>& theFeature,
+    const FeaturePtr& theFeature,
     const Events_ID& theEvent) : Events_MessageGroup(theEvent, 0)
   {if (theFeature) myFeatures.insert(theFeature);}
 
   /// Returns the feature that has been updated
-  std::set<boost::shared_ptr<ModelAPI_Feature> > features() const {return myFeatures;}
+  std::set<FeaturePtr > features() const {return myFeatures;}
 
   //! Creates a new empty group (to store it in the loop before flush)
   virtual Events_MessageGroup* newEmpty() {
-    boost::shared_ptr<ModelAPI_Feature> anEmptyFeature;
+    FeaturePtr anEmptyFeature;
     return new Model_FeatureUpdatedMessage(anEmptyFeature, eventID());
   }
 
   //! Allows to join the given message with the current one
   virtual void Join(Events_MessageGroup& theJoined) {
     Model_FeatureUpdatedMessage* aJoined = dynamic_cast<Model_FeatureUpdatedMessage*>(&theJoined);
-    std::set<boost::shared_ptr<ModelAPI_Feature> >::iterator aFIter = aJoined->myFeatures.begin();
+    std::set<FeaturePtr >::iterator aFIter = aJoined->myFeatures.begin();
     for(; aFIter != aJoined->myFeatures.end(); aFIter++) {
       myFeatures.insert(*aFIter);
     }
index 269c547cf90b641ceeaa1ee7c912ac69d460520a..e0c5b30280e87cb671145536861239432747328c 100644 (file)
@@ -7,7 +7,7 @@
 #include "Model_Events.h"
 #include <Events_Loop.h>
 
-boost::shared_ptr<ModelAPI_Feature> Model_Object::featureRef()
+FeaturePtr Model_Object::featureRef()
 {
   return myRef;
 }
@@ -29,7 +29,7 @@ void Model_Object::setName(std::string theName)
   }
 }
 
-Model_Object::Model_Object(boost::shared_ptr<ModelAPI_Feature> theRef,
+Model_Object::Model_Object(FeaturePtr theRef,
                            Handle_TDataStd_Name theName)
                            : myRef(theRef), myName(theName)
 {
index 811edf709171f691d7f0340747d471d1011bea10..73975bc28e24dc91130eca9172c0bd5ad0ee707d 100644 (file)
  */
 class Model_Object : public ModelAPI_Object
 {
-  boost::shared_ptr<ModelAPI_Feature> myRef; ///< the referenced feature
+  FeaturePtr myRef; ///< the referenced feature
   Handle_TDataStd_Name myName; ///< the name of this object that may be changed
 public:
   /// Reference to the feature-operation that produces this object
-  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> featureRef();
+  MODEL_EXPORT virtual FeaturePtr featureRef();
 
   /// Returns the name of this object (by default equal to the name of feature)
   MODEL_EXPORT virtual std::string getName();
@@ -42,7 +42,7 @@ public:
   {return myRef->document();}
 
   /// Returns true if feature refers to the same model data instance
-  MODEL_EXPORT virtual bool isSame(const boost::shared_ptr<ModelAPI_Feature>& theFeature)
+  MODEL_EXPORT virtual bool isSame(const FeaturePtr& theFeature)
   {
     boost::shared_ptr<Model_Object> anObj = boost::dynamic_pointer_cast<Model_Object>(theFeature);
     return anObj && myRef == anObj->myRef;
@@ -57,7 +57,7 @@ public:
 private:
 
   /// Constructor fully defines this object
-  Model_Object(boost::shared_ptr<ModelAPI_Feature> theRef, Handle_TDataStd_Name theName);
+  Model_Object(FeaturePtr theRef, Handle_TDataStd_Name theName);
 
   friend class Model_Document;  
 };
index 1a6cef9d82964e297c036547464e3240ac0bdeec..c95ab12426ef7dd5c06e1ffb1399d2a12c54d027 100644 (file)
@@ -24,7 +24,7 @@ using namespace std;
 
 static Model_PluginManager* myImpl = new Model_PluginManager();
 
-boost::shared_ptr<ModelAPI_Feature> Model_PluginManager::createFeature(string theFeatureID)
+FeaturePtr Model_PluginManager::createFeature(string theFeatureID)
 {
   if (this != myImpl) return myImpl->createFeature(theFeatureID);
 
@@ -36,7 +36,7 @@ boost::shared_ptr<ModelAPI_Feature> Model_PluginManager::createFeature(string th
       Config_ModuleReader::loadLibrary(myCurrentPluginName);
     }
     if (myPluginObjs.find(myCurrentPluginName) != myPluginObjs.end()) {
-      boost::shared_ptr<ModelAPI_Feature> aCreated = 
+      FeaturePtr aCreated = 
         myPluginObjs[myCurrentPluginName]->createFeature(theFeatureID);
       if (!aCreated) {
         Events_Error::send(string("Can not initialize feature '") + theFeatureID +
@@ -48,7 +48,7 @@ boost::shared_ptr<ModelAPI_Feature> Model_PluginManager::createFeature(string th
     }
   }
 
-  return boost::shared_ptr<ModelAPI_Feature>(); // return nothing
+  return FeaturePtr(); // return nothing
 }
 
 boost::shared_ptr<ModelAPI_Document> Model_PluginManager::rootDocument()
index 4efef6a4cd5034c79e8ff69a405cc49b852ceb33..bed54c08b496dc4629c46cdbffe2544a69a60d6c 100644 (file)
@@ -7,6 +7,8 @@
 
 #include "Model.h"
 #include <ModelAPI_PluginManager.h>
+#include <ModelAPI_Feature.h>
+
 #include <Events_Listener.h>
 #include <map>
 
@@ -62,7 +64,7 @@ protected:
   void LoadPluginsInfo();
 
   /// Creates the feature object using plugins functionality
-  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID);
+  virtual FeaturePtr createFeature(std::string theFeatureID);
 };
 
 #endif
index 4fd8834669118d033d802c416da5250ec6152965..a16813609520877f62af3b2e996f96486cff5b65 100644 (file)
@@ -6,6 +6,7 @@
 #define ModelAPI_AttributeRefAttr_HeaderFile
 
 #include "ModelAPI_Attribute.h"
+#include "ModelAPI_Feature.h"
 
 /**\class ModelAPI_AttributeRefAttr
  * \ingroup DataModel
@@ -26,10 +27,10 @@ public:
   MODELAPI_EXPORT virtual boost::shared_ptr<ModelAPI_Attribute> attr() = 0;
 
   /// Defines the reference to the feature
-  MODELAPI_EXPORT virtual void setFeature(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
+  MODELAPI_EXPORT virtual void setFeature(FeaturePtr theFeature) = 0;
 
   /// Returns feature referenced from this attribute
-  MODELAPI_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> feature() = 0;
+  MODELAPI_EXPORT virtual FeaturePtr feature() = 0;
 
   /// Returns the type of this class of attributes
   MODELAPI_EXPORT static std::string type() {return "RefAttr";}
index 973fbc46deb88e83cf5af51ce18585c499e5b36d..87800fb3660d0ab102944894dc0093aaf5295138 100644 (file)
@@ -6,6 +6,7 @@
 #define ModelAPI_AttributeRefList_HeaderFile
 
 #include "ModelAPI_Attribute.h"
+#include "ModelAPI_Feature.h"
 #include <list>
 
 /**\class ModelAPI_AttributeRefList
@@ -23,16 +24,16 @@ public:
   MODELAPI_EXPORT virtual std::string attributeType() {return type();}
 
   /// Appends the feature to the end of a list
-  MODELAPI_EXPORT virtual void append(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
+  MODELAPI_EXPORT virtual void append(FeaturePtr theFeature) = 0;
 
   /// Erases the first meet of the feature in the list
-  MODELAPI_EXPORT virtual void remove(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
+  MODELAPI_EXPORT virtual void remove(FeaturePtr theFeature) = 0;
 
   /// Returns number of features in the list
   MODELAPI_EXPORT virtual int size() = 0;
 
   /// Returns the list of features
-  MODELAPI_EXPORT virtual std::list<boost::shared_ptr<ModelAPI_Feature> > list() = 0;
+  MODELAPI_EXPORT virtual std::list<FeaturePtr > list() = 0;
 
 protected:
   /// Objects are created for features automatically
index 37b22560cc520562ecf9e28134834d41f5ea2a28..0af5898ff69c29fb97b555fc619e81e17b754929 100644 (file)
@@ -6,6 +6,7 @@
 #define ModelAPI_AttributeReference_HeaderFile
 
 #include "ModelAPI_Attribute.h"
+#include <ModelAPI_Feature.h>
 
 /**\class ModelAPI_AttributeReference
  * \ingroup DataModel
@@ -16,10 +17,10 @@ class ModelAPI_AttributeReference : public ModelAPI_Attribute
 {
 public:
   /// Defines the feature referenced from this attribute
-  MODELAPI_EXPORT virtual void setValue(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
+  MODELAPI_EXPORT virtual void setValue(FeaturePtr theFeature) = 0;
 
   /// Returns feature referenced from this attribute
-  MODELAPI_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> value() = 0;
+  MODELAPI_EXPORT virtual FeaturePtr value() = 0;
 
   /// Returns the type of this class of attributes
   MODELAPI_EXPORT static std::string type() {return "Reference";}
index 55ee0952733f50dbe8943d7c11f347b41e46414b..581f045884c0e45f2bf4efc43271fbfa47634611 100644 (file)
@@ -23,7 +23,7 @@ public:
   MODELAPI_EXPORT virtual bool isInHistory() {return false;}
 
   /// Reference to the feature-operation that produces this object
-  MODELAPI_EXPORT virtual boost::shared_ptr<ModelAPI_Feature> featureRef() = 0;
+  MODELAPI_EXPORT virtual FeaturePtr featureRef() = 0;
 
   /// Returns the name of this object (by default equal to the name of feature)
   MODELAPI_EXPORT virtual std::string getName() = 0;
index a8a65232b423e09cff1312ac37c23d400a3a0408..ba8eb260d6857ab0208650d5b0d22e489f170080 100644 (file)
@@ -21,7 +21,7 @@ ModuleBase_MetaWidget::~ModuleBase_MetaWidget()
 
 }
 
-bool ModuleBase_MetaWidget::storeValue(boost::shared_ptr<ModelAPI_Feature> theFeature)
+bool ModuleBase_MetaWidget::storeValue(FeaturePtr theFeature)
 {
   #ifdef _DEBUG
   std::cout << "ModuleBase_MetaWidget::storeValue"
@@ -30,7 +30,7 @@ bool ModuleBase_MetaWidget::storeValue(boost::shared_ptr<ModelAPI_Feature> theFe
   return true;
 }
 
-bool ModuleBase_MetaWidget::restoreValue(boost::shared_ptr<ModelAPI_Feature> theFeature)
+bool ModuleBase_MetaWidget::restoreValue(FeaturePtr theFeature)
 {
   #ifdef _DEBUG
   std::cout << "ModuleBase_MetaWidget::restoreValue"
index 0bbc6fbcdfdc945964273092697e5acb451eb596..42504e0f0a98203a44d1b34501f40c93b2575c64 100644 (file)
@@ -23,9 +23,9 @@ public:
   MODULEBASE_EXPORT ModuleBase_MetaWidget(QWidget* theWrapped);
   virtual ~ModuleBase_MetaWidget();
   //! Interface for saving widget's data into the data model
-  MODULEBASE_EXPORT virtual bool storeValue(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  MODULEBASE_EXPORT virtual bool storeValue(FeaturePtr theFeature);
   //! Interface for loading widget's data from the data model
-  MODULEBASE_EXPORT virtual bool restoreValue(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  MODULEBASE_EXPORT virtual bool restoreValue(FeaturePtr theFeature);
 
   /// Set focus to the current widget if it corresponds to the given attribute
   /// \param theAttribute name
index afdc1f2cafccbf317b6faa7d3e3fe28696d3da64..ff9b6da8840cf2b899614fa3d5086d83e244aed5 100644 (file)
@@ -7,6 +7,8 @@
 
 #include <ModuleBase.h>
 
+#include <ModelAPI_Feature.h>
+
 #include <QObject>
 
 #include <boost/shared_ptr.hpp>
@@ -34,9 +36,9 @@ public:
 
   /// Saves the internal parameters to the given feature
   /// \param theFeature a model feature to be changed
-  virtual bool storeValue(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
+  virtual bool storeValue(FeaturePtr theFeature) = 0;
 
-  virtual bool restoreValue(boost::shared_ptr<ModelAPI_Feature> theFeature) = 0;
+  virtual bool restoreValue(FeaturePtr theFeature) = 0;
 
   /// Returns whether the widget can accept focus, or if it corresponds to the given attribute
   /// \param theAttribute name
index 600c27a345d06bb789071164d73cb3ad0d1f274d..4b9a4faa0e4f001bd10bc343e29ca8f86c4213cf 100644 (file)
@@ -37,7 +37,7 @@ QString ModuleBase_Operation::id() const
   return getDescription()->operationId();
 }
 
-boost::shared_ptr<ModelAPI_Feature> ModuleBase_Operation::feature() const
+FeaturePtr ModuleBase_Operation::feature() const
 {
   return myFeature;
 }
@@ -113,10 +113,10 @@ void ModuleBase_Operation::flushCreated()
   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_CREATED));
 }
 
-boost::shared_ptr<ModelAPI_Feature> ModuleBase_Operation::createFeature(const bool theFlushMessage)
+FeaturePtr ModuleBase_Operation::createFeature(const bool theFlushMessage)
 {
   boost::shared_ptr<ModelAPI_Document> aDoc = document();
-  boost::shared_ptr<ModelAPI_Feature> aFeature = aDoc->addFeature(
+  FeaturePtr aFeature = aDoc->addFeature(
                                            getDescription()->operationId().toStdString());
   if (aFeature) // TODO: generate an error if feature was not created
     aFeature->execute();
@@ -126,7 +126,7 @@ boost::shared_ptr<ModelAPI_Feature> ModuleBase_Operation::createFeature(const bo
   return aFeature;
 }
 
-void ModuleBase_Operation::setFeature(boost::shared_ptr<ModelAPI_Feature> theFeature)
+void ModuleBase_Operation::setFeature(FeaturePtr theFeature)
 {
   myFeature = theFeature;
 }
index 73e00f663d6598a38e078c47053bb97782685854..bbbfd04d2c304ccf938c44533802ebb13f97349b 100644 (file)
 #include <ModuleBase.h>
 #include <ModuleBase_IOperation.h>
 
+#include "ModelAPI_Feature.h"
+
 #include <QObject>
 #include <QString>
 
 #include <boost/shared_ptr.hpp>
 
-class ModelAPI_Feature;
 class ModelAPI_Document;
 
 class QKeyEvent;
@@ -54,7 +55,7 @@ public:
   QString id() const;
   /// Returns the operation feature
   /// \return the feature
-  boost::shared_ptr<ModelAPI_Feature> feature() const;
+  FeaturePtr feature() const;
 
   /// Returns whether the nested operations are enabled.
   /// The state can depend on the operation current state.
@@ -71,7 +72,7 @@ public:
   virtual void keyReleased(std::string theName, QKeyEvent* theEvent) {};
 
   /// Sets the operation feature
-  void setFeature(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  void setFeature(FeaturePtr theFeature);
 
 protected:
   /// Virtual method called when operation started (see start() method for more description)
@@ -94,10 +95,10 @@ protected:
   /// Creates an operation new feature
   /// \param theFlushMessage the flag whether the create message should be flushed
   /// \returns the created feature
-  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(const bool theFlushMessage = true);
+  virtual FeaturePtr createFeature(const bool theFlushMessage = true);
 
 private:
-  boost::shared_ptr<ModelAPI_Feature> myFeature; /// the operation feature to be handled
+  FeaturePtr myFeature; /// the operation feature to be handled
 };
 
 #endif
index cbc61430a743a286c9278a46b33573c28364ed7c..ae601b62094bbf04f030e1a105ee639ee91cf075 100644 (file)
@@ -68,7 +68,7 @@ ModuleBase_WidgetPoint2D::~ModuleBase_WidgetPoint2D()
 {
 }
 
-bool ModuleBase_WidgetPoint2D::storeValue(boost::shared_ptr<ModelAPI_Feature> theFeature)
+bool ModuleBase_WidgetPoint2D::storeValue(FeaturePtr theFeature)
 {
   boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
   boost::shared_ptr<GeomDataAPI_Point2D> aPoint =
@@ -82,7 +82,7 @@ bool ModuleBase_WidgetPoint2D::storeValue(boost::shared_ptr<ModelAPI_Feature> th
   return true;
 }
 
-bool ModuleBase_WidgetPoint2D::restoreValue(boost::shared_ptr<ModelAPI_Feature> theFeature)
+bool ModuleBase_WidgetPoint2D::restoreValue(FeaturePtr theFeature)
 {
   boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
   boost::shared_ptr<GeomDataAPI_Point2D> aPoint =
index 1a09516b00c30e50635cca03db926459f5233120..c544b6c168f8de9bdbc934295bc610568c14dfb2 100644 (file)
@@ -34,9 +34,9 @@ public:
 
   /// Saves the internal parameters to the given feature
   /// \param theFeature a model feature to be changed
-  virtual bool storeValue(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  virtual bool storeValue(FeaturePtr theFeature);
 
-  virtual bool restoreValue(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  virtual bool restoreValue(FeaturePtr theFeature);
 
   /// Returns whether the widget can accept focus, or if it corresponds to the given attribute
   /// \param theAttribute name
index 183a2459bb70de2e7e4289f148912e8d3968e143..1f3505ee771821645ce24f312f47364718f4e481 100644 (file)
@@ -41,11 +41,10 @@ void PartSet_Listener::processEvent(const Events_Message* theMessage)
   {
     const Model_FeatureUpdatedMessage* aUpdMsg = dynamic_cast<const Model_FeatureUpdatedMessage*>
                                                                                     (theMessage);
-    std::set<boost::shared_ptr<ModelAPI_Feature> > aFeatures = aUpdMsg->features();
-    std::set<boost::shared_ptr<ModelAPI_Feature> >::const_iterator anIt = aFeatures.begin(),
-                                                                   aLast = aFeatures.end();
+    std::set<FeaturePtr > aFeatures = aUpdMsg->features();
+    std::set<FeaturePtr >::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end();
     for (; anIt != aLast; anIt++) {
-      boost::shared_ptr<ModelAPI_Feature> aFeature = *anIt;
+      FeaturePtr aFeature = *anIt;
       if (myModule->workshop()->displayer()->isVisible(aFeature) ||
           aType == EVENT_FEATURE_CREATED) {
         myModule->visualizePreview(aFeature, true, false);
index aa63b63e75c2ccbbfcdb3099f6fba354b5f420ef..3de97e8b371a038e2fabd60a2e80b5cba5a20e00 100644 (file)
@@ -221,7 +221,7 @@ void PartSet_Module::onFitAllView()
   myWorkshop->viewer()->fitAll();
 }
 
-void PartSet_Module::onLaunchOperation(std::string theName, boost::shared_ptr<ModelAPI_Feature> theFeature)
+void PartSet_Module::onLaunchOperation(std::string theName, FeaturePtr theFeature)
 {
   ModuleBase_Operation* anOperation = createOperation(theName.c_str());
   PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
@@ -250,7 +250,7 @@ void PartSet_Module::onStopSelection(const std::list<XGUI_ViewerPrs>& theFeature
   XGUI_Displayer* aDisplayer = myWorkshop->displayer();
   if (!isStop) {
     std::list<XGUI_ViewerPrs>::const_iterator anIt = theFeatures.begin(), aLast = theFeatures.end();
-    boost::shared_ptr<ModelAPI_Feature> aFeature;
+    FeaturePtr aFeature;
     for (; anIt != aLast; anIt++) {
       activateFeature((*anIt).feature(), false);
     }
@@ -276,25 +276,23 @@ void PartSet_Module::onCloseLocalContext()
   aDisplayer->closeLocalContexts();
 }
 
-void PartSet_Module::onFeatureConstructed(boost::shared_ptr<ModelAPI_Feature> theFeature,
-                                          int theMode)
+void PartSet_Module::onFeatureConstructed(FeaturePtr theFeature, int theMode)
 {
   bool isDisplay = theMode != PartSet_OperationSketchBase::FM_Hide;
   visualizePreview(theFeature, isDisplay, false);
   if (!isDisplay) {
     ModuleBase_Operation* aCurOperation = myWorkshop->operationMgr()->currentOperation();
-    boost::shared_ptr<ModelAPI_Feature> aSketch;
+    FeaturePtr aSketch;
     PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
     if (aPrevOp) {
-      std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >
-                                                                         aList = aPrevOp->subPreview();
+      std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> > aList = aPrevOp->subPreview();
       XGUI_Displayer* aDisplayer = myWorkshop->displayer();
       std::list<int> aModes = aPrevOp->getSelectionModes(aPrevOp->feature());
 
-      std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >::const_iterator
+      std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> >::const_iterator
                                                              anIt = aList.begin(), aLast = aList.end();
       for (; anIt != aLast; anIt++) {
-        boost::shared_ptr<ModelAPI_Feature> aFeature = (*anIt).first;
+        FeaturePtr aFeature = (*anIt).first;
         visualizePreview(aFeature, false, false);
       }
       aDisplayer->updateViewer();
@@ -325,7 +323,7 @@ ModuleBase_Operation* PartSet_Module::createOperation(const std::string& theCmdI
   }
   else {
     ModuleBase_Operation* aCurOperation = myWorkshop->operationMgr()->currentOperation();
-    boost::shared_ptr<ModelAPI_Feature> aSketch;
+    FeaturePtr aSketch;
     PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
     if (aPrevOp)
       aSketch = aPrevOp->sketch();
@@ -346,10 +344,10 @@ ModuleBase_Operation* PartSet_Module::createOperation(const std::string& theCmdI
   // connect the operation
   PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
   if (aPreviewOp) {
-    connect(aPreviewOp, SIGNAL(featureConstructed(boost::shared_ptr<ModelAPI_Feature>, int)),
-            this, SLOT(onFeatureConstructed(boost::shared_ptr<ModelAPI_Feature>, int)));
-    connect(aPreviewOp, SIGNAL(launchOperation(std::string, boost::shared_ptr<ModelAPI_Feature>)),
-            this, SLOT(onLaunchOperation(std::string, boost::shared_ptr<ModelAPI_Feature>)));
+    connect(aPreviewOp, SIGNAL(featureConstructed(FeaturePtr, int)),
+            this, SLOT(onFeatureConstructed(FeaturePtr, int)));
+    connect(aPreviewOp, SIGNAL(launchOperation(std::string, FeaturePtr)),
+            this, SLOT(onLaunchOperation(std::string, FeaturePtr)));
     connect(aPreviewOp, SIGNAL(multiSelectionEnabled(bool)),
             this, SLOT(onMultiSelectionEnabled(bool)));
 
@@ -384,7 +382,7 @@ void PartSet_Module::sendOperation(ModuleBase_Operation* theOperation)
   Events_Loop::loop()->send(aMessage);
 }
 
-void PartSet_Module::visualizePreview(boost::shared_ptr<ModelAPI_Feature> theFeature, bool isDisplay,
+void PartSet_Module::visualizePreview(FeaturePtr theFeature, bool isDisplay,
                                       const bool isUpdateViewer)
 {
   ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation();
@@ -416,8 +414,7 @@ void PartSet_Module::visualizePreview(boost::shared_ptr<ModelAPI_Feature> theFea
     aDisplayer->updateViewer();
 }
 
-void PartSet_Module::activateFeature(boost::shared_ptr<ModelAPI_Feature> theFeature,
-                                     const bool isUpdateViewer)
+void PartSet_Module::activateFeature(FeaturePtr theFeature, const bool isUpdateViewer)
 {
   ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation();
   PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
@@ -438,19 +435,18 @@ void PartSet_Module::updateCurrentPreview(const std::string& theCmdId)
   if (!aPreviewOp)
     return;
 
-  boost::shared_ptr<ModelAPI_Feature> aFeature = aPreviewOp->feature();
+  FeaturePtr aFeature = aPreviewOp->feature();
   if (!aFeature || aFeature->getKind() != theCmdId)
     return;
 
-  std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >
-                                                                     aList = aPreviewOp->subPreview();
+  std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> > aList = aPreviewOp->subPreview();
   XGUI_Displayer* aDisplayer = myWorkshop->displayer();
   std::list<int> aModes = aPreviewOp->getSelectionModes(aPreviewOp->feature());
 
-  std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >::const_iterator
+  std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> >::const_iterator
                                                          anIt = aList.begin(), aLast = aList.end();
   for (; anIt != aLast; anIt++) {
-    boost::shared_ptr<ModelAPI_Feature> aFeature = (*anIt).first;
+    FeaturePtr aFeature = (*anIt).first;
     boost::shared_ptr<GeomAPI_Shape> aPreview = (*anIt).second;
     Handle(AIS_InteractiveObject) anAIS = PartSet_Presentation::createPresentation(
                            aFeature, aPreviewOp->sketch(),
index d92604bbb89410135ec12244364edb5464ac4779..f906f939ae34615add931df859534cde4850b74d 100644 (file)
@@ -44,13 +44,13 @@ public:
   /// \param theFeature the feature instance to be displayed
   /// \param isDisplay the state whether the presentation should be displayed or erased
   /// \param isUpdateViewer the flag whether the viewer should be updated
-  void visualizePreview(boost::shared_ptr<ModelAPI_Feature> theFeature, bool isDisplay,
+  void visualizePreview(FeaturePtr theFeature, bool isDisplay,
                         const bool isUpdateViewer = true);
 
   /// Activates the feature in the displayer
   /// \param theFeature the feature instance to be displayed
   /// \param isUpdateViewer the flag whether the viewer should be updated
-  void activateFeature(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  void activateFeature(FeaturePtr theFeature,
                        const bool isUpdateViewer);
 
   /// Updates current operation preview, if it has it.
@@ -92,7 +92,7 @@ public slots:
   /// SLOT, to fit all current viewer
   void onFitAllView();
 
-  void onLaunchOperation(std::string theName, boost::shared_ptr<ModelAPI_Feature> theFeature);
+  void onLaunchOperation(std::string theName, FeaturePtr theFeature);
 
   /// SLOT, to switch on/off the multi selection in the viewer
   /// \param theEnabled the enabled state
@@ -113,7 +113,7 @@ public slots:
   /// SLOT, to visualize the feature in another local context mode
   /// \param theFeature the feature to be put in another local context mode
   /// \param theMode the mode appeared on the feature
-  void onFeatureConstructed(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  void onFeatureConstructed(FeaturePtr theFeature,
                             int theMode);
 protected:
   /// Creates a new operation
index 99e167d41935684af4cd91e06a9e8c7fb7baf264..6c65c0eaca5da203065b6de115fd3c6596270868 100644 (file)
@@ -45,7 +45,7 @@ using namespace std;
 
 PartSet_OperationConstraint::PartSet_OperationConstraint(const QString& theId,
                                                  QObject* theParent,
-                                              boost::shared_ptr<ModelAPI_Feature> theFeature)
+                                              FeaturePtr theFeature)
 : PartSet_OperationSketchBase(theId, theParent), mySketch(theFeature)
 {
 }
@@ -59,7 +59,7 @@ bool PartSet_OperationConstraint::isGranted(ModuleBase_IOperation* theOperation)
   return theOperation->getDescription()->operationId().toStdString() == PartSet_OperationSketch::Type();
 }
 
-void PartSet_OperationConstraint::init(boost::shared_ptr<ModelAPI_Feature> theFeature,
+void PartSet_OperationConstraint::init(FeaturePtr theFeature,
                                        const std::list<XGUI_ViewerPrs>& /*theSelected*/,
                                        const std::list<XGUI_ViewerPrs>& /*theHighlighted*/)
 {
@@ -70,7 +70,7 @@ void PartSet_OperationConstraint::init(boost::shared_ptr<ModelAPI_Feature> theFe
   //myInitPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(LINE_ATTR_END));
 }
 
-boost::shared_ptr<ModelAPI_Feature> PartSet_OperationConstraint::sketch() const
+FeaturePtr PartSet_OperationConstraint::sketch() const
 {
   return mySketch;
 }
@@ -99,7 +99,7 @@ void PartSet_OperationConstraint::mouseReleased(QMouseEvent* theEvent, Handle(V3
   }
   else {
     XGUI_ViewerPrs aPrs = theSelected.front();
-    boost::shared_ptr<ModelAPI_Feature> aFeature = aPrs.feature();
+    FeaturePtr aFeature = aPrs.feature();
 
     setFeature(aFeature);
     setValue(120);
@@ -120,7 +120,7 @@ void PartSet_OperationConstraint::mouseReleased(QMouseEvent* theEvent, Handle(V3
       }
       else if (aShape.ShapeType() == TopAbs_EDGE) // the line is selected
       {
-        boost::shared_ptr<ModelAPI_Feature> aFeature = aPrs.feature();
+        FeaturePtr aFeature = aPrs.feature();
         if (aFeature) {
           double X0, X1, X2, X3;
           double Y0, Y1, Y2, Y3;
@@ -226,9 +226,9 @@ void PartSet_OperationConstraint::afterCommitOperation()
   emit featureConstructed(feature(), FM_Deactivation);
 }
 
-boost::shared_ptr<ModelAPI_Feature> PartSet_OperationConstraint::createFeature(const bool theFlushMessage)
+FeaturePtr PartSet_OperationConstraint::createFeature(const bool theFlushMessage)
 {
-  boost::shared_ptr<ModelAPI_Feature> aNewFeature = ModuleBase_Operation::createFeature(false);
+  FeaturePtr aNewFeature = ModuleBase_Operation::createFeature(false);
   if (sketch()) {
     boost::shared_ptr<SketchPlugin_Feature> aFeature = 
                            boost::dynamic_pointer_cast<SketchPlugin_Feature>(sketch());
@@ -251,7 +251,7 @@ boost::shared_ptr<ModelAPI_Feature> PartSet_OperationConstraint::createFeature(c
   return aNewFeature;
 }
 
-void PartSet_OperationConstraint::setFeature(boost::shared_ptr<ModelAPI_Feature> theFeature)
+void PartSet_OperationConstraint::setFeature(FeaturePtr theFeature)
 {
   if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
     return;
index 0925b4fe0e5ccc9bfd9cf405df7c5feffe653960..678964aaf265a7eb145be6274633f97fc3fb524f 100644 (file)
@@ -31,7 +31,7 @@ public:
   /// \param theParent the operation parent
   /// \param theFeature the parent feature
   PartSet_OperationConstraint(const QString& theId, QObject* theParent,
-                              boost::shared_ptr<ModelAPI_Feature> theSketchFeature);
+                              FeaturePtr theSketchFeature);
   /// Destructor
   virtual ~PartSet_OperationConstraint();
 
@@ -43,13 +43,13 @@ public:
   /// Initializes some fields accorging to the feature
   /// \param theSelected the list of selected presentations
   /// \param theHighlighted the list of highlighted presentations
-  virtual void init(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  virtual void init(FeaturePtr theFeature,
                     const std::list<XGUI_ViewerPrs>& theSelected,
                     const std::list<XGUI_ViewerPrs>& theHighlighted);
 
   /// Returns the operation sketch feature
   /// \returns the sketch instance
-  virtual boost::shared_ptr<ModelAPI_Feature> sketch() const;
+  virtual FeaturePtr sketch() const;
 
   /// Gives the current selected objects to be processed by the operation
   /// \param theEvent the mouse event
@@ -86,18 +86,18 @@ protected:
   /// the sketch feature
   /// \param theFlushMessage the flag whether the create message should be flushed
   /// \returns the created feature
-  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(const bool theFlushMessage = true);
+  virtual FeaturePtr createFeature(const bool theFlushMessage = true);
 
   /// Set the feature for the constraint
   /// \param theFeature the line feature
-  void setFeature(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  void setFeature(FeaturePtr theFeature);
 
   /// Set the value for the constraint
   /// \param theValue the constraint value
   void setValue(const double theValue);
 
 private:
-  boost::shared_ptr<ModelAPI_Feature> mySketch; ///< the sketch feature
+  FeaturePtr mySketch; ///< the sketch feature
 };
 
 #endif
index 7b34c8f8fd4352175a32276fca0c6d94bfaa4b8d..af46da90da3ba3b0a94e8e9d256cb6594f9ed6a0 100644 (file)
@@ -34,7 +34,7 @@ using namespace std;
 
 PartSet_OperationEditLine::PartSet_OperationEditLine(const QString& theId,
                                                  QObject* theParent,
-                                              boost::shared_ptr<ModelAPI_Feature> theFeature)
+                                              FeaturePtr theFeature)
 : PartSet_OperationSketchBase(theId, theParent), mySketch(theFeature), myIsBlockedSelection(false)
 {
 }
@@ -48,12 +48,12 @@ bool PartSet_OperationEditLine::isGranted(ModuleBase_IOperation* theOperation) c
   return theOperation->getDescription()->operationId().toStdString() == PartSet_OperationSketch::Type();
 }
 
-std::list<int> PartSet_OperationEditLine::getSelectionModes(boost::shared_ptr<ModelAPI_Feature> theFeature) const
+std::list<int> PartSet_OperationEditLine::getSelectionModes(FeaturePtr theFeature) const
 {
   return PartSet_OperationSketchBase::getSelectionModes(theFeature);
 }
 
-void PartSet_OperationEditLine::init(boost::shared_ptr<ModelAPI_Feature> theFeature,
+void PartSet_OperationEditLine::init(FeaturePtr theFeature,
                                      const std::list<XGUI_ViewerPrs>& theSelected,
                                      const std::list<XGUI_ViewerPrs>& theHighlighted)
 {
@@ -78,7 +78,7 @@ void PartSet_OperationEditLine::init(boost::shared_ptr<ModelAPI_Feature> theFeat
     myFeatures = theSelected;
 }
 
-boost::shared_ptr<ModelAPI_Feature> PartSet_OperationEditLine::sketch() const
+FeaturePtr PartSet_OperationEditLine::sketch() const
 {
   return mySketch;
 }
@@ -89,7 +89,7 @@ void PartSet_OperationEditLine::mousePressed(QMouseEvent* theEvent, Handle(V3d_V
 {
   if (myFeatures.size() == 1)
   {
-    boost::shared_ptr<ModelAPI_Feature> aFeature;
+    FeaturePtr aFeature;
     if (!theHighlighted.empty())
       aFeature = theHighlighted.front().feature();
 
@@ -137,7 +137,7 @@ void PartSet_OperationEditLine::mouseMoved(QMouseEvent* theEvent, Handle(V3d_Vie
 
     std::list<XGUI_ViewerPrs>::const_iterator anIt = myFeatures.begin(), aLast = myFeatures.end();
     for (; anIt != aLast; anIt++) {
-      boost::shared_ptr<ModelAPI_Feature> aFeature = (*anIt).feature();
+      FeaturePtr aFeature = (*anIt).feature();
       if (!aFeature || aFeature == feature())
         continue;
       moveLinePoint(aFeature, aDeltaX, aDeltaY, LINE_ATTR_START);
@@ -161,7 +161,7 @@ void PartSet_OperationEditLine::mouseReleased(QMouseEvent* theEvent, Handle(V3d_
     commit();
     std::list<XGUI_ViewerPrs>::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end();
     for (; anIt != aLast; anIt++) {
-      boost::shared_ptr<ModelAPI_Feature> aFeature = (*anIt).feature();
+      FeaturePtr aFeature = (*anIt).feature();
       if (aFeature)
         emit featureConstructed(aFeature, FM_Deactivation);
     }
@@ -205,13 +205,13 @@ void PartSet_OperationEditLine::blockSelection(bool isBlocked, const bool isRest
   }
 }
 
-boost::shared_ptr<ModelAPI_Feature> PartSet_OperationEditLine::createFeature(const bool /*theFlushMessage*/)
+FeaturePtr PartSet_OperationEditLine::createFeature(const bool /*theFlushMessage*/)
 {
   // do nothing in order to do not create a new feature
-  return boost::shared_ptr<ModelAPI_Feature>();
+  return FeaturePtr();
 }
 
-void PartSet_OperationEditLine::moveLinePoint(boost::shared_ptr<ModelAPI_Feature> theFeature,
+void PartSet_OperationEditLine::moveLinePoint(FeaturePtr theFeature,
                                                double theDeltaX, double theDeltaY,
                                                const std::string& theAttribute)
 {
@@ -231,10 +231,10 @@ void PartSet_OperationEditLine::sendFeatures()
 {
   static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_MOVED);
 
-  std::list<boost::shared_ptr<ModelAPI_Feature> > aFeatures;
+  std::list<FeaturePtr > aFeatures;
   std::list<XGUI_ViewerPrs>::const_iterator anIt = myFeatures.begin(), aLast = myFeatures.end();
   for (; anIt != aLast; anIt++) {
-    boost::shared_ptr<ModelAPI_Feature> aFeature = (*anIt).feature();
+    FeaturePtr aFeature = (*anIt).feature();
     if (!aFeature)
       continue;
 
index fef4c95fcec527bfc4418e4aa060bba93b7a2da3..1e18c1511669eda17d636085e0bb3b60540a6fd5 100644 (file)
@@ -56,7 +56,7 @@ public:
   /// \param theParent the operation parent
   /// \param theFeature the parent feature
   PartSet_OperationEditLine(const QString& theId, QObject* theParent,
-                            boost::shared_ptr<ModelAPI_Feature> theFeature);
+                            FeaturePtr theFeature);
   /// Destructor
   virtual ~PartSet_OperationEditLine();
 
@@ -68,19 +68,19 @@ public:
   /// Returns the operation local selection mode
   /// \param theFeature the feature object to get the selection mode
   /// \return the selection mode
-  virtual std::list<int> getSelectionModes(boost::shared_ptr<ModelAPI_Feature> theFeature) const;
+  virtual std::list<int> getSelectionModes(FeaturePtr theFeature) const;
 
   /// Initializes some fields accorging to the feature
   /// \param theFeature the feature
   /// \param theSelected the list of selected presentations
   /// \param theHighlighted the list of highlighted presentations
-  virtual void init(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  virtual void init(FeaturePtr theFeature,
                     const std::list<XGUI_ViewerPrs>& theSelected,
                     const std::list<XGUI_ViewerPrs>& theHighlighted);
 
   /// Returns the operation sketch feature
   /// \returns the sketch instance
-  virtual boost::shared_ptr<ModelAPI_Feature> sketch() const;
+  virtual FeaturePtr sketch() const;
 
   /// Processes the mouse pressed in the point
   /// \param theEvent the mouse event
@@ -116,7 +116,7 @@ protected:
   /// Returns NULL feature. This is an operation of edition, not creation.
   /// \param theFlushMessage the flag whether the create message should be flushed
   /// \returns the created feature
-  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(const bool theFlushMessage = true);
+  virtual FeaturePtr createFeature(const bool theFlushMessage = true);
 
 protected:
   /// Emits a signal about the selection blocking. Emits a signal to change the selection.
@@ -131,14 +131,14 @@ protected:
   /// \param theDeltaX the delta for X coordinate is moved
   /// \param theDeltaY the delta for Y coordinate is moved
   /// \param theAttribute the start or end attribute of the line
-  void  moveLinePoint(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  void  moveLinePoint(FeaturePtr theFeature,
                       double theDeltaX, double theDeltaY,
                       const std::string& theAttribute);
   /// Sends the features
   void sendFeatures();
 
 private:
-  boost::shared_ptr<ModelAPI_Feature> mySketch; ///< the sketch feature
+  FeaturePtr mySketch; ///< the sketch feature
   std::list<XGUI_ViewerPrs> myFeatures; ///< the features to apply the edit operation
   Point myCurPoint; ///< the current 3D point clicked or moved
   bool myIsBlockedSelection; ///< the state of the last state of selection blocked signal
index d57b5da4a16922172955c6dae007f43dd41cc7b4..039d293b39600b053b4d4cfca45565be6a40e561 100644 (file)
@@ -45,7 +45,7 @@ PartSet_OperationSketch::~PartSet_OperationSketch()
 {
 }
 
-std::list<int> PartSet_OperationSketch::getSelectionModes(boost::shared_ptr<ModelAPI_Feature> theFeature) const
+std::list<int> PartSet_OperationSketch::getSelectionModes(FeaturePtr theFeature) const
 {
   std::list<int> aModes;
   if (!hasSketchPlane())
@@ -56,14 +56,14 @@ std::list<int> PartSet_OperationSketch::getSelectionModes(boost::shared_ptr<Mode
   return aModes;
 }
 
-void PartSet_OperationSketch::init(boost::shared_ptr<ModelAPI_Feature> theFeature,
+void PartSet_OperationSketch::init(FeaturePtr theFeature,
                                    const std::list<XGUI_ViewerPrs>& /*theSelected*/,
                                    const std::list<XGUI_ViewerPrs>& /*theHighlighted*/)
 {
   setFeature(theFeature);
 }
 
-boost::shared_ptr<ModelAPI_Feature> PartSet_OperationSketch::sketch() const
+FeaturePtr PartSet_OperationSketch::sketch() const
 {
   return feature();
 }
@@ -88,7 +88,7 @@ void PartSet_OperationSketch::mousePressed(QMouseEvent* theEvent, Handle_V3d_Vie
       return;
 
     if (theHighlighted.size() == 1) {
-      boost::shared_ptr<ModelAPI_Feature> aFeature = theHighlighted.front().feature();
+      FeaturePtr aFeature = theHighlighted.front().feature();
       if (aFeature)
         restartOperation(PartSet_OperationEditLine::Type(), aFeature);
     }
@@ -136,17 +136,17 @@ void PartSet_OperationSketch::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View)
     return;
 
   if (myFeatures.size() != 1) {
-    boost::shared_ptr<ModelAPI_Feature> aFeature = PartSet_Tools::nearestFeature(theEvent->pos(),
+    FeaturePtr aFeature = PartSet_Tools::nearestFeature(theEvent->pos(),
                                                                 theView, feature(), myFeatures);
     if (aFeature)
       restartOperation(PartSet_OperationEditLine::Type(), aFeature);
   }
 }
 
-std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >
+std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> >
                                                         PartSet_OperationSketch::subPreview() const
 {
-  std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> > aPreviewMap;
+  std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> > aPreviewMap;
 
   boost::shared_ptr<SketchPlugin_Feature> aFeature;
 
@@ -156,8 +156,8 @@ std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >
   boost::shared_ptr<ModelAPI_AttributeRefList> aRefList =
         boost::dynamic_pointer_cast<ModelAPI_AttributeRefList>(aData->attribute(SKETCH_ATTR_FEATURES));
 
-  std::list<boost::shared_ptr<ModelAPI_Feature> > aFeatures = aRefList->list();
-  std::list<boost::shared_ptr<ModelAPI_Feature> >::const_iterator anIt = aFeatures.begin(),
+  std::list<FeaturePtr > aFeatures = aRefList->list();
+  std::list<FeaturePtr >::const_iterator anIt = aFeatures.begin(),
                                                                   aLast = aFeatures.end();
   for (; anIt != aLast; anIt++) {
     aFeature = boost::dynamic_pointer_cast<SketchPlugin_Feature>(*anIt);
index 3f5a1c622f2fcf5a7c46e644edfcdbeaea39fcf9..27c0d8641db489ef85cde4dce263e84cc9f3386b 100644 (file)
@@ -37,18 +37,18 @@ public:
   /// Returns the operation local selection mode
   /// \param theFeature the feature object to get the selection mode
   /// \return the selection mode
-  virtual std::list<int> getSelectionModes(boost::shared_ptr<ModelAPI_Feature> theFeature) const;
+  virtual std::list<int> getSelectionModes(FeaturePtr theFeature) const;
 
   /// Initializes some fields accorging to the feature
   /// \param theSelected the list of selected presentations
   /// \param theHighlighted the list of highlighted presentations
-  virtual void init(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  virtual void init(FeaturePtr theFeature,
                     const std::list<XGUI_ViewerPrs>& theSelected,
                     const std::list<XGUI_ViewerPrs>& theHighlighted);
 
   /// Returns the operation sketch feature
   /// \returns the sketch instance
-  virtual boost::shared_ptr<ModelAPI_Feature> sketch() const;
+  virtual FeaturePtr sketch() const;
 
   /// Processes the mouse pressed in the point
   /// \param theEvent the mouse event
@@ -74,7 +74,7 @@ public:
 
   /// Returns the map of the operation previews including the nested feature previews
   /// \return the map of feature to the feature preview
-  virtual std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >
+  virtual std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> >
                                                                            subPreview() const;
 
   /// Virtual method called when operation stopped - committed or aborted.
index ae751b269ec8f14ce686d059e24a9f4c5f6128c0..8bb9e3be213209ebb45a420f67f4304c7aae31be 100644 (file)
@@ -27,7 +27,7 @@ PartSet_OperationSketchBase::~PartSet_OperationSketchBase()
 }
 
 boost::shared_ptr<GeomAPI_Shape> PartSet_OperationSketchBase::preview(
-                                      boost::shared_ptr<ModelAPI_Feature> theFeature)
+                                      FeaturePtr theFeature)
 {
   boost::shared_ptr<SketchPlugin_Feature> aFeature = 
                               boost::dynamic_pointer_cast<SketchPlugin_Feature>(theFeature);
@@ -36,22 +36,22 @@ boost::shared_ptr<GeomAPI_Shape> PartSet_OperationSketchBase::preview(
   return aFeature->preview();
 }
 
-std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >
+std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> >
                                                      PartSet_OperationSketchBase::subPreview() const
 {
-  return std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >();
+  return std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> >();
 }
 
-std::list<int> PartSet_OperationSketchBase::getSelectionModes(boost::shared_ptr<ModelAPI_Feature> theFeature) const
+std::list<int> PartSet_OperationSketchBase::getSelectionModes(FeaturePtr theFeature) const
 {
   std::list<int> aModes;
   aModes.push_back(TopAbs_VERTEX);
   aModes.push_back(TopAbs_EDGE);
   return aModes;
 }
-boost::shared_ptr<ModelAPI_Feature> PartSet_OperationSketchBase::createFeature(const bool theFlushMessage)
+FeaturePtr PartSet_OperationSketchBase::createFeature(const bool theFlushMessage)
 {
-  boost::shared_ptr<ModelAPI_Feature> aFeature = ModuleBase_Operation::createFeature(theFlushMessage);
+  FeaturePtr aFeature = ModuleBase_Operation::createFeature(theFlushMessage);
   if (aFeature)
     emit featureConstructed(aFeature, FM_Activation);
   return aFeature;
@@ -90,7 +90,7 @@ void PartSet_OperationSketchBase::keyReleased(std::string theName, QKeyEvent* th
 }
 
 void PartSet_OperationSketchBase::restartOperation(const std::string& theType,
-                                                   boost::shared_ptr<ModelAPI_Feature> theFeature)
+                                                   FeaturePtr theFeature)
 {
   emit launchOperation(theType, theFeature);
 }
index 697208c5a745d190ff12b4f35e588c00bcdd21b1..ff6f06847b568dbada696596b3a86a656b94d2da 100644 (file)
@@ -43,27 +43,27 @@ public:
 
   /// Returns the feature preview shape
   /// \param theFeature the feature object to obtain the preview
-  static boost::shared_ptr<GeomAPI_Shape> preview(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  static boost::shared_ptr<GeomAPI_Shape> preview(FeaturePtr theFeature);
 
   /// Returns the map of the operation previews including the nested feature previews
   /// \return the map of feature to the feature preview
-  virtual std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> > subPreview() const;
+  virtual std::map<FeaturePtr, boost::shared_ptr<GeomAPI_Shape> > subPreview() const;
 
   /// Returns the operation local selection mode
   /// \param theFeature the feature object to get the selection mode
   /// \return the selection mode
-  virtual std::list<int> getSelectionModes(boost::shared_ptr<ModelAPI_Feature> theFeature) const;
+  virtual std::list<int> getSelectionModes(FeaturePtr theFeature) const;
 
   /// Initializes some fields accorging to the feature
   /// \param theSelected the list of selected presentations
   /// \param theHighlighted the list of highlighted presentations
-  virtual void init(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  virtual void init(FeaturePtr theFeature,
                     const std::list<XGUI_ViewerPrs>& theSelected,
                     const std::list<XGUI_ViewerPrs>& theHighlighted) {}
 
   /// Returns the operation sketch feature
   /// \returns the sketch instance
-  virtual boost::shared_ptr<ModelAPI_Feature> sketch() const = 0;
+  virtual FeaturePtr sketch() const = 0;
 
   /// Processes the mouse pressed in the point
   /// \param theEvent the mouse event
@@ -99,13 +99,13 @@ public:
   /// \param theType a type of an operation started
   /// theFeature the operation argument
   void restartOperation(const std::string& theType,
-         boost::shared_ptr<ModelAPI_Feature> theFeature = boost::shared_ptr<ModelAPI_Feature>());
+         FeaturePtr theFeature = FeaturePtr());
 
 signals:
   /// signal about the request to launch operation
   /// theName the operation name
   /// theFeature the operation argument
-  void launchOperation(std::string theName, boost::shared_ptr<ModelAPI_Feature> theFeature);
+  void launchOperation(std::string theName, FeaturePtr theFeature);
   /// signal about the focus activated
   /// theName the attribute name
   void focusActivated(const std::string& theAttibuteName);
@@ -113,7 +113,7 @@ signals:
   /// Signal about the feature construing is finished
   /// \param theFeature the result feature
   /// \param theMode the mode of the feature modification
-  void featureConstructed(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  void featureConstructed(FeaturePtr theFeature,
                           int theMode);
   /// Signal about the features should be selected
   /// \param theSelected the list of selected presentations
@@ -139,7 +139,7 @@ protected:
   /// the sketch feature
   /// \param theFlushMessage the flag whether the create message should be flushed
   /// \returns the created feature
-  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(const bool theFlushMessage = true);
+  virtual FeaturePtr createFeature(const bool theFlushMessage = true);
 };
 
 #endif
index cd7e1497a926926f16fc37200eb542e726215a14..bd24b954a4e52f5c1afe980c9147c62e5c522a03 100644 (file)
@@ -45,7 +45,7 @@ using namespace std;
 
 PartSet_OperationSketchLine::PartSet_OperationSketchLine(const QString& theId,
                                                  QObject* theParent,
-                                              boost::shared_ptr<ModelAPI_Feature> theFeature)
+                                              FeaturePtr theFeature)
 : PartSet_OperationSketchBase(theId, theParent), mySketch(theFeature),
   myPointSelectionMode(SM_FirstPoint)
 {
@@ -65,7 +65,7 @@ bool PartSet_OperationSketchLine::isGranted(ModuleBase_IOperation* theOperation)
   return theOperation->getDescription()->operationId().toStdString() == PartSet_OperationSketch::Type();
 }
 
-std::list<int> PartSet_OperationSketchLine::getSelectionModes(boost::shared_ptr<ModelAPI_Feature> theFeature) const
+std::list<int> PartSet_OperationSketchLine::getSelectionModes(FeaturePtr theFeature) const
 {
   std::list<int> aModes;
   if (theFeature != feature())
@@ -73,7 +73,7 @@ std::list<int> PartSet_OperationSketchLine::getSelectionModes(boost::shared_ptr<
   return aModes;
 }
 
-void PartSet_OperationSketchLine::init(boost::shared_ptr<ModelAPI_Feature> theFeature,
+void PartSet_OperationSketchLine::init(FeaturePtr theFeature,
                                        const std::list<XGUI_ViewerPrs>& /*theSelected*/,
                                        const std::list<XGUI_ViewerPrs>& /*theHighlighted*/)
 {
@@ -84,7 +84,7 @@ void PartSet_OperationSketchLine::init(boost::shared_ptr<ModelAPI_Feature> theFe
   myInitPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(LINE_ATTR_END));
 }
 
-boost::shared_ptr<ModelAPI_Feature> PartSet_OperationSketchLine::sketch() const
+FeaturePtr PartSet_OperationSketchLine::sketch() const
 {
   return mySketch;
 }
@@ -127,7 +127,7 @@ void PartSet_OperationSketchLine::mouseReleased(QMouseEvent* theEvent, Handle(V3
       }
       else if (aShape.ShapeType() == TopAbs_EDGE) // the line is selected
       {
-        boost::shared_ptr<ModelAPI_Feature> aFeature = aPrs.feature();
+        FeaturePtr aFeature = aPrs.feature();
         if (aFeature) {
           double X0, X1, X2, X3;
           double Y0, Y1, Y2, Y3;
@@ -233,7 +233,7 @@ void PartSet_OperationSketchLine::keyReleased(const int theKey)
       }
       //else
       //  abort();
-      //emit launchOperation(PartSet_OperationSketchLine::Type(), boost::shared_ptr<ModelAPI_Feature>());
+      //emit launchOperation(PartSet_OperationSketchLine::Type(), FeaturePtr());
     }
     break;
     case Qt::Key_Escape: {
@@ -275,9 +275,9 @@ void PartSet_OperationSketchLine::afterCommitOperation()
   emit featureConstructed(feature(), FM_Deactivation);
 }
 
-boost::shared_ptr<ModelAPI_Feature> PartSet_OperationSketchLine::createFeature(const bool theFlushMessage)
+FeaturePtr PartSet_OperationSketchLine::createFeature(const bool theFlushMessage)
 {
-  boost::shared_ptr<ModelAPI_Feature> aNewFeature = ModuleBase_Operation::createFeature(false);
+  FeaturePtr aNewFeature = ModuleBase_Operation::createFeature(false);
   if (sketch()) {
     boost::shared_ptr<SketchPlugin_Feature> aFeature = 
                            boost::dynamic_pointer_cast<SketchPlugin_Feature>(sketch());
@@ -304,7 +304,7 @@ void PartSet_OperationSketchLine::createConstraint(boost::shared_ptr<GeomDataAPI
                                                    boost::shared_ptr<GeomDataAPI_Point2D> thePoint2)
 {
   boost::shared_ptr<ModelAPI_Document> aDoc = document();
-  boost::shared_ptr<ModelAPI_Feature> aFeature = aDoc->addFeature(SKETCH_CONSTRAINT_COINCIDENCE_KIND);
+  FeaturePtr aFeature = aDoc->addFeature(SKETCH_CONSTRAINT_COINCIDENCE_KIND);
 
   if (sketch()) {
     boost::shared_ptr<SketchPlugin_Feature> aSketch = 
@@ -341,7 +341,7 @@ void PartSet_OperationSketchLine::setConstraints(double theX, double theY)
       break;
   }
 
-  boost::shared_ptr<ModelAPI_Feature> aSkFeature = feature();
+  FeaturePtr aSkFeature = feature();
 
   boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
   boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
@@ -350,18 +350,18 @@ void PartSet_OperationSketchLine::setConstraints(double theX, double theY)
   boost::shared_ptr<ModelAPI_AttributeRefList> aRefList =
         boost::dynamic_pointer_cast<ModelAPI_AttributeRefList>(aData->attribute(SKETCH_ATTR_FEATURES));
 
-  std::list<boost::shared_ptr<ModelAPI_Feature> > aFeatures = aRefList->list();
-  std::list<boost::shared_ptr<ModelAPI_Feature> >::const_iterator anIt = aFeatures.begin(),
+  std::list<FeaturePtr > aFeatures = aRefList->list();
+  std::list<FeaturePtr >::const_iterator anIt = aFeatures.begin(),
                                                                   aLast = aFeatures.end();
   for (; anIt != aLast; anIt++) {
-    boost::shared_ptr<ModelAPI_Feature> aFeature = *anIt;
+    FeaturePtr aFeature = *anIt;
     boost::shared_ptr<GeomDataAPI_Point2D> aFPoint = findLinePoint(aFeature, theX, theY);
     if (aFPoint)
       createConstraint(aFPoint, aPoint);
   }
 }
 
-void PartSet_OperationSketchLine::getLinePoint(boost::shared_ptr<ModelAPI_Feature> theFeature,
+void PartSet_OperationSketchLine::getLinePoint(FeaturePtr theFeature,
                                                const std::string& theAttribute,
                                                double& theX, double& theY)
 {
@@ -375,7 +375,7 @@ void PartSet_OperationSketchLine::getLinePoint(boost::shared_ptr<ModelAPI_Featur
 }
 
 boost::shared_ptr<GeomDataAPI_Point2D> PartSet_OperationSketchLine::findLinePoint(
-                                               boost::shared_ptr<ModelAPI_Feature> theFeature,
+                                               FeaturePtr theFeature,
                                                double theX, double theY)
 {
   boost::shared_ptr<GeomDataAPI_Point2D> aPoint2D;
@@ -395,7 +395,7 @@ boost::shared_ptr<GeomDataAPI_Point2D> PartSet_OperationSketchLine::findLinePoin
   return aPoint2D;
 }
 
-void PartSet_OperationSketchLine::setLinePoint(boost::shared_ptr<ModelAPI_Feature> theFeature,
+void PartSet_OperationSketchLine::setLinePoint(FeaturePtr theFeature,
                                                double theX, double theY,
                                                const std::string& theAttribute)
 {
index 9dd5dc6ccc92888000fa3b40cb30200d1dea039e..153bfbb661ff41dbd51325d6b67e094adbafa001 100644 (file)
@@ -35,7 +35,7 @@ public:
   /// \param theParent the operation parent
   /// \param theFeature the parent feature
   PartSet_OperationSketchLine(const QString& theId, QObject* theParent,
-                              boost::shared_ptr<ModelAPI_Feature> theSketchFeature);
+                              FeaturePtr theSketchFeature);
   /// Destructor
   virtual ~PartSet_OperationSketchLine();
 
@@ -51,18 +51,18 @@ public:
   /// Returns the operation local selection mode
   /// \param theFeature the feature object to get the selection mode
   /// \return the selection mode
-  virtual std::list<int> getSelectionModes(boost::shared_ptr<ModelAPI_Feature> theFeature) const;
+  virtual std::list<int> getSelectionModes(FeaturePtr theFeature) const;
 
   /// Initializes some fields accorging to the feature
   /// \param theSelected the list of selected presentations
   /// \param theHighlighted the list of highlighted presentations
-  virtual void init(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  virtual void init(FeaturePtr theFeature,
                     const std::list<XGUI_ViewerPrs>& theSelected,
                     const std::list<XGUI_ViewerPrs>& theHighlighted);
 
   /// Returns the operation sketch feature
   /// \returns the sketch instance
-  virtual boost::shared_ptr<ModelAPI_Feature> sketch() const;
+  virtual FeaturePtr sketch() const;
 
   /// Gives the current selected objects to be processed by the operation
   /// \param theEvent the mouse event
@@ -87,7 +87,7 @@ public:
   /// \param theX the horizontal coordinate
   /// \param theY the vertical coordinate
   /// \param theAttribute the start or end attribute of the line
-  static void setLinePoint(boost::shared_ptr<ModelAPI_Feature>, double theX, double theY,
+  static void setLinePoint(FeaturePtr, double theX, double theY,
                            const std::string& theAttribute);
 
 protected:
@@ -112,7 +112,7 @@ protected:
   /// the sketch feature
   /// \param theFlushMessage the flag whether the create message should be flushed
   /// \returns the created feature
-  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(const bool theFlushMessage = true);
+  virtual FeaturePtr createFeature(const bool theFlushMessage = true);
 
   /// Creates a constraint on two points
   /// \param thePoint1 the first point
@@ -131,13 +131,13 @@ protected:
   /// \param theAttribute the start or end attribute of the line
   /// \param theX the horizontal coordinate
   /// \param theY the vertical coordinate
-  void getLinePoint(boost::shared_ptr<ModelAPI_Feature> theFeature, const std::string& theAttribute,
+  void getLinePoint(FeaturePtr theFeature, const std::string& theAttribute,
                     double& theX, double& theY);
   /// Find a point in the line with given coordinates
   /// \param theFeature the line feature
   /// \param theX the horizontal point coordinate
   /// \param theY the vertical point coordinate
-  boost::shared_ptr<GeomDataAPI_Point2D> findLinePoint(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  boost::shared_ptr<GeomDataAPI_Point2D> findLinePoint(FeaturePtr theFeature,
                                                        double theX, double theY);
 
   /// \brief Save the point to the line.
@@ -155,7 +155,7 @@ protected:
   void setPointSelectionMode(const PointSelectionMode& theMode, const bool isToEmitSignal = true);
 
 private:
-  boost::shared_ptr<ModelAPI_Feature> mySketch; ///< the sketch feature
+  FeaturePtr mySketch; ///< the sketch feature
   boost::shared_ptr<GeomDataAPI_Point2D> myInitPoint; ///< the first line point
   PointSelectionMode myPointSelectionMode; ///< point selection mode
 };
index 78d47b58e4bf227904557d6d0c2dbd07f151a188..28d9ce3d188b20419ecef62cde02d78a1fcd8fd2 100644 (file)
@@ -28,8 +28,8 @@ const Quantity_NameOfColor SKETCH_PLANE_COLOR = Quantity_NOC_CHOCOLATE; /// the
 const int SKETCH_WIDTH = 4; /// the plane edge width
 
 Handle(AIS_InteractiveObject) PartSet_Presentation::createPresentation(
-                                         boost::shared_ptr<ModelAPI_Feature> theFeature,
-                                         boost::shared_ptr<ModelAPI_Feature> theSketch,
+                                         FeaturePtr theFeature,
+                                         FeaturePtr theSketch,
                                          const TopoDS_Shape& theShape,
                                          Handle_AIS_InteractiveObject thePrevPrs)
 {
@@ -52,7 +52,7 @@ Handle(AIS_InteractiveObject) PartSet_Presentation::createPresentation(
 }
 
 Handle(AIS_InteractiveObject) PartSet_Presentation::createFeature(
-                                              boost::shared_ptr<ModelAPI_Feature> theFeature,
+                                              FeaturePtr theFeature,
                                               const TopoDS_Shape& theShape,
                                               Handle_AIS_InteractiveObject thePrevPrs)
 {
@@ -78,8 +78,8 @@ Handle(AIS_InteractiveObject) PartSet_Presentation::createFeature(
 }
 
 Handle(AIS_InteractiveObject) PartSet_Presentation::createSketchConstraintLength(
-                                         boost::shared_ptr<ModelAPI_Feature> theFeature,
-                                         boost::shared_ptr<ModelAPI_Feature> theSketch,
+                                         FeaturePtr theFeature,
+                                         FeaturePtr theSketch,
                                          Handle(AIS_InteractiveObject) thePrevPrs)
 {
   if (!theFeature || !theSketch)
@@ -97,7 +97,7 @@ Handle(AIS_InteractiveObject) PartSet_Presentation::createSketchConstraintLength
           boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(CONSTRAINT_ATTR_ENTITY_A));
   if (!anAttr)
     return thePrevPrs;
-  boost::shared_ptr<ModelAPI_Feature> aFeature = anAttr->feature();
+  FeaturePtr aFeature = anAttr->feature();
   if (!aFeature || aFeature->getKind() != SKETCH_LINE_KIND)
     return thePrevPrs;
 
index ffe8ed4dbec9822fabe1ab1da8e8fcc264fd883c..8e4b2ae6fa0fb6b84680549bbf13b7eeffd92c39 100644 (file)
@@ -9,9 +9,10 @@
 
 #include <TopoDS_Shape.hxx>
 
+#include <ModelAPI_Feature.h>
+
 #include <boost/shared_ptr.hpp>
 
-class ModelAPI_Feature;
 class Handle_AIS_InteractiveObject;
 
 /*!
@@ -25,19 +26,19 @@ public:
   /// \param theFeature a feature
   /// \return the presentation
   static Handle_AIS_InteractiveObject createPresentation(
-                                              boost::shared_ptr<ModelAPI_Feature> theFeature,
-                                              boost::shared_ptr<ModelAPI_Feature> theSketch,
+                                              FeaturePtr theFeature,
+                                              FeaturePtr theSketch,
                                               const TopoDS_Shape& theShape,
                                               Handle_AIS_InteractiveObject thePrevPrs);
 protected:
   static Handle_AIS_InteractiveObject createFeature(
-                                              boost::shared_ptr<ModelAPI_Feature> theFeature,
+                                              FeaturePtr theFeature,
                                               const TopoDS_Shape& theShape,
                                               Handle_AIS_InteractiveObject thePrevPrs);
 
   static Handle_AIS_InteractiveObject createSketchConstraintLength(
-                                              boost::shared_ptr<ModelAPI_Feature> theFeature,
-                                              boost::shared_ptr<ModelAPI_Feature> theSketch,
+                                              FeaturePtr theFeature,
+                                              FeaturePtr theSketch,
                                               Handle_AIS_InteractiveObject thePrevPrs);
 };
 
index d56025223178272795be6ff8cb6bd0d1d6bde416..dc02950203fc922581494c571bb4334e2ae0e67e 100644 (file)
@@ -18,7 +18,7 @@
 #include <ModelAPI_Document.h>
 
 static double myTestDelta;
-static boost::shared_ptr<ModelAPI_Feature> myTestFeature;
+static FeaturePtr myTestFeature;
 
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_Shape.hxx>
@@ -127,12 +127,12 @@ void PartSet_TestOCC::createTestLine(XGUI_Workshop* theWorkshop)
 
   ModuleBase_Operation* anOperation = theWorkshop->operationMgr()->currentOperation();
   PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
-    boost::shared_ptr<ModelAPI_Feature> aSketch;
+    FeaturePtr aSketch;
 
   if (aPreviewOp) {
     // create a line
     boost::shared_ptr<ModelAPI_Document> aDoc = ModelAPI_PluginManager::get()->rootDocument();
-    boost::shared_ptr<ModelAPI_Feature> aFeature = aDoc->addFeature(
+    FeaturePtr aFeature = aDoc->addFeature(
                                                    PartSet_OperationSketchLine::Type().c_str());
     if (aFeature) // TODO: generate an error if feature was not created
       aFeature->execute();
@@ -195,7 +195,7 @@ void PartSet_TestOCC::changeTestLine(XGUI_Workshop* theWorkshop)
   // change the line
   if (!myTestFeature)
     return;
-  boost::shared_ptr<ModelAPI_Feature> aFeature = myTestFeature;
+  FeaturePtr aFeature = myTestFeature;
 
   myTestDelta = myTestDelta - 50;
   double aDelta = myTestDelta;
@@ -204,7 +204,7 @@ void PartSet_TestOCC::changeTestLine(XGUI_Workshop* theWorkshop)
   boost::shared_ptr<GeomAPI_Shape> aPreview = PartSet_OperationSketchLine::preview(aFeature);
 
   Handle(AIS_InteractiveObject) aPrevAIS;
-  boost::shared_ptr<ModelAPI_Feature> aSketch;//NULL
+  FeaturePtr aSketch;//NULL
   Handle(AIS_InteractiveObject) anAIS = PartSet_Presentation::createPresentation(
                           aFeature, aSketch,
                           aPreview ? aPreview->impl<TopoDS_Shape>() : TopoDS_Shape(),
index 4713f2cdaf4fb8bd475aa07434216e6b36765d36..ae51d7b20a6d788ba94f9861169852ba8fe787e1 100644 (file)
@@ -57,7 +57,7 @@ gp_Pnt PartSet_Tools::convertClickToPoint(QPoint thePoint, Handle(V3d_View) theV
   return ResultPoint;
 }
 
-void PartSet_Tools::convertTo2D(const gp_Pnt& thePoint, boost::shared_ptr<ModelAPI_Feature> theSketch,
+void PartSet_Tools::convertTo2D(const gp_Pnt& thePoint, FeaturePtr theSketch,
                                 Handle(V3d_View) theView, double& theX, double& theY)
 {
   if (!theSketch)
@@ -104,7 +104,7 @@ void PartSet_Tools::convertTo2D(const gp_Pnt& thePoint, boost::shared_ptr<ModelA
 }
 
 void PartSet_Tools::convertTo3D(const double theX, const double theY,
-                                boost::shared_ptr<ModelAPI_Feature> theSketch,
+                                FeaturePtr theSketch,
                                 gp_Pnt& thePoint)
 {
   if (!theSketch)
@@ -167,19 +167,19 @@ void PartSet_Tools::projectPointOnLine(double theX1, double theY1, double theX2,
   }
 }
 
-boost::shared_ptr<ModelAPI_Feature> PartSet_Tools::nearestFeature(QPoint thePoint,
+FeaturePtr PartSet_Tools::nearestFeature(QPoint thePoint,
                                                    Handle_V3d_View theView,
-                                                   boost::shared_ptr<ModelAPI_Feature> theSketch,
+                                                   FeaturePtr theSketch,
                                                    const std::list<XGUI_ViewerPrs>& theFeatures)
 {
   double aX, anY;
   gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(thePoint, theView);
   PartSet_Tools::convertTo2D(aPoint, theSketch, theView, aX, anY);
 
-  boost::shared_ptr<ModelAPI_Feature> aFeature;
+  FeaturePtr aFeature;
   std::list<XGUI_ViewerPrs>::const_iterator anIt = theFeatures.begin(), aLast = theFeatures.end();
 
-  boost::shared_ptr<ModelAPI_Feature> aDeltaFeature;   
+  FeaturePtr aDeltaFeature;   
   double aMinDelta = -1;
   XGUI_ViewerPrs aPrs;
   for (; anIt != aLast; anIt++) {
@@ -195,7 +195,7 @@ boost::shared_ptr<ModelAPI_Feature> PartSet_Tools::nearestFeature(QPoint thePoin
   return aDeltaFeature;
 }
 
-double PartSet_Tools::distanceToPoint(boost::shared_ptr<ModelAPI_Feature> theFeature,
+double PartSet_Tools::distanceToPoint(FeaturePtr theFeature,
                                       double theX, double theY)
 {
   double aDelta = 0;
index b0778b5e1760af9aa86f84c98df5e4669c26f0f8..c8fa3066094b9a748b11716dfd5b6e9251ad1a88 100644 (file)
 
 #include <QPoint>
 
+#include <ModelAPI_Feature.h>
+
 #include <boost/shared_ptr.hpp>
 
 #include <list>
 
 class Handle_V3d_View;
-class ModelAPI_Feature;
 class XGUI_ViewerPrs;
 
 /*!
@@ -36,7 +37,7 @@ public:
   /// \param theSketch the sketch feature
   /// \param theX the X coordinate
   /// \param theY the Y coordinate
-  static void convertTo2D(const gp_Pnt& thePoint, boost::shared_ptr<ModelAPI_Feature> theSketch,
+  static void convertTo2D(const gp_Pnt& thePoint, FeaturePtr theSketch,
                           Handle(V3d_View) theView, double& theX, double& theY);
 
   /// \brief Converts the 2D projected coodinates on the sketch plane to the 3D point.
@@ -45,7 +46,7 @@ public:
   /// \param theSketch the sketch feature
   /// \param thePoint the 3D point in the viewer
   static void convertTo3D(const double theX, const double theY,
-                          boost::shared_ptr<ModelAPI_Feature> theSketch,
+                          FeaturePtr theSketch,
                           gp_Pnt& thePoint);
 
   /// Returns the point of intersection of the two lines, the first is (v0, v1), the second is (v2, v3),
@@ -79,15 +80,15 @@ public:
   /// \param theView a 3D view
   /// \param theSketch the sketch feature
   /// \param theFeatures the list of selected presentations
-  static boost::shared_ptr<ModelAPI_Feature> nearestFeature(QPoint thePoint, Handle_V3d_View theView,
-                                                     boost::shared_ptr<ModelAPI_Feature> theSketch,
+  static FeaturePtr nearestFeature(QPoint thePoint, Handle_V3d_View theView,
+                                                     FeaturePtr theSketch,
                                                      const std::list<XGUI_ViewerPrs>& theFeatures);
 private:
   /// Return the distance between the feature and the point
   /// \param theFeature feature object
   /// \param theX the horizontal coordinate of the point
   /// \param theX the vertical coordinate of the point
-  static double distanceToPoint(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  static double distanceToPoint(FeaturePtr theFeature,
                                 double theX, double theY);
 };
 
index 76ea7b441c0f6ae5375b48bdb1ed5c4bc498ddcc..435cc1efcbc8054a33906088bbb74c1828795ee4 100644 (file)
@@ -16,17 +16,17 @@ PartSetPlugin_Plugin::PartSetPlugin_Plugin()
   ModelAPI_PluginManager::get()->registerPlugin(this);
 }
 
-boost::shared_ptr<ModelAPI_Feature> PartSetPlugin_Plugin::createFeature(string theFeatureID)
+FeaturePtr PartSetPlugin_Plugin::createFeature(string theFeatureID)
 {
   if (theFeatureID == "Part") {
-    return boost::shared_ptr<ModelAPI_Feature>(new PartSetPlugin_Part);
+    return FeaturePtr(new PartSetPlugin_Part);
   }
   if (theFeatureID == "duplicate") {
-    return boost::shared_ptr<ModelAPI_Feature>(new PartSetPlugin_Duplicate);
+    return FeaturePtr(new PartSetPlugin_Duplicate);
   }
   if (theFeatureID == "remove") {
-    return boost::shared_ptr<ModelAPI_Feature>(new PartSetPlugin_Remove);
+    return FeaturePtr(new PartSetPlugin_Remove);
   }
     // feature of such kind is not found
-  return boost::shared_ptr<ModelAPI_Feature>();
+  return FeaturePtr();
 }
index ff577f79a3adec8e2003a43ece502a805e536255..d1ccd314b37f5f138a97b6b5122b469f50d1fad1 100644 (file)
@@ -8,12 +8,13 @@
 
 #include "PartSetPlugin.h"
 #include "ModelAPI_Plugin.h"
+#include "ModelAPI_Feature.h"
 
 class PARTSETPLUGIN_EXPORT PartSetPlugin_Plugin: public ModelAPI_Plugin
 {
 public:
   /// Creates the feature object of this plugin by the feature string ID
-  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID);
+  virtual FeaturePtr createFeature(std::string theFeatureID);
 
 public:
   /// Is needed for python wrapping by swig
index 5e99cb1f9a8734f5c318133546e6f65e740f5e46..6c56d01f1f1c3d5dbabac5bf89c4adffc4de0891 100644 (file)
@@ -15,7 +15,7 @@ void PartSetPlugin_Remove::execute()
   boost::shared_ptr<ModelAPI_Document> aCurrent;
   boost::shared_ptr<PartSetPlugin_Part> a;
   for(int a = aRoot->size(getGroup()) - 1; a >= 0; a--) {
-    boost::shared_ptr<ModelAPI_Feature> aFeature = aRoot->feature(getGroup(), a, true);
+    FeaturePtr aFeature = aRoot->feature(getGroup(), a, true);
     if (aFeature->getKind() == "Part") {
       boost::shared_ptr<PartSetPlugin_Part> aPart = 
         boost::static_pointer_cast<PartSetPlugin_Part>(aFeature);
index 3286cff4218506c53690ae23699c9022221cb905..928a7608347f7af73e96125bfc43c30965e559e4 100644 (file)
@@ -46,7 +46,7 @@ public:
   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
   /// \param theFeature sub-feature
   SKETCHPLUGIN_EXPORT virtual const void addSub(
-    const boost::shared_ptr<ModelAPI_Feature>& theFeature) {};
+    const FeaturePtr& theFeature) {};
 
   /// Use plugin manager for features creation
   SketchPlugin_Arc();
index 3e7b9ac8295082fe6a4bff4ec82498c36d1f5bf8..10fee4f7bba9f27b1c453d745528138dcced52d9 100644 (file)
@@ -44,7 +44,7 @@ public:
   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
   /// \param theFeature sub-feature
   SKETCHPLUGIN_EXPORT virtual const void addSub(
-    const boost::shared_ptr<ModelAPI_Feature>& theFeature) {};
+    const FeaturePtr& theFeature) {};
 
   /// Use plugin manager for features creation
   SketchPlugin_Circle();
index dcb0a3c792e4d9a160110fa0c0ff227b79589ca7..b4e8bcca6aac2b5496e6e547cbd8e37651ed7654 100644 (file)
@@ -57,7 +57,7 @@ public:
    *  \param theFeature sub-feature
    */
   SKETCHPLUGIN_EXPORT virtual const void addSub(
-    const boost::shared_ptr<ModelAPI_Feature>& theFeature) {}
+    const FeaturePtr& theFeature) {}
 
 protected:
   /// \brief Use plugin manager for features creation
index ae771b5567b1dff3cc71ac5f52d9c4b15ff95969..7bda5720bb0e1fc8bdb0e28705d1a420bd965c88 100644 (file)
@@ -29,9 +29,9 @@ SketchPlugin_Sketch* SketchPlugin_Feature::sketch()
       boost::shared_ptr<SketchPlugin_Sketch> aSketch = boost::
         dynamic_pointer_cast<SketchPlugin_Sketch>(document()->feature("Construction", a, true));
       if (aSketch) {
-        std::list<boost::shared_ptr<ModelAPI_Feature> > aList = 
+        std::list<FeaturePtr > aList = 
           aSketch->data()->reflist(SKETCH_ATTR_FEATURES)->list();
-        std::list<boost::shared_ptr<ModelAPI_Feature> >::iterator aSub = aList.begin();
+        std::list<FeaturePtr >::iterator aSub = aList.begin();
         for(; aSub != aList.end(); aSub++) {
           if ((*aSub)->data()->isEqual(data())) {
             mySketch = aSketch.get();
index db6a6d6607aff088a251a6e4f6e43fb30d71b82e..8e59b54892d5c8935f587563554b8338ec546032 100644 (file)
@@ -27,7 +27,7 @@ public:
   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
   /// \param theFeature sub-feature
   SKETCHPLUGIN_EXPORT virtual const void addSub(
-    const boost::shared_ptr<ModelAPI_Feature>& theFeature) = 0;
+    const FeaturePtr& theFeature) = 0;
 
   /// Returns true if this feature must be displayed in the history (top level of Part tree)
   SKETCHPLUGIN_EXPORT virtual bool isInHistory() {return false;}
index b22f551b704a0acc3597540a5edb9c8b8ab398c9..6acefd2943f36e69a885cd34769e7b36b6e10913 100644 (file)
@@ -45,7 +45,7 @@ public:
   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
   /// \param theFeature sub-feature
   SKETCHPLUGIN_EXPORT virtual const void addSub(
-    const boost::shared_ptr<ModelAPI_Feature>& theFeature) {};
+    const FeaturePtr& theFeature) {};
 
   /// Use plugin manager for features creation
   SketchPlugin_Line();
index 7f75377f2af0d507a8ffcb8df389e672844d7cac..14e61b2362c7806c27657e8017b92cb77c2f95c8 100644 (file)
@@ -24,38 +24,38 @@ SketchPlugin_Plugin::SketchPlugin_Plugin()
   ModelAPI_PluginManager::get()->registerPlugin(this);
 }
 
-boost::shared_ptr<ModelAPI_Feature> SketchPlugin_Plugin::createFeature(string theFeatureID)
+FeaturePtr SketchPlugin_Plugin::createFeature(string theFeatureID)
 {
   if (theFeatureID == SKETCH_KIND) {
-    return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Sketch);
+    return FeaturePtr(new SketchPlugin_Sketch);
   }
   else if (theFeatureID == SKETCH_POINT_KIND) {
-    return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Point);
+    return FeaturePtr(new SketchPlugin_Point);
   }
   else if (theFeatureID == SKETCH_LINE_KIND) {
-    return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Line);
+    return FeaturePtr(new SketchPlugin_Line);
   }
   else if (theFeatureID == SKETCH_CIRCLE_KIND) {
-    return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_Circle);
+    return FeaturePtr(new SketchPlugin_Circle);
   }
   else if (theFeatureID == SKETCH_CONSTRAINT_COINCIDENCE_KIND) {
-    return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_ConstraintCoincidence);
+    return FeaturePtr(new SketchPlugin_ConstraintCoincidence);
   }
   else if (theFeatureID == SKETCH_CONSTRAINT_DISTANCE_KIND) {
-    return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_ConstraintDistance);
+    return FeaturePtr(new SketchPlugin_ConstraintDistance);
   }
   else if (theFeatureID == SKETCH_CONSTRAINT_LENGTH_KIND) {
-    return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_ConstraintLength);
+    return FeaturePtr(new SketchPlugin_ConstraintLength);
   }
   else if (theFeatureID == SKETCH_CONSTRAINT_PARALLEL_KIND) {
-    return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_ConstraintParallel);
+    return FeaturePtr(new SketchPlugin_ConstraintParallel);
   }
   else if (theFeatureID == SKETCH_CONSTRAINT_PERPENDICULAR_KIND) {
-    return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_ConstraintPerpendicular);
+    return FeaturePtr(new SketchPlugin_ConstraintPerpendicular);
   }
   else if (theFeatureID == SKETCH_CONSTRAINT_RADIUS_KIND) {
-    return boost::shared_ptr<ModelAPI_Feature>(new SketchPlugin_ConstraintRadius);
+    return FeaturePtr(new SketchPlugin_ConstraintRadius);
   }
   // feature of such kind is not found
-  return boost::shared_ptr<ModelAPI_Feature>();
+  return FeaturePtr();
 }
index f232b68fac26fdfdd6d38e824cae6f624aa520fb..408ae73cc2be30eacbf5e0211ed6c6aef3fcdae2 100644 (file)
@@ -8,12 +8,13 @@
 
 #include "SketchPlugin.h"
 #include "ModelAPI_Plugin.h"
+#include "ModelAPI_Feature.h"
 
 class SKETCHPLUGIN_EXPORT SketchPlugin_Plugin: public ModelAPI_Plugin
 {
 public:
   /// Creates the feature object of this plugin by the feature string ID
-  virtual boost::shared_ptr<ModelAPI_Feature> createFeature(std::string theFeatureID);
+  virtual FeaturePtr createFeature(std::string theFeatureID);
 
 public:
   /// Is needed for python wrapping by swig
index e791cce852b360dc1d5ff0c1eeeebbf73b19b222..8d37e19e13eaea2520b4163670251c9d6ad6bae7 100644 (file)
@@ -43,7 +43,7 @@ public:
   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
   /// \param theFeature sub-feature
   SKETCHPLUGIN_EXPORT virtual const void addSub(
-    const boost::shared_ptr<ModelAPI_Feature>& theFeature) {};
+    const FeaturePtr& theFeature) {};
 
   /// Use plugin manager for features creation
   SketchPlugin_Point();
index 1d97cb2b051be4fd0e51d787f4f9591d8989b2b9..d2c111990d926303e5c6197e3655ce4cc2552572 100644 (file)
@@ -50,7 +50,7 @@ const boost::shared_ptr<GeomAPI_Shape>& SketchPlugin_Sketch::preview()
   return getPreview();
 }
 
-const void SketchPlugin_Sketch::addSub(const boost::shared_ptr<ModelAPI_Feature>& theFeature)
+const void SketchPlugin_Sketch::addSub(const FeaturePtr& theFeature)
 {
   boost::dynamic_pointer_cast<SketchPlugin_Feature>(theFeature)->setSketch(this);
   data()->reflist(SKETCH_ATTR_FEATURES)->append(theFeature);
index b5a46830ab9d70372b8547885cc235c1f50cc721..8337c8d2478d18a9c13fc1524373753eb4cdf405 100644 (file)
@@ -51,7 +51,7 @@ public:
   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
   /// \param theFeature sub-feature
   SKETCHPLUGIN_EXPORT virtual const void addSub(
-    const boost::shared_ptr<ModelAPI_Feature>& theFeature);
+    const FeaturePtr& theFeature);
 
   /// Converts a 2D sketch space point into point in 3D space
   SKETCHPLUGIN_EXPORT boost::shared_ptr<GeomAPI_Pnt> to3D(
index d349e78b97049fbd22fd6bf8238dfadd85e6a8cb..186e80505628cc859a2da9867c6558333338a0b2 100644 (file)
@@ -317,10 +317,10 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeEntity(
 //  Purpose:  create/update the element defined by the feature affected by any constraint
 // ============================================================================
 Slvs_hEntity SketchSolver_ConstraintGroup::changeEntity(
-                boost::shared_ptr<ModelAPI_Feature> theEntity)
+                FeaturePtr theEntity)
 {
   // If the entity is already in the group, try to find it
-  std::map<boost::shared_ptr<ModelAPI_Feature>, Slvs_hEntity>::const_iterator
+  std::map<FeaturePtr, Slvs_hEntity>::const_iterator
     aEntIter = myEntityFeatMap.find(theEntity);
   // defines that the entity already exists
   const bool isEntExists = (myEntityFeatMap.find(theEntity) != myEntityFeatMap.end());
@@ -996,13 +996,13 @@ void SketchSolver_ConstraintGroup::removeConstraint(boost::shared_ptr<SketchPlug
     }
     else anEntAttrIter++;
   }
-  std::map<boost::shared_ptr<ModelAPI_Feature>, Slvs_hEntity>::iterator
+  std::map<FeaturePtr, Slvs_hEntity>::iterator
     anEntFeatIter = myEntityFeatMap.begin();
   while (anEntFeatIter != myEntityFeatMap.end())
   {
     if (anEntToRemove.find(anEntFeatIter->second) != anEntToRemove.end())
     {
-      std::map<boost::shared_ptr<ModelAPI_Feature>, Slvs_hEntity>::iterator
+      std::map<FeaturePtr, Slvs_hEntity>::iterator
         aRemovedIter = anEntFeatIter;
       anEntFeatIter++;
       myEntityFeatMap.erase(aRemovedIter);
index 7baeac158450944060cc9d49ea54f98aa62afcc0..69c1a7c04584e6894796a4ab1fcc4f85a1da8e8b 100644 (file)
@@ -104,7 +104,7 @@ protected:
    *  \return identifier of changed entity or 0 if entity could not be changed
    */
   Slvs_hEntity changeEntity(boost::shared_ptr<ModelAPI_Attribute> theEntity);
-  Slvs_hEntity changeEntity(boost::shared_ptr<ModelAPI_Feature>   theEntity);
+  Slvs_hEntity changeEntity(FeaturePtr   theEntity);
 
   /** \brief Adds or updates a normal in the group
    *
@@ -192,7 +192,7 @@ private:
                                myConstraintMap; ///< The map between SketchPlugin and SolveSpace constraints
   std::map<boost::shared_ptr<ModelAPI_Attribute>, Slvs_hEntity>
                                myEntityAttrMap;     ///< The map between "attribute" parameters of constraints and their equivalent SolveSpace entities
-  std::map<boost::shared_ptr<ModelAPI_Feature>, Slvs_hEntity>
+  std::map<FeaturePtr, Slvs_hEntity>
                                myEntityFeatMap;     ///< The map between "feature" parameters of constraints and their equivalent SolveSpace entities
 
   // Conincident items
index dd71f00f193afa2de0616169d35ca282bcfc5945..e91d65a16bc5491c0473d65a62b2f1fcc3283b15 100644 (file)
@@ -64,12 +64,12 @@ void SketchSolver_ConstraintManager::processEvent(const Events_Message* theMessa
       theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_MOVED))
   {
     const Model_FeatureUpdatedMessage* anUpdateMsg = dynamic_cast<const Model_FeatureUpdatedMessage*>(theMessage);
-    std::set< boost::shared_ptr<ModelAPI_Feature> > aFeatures = anUpdateMsg->features();
+    std::set< FeaturePtr > aFeatures = anUpdateMsg->features();
 
     bool isModifiedEvt = theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_MOVED);
     if (!isModifiedEvt)
     {
-      std::set< boost::shared_ptr<ModelAPI_Feature> >::iterator aFeatIter;
+      std::set< FeaturePtr >::iterator aFeatIter;
       for (aFeatIter = aFeatures.begin(); aFeatIter != aFeatures.end(); aFeatIter++)
       {
         // Only sketches and constraints can be added by Create event
@@ -343,8 +343,8 @@ boost::shared_ptr<SketchPlugin_Feature> SketchSolver_ConstraintManager::findWork
 
     boost::shared_ptr<ModelAPI_AttributeRefList> aWPFeatures =
       boost::dynamic_pointer_cast<ModelAPI_AttributeRefList>(aWP->data()->attribute(SKETCH_ATTR_FEATURES));
-    std::list< boost::shared_ptr<ModelAPI_Feature> > aFeaturesList = aWPFeatures->list();
-    std::list< boost::shared_ptr<ModelAPI_Feature> >::const_iterator anIter;
+    std::list< FeaturePtr > aFeaturesList = aWPFeatures->list();
+    std::list< FeaturePtr >::const_iterator anIter;
     for (anIter = aFeaturesList.begin(); anIter != aFeaturesList.end(); anIter++)
       if (*anIter == theConstraint)
         return aWP; // workplane is found
index 2321f4874ccf8ed510138baef74df82487a54fbd..54f3728edb3e01d4f92a4fbe406efe06987d53de 100644 (file)
@@ -32,17 +32,17 @@ XGUI_Displayer::~XGUI_Displayer()
 {
 }
 
-bool XGUI_Displayer::isVisible(boost::shared_ptr<ModelAPI_Feature> theFeature)
+bool XGUI_Displayer::isVisible(FeaturePtr theFeature)
 {
   return myFeature2AISObjectMap.find(theFeature) != myFeature2AISObjectMap.end();
 }
 
-//void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature,
+//void XGUI_Displayer::Display(FeaturePtr theFeature,
 //                             const bool isUpdateViewer)
 //{
 //}
 
-/*void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature,
+/*void XGUI_Displayer::Display(FeaturePtr theFeature,
                              const TopoDS_Shape& theShape, const bool isUpdateViewer)
 {
   Handle(AIS_InteractiveContext) aContext = AISContext();
@@ -58,7 +58,7 @@ bool XGUI_Displayer::isVisible(boost::shared_ptr<ModelAPI_Feature> theFeature)
 
 std::list<XGUI_ViewerPrs> XGUI_Displayer::getSelected(const int theShapeTypeToSkip)
 {
-  std::set<boost::shared_ptr<ModelAPI_Feature> > aPrsFeatures;
+  std::set<FeaturePtr > aPrsFeatures;
   std::list<XGUI_ViewerPrs> aPresentations;
 
   Handle(AIS_InteractiveContext) aContext = AISContext();
@@ -69,7 +69,7 @@ std::list<XGUI_ViewerPrs> XGUI_Displayer::getSelected(const int theShapeTypeToSk
     if (theShapeTypeToSkip >= 0 && !aShape.IsNull() && aShape.ShapeType() == theShapeTypeToSkip)
       continue;
 
-    boost::shared_ptr<ModelAPI_Feature> aFeature = getFeature(anIO);
+    FeaturePtr aFeature = getFeature(anIO);
     if (aPrsFeatures.find(aFeature) != aPrsFeatures.end())
       continue;
     Handle(SelectMgr_EntityOwner) anOwner = aContext->SelectedOwner();
@@ -81,7 +81,7 @@ std::list<XGUI_ViewerPrs> XGUI_Displayer::getSelected(const int theShapeTypeToSk
 
 std::list<XGUI_ViewerPrs> XGUI_Displayer::getHighlighted(const int theShapeTypeToSkip)
 {
-  std::set<boost::shared_ptr<ModelAPI_Feature> > aPrsFeatures;
+  std::set<FeaturePtr > aPrsFeatures;
   std::list<XGUI_ViewerPrs> aPresentations;
 
   Handle(AIS_InteractiveContext) aContext = AISContext();
@@ -91,7 +91,7 @@ std::list<XGUI_ViewerPrs> XGUI_Displayer::getHighlighted(const int theShapeTypeT
     if (theShapeTypeToSkip >= 0 && !aShape.IsNull() && aShape.ShapeType() == theShapeTypeToSkip)
       continue;
 
-    boost::shared_ptr<ModelAPI_Feature> aFeature = getFeature(anIO);
+    FeaturePtr aFeature = getFeature(anIO);
     if (aPrsFeatures.find(aFeature) != aPrsFeatures.end())
       continue;
     aPresentations.push_back(XGUI_ViewerPrs(aFeature, aShape, NULL));
@@ -101,7 +101,7 @@ std::list<XGUI_ViewerPrs> XGUI_Displayer::getHighlighted(const int theShapeTypeT
   return aPresentations;
 }
 
-void XGUI_Displayer::erase(boost::shared_ptr<ModelAPI_Feature> theFeature,
+void XGUI_Displayer::erase(FeaturePtr theFeature,
                            const bool isUpdateViewer)
 {
   if (myFeature2AISObjectMap.find(theFeature) == myFeature2AISObjectMap.end())
@@ -120,7 +120,7 @@ void XGUI_Displayer::erase(boost::shared_ptr<ModelAPI_Feature> theFeature,
     updateViewer();
 }
 
-bool XGUI_Displayer::redisplay(boost::shared_ptr<ModelAPI_Feature> theFeature,
+bool XGUI_Displayer::redisplay(FeaturePtr theFeature,
                                Handle(AIS_InteractiveObject) theAIS,
                                const int theSelectionMode,
                                const bool isUpdateViewer)
@@ -157,7 +157,7 @@ bool XGUI_Displayer::redisplay(boost::shared_ptr<ModelAPI_Feature> theFeature,
   return isCreated;
 }
 
-void XGUI_Displayer::activateInLocalContext(boost::shared_ptr<ModelAPI_Feature> theFeature,
+void XGUI_Displayer::activateInLocalContext(FeaturePtr theFeature,
                                          const std::list<int>& theModes, const bool isUpdateViewer)
 {
   Handle(AIS_InteractiveContext) aContext = AISContext();
@@ -194,7 +194,7 @@ void XGUI_Displayer::stopSelection(const std::list<XGUI_ViewerPrs>& theFeatures,
 
   Handle(AIS_Shape) anAIS;
   std::list<XGUI_ViewerPrs>::const_iterator anIt = theFeatures.begin(), aLast = theFeatures.end();
-  boost::shared_ptr<ModelAPI_Feature> aFeature;
+  FeaturePtr aFeature;
   for (; anIt != aLast; anIt++) {
     aFeature = (*anIt).feature();
     if (isVisible(aFeature))
@@ -222,7 +222,7 @@ void XGUI_Displayer::setSelected(const std::list<XGUI_ViewerPrs>& theFeatures, c
   Handle(AIS_InteractiveContext) aContext = AISContext();
 
   std::list<XGUI_ViewerPrs>::const_iterator anIt = theFeatures.begin(), aLast = theFeatures.end();
-  boost::shared_ptr<ModelAPI_Feature> aFeature;
+  FeaturePtr aFeature;
 
   Handle(AIS_Shape) anAIS;
   // we need to unhighligth objects manually in the current local context
@@ -271,10 +271,10 @@ void XGUI_Displayer::eraseDeletedFeatures(const bool isUpdateViewer)
 
   FeatureToAISMap::const_iterator aFIt = myFeature2AISObjectMap.begin(),
                                   aFLast = myFeature2AISObjectMap.end();
-  std::list<boost::shared_ptr<ModelAPI_Feature>> aRemoved;
+  std::list<FeaturePtr> aRemoved;
   for (; aFIt != aFLast; aFIt++)
   {
-    boost::shared_ptr<ModelAPI_Feature> aFeature = (*aFIt).first;
+    FeaturePtr aFeature = (*aFIt).first;
     if (!aFeature || !aFeature->data() || !aFeature->data()->isValid()) {
       Handle(AIS_InteractiveObject) anAIS = (*aFIt).second;
       if (!anAIS.IsNull()) {
@@ -283,7 +283,7 @@ void XGUI_Displayer::eraseDeletedFeatures(const bool isUpdateViewer)
       }
     }
   }
-  std::list<boost::shared_ptr<ModelAPI_Feature>>::const_iterator anIt = aRemoved.begin(),
+  std::list<FeaturePtr>::const_iterator anIt = aRemoved.begin(),
                                                                  aLast = aRemoved.end();
   for (; anIt != aLast; anIt++) {
     myFeature2AISObjectMap.erase(myFeature2AISObjectMap.find(*anIt));
@@ -299,7 +299,7 @@ void XGUI_Displayer::closeLocalContexts(const bool isUpdateViewer)
 }
 
 Handle(AIS_InteractiveObject) XGUI_Displayer::getAISObject(
-                                              boost::shared_ptr<ModelAPI_Feature> theFeature) const
+                                              FeaturePtr theFeature) const
 {
   Handle(AIS_InteractiveObject) anIO;
   if (myFeature2AISObjectMap.find(theFeature) != myFeature2AISObjectMap.end())
@@ -307,9 +307,9 @@ Handle(AIS_InteractiveObject) XGUI_Displayer::getAISObject(
   return anIO;
 }
 
-boost::shared_ptr<ModelAPI_Feature> XGUI_Displayer::getFeature(Handle(AIS_InteractiveObject) theIO) const
+FeaturePtr XGUI_Displayer::getFeature(Handle(AIS_InteractiveObject) theIO) const
 {
-  boost::shared_ptr<ModelAPI_Feature> aFeature;
+  FeaturePtr aFeature;
   FeatureToAISMap::const_iterator aFIt = myFeature2AISObjectMap.begin(),
                                   aFLast = myFeature2AISObjectMap.end();
   for (; aFIt != aFLast && !aFeature; aFIt++) {
index d0d4789d7b928638835d8cfd3832aa686b5ad3f0..b8389af5d52539dab819b34850fbd125663f17ed 100644 (file)
@@ -15,6 +15,8 @@
 #include <AIS_InteractiveContext.hxx>
 #include <NCollection_List.hxx>
 
+#include <ModelAPI_Feature.h>
+
 #include <XGUI_ViewerPrs.h>
 
 #include <map>
@@ -44,18 +46,18 @@ public:
 
   /// Returns the feature visibility state.
   /// \param theFeature a feature instance
-  bool isVisible(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  bool isVisible(FeaturePtr theFeature);
 
   /// Display the feature. Obtain the visualized object from the feature.
   /// \param theFeature a feature instance
   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
-  //void Display(boost::shared_ptr<ModelAPI_Feature> theFeature, const bool isUpdateViewer = true);
+  //void Display(FeaturePtr theFeature, const bool isUpdateViewer = true);
 
   /// Display the feature and a shape. This shape would be associated to the given feature
   /// \param theFeature a feature instance
   /// \param theShape a shape
   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
-  //void Display(boost::shared_ptr<ModelAPI_Feature> theFeature, const TopoDS_Shape& theShape,
+  //void Display(FeaturePtr theFeature, const TopoDS_Shape& theShape,
   //             const bool isUpdateViewer = true);
   
   /// Returns a list of viewer selected presentations
@@ -73,7 +75,7 @@ public:
   /// \param theAIS an AIS object
   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
   /// \returns true if the presentation is created
-  bool redisplay(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  bool redisplay(FeaturePtr theFeature,
                  Handle(AIS_InteractiveObject) theAIS,
                  const int theSelectionMode, const bool isUpdateViewer = true);
 
@@ -87,7 +89,7 @@ public:
   /// \param theShape a shape
   /// \param theMode a list of local selection modes
   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
-  void activateInLocalContext(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  void activateInLocalContext(FeaturePtr theFeature,
                               const std::list<int>& theModes, const bool isUpdateViewer = true);
 
   /// Stop the current selection and color the given features to the selection color
@@ -105,7 +107,7 @@ public:
   /// Erase the feature and a shape.
   /// \param theFeature a feature instance
   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
-  void erase(boost::shared_ptr<ModelAPI_Feature> theFeature, const bool isUpdateViewer = true);
+  void erase(FeaturePtr theFeature, const bool isUpdateViewer = true);
 
   /// Erase all presentations
   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
@@ -125,13 +127,13 @@ public:
   /// Searches the interactive object by feature
   /// \param theFeature the feature or NULL if it not visualized
   /// \return theIO an interactive object
-  Handle(AIS_InteractiveObject) getAISObject(boost::shared_ptr<ModelAPI_Feature> theFeature) const;
+  Handle(AIS_InteractiveObject) getAISObject(FeaturePtr theFeature) const;
 
 protected:
   /// Searches the feature by interactive object
   /// \param theIO an interactive object
   /// \return feature the feature or NULL if it not visualized
-  boost::shared_ptr<ModelAPI_Feature> getFeature(Handle(AIS_InteractiveObject) theIO) const;
+  FeaturePtr getFeature(Handle(AIS_InteractiveObject) theIO) const;
   /// Deactivate local selection
   /// \param isUpdateViewer the state wether the viewer should be updated immediatelly
   void closeAllContexts(const bool isUpdateViewer);
@@ -142,7 +144,7 @@ protected:
 protected:
   XGUI_Workshop* myWorkshop;
 
-  typedef std::map<boost::shared_ptr<ModelAPI_Feature>, Handle(AIS_InteractiveObject) > FeatureToAISMap;
+  typedef std::map<FeaturePtr, Handle(AIS_InteractiveObject) > FeatureToAISMap;
   FeatureToAISMap myFeature2AISObjectMap;
 };
 
index f511a5750a38d3b40f86638087076ae0b16b645d..ce30a89c1e61c31fc11f76982403f8acbddd69a8 100644 (file)
@@ -119,7 +119,7 @@ QWidget* XGUI_PropertyPanel::contentWidget()
   return myCustomWidget;
 }
 
-void XGUI_PropertyPanel::updateContentWidget(boost::shared_ptr<ModelAPI_Feature> theFeature)
+void XGUI_PropertyPanel::updateContentWidget(FeaturePtr theFeature)
 {
   foreach(ModuleBase_ModelWidget* eachWidget, myWidgets) {
     eachWidget->restoreValue(theFeature);
index d034d728903641885564db7737e56e2748e61d74..67c9857c305f004482025fec025d18ec239abb86 100644 (file)
@@ -30,7 +30,7 @@ public:
   virtual bool eventFilter(QObject *theObject, QEvent *theEvent);
 
 public slots:
-  void updateContentWidget(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  void updateContentWidget(FeaturePtr theFeature);
   /// slot to set the focus to the widget visualized an attribute with the given name
   /// \param theAttributteName
   void onFocusActivated(const std::string& theAttributeName);
index 339d08369551b6128bcff4b93083563a4150848e..3148bc274b06024ee92ff0c92168b7826726455b 100644 (file)
@@ -56,13 +56,13 @@ QRect makeRect(const int x1, const int y1, const int x2, const int y2)
 }
 
 //******************************************************************
-bool isModelObject(boost::shared_ptr<ModelAPI_Feature> theFeature)
+bool isModelObject(FeaturePtr theFeature)
 {
   return theFeature && !theFeature->data();
 }
 
 //******************************************************************
-std::string featureInfo(boost::shared_ptr<ModelAPI_Feature> theFeature)
+std::string featureInfo(FeaturePtr theFeature)
 {
   std::ostringstream aStream; 
   if (theFeature)
index d20260f8e3046847cc6d0b53c51f0f1e021e2190..f2f2b9d88c5b98a2abc2a9c89d47b7c7f8fe9645 100644 (file)
@@ -5,10 +5,11 @@
 #include <QString>
 #include <QRect>
 
+#include <ModelAPI_Feature.h>
+
 #include <boost/shared_ptr.hpp>
 
 class TopoDS_Shape;
-class ModelAPI_Feature;
 /*!
  \brief Return directory part of the file path.
 
@@ -64,13 +65,13 @@ namespace XGUI_Tools
    Returns true if the feature is a model object
    \param theFeature a feature
   */
-  bool XGUI_EXPORT isModelObject(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  bool XGUI_EXPORT isModelObject(FeaturePtr theFeature);
 
   /*!
    Returns the string presentation of the given feature
    \param theFeature a feature
   */
-  std::string XGUI_EXPORT featureInfo(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  std::string XGUI_EXPORT featureInfo(FeaturePtr theFeature);
 }
 
 #endif
index 50cc05d88eaa20ec3524804d5752df06197eb72e..e0958f76fc6417fd2cbf50bbb543b8b4000882c2 100644 (file)
@@ -10,7 +10,7 @@ XGUI_ViewerPrs::XGUI_ViewerPrs()
 {
 }
 
-XGUI_ViewerPrs::XGUI_ViewerPrs(boost::shared_ptr<ModelAPI_Feature> theFeature,
+XGUI_ViewerPrs::XGUI_ViewerPrs(FeaturePtr theFeature,
                                const TopoDS_Shape& theShape,
                                Handle(SelectMgr_EntityOwner) theOwner)
 : myFeature(theFeature), myShape(theShape), myOwner(theOwner)
@@ -21,12 +21,12 @@ XGUI_ViewerPrs::~XGUI_ViewerPrs()
 {
 }
 
-void XGUI_ViewerPrs::setFeature(boost::shared_ptr<ModelAPI_Feature> theFeature)
+void XGUI_ViewerPrs::setFeature(FeaturePtr theFeature)
 {
   myFeature = theFeature;
 }
 
-boost::shared_ptr<ModelAPI_Feature> XGUI_ViewerPrs::feature() const
+FeaturePtr XGUI_ViewerPrs::feature() const
 {
   return myFeature;
 }
index b0e046b4edc55b1f6f77ef6c19e301a1e0c71fb7..585b65cc37a8dffd705a1e6f21271c488cc1dac9 100644 (file)
@@ -11,7 +11,7 @@
 #include <TopoDS_Shape.hxx>
 #include <SelectMgr_EntityOwner.hxx>
 
-class ModelAPI_Feature;
+#include <ModelAPI_Feature.h>
 
 /**\class XGUI_ViewerPrs
  * \ingroup GUI
@@ -26,7 +26,7 @@ public:
   /// \param theFeature a model feature
   /// \param theShape a viewer shape
   /// \param theOwner a selection owner
-  XGUI_ViewerPrs(boost::shared_ptr<ModelAPI_Feature> theFeature,
+  XGUI_ViewerPrs(FeaturePtr theFeature,
                  const TopoDS_Shape& theShape,
                  Handle_SelectMgr_EntityOwner theOwner);
   /// Destructor
@@ -34,11 +34,11 @@ public:
 
   /// Sets the feature.
   /// \param theFeature a feature instance
-  void setFeature(boost::shared_ptr<ModelAPI_Feature> theFeature);
+  void setFeature(FeaturePtr theFeature);
 
   /// Returns the feature.
   /// \return a feature instance
-  boost::shared_ptr<ModelAPI_Feature> feature() const;
+  FeaturePtr feature() const;
 
   /// Returns the presentation owner
   /// \param the owner
@@ -57,7 +57,7 @@ public:
   const TopoDS_Shape& shape() const;
 
 private:
-  boost::shared_ptr<ModelAPI_Feature> myFeature; /// the feature
+  FeaturePtr myFeature; /// the feature
   Handle(SelectMgr_EntityOwner) myOwner; /// the selection owner
   TopoDS_Shape myShape; /// the shape
 };