Salome HOME
Optimization of SketchPrs objects parameters
authorvsv <vsv@opencascade.com>
Wed, 5 Sep 2018 09:40:58 +0000 (12:40 +0300)
committervsv <vsv@opencascade.com>
Wed, 5 Sep 2018 09:40:58 +0000 (12:40 +0300)
39 files changed:
src/SketchPlugin/SketchPlugin_ConstraintCoincidence.cpp
src/SketchPlugin/SketchPlugin_ConstraintCollinear.cpp
src/SketchPlugin/SketchPlugin_ConstraintEqual.cpp
src/SketchPlugin/SketchPlugin_ConstraintHorizontal.cpp
src/SketchPlugin/SketchPlugin_ConstraintMiddle.cpp
src/SketchPlugin/SketchPlugin_ConstraintMirror.cpp
src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp
src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp
src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp
src/SketchPlugin/SketchPlugin_ConstraintTangent.cpp
src/SketchPlugin/SketchPlugin_ConstraintVertical.cpp
src/SketchPlugin/SketchPlugin_MultiRotation.cpp
src/SketchPlugin/SketchPlugin_MultiTranslation.cpp
src/SketcherPrs/SketcherPrs_Coincident.cpp
src/SketcherPrs/SketcherPrs_Coincident.h
src/SketcherPrs/SketcherPrs_Collinear.cpp
src/SketcherPrs/SketcherPrs_Collinear.h
src/SketcherPrs/SketcherPrs_Equal.cpp
src/SketcherPrs/SketcherPrs_Equal.h
src/SketcherPrs/SketcherPrs_Factory.cpp
src/SketcherPrs/SketcherPrs_Factory.h
src/SketcherPrs/SketcherPrs_HVDirection.cpp
src/SketcherPrs/SketcherPrs_HVDirection.h
src/SketcherPrs/SketcherPrs_Middle.cpp
src/SketcherPrs/SketcherPrs_Middle.h
src/SketcherPrs/SketcherPrs_Mirror.cpp
src/SketcherPrs/SketcherPrs_Mirror.h
src/SketcherPrs/SketcherPrs_Parallel.cpp
src/SketcherPrs/SketcherPrs_Parallel.h
src/SketcherPrs/SketcherPrs_Perpendicular.cpp
src/SketcherPrs/SketcherPrs_Perpendicular.h
src/SketcherPrs/SketcherPrs_Rigid.cpp
src/SketcherPrs/SketcherPrs_Rigid.h
src/SketcherPrs/SketcherPrs_SymbolPrs.cpp
src/SketcherPrs/SketcherPrs_SymbolPrs.h
src/SketcherPrs/SketcherPrs_Tangent.cpp
src/SketcherPrs/SketcherPrs_Tangent.h
src/SketcherPrs/SketcherPrs_Transformation.cpp
src/SketcherPrs/SketcherPrs_Transformation.h

index 619ca41ac52347d6a746bfc27118f3bca39ae426..ac7b9961b9837967f4913196db8f6d4bc8d6bf55 100644 (file)
@@ -52,8 +52,7 @@ AISObjectPtr SketchPlugin_ConstraintCoincidence::getAISObject(AISObjectPtr thePr
   if (!sketch())
     return thePrevious;
 
-  AISObjectPtr anAIS = SketcherPrs_Factory::coincidentConstraint(this, sketch()->coordinatePlane(),
-                                                                 thePrevious);
+  AISObjectPtr anAIS = SketcherPrs_Factory::coincidentConstraint(this, sketch(), thePrevious);
   return anAIS;
 }
 
index e36287b4c35f2f8f4212f8c37cadc03256e9b8f5..c1742919fe8ecba76ed83e23b2b676563b3c2158 100644 (file)
@@ -42,7 +42,7 @@ AISObjectPtr SketchPlugin_ConstraintCollinear::getAISObject(AISObjectPtr thePrev
     return thePrevious;
 
   AISObjectPtr anAIS = SketcherPrs_Factory::collinearConstraint(
-      this, sketch(), sketch()->coordinatePlane(), thePrevious);
+      this, sketch(), thePrevious);
   return anAIS;
 }
 
index 7be8935aa2d9b52aff0d55ae7691c788e5c16834..f03f7dab1bb0935a085e368a1723b281270ba335 100644 (file)
@@ -51,7 +51,6 @@ AISObjectPtr SketchPlugin_ConstraintEqual::getAISObject(AISObjectPtr thePrevious
     return thePrevious;
 
   AISObjectPtr anAIS = SketcherPrs_Factory::equalConstraint(this, sketch(),
-                                                            sketch()->coordinatePlane(),
                                                             thePrevious);
   return anAIS;
 }
index 6ebf472e8f8157c0cc1fb38e15d9b9ba1f2f555d..545102700e937eb69f3d359d65d6fcfb1604221b 100644 (file)
@@ -51,7 +51,6 @@ AISObjectPtr SketchPlugin_ConstraintHorizontal::getAISObject(AISObjectPtr thePre
     return thePrevious;
 
   AISObjectPtr anAIS = SketcherPrs_Factory::horisontalConstraint(this, sketch(),
-                                                                 sketch()->coordinatePlane(),
                                                                  thePrevious);
   return anAIS;
 }
