Salome HOME
Disabled pieces of code which causes runtime error in libPartSet.so
authorsbh <sergey.belash@opencascade.com>
Wed, 1 Apr 2015 16:57:02 +0000 (19:57 +0300)
committersbh <sergey.belash@opencascade.com>
Wed, 1 Apr 2015 16:57:02 +0000 (19:57 +0300)
undefined symbol: _ZTI17SketchPlugin_Line (through the libSketcherPrs.so)

src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp
src/SketchPlugin/SketchPlugin_Line.cpp
src/SketchPlugin/SketchPlugin_Line.h
src/SketcherPrs/SketcherPrs_LengthDimension.cpp
src/SketcherPrs/SketcherPrs_Tools.cpp
src/SketcherPrs/SketcherPrs_Tools.h

index 59ca35b02cc6fcebf2681d99929a8219f415238f..b7f708a9c59578efdec9e6d06e6b9690e1c46058 100644 (file)
@@ -82,19 +82,19 @@ bool SketchPlugin_ConstraintDistance::compute(const std::string& theAttributeId)
     aPnt_A = aPoint_A->pnt();
     aPnt_B = aPoint_B->pnt();
   } else if (!aPoint_A && aPoint_B) {
-    std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
-        aData, SketchPlugin_Constraint::ENTITY_A());
-    if (aLine) {
-      aPnt_B = aPoint_B->pnt();
-      aPnt_A = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_B);
-    }
+    //std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
+    //    aData, SketchPlugin_Constraint::ENTITY_A());
+    //if (aLine) {
+    //  aPnt_B = aPoint_B->pnt();
+    //  aPnt_A = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_B);
+    //}
   } else if (aPoint_A && !aPoint_B) {
-    std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
-        aData, SketchPlugin_Constraint::ENTITY_B());
-    if (aLine) {
-      aPnt_A = aPoint_A->pnt();
-      aPnt_B = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_A);
-    }
+    //std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
+    //    aData, SketchPlugin_Constraint::ENTITY_B());
+    //if (aLine) {
+    //  aPnt_A = aPoint_A->pnt();
+    //  aPnt_B = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_A);
+    //}
   }
   if (!aPnt_A || !aPnt_B)
     return false;
@@ -159,19 +159,19 @@ double SketchPlugin_ConstraintDistance::calculateCurrentDistance() const
   if (aPointA && aPointB) {  // both points
     aDistance = aPointA->pnt()->distance(aPointB->pnt());
   } else {
-    if (!aPointA && aPointB) {  //Line and point
-      std::shared_ptr<SketchPlugin_Line> aLine =
-          SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A());
-      if (aLine) {
-        aDistance = aLine->distanceToPoint(aPointB->pnt());
-      }
-    } else if (aPointA && !aPointB) {  // Point and line
-      std::shared_ptr<SketchPlugin_Line> aLine =
-          SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B());
-      if (aLine) {
-        aDistance = aLine->distanceToPoint(aPointA->pnt());
-      }
-    }
+//    if (!aPointA && aPointB) {  //Line and point
+//      std::shared_ptr<SketchPlugin_Line> aLine =
+//          SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A());
+//      if (aLine) {
+//        aDistance = aLine->distanceToPoint(aPointB->pnt());
+//      }
+//    } else if (aPointA && !aPointB) {  // Point and line
+//      std::shared_ptr<SketchPlugin_Line> aLine =
+//          SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B());
+//      if (aLine) {
+//        aDistance = aLine->distanceToPoint(aPointA->pnt());
+//      }
+//    }
   }
   return aDistance;
 }
index ed07e4079bd6bd7eba234a943289ec1d97b6539e..555b8ae7f4e18e85e3d490e5537bd7a6fd2c899e 100644 (file)
@@ -100,6 +100,12 @@ double SketchPlugin_Line::distanceToPoint(const std::shared_ptr<GeomAPI_Pnt2d>&
   return aDelta;
 }
 
+const std::string& SketchPlugin_Line::getKind()
+{
+  static std::string MY_KIND = SketchPlugin_Line::ID();
+  return MY_KIND;
+}
+
 bool SketchPlugin_Line::isFixed() {
   return data()->selection(EXTERNAL_ID())->context().get() != NULL;
 }
index 05d94cc65e59bd582bd6290920a1d7820d995e4a..f6d895974b981354c6eda92f0ba9c2f95f4a2dd8 100644 (file)
@@ -39,11 +39,7 @@ class SketchPlugin_Line : public SketchPlugin_SketchEntity
   }
 
   /// Returns the kind of a feature
-  SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
-  {
-    static std::string MY_KIND = SketchPlugin_Line::ID();
-    return MY_KIND;
-  }
+  SKETCHPLUGIN_EXPORT virtual const std::string& getKind();
 
   /// Returns true is sketch element is under the rigid constraint
   SKETCHPLUGIN_EXPORT virtual bool isFixed();
