Salome HOME
bugfix for libSketchSolver.so: removing unresolved symbols from the SketchPlugin
authorSergey BELASH <belash.sergey@opencascade.com>
Wed, 20 Aug 2014 07:48:14 +0000 (11:48 +0400)
committerSergey BELASH <belash.sergey@opencascade.com>
Wed, 20 Aug 2014 07:48:14 +0000 (11:48 +0400)
* SketchPlugin_Constraint extracted as interface for the SketchSolver
* SketchPlugin_Constraint base implemnetation for the SketchPlugin became SketchPlugin_ConstraintBase
* Refactoring: boost::shared_ptr<GeomAPI_AISObject> typedefed as AISObjectPtr

27 files changed:
src/GeomAPI/GeomAPI_AISObject.h
src/GeomAPI/GeomAPI_IPresentable.h
src/SketchPlugin/CMakeLists.txt
src/SketchPlugin/SketchPlugin_Arc.h
src/SketchPlugin/SketchPlugin_Circle.h
src/SketchPlugin/SketchPlugin_Constraint.cpp [deleted file]
src/SketchPlugin/SketchPlugin_Constraint.h
src/SketchPlugin/SketchPlugin_ConstraintBase.cpp [new file with mode: 0644]
src/SketchPlugin/SketchPlugin_ConstraintBase.h [new file with mode: 0644]
src/SketchPlugin/SketchPlugin_ConstraintCoincidence.h
src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp
src/SketchPlugin/SketchPlugin_ConstraintDistance.h
src/SketchPlugin/SketchPlugin_ConstraintLength.cpp
src/SketchPlugin/SketchPlugin_ConstraintLength.h
src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp
src/SketchPlugin/SketchPlugin_ConstraintParallel.h
src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp
src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.h
src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp
src/SketchPlugin/SketchPlugin_ConstraintRadius.h
src/SketchPlugin/SketchPlugin_Feature.cpp
src/SketchPlugin/SketchPlugin_Feature.h
src/SketchPlugin/SketchPlugin_Line.h
src/SketchPlugin/SketchPlugin_Point.h
src/SketchPlugin/SketchPlugin_Sketch.cpp
src/SketchPlugin/SketchPlugin_Sketch.h
src/SketchSolver/CMakeLists.txt

index 12b29708be3a9e77ac87e1bf45f220abbc5dc7b3..215aa69b7589da470f05c15ac9608bfe58067bb0 100644 (file)
@@ -98,5 +98,8 @@ public:
   bool empty() const;
 };
 
+//! Pointer on attribute object
+typedef boost::shared_ptr<GeomAPI_AISObject> AISObjectPtr;
+
 #endif
 
index abb154170f2be91359af5c35a3dac59d970052f8..c300c1b421e6594c40a8b5f9f3f139bc8ef4ba07 100644 (file)
@@ -16,10 +16,9 @@ public:
   /** Returns the AIS preview
   *   \param thePrevious - defines a presentation if it was created previously
   */
-  virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
-                            boost::shared_ptr<GeomAPI_AISObject> thePrevious) = 0;
+  virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious) = 0;
 };
 
 typedef boost::shared_ptr<GeomAPI_IPresentable> GeomPresentablePtr;
 
-#endif
\ No newline at end of file
+#endif
index 2cbe3e324921a683e456a8a7347dff55ec3cfcad..6895c3debc731fa037371bbffaa22d24e4296b58 100644 (file)
@@ -11,6 +11,7 @@ SET(PROJECT_HEADERS
     SketchPlugin_Circle.h
     SketchPlugin_Arc.h
     SketchPlugin_Constraint.h
+    SketchPlugin_ConstraintBase.h
     SketchPlugin_ConstraintCoincidence.h
     SketchPlugin_ConstraintDistance.h
     SketchPlugin_ConstraintLength.h
@@ -28,7 +29,7 @@ SET(PROJECT_SOURCES
     SketchPlugin_Point.cpp
     SketchPlugin_Circle.cpp
     SketchPlugin_Arc.cpp
-    SketchPlugin_Constraint.cpp
+    SketchPlugin_ConstraintBase.cpp
     SketchPlugin_ConstraintCoincidence.cpp
     SketchPlugin_ConstraintDistance.cpp
     SketchPlugin_ConstraintLength.cpp
index 3af4e2fd3a32c2f46c1b432972c67f040e3138eb..26815bc9ec1586bb04b05da1ae7ac2f8d6c61b79 100644 (file)
@@ -54,8 +54,7 @@ public:
   SKETCHPLUGIN_EXPORT virtual void initAttributes();
 
   /// Returns the AIS preview
-  virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
-                                boost::shared_ptr<GeomAPI_AISObject> thePrevious)
+  virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious)
   {return simpleAISObject(firstResult(), thePrevious);}
 
   /// Moves the feature