index 620b0691ab8533023c7a11127cf1a8d7fcc8ec27..c7a8982cacde3cf8db3d2377548e619ae5caee20 100644 (file)
@@ -42,7 +42,6 @@ AISObjectPtr SketchPlugin_ConstraintMiddle::getAISObject(AISObjectPtr thePreviou
     return thePrevious;
 
   AISObjectPtr anAIS = SketcherPrs_Factory::middleConstraint(this, sketch(),
-                                                             sketch()->coordinatePlane(),
                                                              thePrevious);
   return anAIS;
 }
index ec7be3a799ce2bffabe5a2e6bbea54f9d4434445..310a3f456dc20743fe02058417a63b766b6c31e7 100755 (executable)
@@ -210,7 +210,6 @@ AISObjectPtr SketchPlugin_ConstraintMirror::getAISObject(AISObjectPtr thePreviou
     return thePrevious;
 
   AISObjectPtr anAIS = SketcherPrs_Factory::mirrorConstraint(this, sketch(),
-                                                             sketch()->coordinatePlane(),
                                                              thePrevious);
   return anAIS;
 }
index 9ddda85aa439c0873fa1bf99c1e9a23b1e205b8a..4af4bf8653bcaf26321090164866fcd2d2d2a512 100644 (file)
@@ -57,7 +57,6 @@ AISObjectPtr SketchPlugin_ConstraintParallel::getAISObject(AISObjectPtr thePrevi
     return thePrevious;
 
   AISObjectPtr anAIS = SketcherPrs_Factory::parallelConstraint(this, sketch(),
-                                                               sketch()->coordinatePlane(),
                                                                thePrevious);
   return anAIS;
 }
index 258e30dc0b5b6dbeb91652362159c968ac5faef4..c922096b031ad593ac46e260266a8aedffc70d04 100644 (file)
@@ -56,7 +56,7 @@ AISObjectPtr SketchPlugin_ConstraintPerpendicular::getAISObject(AISObjectPtr the
     return thePrevious;
 
   AISObjectPtr anAIS = SketcherPrs_Factory::perpendicularConstraint(this, sketch(),
-    sketch()->coordinatePlane(), thePrevious);
+    thePrevious);
   return anAIS;
 }
 
index 67eba8044c0a570e7e5345aea324fed89a17b612..36c329e4a969f19aa58d2198cb6dab7104369720 100644 (file)
@@ -47,6 +47,5 @@ AISObjectPtr SketchPlugin_ConstraintRigid::getAISObject(AISObjectPtr thePrevious
 {
   if (!sketch())
     return thePrevious;
-  return SketcherPrs_Factory::rigidConstraint(this, sketch(),
-                                              sketch()->coordinatePlane(), thePrevious);
+  return SketcherPrs_Factory::rigidConstraint(this, sketch(), thePrevious);
 }
\ No newline at end of file
index 37fa4e0de354499265d75c4340a794105954740e..4a41cac55a0011b4291a1089755f57817b0a7747 100644 (file)
@@ -51,7 +51,6 @@ AISObjectPtr SketchPlugin_ConstraintTangent::getAISObject(AISObjectPtr thePrevio
     return thePrevious;
 
   AISObjectPtr anAIS = SketcherPrs_Factory::tangentConstraint(this, sketch(),
-                                                              sketch()->coordinatePlane(),
                                                               thePrevious);
   return anAIS;
 }
index 3debcfd378d08e9b225e5081e48f7af479ef2448..db4be31c01d8115a04a04aa397a3f58485d54ae0 100644 (file)
@@ -50,7 +50,6 @@ AISObjectPtr SketchPlugin_ConstraintVertical::getAISObject(AISObjectPtr thePrevi
     return thePrevious;
 
   AISObjectPtr anAIS = SketcherPrs_Factory::verticalConstraint(this, sketch(),
-                                                               sketch()->coordinatePlane(),
                                                                thePrevious);
   return anAIS;
 }
index 6a9a1596eab33ba9ae5e7525cc7c06ed1fd81686..0b798f30cc9579e3009346f055a4c37d06cb9b06 100755 (executable)
@@ -233,7 +233,6 @@ AISObjectPtr SketchPlugin_MultiRotation::getAISObject(AISObjectPtr thePrevious)
     return thePrevious;
 
   AISObjectPtr anAIS = SketcherPrs_Factory::rotateConstraint(this, sketch(),
-                                                             sketch()->coordinatePlane(),
                                                              thePrevious);
   return anAIS;
 }
index b927739d1c65c12dc7d52c21d2b7eb48996fabce..cd5b731ed697675ff6ca383709d62698bd5cf8dc 100755 (executable)
@@ -213,7 +213,6 @@ AISObjectPtr SketchPlugin_MultiTranslation::getAISObject(AISObjectPtr thePreviou
     return thePrevious;
 
   AISObjectPtr anAIS = SketcherPrs_Factory::translateConstraint(this, sketch(),
-                                                                sketch()->coordinatePlane(),
                                                                 thePrevious);
   return anAIS;
 }
