X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSketcherPrs%2FSketcherPrs_Tangent.cpp;h=45f32049425091c54120cc4d9426ca5457d3d15e;hb=64576d3cff0fccdf9f2676044e2b699c9681d9fb;hp=88dcd35c3fd45b27b56196ccb1e4f7ad9daef8a6;hpb=d1b90cc379d69e8539f4613ae1aaf78009bffa12;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_Tangent.cpp b/src/SketcherPrs/SketcherPrs_Tangent.cpp index 88dcd35c3..45f320494 100644 --- a/src/SketcherPrs/SketcherPrs_Tangent.cpp +++ b/src/SketcherPrs/SketcherPrs_Tangent.cpp @@ -23,7 +23,7 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Tangent, SketcherPrs_SymbolPrs); static Handle(Image_AlienPixMap) MyPixMap; -SketcherPrs_Tangent::SketcherPrs_Tangent(SketchPlugin_Constraint* theConstraint, +SketcherPrs_Tangent::SketcherPrs_Tangent(ModelAPI_Feature* theConstraint, const std::shared_ptr& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { @@ -32,32 +32,21 @@ SketcherPrs_Tangent::SketcherPrs_Tangent(SketchPlugin_Constraint* theConstraint, myPntArray->AddVertex(0., 0., 0.); } -void SketcherPrs_Tangent::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, - const Handle(Prs3d_Presentation)& thePresentation, - const Standard_Integer theMode) +bool SketcherPrs_Tangent::updatePoints(double theStep) const { - prepareAspect(); - ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A()); ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B()); + if (SketcherPrs_Tools::getShape(aObj1).get() == NULL) + return false; + if (SketcherPrs_Tools::getShape(aObj2).get() == NULL) + return false; - std::shared_ptr aLine1 = SketcherPrs_Tools::getShape(aObj1); - if (aLine1.get() == NULL) - return; - - std::shared_ptr aLine2 = SketcherPrs_Tools::getShape(aObj2); - if (aLine2.get() == NULL) - return; - SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get(); - 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); + gp_Pnt aP1 = aMgr->getPosition(aObj1, this, theStep); + gp_Pnt aP2 = aMgr->getPosition(aObj2, this, theStep); myPntArray->SetVertice(1, aP1); myPntArray->SetVertice(2, aP2); - aGroup->AddPrimitiveArray(myPntArray); + return true; } void SketcherPrs_Tangent::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const