]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
authornds <natalia.donis@opencascade.com>
Wed, 25 Jun 2014 16:25:26 +0000 (20:25 +0400)
committernds <natalia.donis@opencascade.com>
Wed, 25 Jun 2014 16:25:26 +0000 (20:25 +0400)
1. Remove feature presentation. Functionality is moved to SketchPlugin and ModelWidget.

23 files changed:
src/PartSet/CMakeLists.txt
src/PartSet/PartSet_Constants.h
src/PartSet/PartSet_ConstraintDistancePrs.cpp [deleted file]
src/PartSet/PartSet_ConstraintDistancePrs.h [deleted file]
src/PartSet/PartSet_ConstraintLengthPrs.cpp [deleted file]
src/PartSet/PartSet_ConstraintLengthPrs.h [deleted file]
src/PartSet/PartSet_ConstraintRadiusPrs.cpp [deleted file]
src/PartSet/PartSet_ConstraintRadiusPrs.h [deleted file]
src/PartSet/PartSet_FeatureArcPrs.cpp [deleted file]
src/PartSet/PartSet_FeatureArcPrs.h [deleted file]
src/PartSet/PartSet_FeatureCirclePrs.cpp [deleted file]
src/PartSet/PartSet_FeatureCirclePrs.h [deleted file]
src/PartSet/PartSet_FeatureLinePrs.cpp [deleted file]
src/PartSet/PartSet_FeatureLinePrs.h [deleted file]
src/PartSet/PartSet_FeaturePointPrs.cpp [deleted file]
src/PartSet/PartSet_FeaturePointPrs.h [deleted file]
src/PartSet/PartSet_FeaturePrs.cpp [deleted file]
src/PartSet/PartSet_FeaturePrs.h [deleted file]
src/PartSet/PartSet_OperationFeatureCreate.cpp
src/PartSet/PartSet_OperationFeatureCreate.h
src/PartSet/PartSet_TestOCC.cpp
src/PartSet/PartSet_Tools.cpp
src/PartSet/PartSet_Tools.h