index fc2f3e36aa163cd5b35d2dc28d8efb8f4d74b447..9e4c24723e807bbf9b21121ce6285ceaa251e2d9 100644 (file)
@@ -46,8 +46,8 @@
 IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Coincident, AIS_InteractiveObject);
 
 SketcherPrs_Coincident::SketcherPrs_Coincident(ModelAPI_Feature* theConstraint,
-                                               const std::shared_ptr<GeomAPI_Ax3>& thePlane)
-: AIS_InteractiveObject(), myConstraint(theConstraint), mySketcherPlane(thePlane),
+  SketchPlugin_Sketch* theSketch)
+: AIS_InteractiveObject(), myConstraint(theConstraint), mySketch(theSketch),
   myPoint(gp_Pnt(0.0, 0.0, 0.0)), myIsCustomColor(false)
 {
 }
@@ -85,7 +85,7 @@ void SketcherPrs_Coincident::Compute(
   const Standard_Integer theMode)
 {
   gp_Pnt aPoint;
-  bool aReadyToDisplay = readyToDisplay(myConstraint, mySketcherPlane, aPoint);
+  bool aReadyToDisplay = readyToDisplay(myConstraint, mySketch->coordinatePlane(), aPoint);
   if (aReadyToDisplay)
     myPoint = aPoint;
 
index 4b6d4effce36a4b751b120715fc628236215df70..b33ba40ccb1811cb752f20cc5c65155c44df3c8e 100644 (file)
@@ -22,6 +22,7 @@
 #define SketcherPrs_Coincident_H
 
 #include <GeomAPI_Ax3.h>
+#include <SketchPlugin_Sketch.h>
 #include <ModelAPI_Feature.h>
 
 #include <AIS_InteractiveObject.hxx>
@@ -42,7 +43,7 @@ public:
   /// \param theConstraint a constraint object
   /// \param thePlane plane of a sketch
   Standard_EXPORT SketcherPrs_Coincident(ModelAPI_Feature* theConstraint,
-                                         const std::shared_ptr<GeomAPI_Ax3>& thePlane);
+    SketchPlugin_Sketch* theSketch);
 
   /// Defines color for the presentation
   /// \param aColor a color object
@@ -82,7 +83,7 @@ private:
 
 private:
   ModelAPI_Feature* myConstraint;
-  std::shared_ptr<GeomAPI_Ax3> mySketcherPlane;
+  SketchPlugin_Sketch* mySketch;
   gp_Pnt myPoint;
   bool myIsCustomColor; /// state if the presentation is visualized in custom color
   Quantity_Color myCustomColor; /// the color of mid ring if there is a conflict
index fba498a281e8f0f930ca1a140e4f5ca3170a1872..9e98f2132805294025cb95f18d095480ffa9e963 100755 (executable)
@@ -33,9 +33,8 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Collinear, SketcherPrs_SymbolPrs);
 static Handle(Image_AlienPixMap) MyPixMap;
 
 SketcherPrs_Collinear::SketcherPrs_Collinear(ModelAPI_Feature* theConstraint,
-                                      ModelAPI_CompositeFeature* theSketcher,
-                                     const std::shared_ptr<GeomAPI_Ax3>& thePlane)
- : SketcherPrs_SymbolPrs(theConstraint, theSketcher, thePlane)
+  SketchPlugin_Sketch* theSketcher)
+ : SketcherPrs_SymbolPrs(theConstraint, theSketcher)
 {
 }
 
index dfa4d853ef1afc7106ff4271bb9816bf6549f34a..7e42b0efb592309cdaba05ff1fcd5ddb2ff9a21a 100755 (executable)
@@ -37,10 +37,9 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param theSketcher a sketcher object
-  /// \param thePlane a coordinate plane of current sketch
   Standard_EXPORT SketcherPrs_Collinear(ModelAPI_Feature* theConstraint,
-                                        ModelAPI_CompositeFeature* theSketcher,
-                                       const std::shared_ptr<GeomAPI_Ax3>& thePlane);
+    SketchPlugin_Sketch* theSketcher);
+
   DEFINE_STANDARD_RTTIEXT(SketcherPrs_Collinear, SketcherPrs_SymbolPrs)
 
   /// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
index 7077e1a7ae14de4262105cd49101bd6d44686eaf..3c9d261680ebe555e4b7e67b2138b26759339c5d 100644 (file)
@@ -33,9 +33,8 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Equal, SketcherPrs_SymbolPrs);
 static Handle(Image_AlienPixMap) MyPixMap;
 
 SketcherPrs_Equal::SketcherPrs_Equal(ModelAPI_Feature* theConstraint,
-                                      ModelAPI_CompositeFeature* theSketcher,
-                                     const std::shared_ptr<GeomAPI_Ax3>& thePlane)
- : SketcherPrs_SymbolPrs(theConstraint, theSketcher, thePlane)
+  SketchPlugin_Sketch* theSketcher)
+ : SketcherPrs_SymbolPrs(theConstraint, theSketcher)
 {
 }
 