index 3b8dc851b08eb92722823003a6bdc5c3e0e146b5..5c7cc7aa7ff31c950067a974c371cdf9fc615c3e 100644 (file)
@@ -49,8 +49,7 @@ public:
   SKETCHPLUGIN_EXPORT virtual void initAttributes();
 
   /// Returns the AIS preview
-  virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
-                                boost::shared_ptr<GeomAPI_AISObject> thePrevious)
+  virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious)
   {return simpleAISObject(firstResult(), thePrevious);}
 
   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
diff --git a/src/SketchPlugin/SketchPlugin_Constraint.cpp b/src/SketchPlugin/SketchPlugin_Constraint.cpp
deleted file mode 100644 (file)
index 70e4d7b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// File:    SketchPlugin_Constraint.cpp
-// Created: 08 May 2014
-// Author:  Artem ZHIDKOV
-
-#include "SketchPlugin_Constraint.h"
-
-boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_Constraint::getAISObject(
-                              boost::shared_ptr<GeomAPI_AISObject> thePrevious)
-{ 
-  return thePrevious;
-}
index 5417111e399fe5948c34226ce4b683443d018d7e..01fbe230fbcdec6951020ed800177b9399367443 100644 (file)
@@ -5,40 +5,18 @@
 #ifndef SketchPlugin_Constraint_H_
 #define SketchPlugin_Constraint_H_
 
-#include "SketchPlugin.h"
-#include "SketchPlugin_Feature.h"
-#include <SketchPlugin_Sketch.h>
-#include <ModelAPI_AttributeReference.h>
-#include <ModelAPI_AttributeRefAttr.h>
+#include <SketchPlugin_Feature.h>
 
-#include <GeomAPI_IPresentable.h>
-
-#include <list>
-
-
-/*  Description: 
- *    Each constraint uses a set of parameters. In the SolveSpace library 
- *    these parameters are named "valA", "ptA", "ptB", "entityA", "entityB". 
- *    The "ptA" and "ptB" parameters represents a point in the constraint.
- *    The "entityA" and "entityB" represents any other object (and a point too).
- *    And the "valA" represents a real value.
- *
- *    The attributes below are named independent of the SolveSpace.
- *    Some of them may be unused. 
- *
- *    Also the list of possible attributes is provided to simplify assignment.
- */
+#include <string>
 
 /// Size of the list of constraint attributes
 const unsigned int CONSTRAINT_ATTR_SIZE = 4;
 
 /** \class SketchPlugin_Constraint
- *  \ingroup DataModel
- *  \brief Feature for creation of a new constraint between other features.
- *         Base class for all constraints.
+ *  \brief Abstract interface to the SketchPlugin_ConstraintBase
+ *         For more info see: SketchPlugin_ConstraintBase.h
  */
-class SketchPlugin_Constraint: public SketchPlugin_Feature, 
-                               public GeomAPI_IPresentable
+class SketchPlugin_Constraint: public SketchPlugin_Feature
 {
 public:
   /// The value parameter for the constraint
@@ -91,29 +69,6 @@ public:
     return EMPTY_STRING;
   }
 