index 794def4031699f30dbb6472fe2a2acd48d809776..a111f81615c78088ba59030839c09e24d9462ae7 100644 (file)
@@ -5,15 +5,7 @@ SET(CMAKE_AUTOMOC ON)
 SET(PROJECT_HEADERS
        PartSet.h
        PartSet_Constants.h
-       PartSet_ConstraintDistancePrs.h
-       PartSet_ConstraintLengthPrs.h
-       PartSet_ConstraintRadiusPrs.h
        PartSet_EditLine.h
-       PartSet_FeatureArcPrs.h
-       PartSet_FeatureCirclePrs.h
-       PartSet_FeaturePrs.h
-       PartSet_FeatureLinePrs.h
-       PartSet_FeaturePointPrs.h
        PartSet_Listener.h
        PartSet_Module.h
        PartSet_OperationFeatureCreate.h
@@ -26,15 +18,7 @@ SET(PROJECT_HEADERS
 )
 
 SET(PROJECT_SOURCES
-       PartSet_ConstraintDistancePrs.cpp
-       PartSet_ConstraintLengthPrs.cpp
-       PartSet_ConstraintRadiusPrs.cpp
        PartSet_EditLine.cpp
-       PartSet_FeaturePrs.cpp
-       PartSet_FeatureArcPrs.cpp
-       PartSet_FeatureCirclePrs.cpp
-       PartSet_FeatureLinePrs.cpp
-       PartSet_FeaturePointPrs.cpp
        PartSet_Listener.cpp
        PartSet_Module.cpp
        PartSet_OperationFeatureCreate.cpp
index f55b58048ac9a6cf20b3f6a946ded91eebd2e631..17c0f5e5f63aaa88f320cb931b7ae998fde1dc6c 100644 (file)
@@ -9,16 +9,6 @@
 
 /// This file contains various constants used in the PartSet module
 
-/// Types of viewer selection in an operation
-enum PartSet_SelectionMode
-{
-  SM_FirstPoint,
-  SM_SecondPoint,
-  SM_ThirdPoint,
-  SM_LastPoint,
-  SM_DonePoint
-};
-
 ////const int CONSTRAINT_TEXT_HEIGHT = 28; /// the text height of the constraint
 ////const int CONSTRAINT_TEXT_SELECTION_TOLERANCE = 20; /// the text selection tolerance
 
diff --git a/src/PartSet/PartSet_ConstraintDistancePrs.cpp b/src/PartSet/PartSet_ConstraintDistancePrs.cpp
deleted file mode 100644 (file)
index 8dc195a..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-// File:        PartSet_FeaturePrs.h
-// Created:     16 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#include <PartSet_ConstraintDistancePrs.h>
-#include <PartSet_Tools.h>
-
-#include <PartSet_FeatureLinePrs.h>
-
-#include <SketchPlugin_Feature.h>
-#include <SketchPlugin_Sketch.h>
-#include <SketchPlugin_Line.h>
-#include <SketchPlugin_Point.h>
-#include <SketchPlugin_ConstraintDistance.h>
-
-#include <GeomDataAPI_Point2D.h>
-#include <GeomAPI_Pnt2d.h>
-#include <GeomAPI_Lin2d.h>
-#include <GeomAPI_Pln.h>
-
-#include <ModelAPI_Data.h>
-#include <ModelAPI_Document.h>
-#include <ModelAPI_AttributeRefAttr.h>
-#include <ModelAPI_AttributeRefList.h>
-#include <ModelAPI_AttributeDouble.h>
-
-#include <AIS_InteractiveObject.hxx>
-#include <AIS_LengthDimension.hxx>
-
-#include <Precision.hxx>
-#include <gp_Pln.hxx>
-
-using namespace std;
-
-PartSet_ConstraintDistancePrs::PartSet_ConstraintDistancePrs(FeaturePtr theSketch)
-: PartSet_FeaturePrs(theSketch)
-{
-}
-
-std::string PartSet_ConstraintDistancePrs::getKind()
-{
-  return SKETCH_CONSTRAINT_DISTANCE_KIND;
-}
-
-PartSet_SelectionMode PartSet_ConstraintDistancePrs::setFeature(FeaturePtr theFeature, const PartSet_SelectionMode& theMode)
-{
-  PartSet_SelectionMode aMode = theMode;
-  if (!feature() || !theFeature)
-    return aMode;
-
-  std::string anArgument;
-  if (theMode == SM_FirstPoint) {
-    anArgument = CONSTRAINT_ATTR_ENTITY_A;
-    aMode = SM_SecondPoint;
-  }
-  else if (theMode == SM_SecondPoint) {
-    anArgument = CONSTRAINT_ATTR_ENTITY_B;
-    aMode = SM_LastPoint;
-  }
-  if (theFeature->getKind() == SKETCH_POINT_KIND)
-  {
-    // set length feature
-    boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
-    boost::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
-          boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(anArgument));
-    aRef->setFeature(theFeature);
-  }
-
-  if (theMode == SM_SecondPoint) {
-    // set length value
-    boost::shared_ptr<GeomDataAPI_Point2D> aPoint_A = getFeaturePoint(feature(), CONSTRAINT_ATTR_ENTITY_A);
-    boost::shared_ptr<GeomDataAPI_Point2D> aPoint_B = getFeaturePoint(feature(), CONSTRAINT_ATTR_ENTITY_B);
-
-    if (aPoint_A && aPoint_B) {
-      double aLenght = aPoint_A->pnt()->distance(aPoint_B->pnt());
-      PartSet_Tools::setFeatureValue(feature(), aLenght, CONSTRAINT_ATTR_VALUE);
-    }
-  }
-
-  return aMode;
-}
-
-PartSet_SelectionMode PartSet_ConstraintDistancePrs::setPoint(double theX, double theY,
-                                                         const PartSet_SelectionMode& theMode)
-{
-  PartSet_SelectionMode aMode = theMode;
-  switch (theMode)
-  {
-    case SM_LastPoint: {
-      boost::shared_ptr<GeomDataAPI_Point2D> aFlyOutAttr = 
-        boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(feature()->data()->attribute(CONSTRAINT_ATTR_FLYOUT_VALUE_PNT));
-      aFlyOutAttr->setValue(boost::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(theX, theY)));
-
-      boost::shared_ptr<GeomAPI_Pnt2d> aFlyOutPnt = aFlyOutAttr->pnt();
-
-      aMode = SM_DonePoint;
-    }
-    break;
-    default:
-      break;
-  }
-  return aMode;
-}
-
-boost::shared_ptr<GeomDataAPI_Point2D> PartSet_ConstraintDistancePrs::getFeaturePoint
-                                                               (FeaturePtr theFeature,
-                                                                const std::string& theAttribute)
-{
-  boost::shared_ptr<GeomDataAPI_Point2D> aPointAttr;
-
-  FeaturePtr aFeature = PartSet_Tools::feature(theFeature, theAttribute, SKETCH_POINT_KIND);
-  if (aFeature)
-    aPointAttr = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
-                                           (aFeature->data()->attribute(POINT_ATTR_COORD));
-  return aPointAttr;
-}
-
-std::string PartSet_ConstraintDistancePrs::getAttribute(const PartSet_SelectionMode& theMode) const
-{
-  return "";
-}
-
-PartSet_SelectionMode PartSet_ConstraintDistancePrs::getNextMode(const std::string& theAttribute) const
-{
-  return SM_FirstPoint;
-}
-
-boost::shared_ptr<GeomDataAPI_Point2D> PartSet_ConstraintDistancePrs::featurePoint
-                                                     (const PartSet_SelectionMode& theMode)
-{
-  return boost::shared_ptr<GeomDataAPI_Point2D>();
-}
diff --git a/src/PartSet/PartSet_ConstraintDistancePrs.h b/src/PartSet/PartSet_ConstraintDistancePrs.h
deleted file mode 100644 (file)
index 8d71154..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-// File:        PartSet_ConstraintDistancePrs.h
-// Created:     16 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#ifndef PartSet_ConstraintDistancePrs_H
-#define PartSet_ConstraintDistancePrs_H
-
-#include "PartSet.h"
-
-#include "PartSet_FeaturePrs.h"
-#include "PartSet_Constants.h"
-
-class GeomDataAPI_Point2D;
-class Handle_AIS_InteractiveObject;
-
-/*!
- \class PartSet_ConstraintDistancePrs
- * \brief The class to define the circle feature manipulation. It is created for
- * the feature create operation to move out the feature properties set and use one operation
- * for any type of features.
-*/
-class PARTSET_EXPORT PartSet_ConstraintDistancePrs : public PartSet_FeaturePrs
-{
-public:
-  /// Returns the feature type processed by this presentation
-  /// \return the feature kind
-  static std::string getKind();
-
-  /// Constructor
-  /// \param theSketch the sketch feature
-  PartSet_ConstraintDistancePrs(FeaturePtr theSketch);
-  /// Destructor
-  virtual ~PartSet_ConstraintDistancePrs() {};
-
-  /// Sets the feature to to a feature attribute depending on the selection mode
-  /// \param theFeature a feature instance
-  /// \param theMode the selection mode
-  /// \return whether the feature is set
-  virtual PartSet_SelectionMode setFeature(FeaturePtr theFeature, const PartSet_SelectionMode& theMode);
-
-  /// Sets the point to the feature in an attribute depending on the selection mode
-  /// \param theX the 2D point horizontal coordinate
-  /// \param theY the 2D point vertical coordinate
-  /// \param theMode the selection mode
-  /// \return the new selection mode
-  virtual PartSet_SelectionMode setPoint(double theX, double theY,
-                                         const PartSet_SelectionMode& theMode);
-
-  /// Returns the feature attribute name for the selection mode
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const;
-
-  /// Returns the next selection mode after the attribute
-  /// \param theAttribute the feature attribute name
-  /// \return next attribute selection mode
-  virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const;
-
-protected:
-  /// Returns the feature point in the selection mode position.
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode);
-
-private:
-  /// Find the feature point
-  /// \param theFeature the constraint feature
-  /// \param theAttribute a distance constraint attribute name of feature
-  /// \return the point in the feature
-  static boost::shared_ptr<GeomDataAPI_Point2D> getFeaturePoint(FeaturePtr theFeature,
-                                                                const std::string& theAttribute);
-};
-
-#endif
diff --git a/src/PartSet/PartSet_ConstraintLengthPrs.cpp b/src/PartSet/PartSet_ConstraintLengthPrs.cpp
deleted file mode 100644 (file)
index 9e41402..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-// File:        PartSet_FeaturePrs.h
-// Created:     16 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#include <PartSet_ConstraintLengthPrs.h>
-#include <PartSet_Tools.h>
-#include <PartSet_Constants.h>
-
-#include <PartSet_FeatureLinePrs.h>
-
-#include <SketchPlugin_Feature.h>
-#include <SketchPlugin_Sketch.h>
-#include <SketchPlugin_Line.h>
-#include <SketchPlugin_ConstraintLength.h>
-
-#include <GeomDataAPI_Point.h>
-#include <GeomDataAPI_Point2D.h>
-#include <GeomDataAPI_Dir.h>
-#include <GeomAPI_Pnt2d.h>
-#include <GeomAPI_Lin2d.h>
-#include <GeomAPI_Pln.h>
-
-#include <AIS_InteractiveObject.hxx>
-#include <AIS_LengthDimension.hxx>
-
-#include <ModelAPI_Data.h>
-#include <ModelAPI_Document.h>
-#include <ModelAPI_AttributeRefAttr.h>
-#include <ModelAPI_AttributeRefList.h>
-#include <ModelAPI_AttributeDouble.h>
-
-#include <AIS_InteractiveObject.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Pnt.hxx>
-#include <Precision.hxx>
-
-using namespace std;
-
-PartSet_ConstraintLengthPrs::PartSet_ConstraintLengthPrs(FeaturePtr theSketch)
-: PartSet_FeaturePrs(theSketch)
-{
-}
-
-std::string PartSet_ConstraintLengthPrs::getKind()
-{
-  return SKETCH_CONSTRAINT_LENGTH_KIND;
-}
-
-PartSet_SelectionMode PartSet_ConstraintLengthPrs::setFeature(FeaturePtr theFeature, const PartSet_SelectionMode& theMode)
-{
-  PartSet_SelectionMode aMode = theMode;
-  if (feature() && theFeature && theFeature->getKind() == SKETCH_LINE_KIND && theMode == SM_FirstPoint)
-  {
-    // set length feature
-    boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
-    boost::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
-          boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(CONSTRAINT_ATTR_ENTITY_A));
-    aRef->setFeature(theFeature);
-
-    // set length value
-    aData = theFeature->data();
-    boost::shared_ptr<GeomDataAPI_Point2D> aPoint1 =
-          boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(LINE_ATTR_START));
-    boost::shared_ptr<GeomDataAPI_Point2D> aPoint2 =
-          boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(LINE_ATTR_END));
-
-    double aLenght = aPoint1->pnt()->distance(aPoint2->pnt());
-    PartSet_Tools::setFeatureValue(feature(), aLenght, CONSTRAINT_ATTR_VALUE);
-    aMode = SM_LastPoint;
-  }
-  return aMode;
-}
-
-PartSet_SelectionMode PartSet_ConstraintLengthPrs::setPoint(double theX, double theY,
-                                                         const PartSet_SelectionMode& theMode)
-{
-  PartSet_SelectionMode aMode = theMode;
-  switch (theMode)
-  {
-    case SM_LastPoint: {
-      boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
-      boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = 
-              boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(CONSTRAINT_ATTR_ENTITY_A));
-      FeaturePtr aFeature;
-      if (anAttr) {
-        aFeature = anAttr->feature();
-        if (aFeature->getKind() != SKETCH_LINE_KIND) {
-          aFeature = FeaturePtr();
-        }
-      }
-      boost::shared_ptr<GeomAPI_Pnt2d> aPoint = boost::shared_ptr<GeomAPI_Pnt2d>
-                                                             (new GeomAPI_Pnt2d(theX, theY));
-      boost::shared_ptr<GeomAPI_Lin2d> aFeatureLin = PartSet_FeatureLinePrs::createLin2d(aFeature);
-      boost::shared_ptr<GeomAPI_Pnt2d> aResult = aFeatureLin->project(aPoint);
-      double aDistance = aPoint->distance(aResult);
-
-      if (!aFeatureLin->isRight(aPoint))
-        aDistance = -aDistance;
-
-      //AttributeDoublePtr aFlyoutAttr = 
-      //    boost::dynamic_pointer_cast<ModelAPI_AttributeDouble>(aData->attribute(CONSTRAINT_ATTR_FLYOUT_VALUE));
-      //aFlyoutAttr->setValue(aDistance);
-
-      aMode = SM_DonePoint;
-    }
-    break;
-    default:
-      break;
-  }
-  return aMode;
-}
-
-std::string PartSet_ConstraintLengthPrs::getAttribute(const PartSet_SelectionMode& theMode) const
-{
-  return "";
-}
-
-PartSet_SelectionMode PartSet_ConstraintLengthPrs::getNextMode(const std::string& theAttribute) const
-{
-  return SM_FirstPoint;
-}
-
-boost::shared_ptr<GeomDataAPI_Point2D> PartSet_ConstraintLengthPrs::featurePoint
-                                                     (const PartSet_SelectionMode& theMode)
-{
-  return boost::shared_ptr<GeomDataAPI_Point2D>();
-}
diff --git a/src/PartSet/PartSet_ConstraintLengthPrs.h b/src/PartSet/PartSet_ConstraintLengthPrs.h
deleted file mode 100644 (file)
index e00b549..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-// File:        PartSet_ConstraintLengthPrs.h
-// Created:     16 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#ifndef PartSet_ConstraintLengthPrs_H
-#define PartSet_ConstraintLengthPrs_H
-
-#include "PartSet.h"
-
-#include "PartSet_FeaturePrs.h"
-#include "PartSet_Constants.h"
-
-class GeomDataAPI_Point2D;
-class Handle_AIS_InteractiveObject;
-
-/*!
- \class PartSet_ConstraintLengthPrs
- * \brief The class to define the circle feature manipulation. It is created for
- * the feature create operation to move out the feature properties set and use one operation
- * for any type of features.
-*/
-class PARTSET_EXPORT PartSet_ConstraintLengthPrs : public PartSet_FeaturePrs
-{
-public:
-  /// Returns the feature type processed by this presentation
-  /// \return the feature kind
-  static std::string getKind();
-
-  /// Constructor
-  /// \param theSketch the sketch feature
-  PartSet_ConstraintLengthPrs(FeaturePtr theSketch);
-  /// Destructor
-  virtual ~PartSet_ConstraintLengthPrs() {};
-
-  /// Sets the feature to to a feature attribute depending on the selection mode
-  /// \param theFeature a feature instance
-  /// \param theMode the selection mode
-  /// \return whether the feature is set
-  virtual PartSet_SelectionMode setFeature(FeaturePtr theFeature, const PartSet_SelectionMode& theMode);
-
-  /// Sets the point to the feature in an attribute depending on the selection mode
-  /// \param theX the 2D point horizontal coordinate
-  /// \param theY the 2D point vertical coordinate
-  /// \param theMode the selection mode
-  /// \return the new selection mode
-  virtual PartSet_SelectionMode setPoint(double theX, double theY,
-                                         const PartSet_SelectionMode& theMode);
-
-  /// Returns the feature attribute name for the selection mode
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const;
-
-  /// Returns the next selection mode after the attribute
-  /// \param theAttribute the feature attribute name
-  /// \return next attribute selection mode
-  virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const;
-
-protected:
-  /// Returns the feature point in the selection mode position.
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode);
-};
-
-#endif
diff --git a/src/PartSet/PartSet_ConstraintRadiusPrs.cpp b/src/PartSet/PartSet_ConstraintRadiusPrs.cpp
deleted file mode 100644 (file)
index 92caca8..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-// File:        PartSet_FeaturePrs.h
-// Created:     16 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#include <PartSet_ConstraintRadiusPrs.h>
-#include <PartSet_Tools.h>
-
-#include <PartSet_FeatureCirclePrs.h>
-#include <PartSet_FeatureArcPrs.h>
-
-#include <SketchPlugin_Feature.h>
-#include <SketchPlugin_Sketch.h>
-#include <SketchPlugin_Line.h>
-#include <SketchPlugin_Circle.h>
-#include <SketchPlugin_Arc.h>
-#include <SketchPlugin_ConstraintRadius.h>
-
-#include <GeomDataAPI_Point.h>
-#include <GeomDataAPI_Point2D.h>
-#include <GeomDataAPI_Dir.h>
-#include <GeomAPI_Pnt2d.h>
-#include <GeomAPI_Lin2d.h>
-#include <GeomAPI_Pln.h>
-#include <GeomAPI_Dir.h>
-
-#include <GeomAlgoAPI_EdgeBuilder.h>
-
-#include <ModelAPI_Data.h>
-#include <ModelAPI_Document.h>
-#include <ModelAPI_AttributeRefAttr.h>
-#include <ModelAPI_AttributeRefList.h>
-#include <ModelAPI_AttributeDouble.h>
-
-#include <AIS_InteractiveObject.hxx>
-#include <AIS_RadiusDimension.hxx>
-#include <Precision.hxx>
-#include <gp_Circ.hxx>
-#include <V3d_View.hxx>
-
-using namespace std;
-
-PartSet_ConstraintRadiusPrs::PartSet_ConstraintRadiusPrs(FeaturePtr theSketch)
-: PartSet_FeaturePrs(theSketch)
-{
-}
-
-std::string PartSet_ConstraintRadiusPrs::getKind()
-{
-  return SKETCH_CONSTRAINT_RADIUS_KIND;
-}
-
-PartSet_SelectionMode PartSet_ConstraintRadiusPrs::setFeature(FeaturePtr theFeature, const PartSet_SelectionMode& theMode)
-{
-  PartSet_SelectionMode aMode = theMode;
-  if (!feature() || theMode != SM_FirstPoint || !theFeature) {
-    return aMode;
-  }
-  std::string aKind = theFeature->getKind();
-  if (aKind == SKETCH_CIRCLE_KIND || aKind == SKETCH_ARC_KIND) {
-    // set length feature
-    boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
-    boost::shared_ptr<ModelAPI_AttributeRefAttr> aRef =
-          boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(CONSTRAINT_ATTR_ENTITY_A));
-    aRef->setFeature(theFeature);
-
-    double aLength = 50;
-    bool isValid;
-    if (aKind == SKETCH_CIRCLE_KIND) {
-      aLength = PartSet_Tools::featureValue(theFeature, CIRCLE_ATTR_RADIUS, isValid);
-    }
-    else if (aKind == SKETCH_ARC_KIND) {
-      aLength = PartSet_FeatureArcPrs::radius(theFeature);
-    }
-
-    PartSet_Tools::setFeatureValue(feature(), aLength, CONSTRAINT_ATTR_VALUE);
-    aMode = SM_LastPoint;
-  }
-  return aMode;
-}
-
-PartSet_SelectionMode PartSet_ConstraintRadiusPrs::setPoint(double theX, double theY,
-                                                         const PartSet_SelectionMode& theMode)
-{
-  PartSet_SelectionMode aMode = theMode;
-  switch (theMode)
-  {
-    case SM_LastPoint: {
-      boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
-
-      boost::shared_ptr<GeomAPI_Pnt2d> aPoint = boost::shared_ptr<GeomAPI_Pnt2d>
-                                                             (new GeomAPI_Pnt2d(theX, theY));
-
-      //PartSet_Tools::setFeaturePoint(feature(), theX, theY, SKETCH_CONSTRAINT_ATTR_CIRCLE_POINT);
-
-      //double aDistance = 40;
-      //AttributeDoublePtr aFlyoutAttr = 
-      //    boost::dynamic_pointer_cast<ModelAPI_AttributeDouble>(aData->attribute(CONSTRAINT_ATTR_FLYOUT_VALUE));
-      //aFlyoutAttr->setValue(aDistance);
-
-      aMode = SM_LastPoint;
-    }
-    break;
-    default:
-      break;
-  }
-  return aMode;
-}
-
-void PartSet_ConstraintRadiusPrs::projectPointOnFeature(FeaturePtr theFeature, FeaturePtr theSketch,
-                                                        gp_Pnt& thePoint, Handle(V3d_View) theView,
-                                                        double& theX, double& theY)
-{
-  boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
-  boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = 
-          boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(CONSTRAINT_ATTR_ENTITY_A));
-  if (!anAttr)
-    return;
-  FeaturePtr aFeature = anAttr->feature();
-  if (!aFeature)
-    return;
-
-  gp_Circ aCircle;
-  gp_Pnt anAnchorPoint;
-  if (aFeature->getKind() == SKETCH_CIRCLE_KIND) {
-    PartSet_FeatureCirclePrs::projectPointOnFeature(aFeature, theSketch, thePoint, theView, theX, theY);
-  }
-  else if (aFeature->getKind() == SKETCH_ARC_KIND) {
-    PartSet_FeatureArcPrs::projectPointOnFeature(aFeature, theSketch, thePoint, theView, theX, theY);
-  }
-  // TODO: a bug in AIS_RadiusDimension:
-  // The anchor point can't be myCirc.Location() - an exception is raised.
-  // But we need exactly this case...
-  // We want to show a radius dimension starting from the circle centre and 
-  // ending at the user-defined point.
-  // Also, if anchor point coincides with myP2, the radius dimension is not displayed at all.
-  double aDelta = 1/1000.0;
-  theX += aDelta;
-  theY += aDelta;
-}
-
-std::string PartSet_ConstraintRadiusPrs::getAttribute(const PartSet_SelectionMode& theMode) const
-{
-  return "";
-}
-
-PartSet_SelectionMode PartSet_ConstraintRadiusPrs::getNextMode(const std::string& theAttribute) const
-{
-  return SM_FirstPoint;
-}
-
-boost::shared_ptr<GeomDataAPI_Point2D> PartSet_ConstraintRadiusPrs::featurePoint
-                                                     (const PartSet_SelectionMode& theMode)
-{
-  return boost::shared_ptr<GeomDataAPI_Point2D>();
-}
diff --git a/src/PartSet/PartSet_ConstraintRadiusPrs.h b/src/PartSet/PartSet_ConstraintRadiusPrs.h
deleted file mode 100644 (file)
index 48585dc..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-// File:        PartSet_ConstraintRadiusPrs.h
-// Created:     16 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#ifndef PartSet_ConstraintRadiusPrs_H
-#define PartSet_ConstraintRadiusPrs_H
-
-#include "PartSet.h"
-
-#include "PartSet_FeaturePrs.h"
-#include "PartSet_Constants.h"
-
-#include <gp_Pnt.hxx>
-
-class GeomDataAPI_Point2D;
-class Handle_AIS_InteractiveObject;
-class Handle_V3d_View;
-
-/*!
- \class PartSet_ConstraintRadiusPrs
- * \brief The class to define the circle feature manipulation. It is created for
- * the feature create operation to move out the feature properties set and use one operation
- * for any type of features.
-*/
-class PARTSET_EXPORT PartSet_ConstraintRadiusPrs : public PartSet_FeaturePrs
-{
-public:
-  /// Returns the feature type processed by this presentation
-  /// \return the feature kind
-  static std::string getKind();
-
-  /// Constructor
-  /// \param theSketch the sketch feature
-  PartSet_ConstraintRadiusPrs(FeaturePtr theSketch);
-  /// Destructor
-  virtual ~PartSet_ConstraintRadiusPrs() {};
-
-  /// Sets the feature to to a feature attribute depending on the selection mode
-  /// \param theFeature a feature instance
-  /// \param theMode the selection mode
-  /// \return whether the feature is set
-  virtual PartSet_SelectionMode setFeature(FeaturePtr theFeature, const PartSet_SelectionMode& theMode);
-
-  /// Sets the point to the feature in an attribute depending on the selection mode
-  /// \param theX the 2D point horizontal coordinate
-  /// \param theY the 2D point vertical coordinate
-  /// \param theMode the selection mode
-  /// \return the new selection mode
-  virtual PartSet_SelectionMode setPoint(double theX, double theY,
-                                         const PartSet_SelectionMode& theMode);
-
-  /// Returns the feature attribute name for the selection mode
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const;
-
-  /// Returns the next selection mode after the attribute
-  /// \param theAttribute the feature attribute name
-  /// \return next attribute selection mode
-  virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const;
-
-  /// Project the view point on the feature. The output coordinates belong to the feature
-  /// \param theFeature a feature
-  /// \param theSketch the sketch feature
-  /// \param thePoint a viewer point
-  /// \param theView the OCC view
-  /// \theX the output horizontal coordinate of a projected point
-  /// \theY the output vertical coordinate of a projected point
-  static void projectPointOnFeature(FeaturePtr theFeature, FeaturePtr theSketch, gp_Pnt& thePoint,
-                                    Handle_V3d_View theView, double& theX, double& theY);
-
-protected:
-  /// Returns the feature point in the selection mode position.
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode);
-};
-
-#endif
diff --git a/src/PartSet/PartSet_FeatureArcPrs.cpp b/src/PartSet/PartSet_FeatureArcPrs.cpp
deleted file mode 100644 (file)
index 440f562..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-// File:        PartSet_FeaturePrs.h
-// Created:     04 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#include <PartSet_FeatureArcPrs.h>
-#include <PartSet_Tools.h>
-
-#include <SketchPlugin_Feature.h>
-#include <SketchPlugin_Sketch.h>
-#include <SketchPlugin_Arc.h>
-
-#include <GeomDataAPI_Point2D.h>
-#include <GeomAPI_Pnt2d.h>
-#include <GeomAPI_Circ2d.h>
-
-#include <ModelAPI_Data.h>
-#include <ModelAPI_Document.h>
-#include <ModelAPI_AttributeRefAttr.h>
-#include <ModelAPI_AttributeRefList.h>
-
-#include <V3d_View.hxx>
-
-#include <Precision.hxx>
-
-using namespace std;
-
-PartSet_FeatureArcPrs::PartSet_FeatureArcPrs(FeaturePtr theSketch)
-: PartSet_FeaturePrs(theSketch)
-{
-}
-
-std::string PartSet_FeatureArcPrs::getKind()
-{
-  return SKETCH_ARC_KIND;
-}
-
-PartSet_SelectionMode PartSet_FeatureArcPrs::setPoint(double theX, double theY,
-                                                       const PartSet_SelectionMode& theMode)
-{
-  PartSet_SelectionMode aMode = theMode;
-  switch (theMode)
-  {
-    case SM_FirstPoint: {
-      PartSet_Tools::setFeaturePoint(feature(), theX, theY, ARC_ATTR_CENTER);
-      aMode = SM_SecondPoint;
-    }
-    break;
-    case SM_SecondPoint: {
-      PartSet_Tools::setFeaturePoint(feature(), theX, theY, ARC_ATTR_START);
-      aMode = SM_ThirdPoint;
-   }
-   break;
-   case SM_ThirdPoint: {
-     PartSet_Tools::setFeaturePoint(feature(), theX, theY, ARC_ATTR_END);
-     aMode = SM_DonePoint;
-   }
-    break;
-    default:
-      break;
-  }
-  return aMode;
-}
-
-std::string PartSet_FeatureArcPrs::getAttribute(const PartSet_SelectionMode& theMode) const
-{
-  std::string aAttribute;
-  switch (theMode)
-  {
-    case SM_FirstPoint:
-      aAttribute = ARC_ATTR_CENTER;
-    break;
-    case SM_SecondPoint:
-      aAttribute = ARC_ATTR_START;
-    break;
-    case SM_ThirdPoint:
-      aAttribute = ARC_ATTR_END;
-    break;
-    default:
-    break;
-  }
-  return aAttribute;
-}
-
-PartSet_SelectionMode PartSet_FeatureArcPrs::getNextMode(const std::string& theAttribute) const
-{
-  PartSet_SelectionMode aMode;
-
-  if (theAttribute == ARC_ATTR_CENTER)
-    aMode = SM_SecondPoint;
-  else if (theAttribute == ARC_ATTR_START)
-    aMode = SM_ThirdPoint;
-  else if (theAttribute == ARC_ATTR_END)
-    aMode = SM_DonePoint;
-  return aMode;
-}
-
-void PartSet_FeatureArcPrs::projectPointOnFeature(FeaturePtr theFeature, FeaturePtr theSketch,
-                                                  gp_Pnt& thePoint, Handle(V3d_View) theView,
-                                                  double& theX, double& theY)
-{
-  FeaturePtr aSketch = theSketch;
-  if (aSketch) {
-    double aX, anY;
-    PartSet_Tools::convertTo2D(thePoint, aSketch, theView, aX, anY);
-
-    // circle origin point and radius
-    boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
-    boost::shared_ptr<GeomDataAPI_Point2D> aCenter = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
-                                                              (aData->attribute(ARC_ATTR_CENTER));
-    boost::shared_ptr<GeomDataAPI_Point2D> aStart = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
-                                                              (aData->attribute(ARC_ATTR_START));
-
-    boost::shared_ptr<GeomAPI_Circ2d> aCirc(new GeomAPI_Circ2d(aCenter->pnt(), aStart->pnt()));
-    boost::shared_ptr<GeomAPI_Pnt2d> aGeomPoint2d(new GeomAPI_Pnt2d(aX, anY));
-    boost::shared_ptr<GeomAPI_Pnt2d> aPnt2d = aCirc->project(aGeomPoint2d);
-    if (aPnt2d) {
-      theX = aPnt2d->x();
-      theY = aPnt2d->y();
-    }
-  }
-}
-
-boost::shared_ptr<GeomDataAPI_Point2D> PartSet_FeatureArcPrs::featurePoint
-                                                     (const PartSet_SelectionMode& theMode)
-{
-  std::string aPointArg;
-  switch (theMode)
-  {
-    case SM_FirstPoint:
-      aPointArg = ARC_ATTR_CENTER;
-      break;
-    case SM_SecondPoint:
-      aPointArg = ARC_ATTR_START;
-      break;
-    case SM_ThirdPoint:
-      aPointArg = ARC_ATTR_END;
-      break;
-    default:
-      break;
-  }
-  boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
-  boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
-                                                              (aData->attribute(aPointArg));
-  return aPoint;
-}
-
-double PartSet_FeatureArcPrs::radius(FeaturePtr theFeature)
-{
-  if (!theFeature)
-    return 0;
-
-  boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
-
-  boost::shared_ptr<GeomDataAPI_Point2D> aCenterAttr = 
-    boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(ARC_ATTR_CENTER));
-  boost::shared_ptr<GeomDataAPI_Point2D> aStartAttr = 
-    boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(ARC_ATTR_START));
-  
-  return aCenterAttr->pnt()->distance(aStartAttr->pnt());
-}
diff --git a/src/PartSet/PartSet_FeatureArcPrs.h b/src/PartSet/PartSet_FeatureArcPrs.h
deleted file mode 100644 (file)
index fd0bff9..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-// File:        PartSet_FeatureArcPrs.h
-// Created:     04 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#ifndef PartSet_FeatureArcPrs_H
-#define PartSet_FeatureArcPrs_H
-
-#include "PartSet.h"
-
-#include "PartSet_FeaturePrs.h"
-#include "PartSet_Constants.h"
-
-#include <gp_Pnt.hxx>
-
-class GeomDataAPI_Point2D;
-class Handle_V3d_View;
-
-/*!
- \class PartSet_FeatureArcPrs
- * \brief The class to define the circle arc feature manipulation. It is created for
- * the feature create operation to move out the feature properties set and use one operation
- * for any type of features.
-*/
-class PARTSET_EXPORT PartSet_FeatureArcPrs : public PartSet_FeaturePrs
-{
-public:
-  /// Returns the feature type processed by this presentation
-  /// \return the feature kind
-  static std::string getKind();
-
-  /// Constructor
-  /// \param theSketch the sketch feature
-  PartSet_FeatureArcPrs(FeaturePtr theSketch);
-  /// Destructor
-  virtual ~PartSet_FeatureArcPrs() {};
-
-  /// Sets the point to the feature in an attribute depending on the selection mode
-  /// \param theX the 2D point horizontal coordinate
-  /// \param theY the 2D point vertical coordinate
-  /// \param theMode the selection mode
-  /// \return the new selection mode
-  virtual PartSet_SelectionMode setPoint(double theX, double theY,
-                                         const PartSet_SelectionMode& theMode);
-
-  /// Returns the feature attribute name for the selection mode
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const;
-
-  /// Returns the next selection mode after the attribute
-  /// \param theAttribute the feature attribute name
-  /// \return next attribute selection mode
-  virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const;
-
-  /// Project the view point on the feature. The output coordinates belong to the feature
-  /// \param theFeature a feature
-  /// \param theSketch the sketch feature
-  /// \param thePoint a viewer point
-  /// \param theView the OCC view
-  /// \theX the output horizontal coordinate of a projected point
-  /// \theY the output vertical coordinate of a projected point
-  static void projectPointOnFeature(FeaturePtr theFeature, FeaturePtr theSketch, gp_Pnt& thePoint,
-                                    Handle_V3d_View theView, double& theX, double& theY);
-
-  /// Computes the feature's radius
-  /// \param theFeature an arc feature
-  /// \return the double value
-  static double radius(FeaturePtr theFeature);
-
-protected:
-  /// Returns the feature point in the selection mode position.
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode);
-};
-
-#endif
diff --git a/src/PartSet/PartSet_FeatureCirclePrs.cpp b/src/PartSet/PartSet_FeatureCirclePrs.cpp
deleted file mode 100644 (file)
index 426d9f1..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-// File:        PartSet_FeaturePrs.h
-// Created:     04 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#include <PartSet_FeatureCirclePrs.h>
-#include <PartSet_Tools.h>
-
-#include <SketchPlugin_Feature.h>
-#include <SketchPlugin_Sketch.h>
-#include <SketchPlugin_Circle.h>
-
-#include <GeomDataAPI_Point2D.h>
-#include <GeomDataAPI_Dir.h>
-#include <GeomAPI_Pnt2d.h>
-#include <GeomAPI_Circ2d.h>
-#include <GeomAPI_Dir2d.h>
-#include <GeomAPI_Dir.h>
-
-#include <ModelAPI_Data.h>
-#include <ModelAPI_Document.h>
-#include <ModelAPI_AttributeRefAttr.h>
-#include <ModelAPI_AttributeRefList.h>
-
-#include <V3d_View.hxx>
-#include <Precision.hxx>
-
-using namespace std;
-
-PartSet_FeatureCirclePrs::PartSet_FeatureCirclePrs(FeaturePtr theSketch)
-: PartSet_FeaturePrs(theSketch)
-{
-}
-
-std::string PartSet_FeatureCirclePrs::getKind()
-{
-  return SKETCH_CIRCLE_KIND;
-}
-
-PartSet_SelectionMode PartSet_FeatureCirclePrs::setPoint(double theX, double theY,
-                                                         const PartSet_SelectionMode& theMode)
-{
-  PartSet_SelectionMode aMode = theMode;
-  switch (theMode)
-  {
-    case SM_FirstPoint: {
-      PartSet_Tools::setFeaturePoint(feature(), theX, theY, CIRCLE_ATTR_CENTER);
-      aMode = SM_SecondPoint;
-    }
-    break;
-    case SM_SecondPoint: {
-      boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
-      boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
-                                                                  (aData->attribute(CIRCLE_ATTR_CENTER));
-      boost::shared_ptr<GeomAPI_Pnt2d> aCoordPoint(new GeomAPI_Pnt2d(theX, theY));
-      double aRadius = aCoordPoint->distance(aPoint->pnt());
-      PartSet_Tools::setFeatureValue(feature(), aRadius, CIRCLE_ATTR_RADIUS);
-
-      aMode = SM_DonePoint;
-   }
-    break;
-    default:
-      break;
-  }
-  return aMode;
-}
-
-std::string PartSet_FeatureCirclePrs::getAttribute(const PartSet_SelectionMode& theMode) const
-{
-  std::string aAttribute;
-  switch (theMode)
-  {
-    case SM_FirstPoint:
-      aAttribute = CIRCLE_ATTR_CENTER;
-    break;
-    case SM_SecondPoint:
-      aAttribute = CIRCLE_ATTR_RADIUS;
-    break;
-    default:
-    break;
-  }
-  return aAttribute;
-}
-
-PartSet_SelectionMode PartSet_FeatureCirclePrs::getNextMode(const std::string& theAttribute) const
-{
-  PartSet_SelectionMode aMode;
-
-  if (theAttribute == CIRCLE_ATTR_CENTER)
-    aMode = SM_SecondPoint;
-  else if (theAttribute == CIRCLE_ATTR_RADIUS)
-    aMode = SM_DonePoint;
-  return aMode;
-}
-
-void PartSet_FeatureCirclePrs::projectPointOnFeature(FeaturePtr theFeature, FeaturePtr theSketch,
-                                                     gp_Pnt& thePoint, Handle(V3d_View) theView,
-                                                     double& theX, double& theY)
-{
-  FeaturePtr aSketch = theSketch;
-  if (aSketch) {
-    double aX, anY;
-    PartSet_Tools::convertTo2D(thePoint, aSketch, theView, aX, anY);
-
-    // circle origin point and radius
-    boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
-    boost::shared_ptr<GeomDataAPI_Point2D> aCenter = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
-                                                              (aData->attribute(CIRCLE_ATTR_CENTER));
-    bool isValid;
-    double aRadius = PartSet_Tools::featureValue(theFeature, CIRCLE_ATTR_RADIUS, isValid);
-
-    boost::shared_ptr<GeomAPI_Dir2d> aNormal(new GeomAPI_Dir2d(aX, anY));
-    boost::shared_ptr<GeomAPI_Circ2d> aCirc(new GeomAPI_Circ2d(aCenter->pnt(), aNormal, aRadius));
-    boost::shared_ptr<GeomAPI_Pnt2d> aGeomPoint2d(new GeomAPI_Pnt2d(aX, anY));
-    boost::shared_ptr<GeomAPI_Pnt2d> aPnt2d = aCirc->project(aGeomPoint2d);
-    if (aPnt2d) {
-      theX = aPnt2d->x();
-      theY = aPnt2d->y();
-    }
-  }
-}
-
-boost::shared_ptr<GeomDataAPI_Point2D> PartSet_FeatureCirclePrs::featurePoint
-                                                     (const PartSet_SelectionMode& theMode)
-{
-  std::string aPointArg;
-  switch (theMode)
-  {
-    case SM_FirstPoint:
-      aPointArg = CIRCLE_ATTR_CENTER;
-      break;
-    default:
-      break;
-  }
-  boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
-  boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
-                                                              (aData->attribute(aPointArg));
-  return aPoint;
-}
diff --git a/src/PartSet/PartSet_FeatureCirclePrs.h b/src/PartSet/PartSet_FeatureCirclePrs.h
deleted file mode 100644 (file)
index f9688b1..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// File:        PartSet_FeatureCirclePrs.h
-// Created:     04 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#ifndef PartSet_FeatureCirclePrs_H
-#define PartSet_FeatureCirclePrs_H
-
-#include "PartSet.h"
-
-#include "PartSet_FeaturePrs.h"
-#include "PartSet_Constants.h"
-
-#include <gp_Pnt.hxx>
-
-class GeomDataAPI_Point2D;
-class Handle_V3d_View;
-
-/*!
- \class PartSet_FeatureCirclePrs
- * \brief The class to define the circle feature manipulation. It is created for
- * the feature create operation to move out the feature properties set and use one operation
- * for any type of features.
-*/
-class PARTSET_EXPORT PartSet_FeatureCirclePrs : public PartSet_FeaturePrs
-{
-public:
-  /// Returns the feature type processed by this presentation
-  /// \return the feature kind
-  static std::string getKind();
-
-  /// Constructor
-  /// \param theSketch the sketch feature
-  PartSet_FeatureCirclePrs(FeaturePtr theSketch);
-  /// Destructor
-  virtual ~PartSet_FeatureCirclePrs() {};
-
-  /// Sets the point to the feature in an attribute depending on the selection mode
-  /// \param theX the 2D point horizontal coordinate
-  /// \param theY the 2D point vertical coordinate
-  /// \param theMode the selection mode
-  /// \return the new selection mode
-  virtual PartSet_SelectionMode setPoint(double theX, double theY,
-                                         const PartSet_SelectionMode& theMode);
-
-  /// Returns the feature attribute name for the selection mode
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const;
-
-  /// Returns the next selection mode after the attribute
-  /// \param theAttribute the feature attribute name
-  /// \return next attribute selection mode
-  virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const;
-
-  /// Project the view point on the feature. The output coordinates belong to the feature
-  /// \param theFeature a feature
-  /// \param theSketch the sketch feature
-  /// \param thePoint a viewer point
-  /// \param theView the OCC view
-  /// \theX the output horizontal coordinate of a projected point
-  /// \theY the output vertical coordinate of a projected point
-  static void projectPointOnFeature(FeaturePtr theFeature, FeaturePtr theSketch, gp_Pnt& thePoint,
-                                    Handle_V3d_View theView, double& theX, double& theY);
-
-protected:
-  /// Returns the feature point in the selection mode position.
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode);
-};
-
-#endif
diff --git a/src/PartSet/PartSet_FeatureLinePrs.cpp b/src/PartSet/PartSet_FeatureLinePrs.cpp
deleted file mode 100644 (file)
index fe4c3a5..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-// File:        PartSet_FeaturePrs.h
-// Created:     04 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#include <PartSet_FeatureLinePrs.h>
-#include <PartSet_Tools.h>
-
-#include <SketchPlugin_Feature.h>
-#include <SketchPlugin_Sketch.h>
-#include <SketchPlugin_ConstraintCoincidence.h>
-#include <SketchPlugin_Line.h>
-#include <SketchPlugin_Constraint.h>
-
-#include <GeomDataAPI_Point2D.h>
-#include <GeomAPI_Lin2d.h>
-#include <GeomAPI_Pnt2d.h>
-
-#include <ModelAPI_Data.h>
-#include <ModelAPI_Document.h>
-#include <ModelAPI_AttributeRefAttr.h>
-#include <ModelAPI_AttributeRefList.h>
-
-#include <Precision.hxx>
-#include <V3d_View.hxx>
-
-using namespace std;
-
-PartSet_FeatureLinePrs::PartSet_FeatureLinePrs(FeaturePtr theSketch)
-: PartSet_FeaturePrs(theSketch)
-{
-}
-
-std::string PartSet_FeatureLinePrs::getKind()
-{
-  return SKETCH_LINE_KIND;
-}
-
-PartSet_SelectionMode PartSet_FeatureLinePrs::setPoint(double theX, double theY,
-                                                       const PartSet_SelectionMode& theMode)
-{
-  PartSet_SelectionMode aMode = theMode;
-  switch (theMode)
-  {
-    case SM_FirstPoint: {
-      PartSet_Tools::setFeaturePoint(feature(), theX, theY, LINE_ATTR_START);
-      PartSet_Tools::setFeaturePoint(feature(), theX, theY, LINE_ATTR_END);
-      aMode = SM_SecondPoint;
-    }
-    break;
-    case SM_SecondPoint: {
-      PartSet_Tools::setFeaturePoint(feature(), theX, theY, LINE_ATTR_END);
-      aMode = SM_DonePoint;
-   }
-    break;
-    default:
-      break;
-  }
-  return aMode;
-}
-
-PartSet_SelectionMode PartSet_FeatureLinePrs::setFeature(FeaturePtr theFeature, const PartSet_SelectionMode& theMode)
-{
-  PartSet_SelectionMode aMode = theMode;
-  if (feature() && theFeature && theMode == SM_FirstPoint)
-  {
-    // use the last point of the previous feature as the first of the new one
-    boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
-    boost::shared_ptr<GeomDataAPI_Point2D> anInitPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
-                                                                  (aData->attribute(LINE_ATTR_END));
-    PartSet_Tools::setFeaturePoint(feature(), anInitPoint->x(), anInitPoint->y(), LINE_ATTR_START);
-    PartSet_Tools::setFeaturePoint(feature(), anInitPoint->x(), anInitPoint->y(), LINE_ATTR_END);
-
-    aData = feature()->data();
-    boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
-                                                                 (aData->attribute(LINE_ATTR_START));
-    PartSet_Tools::createConstraint(sketch(), anInitPoint, aPoint);
-    aMode = SM_SecondPoint;
-  }
-  return aMode;
-}
-
-std::string PartSet_FeatureLinePrs::getAttribute(const PartSet_SelectionMode& theMode) const
-{
-  std::string aAttribute;
-  switch (theMode)
-  {
-    case SM_FirstPoint:
-      aAttribute = LINE_ATTR_START;
-    break;
-    case SM_SecondPoint:
-      aAttribute = LINE_ATTR_END;
-    break;
-    default:
-    break;
-  }
-  return aAttribute;
-}
-
-PartSet_SelectionMode PartSet_FeatureLinePrs::getNextMode(const std::string& theAttribute) const
-{
-  PartSet_SelectionMode aMode;
-
-  if (theAttribute == LINE_ATTR_START)
-    aMode = SM_SecondPoint;
-  else if (theAttribute == LINE_ATTR_END)
-    aMode = SM_DonePoint;
-  return aMode;
-}
-
-void PartSet_FeatureLinePrs::projectPointOnLine(FeaturePtr theFeature,
-                                                const PartSet_SelectionMode& theMode,
-                                                const gp_Pnt& thePoint, Handle(V3d_View) theView,
-                                                double& theX, double& theY)
-{
-  if (theFeature && theFeature->getKind() == getKind()) {
-    double X0, X1;
-    double Y0, Y1;
-
-    PartSet_Tools::convertTo2D(thePoint, sketch(), theView, X1, Y1);
-    boost::shared_ptr<GeomAPI_Pnt2d> aPoint = boost::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(X1, Y1));
-    boost::shared_ptr<GeomAPI_Lin2d> aFeatureLin = PartSet_FeatureLinePrs::createLin2d(theFeature);
-
-    switch (theMode) {
-      case SM_FirstPoint: {
-        boost::shared_ptr<GeomAPI_Pnt2d> aResult = aFeatureLin->project(aPoint);
-        theX = aResult->x();
-        theY = aResult->y();
-      }
-      break;
-      case SM_SecondPoint: {
-        getLinePoint(feature(), LINE_ATTR_START, X0, Y0);
-        boost::shared_ptr<GeomAPI_Lin2d> aCurrentLin = boost::shared_ptr<GeomAPI_Lin2d>
-                                                           (new GeomAPI_Lin2d(X0, Y0, X1, Y1));
-        boost::shared_ptr<GeomAPI_Pnt2d> aResult = aFeatureLin->intersect(aCurrentLin);
-        boost::shared_ptr<GeomAPI_Pnt2d> aPoint0 = boost::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(X0, Y0));
-        if (aResult->distance(aPoint0) < Precision::Confusion()) { // the start point is nearest to the line
-          // if the first point of a line belongs to the given line
-          // we need to project the second point on the same line
-          aResult = aFeatureLin->project(aPoint);
-        }
-        theX = aResult->x();
-        theY = aResult->y();
-      }
-      break;
-      default:
-      break;
-    }
-  }
-}
-
-boost::shared_ptr<GeomAPI_Lin2d> PartSet_FeatureLinePrs::createLin2d(FeaturePtr theFeature)
-{
-  boost::shared_ptr<GeomAPI_Lin2d> aFeatureLin;
-  if (!theFeature || theFeature->getKind() != PartSet_FeatureLinePrs::getKind())
-    return aFeatureLin;
-
-  double aStartX, aStartY, anEndX, anEndY;
-  getLinePoint(theFeature, LINE_ATTR_START, aStartX, aStartY);
-  getLinePoint(theFeature, LINE_ATTR_END, anEndX, anEndY);
-
-  aFeatureLin = boost::shared_ptr<GeomAPI_Lin2d>
-                                        (new GeomAPI_Lin2d(aStartX, aStartY, anEndX, anEndY));
-  return aFeatureLin;
-}
-
-boost::shared_ptr<GeomDataAPI_Point2D> PartSet_FeatureLinePrs::featurePoint
-                                                     (const PartSet_SelectionMode& theMode)
-{
-  std::string aPointArg;
-  switch (theMode)
-  {
-    case SM_FirstPoint:
-      aPointArg = LINE_ATTR_START;
-      break;
-    case SM_SecondPoint:
-      aPointArg = LINE_ATTR_END;
-      break;
-    default:
-      break;
-  }
-  boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
-  boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
-                                                              (aData->attribute(aPointArg));
-  return aPoint;
-}
-
-void PartSet_FeatureLinePrs::getLinePoint(FeaturePtr theFeature, const std::string& theAttribute,
-                                          double& theX, double& theY)
-{
-  if (!theFeature || theFeature->getKind() != PartSet_FeatureLinePrs::getKind())
-    return;
-  boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
-  boost::shared_ptr<GeomDataAPI_Point2D> aPoint =
-        boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(theAttribute));
-  theX = aPoint->x();
-  theY = aPoint->y();
-}
diff --git a/src/PartSet/PartSet_FeatureLinePrs.h b/src/PartSet/PartSet_FeatureLinePrs.h
deleted file mode 100644 (file)
index b9f2cfa..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-// File:        PartSet_FeatureLinePrs.h
-// Created:     04 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#ifndef PartSet_FeatureLinePrs_H
-#define PartSet_FeatureLinePrs_H
-
-#include "PartSet.h"
-
-#include "PartSet_FeaturePrs.h"
-#include "PartSet_Constants.h"
-
-#include <gp_Pnt.hxx>
-
-class GeomDataAPI_Point2D;
-class GeomAPI_Lin2d;
-class Handle_V3d_View;
-
-/*!
- \class PartSet_FeatureLinePrs
- * \brief The class to define the line feature manipulation. It is created for
- * the feature create operation to move out the feature properties set and use one operation
- * for any type of features.
-*/
-class PARTSET_EXPORT PartSet_FeatureLinePrs : public PartSet_FeaturePrs
-{
-public:
-  /// Returns the feature type processed by this presentation
-  /// \return the feature kind
-  static std::string getKind();
-
-  /// Constructor
-  /// \param theSketch the sketch feature
-  PartSet_FeatureLinePrs(FeaturePtr theSketch);
-  /// Destructor
-  virtual ~PartSet_FeatureLinePrs() {};
-
-  /// Sets the point to the feature in an attribute depending on the selection mode
-  /// \param theX the 2D point horizontal coordinate
-  /// \param theY the 2D point vertical coordinate
-  /// \param theMode the selection mode
-  /// \return the new selection mode
-  virtual PartSet_SelectionMode setPoint(double theX, double theY,
-                                         const PartSet_SelectionMode& theMode);
-
-  /// Sets the feature to to a feature attribute depending on the selection mode
-  /// \param theFeature a feature instance
-  /// \param theMode the selection mode
-  /// \return whether the feature is set
-  virtual PartSet_SelectionMode setFeature(FeaturePtr theFeature, const PartSet_SelectionMode& theMode);
-
-  /// Returns the feature attribute name for the selection mode
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const;
-
-  /// Returns the next selection mode after the attribute
-  /// \param theAttribute the feature attribute name
-  /// \return next attribute selection mode
-  virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const;
-
-  /// Project the point on a feature
-  /// \param theFeature the feature to be projected on
-  /// \param theMode the selection mode
-  /// \param thePoint the clicked point
-  /// \param theView the viewer
-  /// \param theX the output horizontal coordinate
-  /// \param theY the output vertical coordinate
-  void projectPointOnLine(FeaturePtr theFeature, const PartSet_SelectionMode& theMode,
-                          const gp_Pnt& thePoint, Handle_V3d_View theView,
-                          double& theX, double& theY);
-
-  /// Creates a lin 2d object on a base of the line feature
-  /// \param theFeature the line feature
-  static boost::shared_ptr<GeomAPI_Lin2d> createLin2d(FeaturePtr theFeature);
-  /// \brief Get the line point 2d coordinates.
-  /// \param theFeature the line feature
-  /// \param theAttribute the start or end attribute of the line
-  /// \param theX the horizontal coordinate
-  /// \param theY the vertical coordinate
-  static void getLinePoint(FeaturePtr theFeature, const std::string& theAttribute,
-                           double& theX, double& theY);
-
-protected:
-  /// Returns the feature point in the selection mode position.
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode);
-};
-
-#endif
diff --git a/src/PartSet/PartSet_FeaturePointPrs.cpp b/src/PartSet/PartSet_FeaturePointPrs.cpp
deleted file mode 100644 (file)
index 818206b..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-// File:        PartSet_FeaturePrs.h
-// Created:     04 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#include <PartSet_FeaturePointPrs.h>
-#include <PartSet_Tools.h>
-
-#include <SketchPlugin_Feature.h>
-#include <SketchPlugin_Sketch.h>
-#include <SketchPlugin_Point.h>
-
-#include <GeomAPI_Pnt2d.h>
-#include <GeomDataAPI_Point2D.h>
-
-#include <ModelAPI_Data.h>
-#include <ModelAPI_Document.h>
-#include <ModelAPI_AttributeRefAttr.h>
-#include <ModelAPI_AttributeRefList.h>
-
-#include <Precision.hxx>
-
-using namespace std;
-
-PartSet_FeaturePointPrs::PartSet_FeaturePointPrs(FeaturePtr theSketch)
-: PartSet_FeaturePrs(theSketch)
-{
-}
-
-std::string PartSet_FeaturePointPrs::getKind()
-{
-  return SKETCH_POINT_KIND;
-}
-
-PartSet_SelectionMode PartSet_FeaturePointPrs::setPoint(double theX, double theY,
-                                                       const PartSet_SelectionMode& theMode)
-{
-  PartSet_SelectionMode aMode = theMode;
-  switch (theMode)
-  {
-    case SM_FirstPoint: {
-      PartSet_Tools::setFeaturePoint(feature(), theX, theY, POINT_ATTR_COORD);
-      aMode = SM_DonePoint;
-    }
-    break;
-    default:
-      break;
-  }
-  return aMode;
-}
-
-std::string PartSet_FeaturePointPrs::getAttribute(const PartSet_SelectionMode& theMode) const
-{
-  std::string aAttribute;
-  switch (theMode)
-  {
-    case SM_FirstPoint:
-      aAttribute = POINT_ATTR_COORD;
-    break;
-    default:
-    break;
-  }
-  return aAttribute;
-}
-
-PartSet_SelectionMode PartSet_FeaturePointPrs::getNextMode(const std::string& theAttribute) const
-{
-  PartSet_SelectionMode aMode;
-
-  if (theAttribute == POINT_ATTR_COORD)
-    aMode = SM_DonePoint;
-  return aMode;
-}
-
-boost::shared_ptr<GeomDataAPI_Point2D> PartSet_FeaturePointPrs::featurePoint
-                                                     (const PartSet_SelectionMode& theMode)
-{
-  std::string aPointArg;
-  switch (theMode)
-  {
-    case SM_FirstPoint:
-      aPointArg = POINT_ATTR_COORD;
-      break;
-    default:
-      break;
-  }
-  boost::shared_ptr<ModelAPI_Data> aData = feature()->data();
-  boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>
-                                                              (aData->attribute(aPointArg));
-  return aPoint;
-}
diff --git a/src/PartSet/PartSet_FeaturePointPrs.h b/src/PartSet/PartSet_FeaturePointPrs.h
deleted file mode 100644 (file)
index 7fec848..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// File:        PartSet_FeaturePointPrs.h
-// Created:     04 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#ifndef PartSet_FeaturePointPrs_H
-#define PartSet_FeaturePointPrs_H
-
-#include "PartSet.h"
-
-#include "PartSet_FeaturePrs.h"
-#include "PartSet_Constants.h"
-
-class GeomDataAPI_Point2D;
-
-/*!
- \class PartSet_FeaturePointPrs
- * \brief The class to define the point feature manipulation. It is created for
- * the feature create operation to move out the feature properties set and use one operation
- * for any type of features.
-*/
-class PARTSET_EXPORT PartSet_FeaturePointPrs : public PartSet_FeaturePrs
-{
-public:
-  /// Returns the feature type processed by this presentation
-  /// \return the feature kind
-  static std::string getKind();
-
-  /// Constructor
-  /// \param theSketch the sketch feature
-  PartSet_FeaturePointPrs(FeaturePtr theSketch);
-  /// Destructor
-  virtual ~PartSet_FeaturePointPrs() {};
-
-  /// Sets the point to the feature in an attribute depending on the selection mode
-  /// \param theX the 2D point horizontal coordinate
-  /// \param theY the 2D point vertical coordinate
-  /// \param theMode the selection mode
-  /// \return the new selection mode
-  virtual PartSet_SelectionMode setPoint(double theX, double theY,
-                                         const PartSet_SelectionMode& theMode);
-
-  /// Returns the feature attribute name for the selection mode
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const;
-
-  /// Returns the next selection mode after the attribute
-  /// \param theAttribute the feature attribute name
-  /// \return next attribute selection mode
-  virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const;
-
-protected:
-  /// Returns the feature point in the selection mode position.
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode);
-};
-
-#endif
diff --git a/src/PartSet/PartSet_FeaturePrs.cpp b/src/PartSet/PartSet_FeaturePrs.cpp
deleted file mode 100644 (file)
index dfbad61..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// File:        PartSet_FeaturePrs.h
-// Created:     04 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#include <PartSet_FeaturePrs.h>
-#include <PartSet_Tools.h>
-
-#include <SketchPlugin_Feature.h>
-#include <SketchPlugin_Sketch.h>
-
-#include <GeomDataAPI_Point2D.h>
-
-#include <ModelAPI_Data.h>
-#include <ModelAPI_Document.h>
-#include <ModelAPI_AttributeRefAttr.h>
-#include <ModelAPI_AttributeRefList.h>
-
-#include <Precision.hxx>
-
-using namespace std;
-
-PartSet_FeaturePrs::PartSet_FeaturePrs(FeaturePtr theFeature)
-: mySketch(theFeature)
-{
-}
-
-PartSet_FeaturePrs::~PartSet_FeaturePrs()
-{
-}
-
-void PartSet_FeaturePrs::init(FeaturePtr theFeature)
-{
-  myFeature = theFeature;
-}
-
-FeaturePtr PartSet_FeaturePrs::sketch() const
-{
-  return mySketch;
-}
-
-FeaturePtr PartSet_FeaturePrs::feature() const
-{
-  return myFeature;
-}
-
-PartSet_SelectionMode PartSet_FeaturePrs::setFeature(FeaturePtr theFeature,
-                                                     const PartSet_SelectionMode& theMode)
-{
-  return SM_FirstPoint;
-}
diff --git a/src/PartSet/PartSet_FeaturePrs.h b/src/PartSet/PartSet_FeaturePrs.h
deleted file mode 100644 (file)
index 9adf4a0..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-// File:        PartSet_FeaturePrs.h
-// Created:     04 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#ifndef PartSet_FeaturePrs_H
-#define PartSet_FeaturePrs_H
-
-#include "PartSet.h"
-
-#include "PartSet_Constants.h"
-
-class GeomDataAPI_Point2D;
-
-/*!
- \class PartSet_FeaturePrs
- * \brief The abstract class to define the specific feature manipulation. It is created for
- * the feature create operation to move out the feature properties set and use one operation
- * for any type of features.
-*/
-class PARTSET_EXPORT PartSet_FeaturePrs
-{
-public:
-  /// Constructor
-  /// \param theSketch the sketch feature
-  PartSet_FeaturePrs(FeaturePtr theSketch);
-  /// Destructor
-  virtual ~PartSet_FeaturePrs();
-
-  /// Initializes some fields of feature accorging to the source feature
-  /// Saves the fiature as the presentation internal feature
-  /// \param theFeature the presentation feature
-  void init(FeaturePtr theFeature);
-
-  /// Returns the operation sketch feature
-  /// \returns the sketch instance
-  FeaturePtr sketch() const;
-
-  /// Sets the point to the feature in an attribute depending on the selection mode
-  /// \param theX the 2D point horizontal coordinate
-  /// \param theY the 2D point vertical coordinate
-  /// \param theMode the selection mode
-  /// \return the new selection mode
-  virtual PartSet_SelectionMode setPoint(double theX, double theY,
-                                         const PartSet_SelectionMode& theMode) = 0;
-
-  /// Sets the feature to to a feature attribute depending on the selection mode
-  /// \param theFeature a feature instance
-  /// \param theMode the selection mode
-  /// \return whether the feature is set
-  /// \return the new selection mode
-  virtual PartSet_SelectionMode setFeature(FeaturePtr theFeature, const PartSet_SelectionMode& theMode);
-
-  /// Returns the feature attribute name for the selection mode
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual std::string getAttribute(const PartSet_SelectionMode& theMode) const = 0;
-
-  /// Returns the next selection mode after the attribute
-  /// \param theAttribute the feature attribute name
-  /// \return next attribute selection mode
-  virtual PartSet_SelectionMode getNextMode(const std::string& theAttribute) const = 0;
-
-protected:
-  /// Returns the operation feature
-  /// \return the feature
-  FeaturePtr feature() const;
-
-  /// Returns the feature point in the selection mode position.
-  /// \param theMode the current operation selection mode. The feature attribute depends on the mode
-  virtual boost::shared_ptr<GeomDataAPI_Point2D> featurePoint(const PartSet_SelectionMode& theMode) = 0;
-
-private:
-  FeaturePtr mySketch; ///< the sketch of the feature
-  FeaturePtr myFeature; ///< the feature
-};
-
-#endif
index e5a54cb382e6f332335040c2d9afe5bac7e48911..794e472d3d161e272ca03a0817de6b975c4af8a5 100644 (file)
@@ -6,10 +6,6 @@
 
 #include <PartSet_Tools.h>
 #include <PartSet_OperationSketch.h>
