From: sbh Date: Wed, 1 Apr 2015 16:57:02 +0000 (+0300) Subject: Disabled pieces of code which causes runtime error in libPartSet.so X-Git-Tag: V_1.1.0~57^2~25^2~3^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a1a507560dbc3226167cc11fc27b5caba672edba;p=modules%2Fshaper.git Disabled pieces of code which causes runtime error in libPartSet.so undefined symbol: _ZTI17SketchPlugin_Line (through the libSketcherPrs.so) --- diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp index 59ca35b02..b7f708a9c 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp @@ -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 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 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 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 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 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 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 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 aLine = +// SketcherPrs_Tools::getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B()); +// if (aLine) { +// aDistance = aLine->distanceToPoint(aPointA->pnt()); +// } +// } } return aDistance; } diff --git a/src/SketchPlugin/SketchPlugin_Line.cpp b/src/SketchPlugin/SketchPlugin_Line.cpp index ed07e4079..555b8ae7f 100644 --- a/src/SketchPlugin/SketchPlugin_Line.cpp +++ b/src/SketchPlugin/SketchPlugin_Line.cpp @@ -100,6 +100,12 @@ double SketchPlugin_Line::distanceToPoint(const std::shared_ptr& 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; } diff --git a/src/SketchPlugin/SketchPlugin_Line.h b/src/SketchPlugin/SketchPlugin_Line.h index 05d94cc65..f6d895974 100644 --- a/src/SketchPlugin/SketchPlugin_Line.h +++ b/src/SketchPlugin/SketchPlugin_Line.h @@ -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(); diff --git a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp index 65b067782..4edc69f69 100644 --- a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp +++ b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp @@ -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 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 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 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 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; diff --git a/src/SketcherPrs/SketcherPrs_Tools.cpp b/src/SketcherPrs/SketcherPrs_Tools.cpp index c94864db6..e154f8000 100644 --- a/src/SketcherPrs/SketcherPrs_Tools.cpp +++ b/src/SketcherPrs/SketcherPrs_Tools.cpp @@ -100,38 +100,38 @@ std::shared_ptr getFeaturePoint(DataPtr theData, } //************************************************************************************* -std::shared_ptr getFeatureLine(DataPtr theData, - const std::string& theAttribute) -{ - std::shared_ptr aLine; - if (!theData) - return aLine; - - std::shared_ptr 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(aFeature); - } - } - return aLine; -} +//std::shared_ptr getFeatureLine(DataPtr theData, +// const std::string& theAttribute) +//{ +// std::shared_ptr aLine; +// if (!theData) +// return aLine; +// +// std::shared_ptr 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(aFeature); +// } +// } +// return aLine; +//} //************************************************************************************* -std::shared_ptr getProjectionPoint( - const std::shared_ptr& theLine, - const std::shared_ptr& thePoint) -{ - std::shared_ptr aData = theLine->data(); - std::shared_ptr aPoint1 = std::dynamic_pointer_cast( - aData->attribute(SketchPlugin_Line::START_ID())); - std::shared_ptr aPoint2 = std::dynamic_pointer_cast( - aData->attribute(SketchPlugin_Line::END_ID())); - - GeomAPI_Lin2d aLin2d(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y()); - return aLin2d.project(thePoint); -} +//std::shared_ptr getProjectionPoint( +// const std::shared_ptr& theLine, +// const std::shared_ptr& thePoint) +//{ +// std::shared_ptr aData = theLine->data(); +// std::shared_ptr aPoint1 = std::dynamic_pointer_cast( +// aData->attribute(SketchPlugin_Line::START_ID())); +// std::shared_ptr aPoint2 = std::dynamic_pointer_cast( +// 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 +}; diff --git a/src/SketcherPrs/SketcherPrs_Tools.h b/src/SketcherPrs/SketcherPrs_Tools.h index 294465963..cd74bdae6 100644 --- a/src/SketcherPrs/SketcherPrs_Tools.h +++ b/src/SketcherPrs/SketcherPrs_Tools.h @@ -29,12 +29,12 @@ namespace SketcherPrs_Tools { SKETCHERPRS_EXPORT std::shared_ptr getPoint(SketchPlugin_Constraint* theFeature, const std::string& theAttrName); - SKETCHERPRS_EXPORT std::shared_ptr getProjectionPoint( - const std::shared_ptr& theLine, - const std::shared_ptr& thePoint); +// SKETCHERPRS_EXPORT std::shared_ptr getProjectionPoint( +// const std::shared_ptr& theLine, +// const std::shared_ptr& thePoint); - SKETCHERPRS_EXPORT std::shared_ptr getFeatureLine(DataPtr theData, - const std::string& theAttribute); +// SKETCHERPRS_EXPORT std::shared_ptr getFeatureLine(DataPtr theData, +// const std::string& theAttribute); /// Obtain the point object from specified constraint parameter SKETCHERPRS_EXPORT std::shared_ptr getFeaturePoint(DataPtr theData, @@ -45,4 +45,4 @@ namespace SketcherPrs_Tools { SKETCHERPRS_EXPORT void setArrowSize(double theSize); }; -#endif \ No newline at end of file +#endif