-  /// \brief Returns to which group in the document must be added feature
-  SKETCHPLUGIN_EXPORT virtual const std::string& getGroup()
-  {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
-
-  /** \brief Adds sub-feature of the higher level feature (sub-element of the sketch)
-   *  \param theFeature sub-feature
-   */
-  SKETCHPLUGIN_EXPORT virtual const void addSub(
-    const FeaturePtr& theFeature) {}
-
-  /// Returns the AIS preview
-  SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
-                                boost::shared_ptr<GeomAPI_AISObject> thePrevious);
-
-  /// Moves the feature
-  /// \param theDeltaX the delta for X coordinate is moved
-  /// \param theDeltaY the delta for Y coordinate is moved
-  SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY) {};
-
-  /// Return the distance between the feature and the point
-  /// \param thePoint the point
-  virtual double distanceToPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint) { return 0; };
-
 protected:
   /// \brief Use plugin manager for features creation
   SketchPlugin_Constraint() {}
diff --git a/src/SketchPlugin/SketchPlugin_ConstraintBase.cpp b/src/SketchPlugin/SketchPlugin_ConstraintBase.cpp
new file mode 100644 (file)
index 0000000..b743c0b
--- /dev/null
@@ -0,0 +1,25 @@
+// File:    SketchPlugin_ConstraintBase.cpp
+// Created: 08 May 2014
+// Author:  Artem ZHIDKOV
+
+#include "SketchPlugin_ConstraintBase.h"
+
+AISObjectPtr SketchPlugin_ConstraintBase::getAISObject(AISObjectPtr thePrevious)
+{ 
+  return thePrevious;
+}
+
+const void SketchPlugin_ConstraintBase::addSub(const FeaturePtr& theFeature)
+{
+
+}
+
+void SketchPlugin_ConstraintBase::move(const double theDeltaX, const double theDeltaY)
+{
+
+}
+
+double SketchPlugin_ConstraintBase::distanceToPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint)
+{
+  return 0;
+}
diff --git a/src/SketchPlugin/SketchPlugin_ConstraintBase.h b/src/SketchPlugin/SketchPlugin_ConstraintBase.h
new file mode 100644 (file)
index 0000000..e08bf76
--- /dev/null
@@ -0,0 +1,63 @@
+// File:    SketchPlugin_ConstraintBase.h
+// Created: 08 May 2014
+// Author:  Artem ZHIDKOV
+
+#ifndef SketchPlugin_ConstraintBase_H_
+#define SketchPlugin_ConstraintBase_H_
+
+#include "SketchPlugin.h"
+#include <SketchPlugin_Constraint.h>
+#include <SketchPlugin_Sketch.h>
+#include <ModelAPI_AttributeReference.h>
+#include <ModelAPI_AttributeRefAttr.h>
+
+#include <GeomAPI_IPresentable.h>
+
+#include <list>
+
+
+/*  Description: 
+ *    Each constraint uses a set of parameters. In the SolveSpace library 
+ *    these parameters are named "valA", "ptA", "ptB", "entityA", "entityB". 
+ *    The "ptA" and "ptB" parameters represents a point in the constraint.
+ *    The "entityA" and "entityB" represents any other object (and a point too).
+ *    And the "valA" represents a real value.
+ *
+ *    The attributes below are named independent of the SolveSpace.
+ *    Some of them may be unused. 
+ *
+ *    Also the list of possible attributes is provided to simplify assignment.
+ */
+
+/** \class SketchPlugin_ConstraintBase
+ *  \ingroup DataModel
+ *  \brief Feature for creation of a new constraint between other features.
+ *         Some feature's methods implemented here as dummy to
+ *         Base class for all constraints.
+ */
+class SketchPlugin_ConstraintBase: public SketchPlugin_Constraint,
+                                   public GeomAPI_IPresentable
+{
+public:
+  /// Returns the AIS preview
+  SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
+
+  /** \brief Adds sub-feature of the higher level feature (sub-element of the sketch)
+   *  \param theFeature sub-feature
+   */
+  SKETCHPLUGIN_EXPORT virtual const void addSub(const FeaturePtr& theFeature);
+  /// Moves the feature
+  /// \param theDeltaX the delta for X coordinate is moved
+  /// \param theDeltaY the delta for Y coordinate is moved
+  SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
+
+  /// Return the distance between the feature and the point
+  /// \param thePoint the point
+  virtual double distanceToPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint);
+
+protected:
+  /// \brief Use plugin manager for features creation
+  SketchPlugin_ConstraintBase() {}
+};
+
+#endif
index 6345f59dce9f7407eed63fc6541967623da122a0..e6595af3050d83abe25d6946b2df370826d980f1 100644 (file)
@@ -6,7 +6,7 @@
 #define SketchPlugin_ConstraintCoincidence_H_
 
 #include "SketchPlugin.h"