-#include <PartSet_FeaturePointPrs.h>
-#include <PartSet_FeatureLinePrs.h>
-#include <PartSet_FeatureCirclePrs.h>
-#include <PartSet_FeatureArcPrs.h>
 
 #include <SketchPlugin_Feature.h>
 #include <SketchPlugin_Point.h>
@@ -139,12 +135,8 @@ void PartSet_OperationFeatureCreate::mouseReleased(QMouseEvent* theEvent, Handle
         PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY);
         // move to selected line
         if (feature()->getKind() == SKETCH_LINE_KIND) {
-          //boost::shared_ptr<PartSet_FeatureLinePrs> aLinePrs =
-          //                       boost::dynamic_pointer_cast<PartSet_FeatureLinePrs>(myFeaturePrs);
-          //if (aLinePrs) {
-          //  FeaturePtr aFeature = aPrs.feature();
-            //aLinePrs->projectPointOnLine(aFeature, myPointSelectionMode, aPoint, theView, aX, anY);
-          //}
+          //FeaturePtr aFeature = aPrs.feature();
+          //projectPointOnLine(aFeature, myPointSelectionMode, aPoint, theView, aX, anY);
         }
       }
     }
index f4ecd643ac96fb3b7e3bd9918c5a697dd05182ab..ddb5fe505b58eda154db60b932e3a2fcc6a16310 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <QObject>
 
