From: vsv Date: Tue, 17 Mar 2015 15:16:22 +0000 (+0300) Subject: Improve tangent presentation X-Git-Tag: V_1.1.0~116 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4db1ccae61d6f09173fcf51c60d1742bb9d37067;p=modules%2Fshaper.git Improve tangent presentation --- diff --git a/src/SketcherPrs/SketcherPrs_Equal.cpp b/src/SketcherPrs/SketcherPrs_Equal.cpp index e14da56f3..d6fa639d9 100644 --- a/src/SketcherPrs/SketcherPrs_Equal.cpp +++ b/src/SketcherPrs/SketcherPrs_Equal.cpp @@ -8,29 +8,10 @@ #include "SketcherPrs_Tools.h" #include "SketcherPrs_PositionMgr.h" -#include - #include -#include -#include - -#include -#include -#include - -#include -#include #include -#include - -#include -#include - -#include -#include -#include - +#include IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Equal, SketcherPrs_SymbolPrs); @@ -39,12 +20,12 @@ IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Equal, SketcherPrs_SymbolPrs); static Handle(Image_AlienPixMap) MyPixMap; SketcherPrs_Equal::SketcherPrs_Equal(SketchPlugin_Constraint* theConstraint, - const std::shared_ptr& thePlane) + const std::shared_ptr& thePlane) : SketcherPrs_SymbolPrs(theConstraint, thePlane) { myPntArray = new Graphic3d_ArrayOfPoints(2); myPntArray->AddVertex(0., 0., 0.); - myPntArray->AddVertex(0. ,0., 0.); + myPntArray->AddVertex(0., 0., 0.); } void SketcherPrs_Equal::Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager, diff --git a/src/SketcherPrs/SketcherPrs_HVDirection.cpp b/src/SketcherPrs/SketcherPrs_HVDirection.cpp index fe0831211..2c0e892dd 100644 --- a/src/SketcherPrs/SketcherPrs_HVDirection.cpp +++ b/src/SketcherPrs/SketcherPrs_HVDirection.cpp @@ -8,28 +8,10 @@ #include "SketcherPrs_Tools.h" #include "SketcherPrs_PositionMgr.h" -#include - #include -#include -#include - -#include -#include -#include - -#include -#include #include -#include - -#include -#include - -#include -#include -#include +#include diff --git a/src/SketcherPrs/SketcherPrs_Parallel.cpp b/src/SketcherPrs/SketcherPrs_Parallel.cpp index 2736ee169..6b7e07194 100644 --- a/src/SketcherPrs/SketcherPrs_Parallel.cpp +++ b/src/SketcherPrs/SketcherPrs_Parallel.cpp @@ -8,28 +8,10 @@ #include "SketcherPrs_Tools.h" #include "SketcherPrs_PositionMgr.h" -#include - #include -#include -#include - -#include -#include -#include - -#include -#include #include -#include - -#include -#include - -#include -#include -#include +#include diff --git a/src/SketcherPrs/SketcherPrs_Perpendicular.cpp b/src/SketcherPrs/SketcherPrs_Perpendicular.cpp index 5158b932d..d27cf03e5 100644 --- a/src/SketcherPrs/SketcherPrs_Perpendicular.cpp +++ b/src/SketcherPrs/SketcherPrs_Perpendicular.cpp @@ -8,21 +8,10 @@ #include "SketcherPrs_Tools.h" #include "SketcherPrs_PositionMgr.h" -#include - #include -#include -#include - -#include -#include -#include - -#include -#include #include -#include +#include diff --git a/src/SketcherPrs/SketcherPrs_Rigid.cpp b/src/SketcherPrs/SketcherPrs_Rigid.cpp index 34c028751..9c3d812ea 100644 --- a/src/SketcherPrs/SketcherPrs_Rigid.cpp +++ b/src/SketcherPrs/SketcherPrs_Rigid.cpp @@ -18,21 +18,8 @@ #include #include -#include -#include -#include - -#include -#include #include -#include - -#include -#include - -#include -#include -#include +#include #include #include diff --git a/src/SketcherPrs/SketcherPrs_Tangent.cpp b/src/SketcherPrs/SketcherPrs_Tangent.cpp index 4d13a6535..d41d5dc1b 100644 --- a/src/SketcherPrs/SketcherPrs_Tangent.cpp +++ b/src/SketcherPrs/SketcherPrs_Tangent.cpp @@ -8,29 +8,14 @@ #include "SketcherPrs_Tools.h" #include "SketcherPrs_PositionMgr.h" -#include +#include #include -#include -#include - -#include +#include #include -#include - -#include -#include #include -#include - -#include -#include - -#include -#include -#include - +#include IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Tangent, SketcherPrs_SymbolPrs); @@ -82,7 +67,25 @@ void SketcherPrs_Tangent::drawLines(const Handle(Prs3d_Presentation)& thePrs, Qu Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2); aGroup->SetPrimitivesAspect(aLineAspect); - addLine(aGroup, SketchPlugin_Constraint::ENTITY_A()); - addLine(aGroup, SketchPlugin_Constraint::ENTITY_B()); + ObjectPtr aObj1 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A()); + ObjectPtr aObj2 = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B()); + + std::shared_ptr aShape1 = SketcherPrs_Tools::getShape(aObj1); + std::shared_ptr aShape2 = SketcherPrs_Tools::getShape(aObj2); + + if ((aShape1.get() == NULL) || (aShape2.get() == NULL)) + return; + + std::shared_ptr aCurve1 = std::shared_ptr(new GeomAPI_Curve(aShape1)); + std::shared_ptr aCurve2 = std::shared_ptr(new GeomAPI_Curve(aShape2)); + if (aCurve1->isLine()) { + addLine(aGroup, SketchPlugin_Constraint::ENTITY_A()); + GeomAdaptor_Curve aAdaptor(aCurve2->impl(), aCurve2->startParam(), aCurve2->endParam()); + StdPrs_DeflectionCurve::Add(thePrs,aAdaptor,myDrawer); + } else { + addLine(aGroup, SketchPlugin_Constraint::ENTITY_B()); + GeomAdaptor_Curve aAdaptor(aCurve1->impl(), aCurve1->startParam(), aCurve1->endParam()); + StdPrs_DeflectionCurve::Add(thePrs,aAdaptor,myDrawer); + } }