index 0b2066d38e7e4f6162a997ee3ca69de913200c6b..b56a6e9b9c2574cb3d89e4f019683d4514a8351d 100644 (file)
@@ -37,10 +37,8 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param theSketcher a sketcher object
-  /// \param thePlane a coordinate plane of current sketch
   Standard_EXPORT SketcherPrs_Equal(ModelAPI_Feature* theConstraint,
-                                    ModelAPI_CompositeFeature* theSketcher,
-                                    const std::shared_ptr<GeomAPI_Ax3>& thePlane);
+    SketchPlugin_Sketch* theSketcher);
   DEFINE_STANDARD_RTTIEXT(SketcherPrs_Equal, SketcherPrs_SymbolPrs)
 
   /// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
index 6059e0ce0dd643132de9fe999d79c2b8defc24c0..68e05f94c510aea42a665b9032f6db1705798317 100644 (file)
 // Macros for constraint presentation definition
 #define CONSTRAINT_PRS_IMPL(NAME, CLASS) \
 AISObjectPtr SketcherPrs_Factory::NAME(ModelAPI_Feature* theConstraint, \
-                                       ModelAPI_CompositeFeature* theSketcher, \
-                                       const std::shared_ptr<GeomAPI_Ax3>& thePlane, \
+                                       SketchPlugin_Sketch* theSketcher, \
                                        AISObjectPtr thePrevious) \
 { \
   std::shared_ptr<GeomAPI_AISObject> anAISObj; \
-  if (CLASS::IsReadyToDisplay(theConstraint, thePlane)) { \
+  if (CLASS::IsReadyToDisplay(theConstraint, theSketcher->coordinatePlane())) { \
     if (thePrevious.get()) \
       anAISObj = thePrevious; \
     else { \
       anAISObj = AISObjectPtr(new GeomAPI_AISObject()); \
-      Handle(CLASS) aPrs = new CLASS(theConstraint, theSketcher, thePlane); \
+      Handle(CLASS) aPrs = new CLASS(theConstraint, theSketcher); \
       anAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs)); \
     } \
   } \
@@ -64,6 +63,7 @@ CONSTRAINT_PRS_IMPL(equalConstraint, SketcherPrs_Equal);
 CONSTRAINT_PRS_IMPL(tangentConstraint, SketcherPrs_Tangent);
 CONSTRAINT_PRS_IMPL(middleConstraint, SketcherPrs_Middle);
 CONSTRAINT_PRS_IMPL(mirrorConstraint, SketcherPrs_Mirror);
+CONSTRAINT_PRS_IMPL(coincidentConstraint, SketcherPrs_Coincident);
 
 
 
@@ -86,25 +86,22 @@ AISObjectPtr SketcherPrs_Factory::NAME(ModelAPI_Feature* theConstraint, \
 }
 
 