-class PartSet_FeaturePrs;
 class GeomDataAPI_Point2D;
 class QMouseEvent;
 class QKeyEvent;
@@ -130,10 +129,8 @@ protected:
   bool setWidgetFeature(const FeaturePtr& theFeature);
 
 private:
-  //boost::shared_ptr<PartSet_FeaturePrs> myFeaturePrs; ///< the feature presentation
   FeaturePtr myInitFeature; ///< the initial feature
   FeaturePtr mySketch; ///< the sketch of the feature
-  //PartSet_SelectionMode myPointSelectionMode; ///< point selection mode
 
   ModuleBase_ModelWidget* myActiveWidget; ///< the active widget
 };
index 7e104ca34aa0e7885a96ea76eb142b5e583e0c05..75a16c52d89e7e93b0c65db9786cce3690752ed6 100644 (file)
@@ -9,7 +9,6 @@
 #include <XGUI_Displayer.h>
 #include <XGUI_ViewerPrs.h>
 #include <XGUI_ViewerProxy.h>
-#include <PartSet_FeaturePrs.h>
 #include <PartSet_Tools.h>
 #include <PartSet_OperationSketchBase.h>
 
index 8c6f38832bfc3005773af18777ff8073b43750c3..ca6b10adbdb8d105719c93f9674978e34d4c982c 100644 (file)
 #include <SketchPlugin_Feature.h>
 #include <SketchPlugin_Sketch.h>
 #include <SketchPlugin_ConstraintCoincidence.h>