-#include "SketchPlugin_Constraint.h"
+#include "SketchPlugin_ConstraintBase.h"
 #include <SketchPlugin_Sketch.h>
 #include <list>
 
@@ -17,7 +17,7 @@
  *  These constraint has two attributes:
  *  SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B()
  */
-class SketchPlugin_ConstraintCoincidence: public SketchPlugin_Constraint
+class SketchPlugin_ConstraintCoincidence: public SketchPlugin_ConstraintBase
 {
 public:
   /// Parallel constraint kind
index 4d043e48b1a2a49106529c0d77c0b36e94f97968..ab8bba03646e1e80c09640c3a7bbd73c8d6b4390 100644 (file)
@@ -62,8 +62,7 @@ void SketchPlugin_ConstraintDistance::execute()
 }
 
 //*************************************************************************************
-boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_ConstraintDistance::getAISObject(
-                    boost::shared_ptr<GeomAPI_AISObject> thePrevious)
+AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevious)
 {
   if (!sketch())
     return thePrevious;
@@ -112,9 +111,9 @@ boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_ConstraintDistance::getAISObje
     boost::dynamic_pointer_cast<ModelAPI_AttributeDouble>(aData->attribute(SketchPlugin_Constraint::VALUE()));
   double aValue = aValueAttr->value();
 
-  boost::shared_ptr<GeomAPI_AISObject> anAIS = thePrevious;
+  AISObjectPtr anAIS = thePrevious;
   if (!anAIS)
-    anAIS = boost::shared_ptr<GeomAPI_AISObject>(new GeomAPI_AISObject);
+    anAIS = AISObjectPtr(new GeomAPI_AISObject);
   anAIS->createDistance(aPoint1, aPoint2, aFlyoutPnt, aPlane, aValue);
 
   // Set color from preferences
@@ -194,4 +193,4 @@ boost::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(const boost::shared_ptr<Sket
 
   GeomAPI_Lin2d aLin2d(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y());
   return aLin2d.project(thePoint);
-}
\ No newline at end of file
+}
index 790068b952fdcb9c28cff1f0130aed8fd79a227b..17d795a898f4c49454962620d3c1676262c9870b 100644 (file)
@@ -6,7 +6,7 @@
 #define SketchPlugin_ConstraintDistance_H_
 
 #include "SketchPlugin.h"
-#include "SketchPlugin_Constraint.h"
+#include "SketchPlugin_ConstraintBase.h"
 #include "SketchPlugin_Sketch.h"
 #include "ModelAPI_Data.h"
 
@@ -25,7 +25,7 @@ class GeomDataAPI_Point2D;
  *  These constraint has three attributes:
  *  SketchPlugin_Constraint::VALUE(), SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B()
  */
-class SketchPlugin_ConstraintDistance: public SketchPlugin_Constraint
+class SketchPlugin_ConstraintDistance: public SketchPlugin_ConstraintBase
 {
 public:
   /// Distance constraint kind
@@ -46,8 +46,7 @@ public:
   SKETCHPLUGIN_EXPORT virtual void initAttributes();
 
   /// Returns the AIS preview
-  SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
-                                boost::shared_ptr<GeomAPI_AISObject> thePrevious);
+  SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
 
   /// Moves the feature
   /// \param theDeltaX the delta for X coordinate is moved
