X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketcherPrs%2FSketcherPrs_Parallel.cpp;h=448ba29e22605c790a7907afc346bafe5cfd208b;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=973a972b2ec00fb70a49b9948cce383432ceac2a;hpb=c4eab94a20a0d93100549a210582d46409fec1cc;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_Parallel.cpp b/src/SketcherPrs/SketcherPrs_Parallel.cpp index 973a972b2..448ba29e2 100644 --- a/src/SketcherPrs/SketcherPrs_Parallel.cpp +++ b/src/SketcherPrs/SketcherPrs_Parallel.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -24,8 +24,6 @@ #include #include -#include - IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_Parallel, SketcherPrs_SymbolPrs); @@ -39,23 +37,24 @@ SketcherPrs_Parallel::SketcherPrs_Parallel(ModelAPI_Feature* theConstraint, } bool SketcherPrs_Parallel::IsReadyToDisplay(ModelAPI_Feature* theConstraint, - const std::shared_ptr&/* thePlane*/) + const std::shared_ptr& thePlane) { bool aReadyToDisplay = false; - - ObjectPtr aObj1 = - SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); - ObjectPtr aObj2 = - SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B()); - - aReadyToDisplay = SketcherPrs_Tools::getShape(aObj1).get() != NULL && - SketcherPrs_Tools::getShape(aObj2).get() != NULL; + if (thePlane) { + ObjectPtr aObj1 = + SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); + ObjectPtr aObj2 = + SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_B()); + + aReadyToDisplay = SketcherPrs_Tools::getShape(aObj1).get() != NULL && + SketcherPrs_Tools::getShape(aObj2).get() != NULL; + } return aReadyToDisplay; } bool SketcherPrs_Parallel::updateIfReadyToDisplay(double theStep, bool withColor) const { - if (!IsReadyToDisplay(myConstraint, myPlane)) + if (!IsReadyToDisplay(myConstraint, plane())) return false; ObjectPtr aObj1 = @@ -77,7 +76,7 @@ bool SketcherPrs_Parallel::updateIfReadyToDisplay(double theStep, bool withColor void SketcherPrs_Parallel::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { - Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(thePrs); + Handle(Graphic3d_Group) aGroup = thePrs->CurrentGroup(); Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);