+#include <SketchPlugin_ConstraintDistance.h>
+#include <SketchPlugin_ConstraintLength.h>
+#include <SketchPlugin_ConstraintRadius.h>
 #include <SketchPlugin_Constraint.h>
 
-#include <PartSet_FeatureLinePrs.h>
-#include <PartSet_FeaturePointPrs.h>
-#include <PartSet_FeatureCirclePrs.h>
-#include <PartSet_FeatureArcPrs.h>
-
-#include <PartSet_ConstraintLengthPrs.h>
-#include <PartSet_ConstraintRadiusPrs.h>
-#include <PartSet_ConstraintDistancePrs.h>
-
 #include <XGUI_ViewerPrs.h>
 
 #include <V3d_View.hxx>
@@ -142,41 +136,6 @@ void PartSet_Tools::convertTo3D(const double theX, const double theY,
   thePoint = gp_Pnt(aPoint->x(), aPoint->y(), aPoint->z());
 }
 
-boost::shared_ptr<PartSet_FeaturePrs> PartSet_Tools::createFeaturePrs(const std::string& theKind,
-                                                                      FeaturePtr theSketch,
-                                                                      FeaturePtr theFeature)
-{
-  boost::shared_ptr<PartSet_FeaturePrs> aFeaturePrs;
-
-  if (theKind == PartSet_FeaturePointPrs::getKind()) {
-    aFeaturePrs = boost::shared_ptr<PartSet_FeaturePrs>(new PartSet_FeaturePointPrs(theSketch));
-  }
-  else if (theKind == PartSet_FeatureLinePrs::getKind()) {
-    aFeaturePrs = boost::shared_ptr<PartSet_FeaturePrs>(new PartSet_FeatureLinePrs(theSketch));
-  }
-  else if (theKind == PartSet_FeatureCirclePrs::getKind()) {
-    aFeaturePrs = boost::shared_ptr<PartSet_FeaturePrs>(new PartSet_FeatureCirclePrs(theSketch));
-  }
-  else if (theKind == PartSet_FeatureArcPrs::getKind()) {
-    aFeaturePrs = boost::shared_ptr<PartSet_FeaturePrs>(new PartSet_FeatureArcPrs(theSketch));
-  }
-  else if (theKind == PartSet_ConstraintLengthPrs::getKind()) {
-    aFeaturePrs = boost::shared_ptr<PartSet_FeaturePrs>(new PartSet_ConstraintLengthPrs(theSketch));
-  }
-  else if (theKind == PartSet_ConstraintRadiusPrs::getKind()) {
-    aFeaturePrs = boost::shared_ptr<PartSet_ConstraintRadiusPrs>(new PartSet_ConstraintRadiusPrs(theSketch));
-  }
-  else if (theKind == PartSet_ConstraintDistancePrs::getKind()) {
-    aFeaturePrs = boost::shared_ptr<PartSet_ConstraintDistancePrs>(new PartSet_ConstraintDistancePrs(theSketch));
-  }
-
-
-  if (theFeature && aFeaturePrs)
-    aFeaturePrs->init(theFeature);
-
-  return aFeaturePrs;
-}
-
 FeaturePtr PartSet_Tools::nearestFeature(QPoint thePoint, Handle_V3d_View theView,
                                          FeaturePtr theSketch,
                                          const std::list<XGUI_ViewerPrs>& theFeatures)
