X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketcherPrs%2FSketcherPrs_HVDirection.cpp;h=b33a3224b5cf5aea260a252f7a3408780fe8fae8;hb=88ee9b2b81cf93a6324336b57e30cc8a3a487499;hp=942bd909e82d5ee64ff52e8250742dcae3463f68;hpb=4c74e5b864eef28128e27b3ece944990ca8f3fbe;p=modules%2Fshaper.git diff --git a/src/SketcherPrs/SketcherPrs_HVDirection.cpp b/src/SketcherPrs/SketcherPrs_HVDirection.cpp index 942bd909e..b33a3224b 100644 --- a/src/SketcherPrs/SketcherPrs_HVDirection.cpp +++ b/src/SketcherPrs/SketcherPrs_HVDirection.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2022 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,6 @@ #include #include -#include IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs); @@ -39,13 +38,14 @@ SketcherPrs_HVDirection::SketcherPrs_HVDirection(ModelAPI_Feature* theConstraint } bool SketcherPrs_HVDirection::IsReadyToDisplay(ModelAPI_Feature* theConstraint, - const std::shared_ptr&/* thePlane*/) + const std::shared_ptr& thePlane) { bool aReadyToDisplay = false; - ObjectPtr aObj = - SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); - - aReadyToDisplay = SketcherPrs_Tools::getShape(aObj).get() != NULL; + if (thePlane.get()) { + ObjectPtr aObj = + SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A()); + aReadyToDisplay = SketcherPrs_Tools::getShape(aObj).get() != NULL; + } return aReadyToDisplay; } @@ -66,7 +66,7 @@ bool SketcherPrs_HVDirection::updateIfReadyToDisplay(double theStep, bool withCo void SketcherPrs_HVDirection::drawLines(const Handle(Prs3d_Presentation)& thePrs, Quantity_Color theColor) const { - Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(thePrs); + Handle(Graphic3d_Group) aGroup = thePrs->CurrentGroup(); // Draw constrained object Handle(Graphic3d_AspectLine3d) aLineAspect =