-CONSTRAINT2_PRS_IMPL(coincidentConstraint, SketcherPrs_Coincident);
 CONSTRAINT2_PRS_IMPL(angleConstraint, SketcherPrs_Angle);
 CONSTRAINT2_PRS_IMPL(radiusConstraint, SketcherPrs_Radius);
 CONSTRAINT2_PRS_IMPL(lengthDimensionConstraint, SketcherPrs_LengthDimension);
 
 // Non-standard constraints definition
 AISObjectPtr SketcherPrs_Factory::horisontalConstraint(ModelAPI_Feature* theConstraint,
-                                        ModelAPI_CompositeFeature* theSketcher,
-                                       const std::shared_ptr<GeomAPI_Ax3>& thePlane,
-                                       AISObjectPtr thePrevious)
+  SketchPlugin_Sketch* theSketcher, AISObjectPtr thePrevious)
 {
   std::shared_ptr<GeomAPI_AISObject> anAISObj;
-  if (SketcherPrs_HVDirection::IsReadyToDisplay(theConstraint, thePlane)) {
+  if (SketcherPrs_HVDirection::IsReadyToDisplay(theConstraint, theSketcher->coordinatePlane())) {
     if (thePrevious.get())
       anAISObj = thePrevious;
     else {
       anAISObj = AISObjectPtr(new GeomAPI_AISObject());
       Handle(SketcherPrs_HVDirection) aPrs =
-        new SketcherPrs_HVDirection(theConstraint, theSketcher, thePlane, true);
+        new SketcherPrs_HVDirection(theConstraint, theSketcher, true);
       anAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
     }
   }
@@ -112,18 +109,16 @@ AISObjectPtr SketcherPrs_Factory::horisontalConstraint(ModelAPI_Feature* theCons
 }
 
 AISObjectPtr SketcherPrs_Factory::verticalConstraint(ModelAPI_Feature* theConstraint,
-                                        ModelAPI_CompositeFeature* theSketcher,
-                                       const std::shared_ptr<GeomAPI_Ax3>& thePlane,
-                                       AISObjectPtr thePrevious)
+  SketchPlugin_Sketch* theSketcher, AISObjectPtr thePrevious)
 {
   std::shared_ptr<GeomAPI_AISObject> anAISObj;
-  if (SketcherPrs_HVDirection::IsReadyToDisplay(theConstraint, thePlane)) {
+  if (SketcherPrs_HVDirection::IsReadyToDisplay(theConstraint, theSketcher->coordinatePlane())) {
     if (thePrevious.get())
       anAISObj = thePrevious;
     else {
       anAISObj = AISObjectPtr(new GeomAPI_AISObject());
       Handle(SketcherPrs_HVDirection) aPrs =
-        new SketcherPrs_HVDirection(theConstraint, theSketcher, thePlane, false);
+        new SketcherPrs_HVDirection(theConstraint, theSketcher, false);
       anAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
     }
   }
@@ -131,18 +126,17 @@ AISObjectPtr SketcherPrs_Factory::verticalConstraint(ModelAPI_Feature* theConstr
 }
 
 AISObjectPtr SketcherPrs_Factory::translateConstraint(ModelAPI_Feature* theConstraint,
-                                        ModelAPI_CompositeFeature* theSketcher,
-                                       const std::shared_ptr<GeomAPI_Ax3>& thePlane,
-                                       AISObjectPtr thePrevious)
+  SketchPlugin_Sketch* theSketcher, AISObjectPtr thePrevious)
 {
   std::shared_ptr<GeomAPI_AISObject> anAISObj;
-  if (SketcherPrs_Transformation::IsReadyToDisplay(theConstraint, thePlane)) {
+  if (SketcherPrs_Transformation::IsReadyToDisplay(theConstraint,
+    theSketcher->coordinatePlane())) {
     if (thePrevious.get())
       anAISObj = thePrevious;
     else {
       anAISObj = AISObjectPtr(new GeomAPI_AISObject());
       Handle(SketcherPrs_Transformation) aPrs =
-        new SketcherPrs_Transformation(theConstraint, theSketcher, thePlane, true);
+        new SketcherPrs_Transformation(theConstraint, theSketcher, true);
       anAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
     }
   }
@@ -150,18 +144,17 @@ AISObjectPtr SketcherPrs_Factory::translateConstraint(ModelAPI_Feature* theConst
 }
 
 AISObjectPtr SketcherPrs_Factory::rotateConstraint(ModelAPI_Feature* theConstraint,
-                                        ModelAPI_CompositeFeature* theSketcher,
-                                       const std::shared_ptr<GeomAPI_Ax3>& thePlane,
-                                       AISObjectPtr thePrevious)
+  SketchPlugin_Sketch* theSketcher, AISObjectPtr thePrevious)
 {
   std::shared_ptr<GeomAPI_AISObject> anAISObj;
-  if (SketcherPrs_Transformation::IsReadyToDisplay(theConstraint, thePlane)) {
+  if (SketcherPrs_Transformation::IsReadyToDisplay(theConstraint,
+    theSketcher->coordinatePlane())) {
     if (thePrevious.get())
       anAISObj = thePrevious;
     else {
       anAISObj = AISObjectPtr(new GeomAPI_AISObject());
       Handle(SketcherPrs_Transformation) aPrs =
-        new SketcherPrs_Transformation(theConstraint, theSketcher, thePlane, false);
+        new SketcherPrs_Transformation(theConstraint, theSketcher, false);
       anAISObj->setImpl(new Handle(AIS_InteractiveObject)(aPrs));
     }
   }
index f59bd0d6173d7dfc316f02ead0e7262558c1d4aa..ef6908daee0320d9783247bf9afc9e9a6439e7fe 100644 (file)
@@ -22,6 +22,7 @@
 #define SketcherPrs_Factory_H_
 
 #include "SketcherPrs.h"
+#include <SketchPlugin_Sketch.h>
 
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_CompositeFeature.h>
@@ -31,8 +32,7 @@
 
 #define GET_CONSTRAINT_PRS(NAME) \
   static AISObjectPtr NAME(ModelAPI_Feature* theConstraint, \
-                           ModelAPI_CompositeFeature* theSketcher, \
-                           const std::shared_ptr<GeomAPI_Ax3>& thePlane, \
+                           SketchPlugin_Sketch* theSketcher, \
                            AISObjectPtr thePrevious);
 
 /**
@@ -113,16 +113,16 @@ public:
   /// \param thePrevious the previous presentation
   GET_CONSTRAINT_PRS(rotateConstraint)
 
-#define GET_CONSTRAINT2_PRS(NAME) \
-  static AISObjectPtr NAME(ModelAPI_Feature* theConstraint, \
-                           const std::shared_ptr<GeomAPI_Ax3>& thePlane, \
-                           AISObjectPtr thePrevious);
-
   /// Creates coincedent constraint presentation
   /// \param theConstraint the constraint
   /// \param thePlane the current sketch plane
   /// \param thePrevious the previous presentation
-  GET_CONSTRAINT2_PRS(coincidentConstraint)
+  GET_CONSTRAINT_PRS(coincidentConstraint)
+
+#define GET_CONSTRAINT2_PRS(NAME) \
+  static AISObjectPtr NAME(ModelAPI_Feature* theConstraint, \
+                           const std::shared_ptr<GeomAPI_Ax3>& thePlane, \
+                           AISObjectPtr thePrevious);
 
   /// Creates angle constraint presentation
   /// \param theConstraint the constraint
index d599d492cc1e16b0c78aa97b14367e73b0967d53..e9d1d14130b27935e295db091cbebeedbb1a15ee 100644 (file)
@@ -33,10 +33,8 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs);
 static Handle(Image_AlienPixMap) MyPixMap;
 
 SketcherPrs_HVDirection::SketcherPrs_HVDirection(ModelAPI_Feature* theConstraint,
-                                           ModelAPI_CompositeFeature* theSketcher,
-                                           const std::shared_ptr<GeomAPI_Ax3>& thePlane,
-                                           bool isHorisontal)
- : SketcherPrs_SymbolPrs(theConstraint, theSketcher, thePlane),
+  SketchPlugin_Sketch* theSketcher, bool isHorisontal)
+ : SketcherPrs_SymbolPrs(theConstraint, theSketcher),
  myIsHorisontal(isHorisontal)
 {
 }
index 07ffa9a07b6846d661e8b7ec7a0fd130386997bd..15f8f7c9e75ade4614a08e2573fb0c17b5b5f61a 100644 (file)
@@ -38,12 +38,9 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param theSketcher a sketcher object
-  /// \param thePlane a coordinate plane of current sketch
   /// \param isHorisontal a flag horizontal or vertical presentation
   Standard_EXPORT SketcherPrs_HVDirection(ModelAPI_Feature* theConstraint,
-                                          ModelAPI_CompositeFeature* theSketcher,
-                                         const std::shared_ptr<GeomAPI_Ax3>& thePlane,
-                                         bool isHorisontal);
+    SketchPlugin_Sketch* theSketcher, bool isHorisontal);
 
   DEFINE_STANDARD_RTTIEXT(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs)
 
index ef272b49d898d73129fef0ee812b7f7d8cbc1fb2..00b82636f08ece84eb2ba240654103bb9a91cbdc 100755 (executable)
@@ -33,9 +33,8 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Middle, SketcherPrs_SymbolPrs);
 static Handle(Image_AlienPixMap) MyPixMap;
 
 SketcherPrs_Middle::SketcherPrs_Middle(ModelAPI_Feature* theConstraint,
-                                      ModelAPI_CompositeFeature* theSketcher,
-                                     const std::shared_ptr<GeomAPI_Ax3>& thePlane)
- : SketcherPrs_SymbolPrs(theConstraint, theSketcher, thePlane)
+  SketchPlugin_Sketch* theSketcher)
+ : SketcherPrs_SymbolPrs(theConstraint, theSketcher)
 {
 }
 
index e5fbda622193d8586cfddccc30e8f7a10b579d28..4f3352bd037c29b94d6ce72754e1eee3e71b465d 100755 (executable)
@@ -37,10 +37,8 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param theSketcher a sketcher object
-  /// \param thePlane a coordinate plane of current sketch
   Standard_EXPORT SketcherPrs_Middle(ModelAPI_Feature* theConstraint,
-                                     ModelAPI_CompositeFeature* theSketcher,
-                                     const std::shared_ptr<GeomAPI_Ax3>& thePlane);
+    SketchPlugin_Sketch* theSketcher);
   DEFINE_STANDARD_RTTIEXT(SketcherPrs_Middle, SketcherPrs_SymbolPrs)
 
   /// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
index 33a650116deaed59f480758d9db6355352847e6b..684669486423b5d46dcb3f3d6b7e3d57782282b9 100644 (file)
@@ -35,9 +35,8 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Mirror, SketcherPrs_SymbolPrs);
 static Handle(Image_AlienPixMap) MyPixMap;
 
 SketcherPrs_Mirror::SketcherPrs_Mirror(ModelAPI_Feature* theConstraint,
-                                      ModelAPI_CompositeFeature* theSketcher,
-                                           const std::shared_ptr<GeomAPI_Ax3>& thePlane)
- : SketcherPrs_SymbolPrs(theConstraint, theSketcher, thePlane)
+  SketchPlugin_Sketch* theSketcher)
+ : SketcherPrs_SymbolPrs(theConstraint, theSketcher)
 {
 }
 
index 7857e711884eb736630f99236d1f98610ab5c2c3..fc7624c66af65c2a62f8308c85837e861504d778 100644 (file)
@@ -37,10 +37,8 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param theSketcher a sketcher object
-  /// \param thePlane a coordinate plane of current sketch
   Standard_EXPORT SketcherPrs_Mirror(ModelAPI_Feature* theConstraint,
-                                     ModelAPI_CompositeFeature* theSketcher,
-                                       const std::shared_ptr<GeomAPI_Ax3>& thePlane);
+    SketchPlugin_Sketch* theSketcher);
   DEFINE_STANDARD_RTTIEXT(SketcherPrs_Mirror, SketcherPrs_SymbolPrs)
 
   /// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
index 90cdfd1299de6bf9e86b99570675c3fcf4798afb..0860b6e687e227a37272c537228b302ce80560a4 100644 (file)
@@ -34,9 +34,8 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Parallel, SketcherPrs_SymbolPrs);
 static Handle(Image_AlienPixMap) MyPixMap;
 
 SketcherPrs_Parallel::SketcherPrs_Parallel(ModelAPI_Feature* theConstraint,
-                                          ModelAPI_CompositeFeature* theSketcher,
-                                           const std::shared_ptr<GeomAPI_Ax3>& thePlane)
- : SketcherPrs_SymbolPrs(theConstraint, theSketcher, thePlane)
+  SketchPlugin_Sketch* theSketcher)
+ : SketcherPrs_SymbolPrs(theConstraint, theSketcher)
 {
 }
 
index d963fcc8b45fbc05a3216134a7672b4ac23fe814..767688c568d6de6117ec7f0f8b6233efb88fc73f 100644 (file)
@@ -37,10 +37,8 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param theSketcher a sketcher object
-  /// \param thePlane a coordinate plane of current sketch
   Standard_EXPORT SketcherPrs_Parallel(ModelAPI_Feature* theConstraint,
-                                       ModelAPI_CompositeFeature* theSketcher,
-                                       const std::shared_ptr<GeomAPI_Ax3>& thePlane);
+    SketchPlugin_Sketch* theSketcher);
   DEFINE_STANDARD_RTTIEXT(SketcherPrs_Parallel, SketcherPrs_SymbolPrs)
 
   /// Returns true if the constraint feature arguments are correcly filled to build AIS presentation
index 237301ee451c1dc532a78288b55ba90f5d1ddc12..7c94af55a221a3e864896c118abe0866f12c04c9 100644 (file)
@@ -37,9 +37,8 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Perpendicular, SketcherPrs_SymbolPrs);
 static Handle(Image_AlienPixMap) MyPixMap;
 
 SketcherPrs_Perpendicular::SketcherPrs_Perpendicular(ModelAPI_Feature* theConstraint,
-                                                     ModelAPI_CompositeFeature* theSketcher,
-                                                     const std::shared_ptr<GeomAPI_Ax3>& thePlane)
- : SketcherPrs_SymbolPrs(theConstraint, theSketcher, thePlane)
+  SketchPlugin_Sketch* theSketcher)
+ : SketcherPrs_SymbolPrs(theConstraint, theSketcher)
 {
 }
 
index b075d4aa4855dea6ba192953c970ea38dd02b3d5..c0c7a4448daa1d37729465e2e37ca902ba0c4215 100644 (file)
@@ -39,10 +39,8 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param theSketcher a sketcher object
-  /// \param thePlane a coordinate plane of current sketch
   Standard_EXPORT SketcherPrs_Perpendicular(ModelAPI_Feature* theConstraint,
-                                            ModelAPI_CompositeFeature* theSketcher,
-                                       const std::shared_ptr<GeomAPI_Ax3>& thePlane);
+    SketchPlugin_Sketch* theSketcher);
 
   DEFINE_STANDARD_RTTIEXT(SketcherPrs_Perpendicular, SketcherPrs_SymbolPrs)
 
index 88ad963b7fe5c20090ee0f113023e7994e0d2e19..19c8fa211d4e4543a010f11596b0ce3209744f2b 100644 (file)
@@ -51,9 +51,8 @@ static Handle(Image_AlienPixMap) MyPixMap;
 
 
 SketcherPrs_Rigid::SketcherPrs_Rigid(ModelAPI_Feature* theConstraint,
-                                      ModelAPI_CompositeFeature* theSketcher,
-                                           const std::shared_ptr<GeomAPI_Ax3>& thePlane)
- : SketcherPrs_SymbolPrs(theConstraint, theSketcher, thePlane)
+  SketchPlugin_Sketch* theSketcher)
+ : SketcherPrs_SymbolPrs(theConstraint, theSketcher)
 {
 }
 
index e35045ab7874095632c7c788e110e8e45cceba69..af9dec23b9799ca57a1cd042b1d4571e2a878d62 100644 (file)
@@ -39,10 +39,8 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param theSketcher a sketcher object
-  /// \param thePlane a coordinate plane of current sketch
   Standard_EXPORT SketcherPrs_Rigid(ModelAPI_Feature* theConstraint,
-                                    ModelAPI_CompositeFeature* theSketcher,
-                                       const std::shared_ptr<GeomAPI_Ax3>& thePlane);
+    SketchPlugin_Sketch* theSketcher);
 
 
   DEFINE_STANDARD_RTTIEXT(SketcherPrs_Rigid, SketcherPrs_SymbolPrs)
index a2e51cbd4fb848d73e2f56d655f6c80571775692..f74c6b5db6d55e015a3f05e373a2a2339edeae11 100644 (file)
@@ -119,10 +119,9 @@ std::map<const char*, Handle(Image_AlienPixMap)> SketcherPrs_SymbolPrs::myIconsM
 
 
 SketcherPrs_SymbolPrs::SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint,
-                                             ModelAPI_CompositeFeature* theSketcher,
-                                             const std::shared_ptr<GeomAPI_Ax3>& thePlane)
+  SketchPlugin_Sketch* theSketcher)
  : AIS_InteractiveObject(), myConstraint(theConstraint),
-   myPlane(thePlane), myIsCustomColor(false),
+   myPlane(theSketcher->coordinatePlane()), myIsCustomColor(false),
    mySketcher(theSketcher)
 {
   SetAutoHilight(Standard_False);
index 669f7a55523ef4cfb5365d56fa8c5e078bd14b52..b552bf612df2920d3e3668f2544727fcd5f2d775 100644 (file)
@@ -22,9 +22,9 @@
 #define SketcherPrs_SymbolPrs_H
 
 #include "SketcherPrs_SensitivePoint.h"
+#include <SketchPlugin_Sketch.h>
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_AttributeRefList.h>
-#include <ModelAPI_CompositeFeature.h>
 
 #include <AIS_InteractiveObject.hxx>
 #include <GeomAPI_Ax3.h>
@@ -56,8 +56,7 @@ public:
   /// \param theConstraint a constraint feature
   /// \param thePlane a coordinate plane of current sketch
   Standard_EXPORT SketcherPrs_SymbolPrs(ModelAPI_Feature* theConstraint,
-                        ModelAPI_CompositeFeature* theSketcher,
-                        const std::shared_ptr<GeomAPI_Ax3>& thePlane);
+                                        SketchPlugin_Sketch* theSketcher);
 
   virtual ~SketcherPrs_SymbolPrs();
 
@@ -66,7 +65,6 @@ public:
                                                const SelectMgr_SequenceOfOwner& theOwners);
 
   //! Method which hilight an owner belonging to
-  //! this selectable object  ( for fast presentation draw )
   Standard_EXPORT virtual void HilightOwnerWithColor(
     const Handle(PrsMgr_PresentationManager3d)& thePM,
     const Handle(Prs3d_Drawer)& theStyle,
index bf998d8120b5e8fe1c17ed3d932ab56567ee012c..46db38c8ef55af4bc0c1114852f026dbb61e4ca9 100644 (file)
@@ -40,9 +40,8 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Tangent, SketcherPrs_SymbolPrs);
 static Handle(Image_AlienPixMap) MyPixMap;
 
 SketcherPrs_Tangent::SketcherPrs_Tangent(ModelAPI_Feature* theConstraint,
-                                         ModelAPI_CompositeFeature* theSketcher,
-                                           const std::shared_ptr<GeomAPI_Ax3>& thePlane)
- : SketcherPrs_SymbolPrs(theConstraint, theSketcher, thePlane)
+  SketchPlugin_Sketch* theSketcher)
+ : SketcherPrs_SymbolPrs(theConstraint, theSketcher)
 {
 }
 
index 6da05ce52b96fa70e1451808ef1f47a61524b170..d8e06aac61d028e132ab0a6f62934eb091bc7255 100644 (file)
@@ -38,10 +38,8 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param theSketcher a sketcher object
-  /// \param thePlane a coordinate plane of current sketch
   Standard_EXPORT SketcherPrs_Tangent(ModelAPI_Feature* theConstraint,
-                                      ModelAPI_CompositeFeature* theSketcher,
-                                       const std::shared_ptr<GeomAPI_Ax3>& thePlane);
+    SketchPlugin_Sketch* theSketcher);
 
   DEFINE_STANDARD_RTTIEXT(SketcherPrs_Tangent, SketcherPrs_SymbolPrs)
 
index ed54c12582773a634fd0d83483bef1657238d25d..78d35e00821b41b0a44b694535449e682c9abc20 100644 (file)
@@ -42,10 +42,9 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Transformation, SketcherPrs_SymbolPrs);
 static Handle(Image_AlienPixMap) MyPixMap;
 
 SketcherPrs_Transformation::SketcherPrs_Transformation(ModelAPI_Feature* theConstraint,
-                                           ModelAPI_CompositeFeature* theSketcher,
-                                           const std::shared_ptr<GeomAPI_Ax3>& thePlane,
+  SketchPlugin_Sketch* theSketcher,
                                            bool isTranslation)
- : SketcherPrs_SymbolPrs(theConstraint, theSketcher, thePlane), myIsTranslation(isTranslation)
+ : SketcherPrs_SymbolPrs(theConstraint, theSketcher), myIsTranslation(isTranslation)
 {
 }
 
index e68397ff443dbfc2747ee873d1507f67168725b2..1119c4516a00689f6b3aaf3c75f1c6b784dd5267 100644 (file)
@@ -38,12 +38,9 @@ public:
   /// Constructor
   /// \param theConstraint a constraint feature
   /// \param theSketcher a sketcher object
-  /// \param thePlane a coordinate plane of current sketch
   /// \param isTranslation a flag is it translation or rotation
   Standard_EXPORT SketcherPrs_Transformation(ModelAPI_Feature* theConstraint,
-                                            ModelAPI_CompositeFeature* theSketcher,
-                                         const std::shared_ptr<GeomAPI_Ax3>& thePlane,
-                                         bool isTranslation);
+    SketchPlugin_Sketch* theSketcher, bool isTranslation);
 
   DEFINE_STANDARD_RTTIEXT(SketcherPrs_Transformation, SketcherPrs_SymbolPrs)