@@ -381,7 +340,7 @@ boost::shared_ptr<GeomAPI_Pnt> PartSet_Tools::point3D(
 
 bool PartSet_Tools::isConstraintFeature(const std::string& theKind)
 {
-  return theKind == PartSet_ConstraintLengthPrs::getKind() ||
-         theKind == PartSet_ConstraintDistancePrs::getKind() ||
-         theKind == PartSet_ConstraintRadiusPrs::getKind();
+  return theKind == SKETCH_CONSTRAINT_DISTANCE_KIND ||
+         theKind == SKETCH_CONSTRAINT_LENGTH_KIND ||
+         theKind == SKETCH_CONSTRAINT_RADIUS_KIND;
 }
index 6aebb10322b3bdb86b80bbe937fefed7b9f539b8..fa1f31f9d765b53dedc062dfef20dbe641592787 100644 (file)
@@ -23,7 +23,6 @@ class GeomDataAPI_Point2D;
 class GeomAPI_Pln;
 class GeomAPI_Pnt2d;
 class GeomAPI_Pnt;
-class PartSet_FeaturePrs;
 
 /*!
  \class PartSet_Tools
@@ -53,14 +52,6 @@ public:
   static void convertTo3D(const double theX, const double theY, FeaturePtr theSketch,
                           gp_Pnt& thePoint);
 
-  /// Creates the feature presentation
-  /// \param theKind a feature kind
-  /// \param theSketch the sketch of the feature
-  /// \param theFeature the feature
-  static boost::shared_ptr<PartSet_FeaturePrs> createFeaturePrs(const std::string& theKind,
-                                                                FeaturePtr theSketch,
-                                                                FeaturePtr theFeature = FeaturePtr());
-
   /// Returns a feature that is under the mouse point
   /// \param thePoint a screen point
   /// \param theView a 3D view