X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketcherPrs%2FSketcherPrs_Perpendicular.cpp;h=d27cf03e57cb1b28e4876ec9d52b7c11ac05f67b;hb=7f873aed4bae5a98dca078209699b54276b46fce;hp=0c9e45da273a071f60fa41c1ec420809a31dc720;hpb=0f0ed262e58309bcd9e5a1cb8415523821051d8d;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_Perpendicular.cpp b/src/SketcherPrs/SketcherPrs_Perpendicular.cpp index 0c9e45da2..d27cf03e5 100644 --- a/src/SketcherPrs/SketcherPrs_Perpendicular.cpp +++ b/src/SketcherPrs/SketcherPrs_Perpendicular.cpp @@ -8,26 +8,10 @@ #include "SketcherPrs_Tools.h" #include "SketcherPrs_PositionMgr.h" -#include - #include -#include -#include - -#include -#include -#include - -#include -#include #include -#include - - -// Function which is defined in SketchPlugin_ConstraintDistance.cpp -extern std::shared_ptr getFeaturePoint(DataPtr theData, - const std::string& theAttribute); +#include @@ -42,7 +26,7 @@ SketcherPrs_Perpendicular::SketcherPrs_Perpendicular(SketchPlugin_Constraint* th { myPntArray = new Graphic3d_ArrayOfPoints(2); myPntArray->AddVertex(0., 0., 0.); - myPntArray->AddVertex(0. ,0., 0.); + myPntArray->AddVertex(0., 0., 0.); } void SketcherPrs_Perpendicular::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, @@ -51,17 +35,20 @@ void SketcherPrs_Perpendicular::Compute(const Handle(PrsMgr_PresentationManager3 { prepareAspect(); - std::shared_ptr aLine1 = SketcherPrs_Tools::getLine(myConstraint, SketchPlugin_Constraint::ENTITY_A()); + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A()); + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B()); + + std::shared_ptr aLine1 = SketcherPrs_Tools::getShape(aObj1); if (aLine1.get() == NULL) return; - std::shared_ptr aLine2 = SketcherPrs_Tools::getLine(myConstraint, SketchPlugin_Constraint::ENTITY_B()); + std::shared_ptr aLine2 = SketcherPrs_Tools::getShape(aObj2); if (aLine2.get() == NULL) return; SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get(); - gp_Pnt aP1 = aMgr->getPosition(aLine1, this); - gp_Pnt aP2 = aMgr->getPosition(aLine2, this); + gp_Pnt aP1 = aMgr->getPosition(aObj1, this); + gp_Pnt aP2 = aMgr->getPosition(aObj2, this); Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(thePresentation); aGroup->SetPrimitivesAspect(myAspect);