index fcd4a4053d3355b6d845d8cbcdf39fa8a969695b..248a9d2c0c4a2e316cfdcebcd1096ebb39904af4 100644 (file)
@@ -54,8 +54,7 @@ void SketchPlugin_ConstraintLength::execute()
   }
 }
 
-boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_ConstraintLength::getAISObject(
-                    boost::shared_ptr<GeomAPI_AISObject> thePrevious)
+AISObjectPtr SketchPlugin_ConstraintLength::getAISObject(AISObjectPtr thePrevious)
 {
   if (!sketch())
     return thePrevious;
@@ -90,9 +89,9 @@ boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_ConstraintLength::getAISObject
     boost::dynamic_pointer_cast<ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE()));
   double aValue = aValueAttr->value();
 
-  boost::shared_ptr<GeomAPI_AISObject> anAIS = thePrevious;
+  AISObjectPtr anAIS = thePrevious;
   if (!anAIS)
-    anAIS = boost::shared_ptr<GeomAPI_AISObject>(new GeomAPI_AISObject);
+    anAIS = AISObjectPtr(new GeomAPI_AISObject);
   anAIS->createDistance(aPoint1, aPoint2, aFlyoutPnt, aPlane, aValue);
 
   // Set color from preferences
index 461cb5ac89240275a6ccf1143b563bbb6f10e2f8..33afa88147be3086ae504b9b143077b109652be3 100644 (file)
@@ -6,7 +6,7 @@
 #define SketchPlugin_ConstraintLength_H_
 
 #include "SketchPlugin.h"
-#include "SketchPlugin_Constraint.h"
+#include "SketchPlugin_ConstraintBase.h"
 #include <SketchPlugin_Sketch.h>
 #include <list>
 
@@ -20,7 +20,7 @@
  *  SketchPlugin_Constraint::VALUE() (length) and SketchPlugin_Constraint::ENTITY_A() (segment),
  *  SketchPlugin_Constraint::FLYOUT_VALUE_PNT() (distance of a constraints handle)
  */
-class SketchPlugin_ConstraintLength: public SketchPlugin_Constraint
+class SketchPlugin_ConstraintLength: public SketchPlugin_ConstraintBase
 {
 public:
   /// Length constraint kind
@@ -40,8 +40,7 @@ public:
   SKETCHPLUGIN_EXPORT virtual void initAttributes();
 
   /// Returns the AIS preview
-  SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
-                                boost::shared_ptr<GeomAPI_AISObject> thePrevious);
+  SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
 
   /// Moves the feature
   /// \param theDeltaX the delta for X coordinate is moved
index e9bcfd0a351db66b157dace6e24103a268765cb4..c39b4b3dbfb65a9155b542d1f35c899bcf87871c 100644 (file)
@@ -32,8 +32,7 @@ void SketchPlugin_ConstraintParallel::execute()
 {
 }
 
-boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_ConstraintParallel::getAISObject(
-                    boost::shared_ptr<GeomAPI_AISObject> thePrevious)
+AISObjectPtr SketchPlugin_ConstraintParallel::getAISObject(AISObjectPtr thePrevious)
 {
   if (!sketch())
     return thePrevious;
@@ -75,9 +74,9 @@ boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_ConstraintParallel::getAISObje
     boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
   boost::shared_ptr<GeomAPI_Pnt> aFlyoutPnt = sketch()->to3D(aFlyoutAttr->x(), aFlyoutAttr->y());
 
-  boost::shared_ptr<GeomAPI_AISObject> anAIS = thePrevious;
+  AISObjectPtr anAIS = thePrevious;
   if (!anAIS)
-    anAIS = boost::shared_ptr<GeomAPI_AISObject>(new GeomAPI_AISObject);
+    anAIS = AISObjectPtr(new GeomAPI_AISObject);
   anAIS->createParallel(aLine1, aLine2, aFlyoutPnt, aPlane);
 
   // Set color from preferences
index 6e02e1c997b4fd2cfa5dc6fac88481682ac79d76..9a77a7a7bb6b0e0a76c6dfb8712785eb7ade5426 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "SketchPlugin.h"
 #include <SketchPlugin_Sketch.h>
-#include "SketchPlugin_Constraint.h"
+#include "SketchPlugin_ConstraintBase.h"
 
 
 #define PARALLEL_COLOR "#ffff00"
@@ -19,7 +19,7 @@
  *  These constraint has two attributes:
  *  SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B()
  */
-class SketchPlugin_ConstraintParallel: public SketchPlugin_Constraint
+class SketchPlugin_ConstraintParallel: public SketchPlugin_ConstraintBase
 {
 public:
   /// Parallel constraint kind
@@ -39,8 +39,7 @@ public:
   SKETCHPLUGIN_EXPORT virtual void initAttributes();
 
   /// Returns the AIS preview
-  SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
-                                boost::shared_ptr<GeomAPI_AISObject> thePrevious);
+  SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
 
   /// Moves the feature
   /// \param theDeltaX the delta for X coordinate is moved
index df192e8d9796d527c292922922d3d4207a3bb25f..826fc50b8fec7bb938f4bc1f1441d02acd851e8c 100644 (file)
@@ -32,8 +32,7 @@ void SketchPlugin_ConstraintPerpendicular::execute()
 {
 }
 
-boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_ConstraintPerpendicular::getAISObject(
-                    boost::shared_ptr<GeomAPI_AISObject> thePrevious)
+AISObjectPtr SketchPlugin_ConstraintPerpendicular::getAISObject(AISObjectPtr thePrevious)
 {
   if (!sketch())
     return thePrevious;
@@ -71,9 +70,9 @@ boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_ConstraintPerpendicular::getAI
     boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(anAttr2->object());
   if (aConst2) aLine2 = aConst2->shape();
 
-  boost::shared_ptr<GeomAPI_AISObject> anAIS = thePrevious;
+  AISObjectPtr anAIS = thePrevious;
   if (!anAIS)
-    anAIS = boost::shared_ptr<GeomAPI_AISObject>(new GeomAPI_AISObject);
+    anAIS = AISObjectPtr(new GeomAPI_AISObject);
   anAIS->createPerpendicular(aLine1, aLine2, aPlane);
 
   // Set color from preferences
index ac565f0763bed0b662e03426fee4b3fb88befbd2..b0bc7ff9e59b6547abe420ed4f5e419e97c76266 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "SketchPlugin.h"
 #include <SketchPlugin_Sketch.h>
-#include "SketchPlugin_Constraint.h"
+#include "SketchPlugin_ConstraintBase.h"
 
 #define PERPENDICULAR_COLOR "#ffff00"
 
@@ -18,7 +18,7 @@
  *  These constraint has two attributes:
  *  SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B()
  */
-class SketchPlugin_ConstraintPerpendicular: public SketchPlugin_Constraint
+class SketchPlugin_ConstraintPerpendicular: public SketchPlugin_ConstraintBase
 {
 public:
   /// Perpendicular constraint kind
@@ -38,8 +38,7 @@ public:
   SKETCHPLUGIN_EXPORT virtual void initAttributes();
 
   /// Returns the AIS preview
-  SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
-                                boost::shared_ptr<GeomAPI_AISObject> thePrevious);
+  SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
 
   /// Moves the feature
   /// \param theDeltaX the delta for X coordinate is moved
index 31b253d542b8010d97f6f19e47fe16f2cc34fef0..c4ab146e212eb7128813e85db05217cda32abf5c 100644 (file)
@@ -64,8 +64,7 @@ void SketchPlugin_ConstraintRadius::execute()
   }
 }
 
-boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_ConstraintRadius::getAISObject(
-                    boost::shared_ptr<GeomAPI_AISObject> thePrevious)
+AISObjectPtr SketchPlugin_ConstraintRadius::getAISObject(AISObjectPtr thePrevious)
 {
   if (!sketch())
     return thePrevious;
@@ -117,9 +116,9 @@ boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_ConstraintRadius::getAISObject
   if (aValueAttr && aValueAttr->isInitialized())
    aValue = aValueAttr->value();
 
-  boost::shared_ptr<GeomAPI_AISObject> anAIS = thePrevious;
+  AISObjectPtr anAIS = thePrevious;
   if (!anAIS)
-    anAIS = boost::shared_ptr<GeomAPI_AISObject>(new GeomAPI_AISObject);
+    anAIS = AISObjectPtr(new GeomAPI_AISObject);
   anAIS->createRadius(aCircle, aFlyoutPnt, aValue);
 
   // Set color from preferences
index a6f1e16aeee53bcadb2959f7cef0448b4aa4d2b7..f330a31ece851d68fd568389b4de86e3a4c20767 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "SketchPlugin.h"
 #include <SketchPlugin_Sketch.h>
-#include "SketchPlugin_Constraint.h"
+#include "SketchPlugin_ConstraintBase.h"
 
 #define RADIUS_COLOR "#ff00ff"
 
@@ -19,7 +19,7 @@
  *  These constraint has two attributes:
  *  SketchPlugin_Constraint::VALUE() (radius), SketchPlugin_Constraint::ENTITY_A() (a circle)
  */
-class SketchPlugin_ConstraintRadius: public SketchPlugin_Constraint
+class SketchPlugin_ConstraintRadius: public SketchPlugin_ConstraintBase
 {
 public:
   /// Radius constraint kind
@@ -38,8 +38,7 @@ public:
   SKETCHPLUGIN_EXPORT virtual void initAttributes();
 
   /// Returns the AIS preview
-  SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
-                                boost::shared_ptr<GeomAPI_AISObject> thePrevious);
+  SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
 
   /// Moves the feature
   /// \param theDeltaX the delta for X coordinate is moved
index acb48d0550b20fd1dd5a8a1ba8b8e427089593ad..4edfeb8f90f2f82850d1d48cad118691ecb6158c 100644 (file)
@@ -35,8 +35,8 @@ SketchPlugin_Sketch* SketchPlugin_Feature::sketch()
   return mySketch;
 }
 
-boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_Feature::simpleAISObject(
-    boost::shared_ptr<ModelAPI_Result> theRes, boost::shared_ptr<GeomAPI_AISObject> thePrevious)
+AISObjectPtr SketchPlugin_Feature::simpleAISObject(
+    boost::shared_ptr<ModelAPI_Result> theRes, AISObjectPtr thePrevious)
 {
   boost::shared_ptr<ModelAPI_ResultConstruction> aConstr = 
     boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theRes);
@@ -44,9 +44,9 @@ boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_Feature::simpleAISObject(
   boost::shared_ptr<GeomAPI_Shape> aPreview;
   if (aConstr) aPreview = aConstr->shape();
 
-  boost::shared_ptr<GeomAPI_AISObject> aResult = thePrevious;
+  AISObjectPtr aResult = thePrevious;
   if (!aResult)
-    aResult = boost::shared_ptr<GeomAPI_AISObject>(new GeomAPI_AISObject());
+    aResult = AISObjectPtr(new GeomAPI_AISObject());
   aResult->createShape(aPreview);
   return aResult;
 }
index 093bf025856dc9c656f6107eb5cc1517fd56f26c..439f1b4f0492bfca90f4024b63aab348b726c503 100644 (file)
@@ -24,8 +24,8 @@ class SketchPlugin_Feature: public ModelAPI_Feature
 {
 public:
   /// Simple creation of interactive object by the result of the object
-  static boost::shared_ptr<GeomAPI_AISObject> simpleAISObject(
-    boost::shared_ptr<ModelAPI_Result> theRes, boost::shared_ptr<GeomAPI_AISObject> thePrevious);
+  static AISObjectPtr simpleAISObject(
+    boost::shared_ptr<ModelAPI_Result> theRes, AISObjectPtr thePrevious);
 
   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
   /// \param theFeature sub-feature
index 370f26bfb3ce35fcb18768089e543aaf80ee5b5e..636b7337d00813dc916871cea974c4ce4ad13948 100644 (file)
@@ -47,8 +47,7 @@ public:
   SKETCHPLUGIN_EXPORT virtual void initAttributes();
 
   /// Returns the AIS preview
-  SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
-                                boost::shared_ptr<GeomAPI_AISObject> thePrevious)
+  SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious)
   {return simpleAISObject(firstResult(), thePrevious);}
 
   /// Moves the feature