index 65b067782dcf50b1a9e48efc7241a5c66b3b5ea8..4edc69f69575362b81c650603cab6d78ebbfb34e 100644 (file)
@@ -126,19 +126,19 @@ bool SketcherPrs_LengthDimension::getPoints(gp_Pnt& thePnt1, gp_Pnt& thePnt2) co
       aPnt_A = aPoint_A->pnt();
       aPnt_B = aPoint_B->pnt();
     } else if (!aPoint_A && aPoint_B) {
-      std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
-          aData, SketchPlugin_Constraint::ENTITY_A());
-      if (aLine) {
-        aPnt_B = aPoint_B->pnt();
-        aPnt_A = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_B);
-      }
+//      std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
+//          aData, SketchPlugin_Constraint::ENTITY_A());
+//      if (aLine) {
+//        aPnt_B = aPoint_B->pnt();
+//        aPnt_A = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_B);
+//      }
     } else if (aPoint_A && !aPoint_B) {
-      std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
-          aData, SketchPlugin_Constraint::ENTITY_B());
-      if (aLine) {
-        aPnt_A = aPoint_A->pnt();
-        aPnt_B = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_A);
-      }
+//      std::shared_ptr<SketchPlugin_Line> aLine = SketcherPrs_Tools::getFeatureLine(
+//          aData, SketchPlugin_Constraint::ENTITY_B());
+//      if (aLine) {
+//        aPnt_A = aPoint_A->pnt();
+//        aPnt_B = SketcherPrs_Tools::getProjectionPoint(aLine, aPnt_A);
+//      }
     }
     if (!aPnt_A || !aPnt_B)
       return false;
index c94864db66134292b2ffa075a1329431bdd3ba04..e154f8000f89d366cfbafc8528fbd5caba6290bd 100644 (file)
@@ -100,38 +100,38 @@ std::shared_ptr<GeomDataAPI_Point2D> getFeaturePoint(DataPtr theData,
 }
 
 //*************************************************************************************
-std::shared_ptr<SketchPlugin_Line> getFeatureLine(DataPtr theData,
-                                                  const std::string& theAttribute)
-{
-  std::shared_ptr<SketchPlugin_Line> aLine;
-  if (!theData)
-    return aLine;
-
-  std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = std::dynamic_pointer_cast<
-      ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute));
-  if (anAttr) {
-    FeaturePtr aFeature = ModelAPI_Feature::feature(anAttr->object());
-    if (aFeature && aFeature->getKind() == SketchPlugin_Line::ID()) {
-      aLine = std::dynamic_pointer_cast<SketchPlugin_Line>(aFeature);
-    }
-  }
-  return aLine;
-}
+//std::shared_ptr<SketchPlugin_Line> getFeatureLine(DataPtr theData,
+//                                                  const std::string& theAttribute)
+//{
+//  std::shared_ptr<SketchPlugin_Line> aLine;
+//  if (!theData)
+//    return aLine;
+//
+//  std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = std::dynamic_pointer_cast<
+//      ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute));
+//  if (anAttr) {
+//    FeaturePtr aFeature = ModelAPI_Feature::feature(anAttr->object());
+//    if (aFeature && aFeature->getKind() == SketchPlugin_Line::ID()) {
+//      aLine = std::dynamic_pointer_cast<SketchPlugin_Line>(aFeature);
+//    }
+//  }
+//  return aLine;
+//}
 
 //*************************************************************************************
-std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(
-    const std::shared_ptr<SketchPlugin_Line>& theLine,
-    const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
-{
-  std::shared_ptr<ModelAPI_Data> aData = theLine->data();
-  std::shared_ptr<GeomDataAPI_Point2D> aPoint1 = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-      aData->attribute(SketchPlugin_Line::START_ID()));
-  std::shared_ptr<GeomDataAPI_Point2D> aPoint2 = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-      aData->attribute(SketchPlugin_Line::END_ID()));
-
-  GeomAPI_Lin2d aLin2d(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y());
-  return aLin2d.project(thePoint);
-}
+//std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(
+//    const std::shared_ptr<SketchPlugin_Line>& theLine,
+//    const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
+//{
+//  std::shared_ptr<ModelAPI_Data> aData = theLine->data();
+//  std::shared_ptr<GeomDataAPI_Point2D> aPoint1 = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+//      aData->attribute(SketchPlugin_Line::START_ID()));
+//  std::shared_ptr<GeomDataAPI_Point2D> aPoint2 = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+//      aData->attribute(SketchPlugin_Line::END_ID()));
+//
+//  GeomAPI_Lin2d aLin2d(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y());
+//  return aLin2d.project(thePoint);
+//}
 
 
 static double MyArrowSize = 30.;
@@ -145,4 +145,4 @@ void setArrowSize(double theSize)
   MyArrowSize = theSize;
 }
 
-};
\ No newline at end of file
+};
index 29446596382d3ccdc54e012871588ec0523fa292..cd74bdae679806e474b87a576dc0938f9ec74757 100644 (file)
@@ -29,12 +29,12 @@ namespace SketcherPrs_Tools {
   SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt2d> getPoint(SketchPlugin_Constraint* theFeature,
                                           const std::string& theAttrName);
 
-  SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(
-                        const std::shared_ptr<SketchPlugin_Line>& theLine,
-                        const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
+//  SKETCHERPRS_EXPORT std::shared_ptr<GeomAPI_Pnt2d> getProjectionPoint(
+//                        const std::shared_ptr<SketchPlugin_Line>& theLine,
+//                        const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
 
-  SKETCHERPRS_EXPORT std::shared_ptr<SketchPlugin_Line> getFeatureLine(DataPtr theData,
-                                                    const std::string& theAttribute);
+//  SKETCHERPRS_EXPORT std::shared_ptr<SketchPlugin_Line> getFeatureLine(DataPtr theData,
+//                                                    const std::string& theAttribute);
 
   /// Obtain the point object from specified constraint parameter
   SKETCHERPRS_EXPORT std::shared_ptr<GeomDataAPI_Point2D> getFeaturePoint(DataPtr theData,
@@ -45,4 +45,4 @@ namespace SketcherPrs_Tools {
   SKETCHERPRS_EXPORT void setArrowSize(double theSize);
 };
 
-#endif
\ No newline at end of file
+#endif