index c60526163583105af95e4be23f4607d084100b7a..fddf2ef5a3750984e376576e1f7598357a50c1ed 100644 (file)
@@ -40,8 +40,7 @@ public:
   SKETCHPLUGIN_EXPORT virtual void initAttributes();
 
   /// Returns the AIS preview
-  virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
-                                boost::shared_ptr<GeomAPI_AISObject> thePrevious)
+  virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious)
   {return simpleAISObject(firstResult(), thePrevious);}
 
   /// Moves the feature
index 0b0381ab7eb647bedd648eca91db1374a47409ab..9236aa008ae5959a34ba9841cacde849b2d2dc44 100644 (file)
@@ -140,14 +140,13 @@ void addPlane(double theX, double theY, double theZ, std::list<boost::shared_ptr
   theShapes.push_back(aFace);
 }
 
-boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_Sketch::
-  getAISObject(boost::shared_ptr<GeomAPI_AISObject> thePrevious)
+AISObjectPtr SketchPlugin_Sketch::getAISObject(AISObjectPtr thePrevious)
 {
   boost::shared_ptr<GeomDataAPI_Dir> aNorm = 
     boost::dynamic_pointer_cast<GeomDataAPI_Dir>(data()->attribute(SketchPlugin_Sketch::NORM_ID()));
 
   if (!aNorm || (aNorm->x() == 0 && aNorm->y() == 0 && aNorm->z() == 0)) {
-    boost::shared_ptr<GeomAPI_AISObject> aAIS = thePrevious;
+    AISObjectPtr aAIS = thePrevious;
     if (!aAIS) {
       std::list<boost::shared_ptr<GeomAPI_Shape> > aFaces;
 
@@ -155,7 +154,7 @@ boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_Sketch::
       addPlane(0, 1, 0, aFaces); // XZ plane
       addPlane(0, 0, 1, aFaces); // XY plane
       boost::shared_ptr<GeomAPI_Shape> aCompound = GeomAlgoAPI_CompoundBuilder::compound(aFaces);
-      aAIS = boost::shared_ptr<GeomAPI_AISObject>(new GeomAPI_AISObject());
+      aAIS = AISObjectPtr(new GeomAPI_AISObject());
       aAIS->createShape(aCompound);
 
       std::vector<int> aRGB = Config_PropManager::color("Sketch definition", 
@@ -169,5 +168,5 @@ boost::shared_ptr<GeomAPI_AISObject> SketchPlugin_Sketch::
     }
     return aAIS;
   }
-  return boost::shared_ptr<GeomAPI_AISObject>();
+  return AISObjectPtr();
 }
index c0845fa8507fa342620064830496d2a8b23ad7b4..0d5d6ea0aebc75d13616fdf83c94b0c479b29b49 100644 (file)
@@ -102,8 +102,7 @@ public:
   /// Returns the basis plane for the sketch
   boost::shared_ptr<GeomAPI_Pln> plane();
 
-  virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
-                            boost::shared_ptr<GeomAPI_AISObject> thePrevious);
+  virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
 
 protected:
   /// Creates a plane and append it to the list
index ae85208d3ed2795ddb353d6879476df00d7c9e91..46ffb3d91bfac013a695cff41ab363681e9630cc 100644 (file)
@@ -34,7 +34,7 @@ INCLUDE_DIRECTORIES(
 
 ADD_DEFINITIONS(-DSKETCHSOLVER_EXPORTS ${BOOST_DEFINITIONS})
 
-ADD_LIBRARY(SketchSolver SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS}
+ADD_LIBRARY(SketchSolver MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS}
 )
 
 TARGET_LINK_LIBRARIES(SketchSolver ${PROJECT_LIBRARIES}