Salome HOME
updated copyright message
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Tools.cpp
index d535a6d7f362c3d27f2d5db3d7a40a5d8996f273..b364447914f73b3c9b155d7c4917b826492b8c51 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2020  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
@@ -47,7 +47,7 @@
 #include <BRep_Tool.hxx>
 #include <Precision.hxx>
 
-#include <AIS_Dimension.hxx>
+#include <PrsDim_Dimension.hxx>
 
 namespace SketcherPrs_Tools {
 
@@ -95,6 +95,11 @@ ObjectPtr getResult(ModelAPI_Feature* theFeature, const std::string& theAttrName
 std::shared_ptr<GeomAPI_Shape> getShape(ObjectPtr theObject)
 {
   ResultConstructionPtr aRes = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theObject);
+  if (!aRes.get()) {
+    FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theObject);
+    if (aFeature.get())
+      aRes = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aFeature->lastResult());
+  }
   if (aRes.get() != NULL && aRes->data()->isValid()) {
     /// essential check as it is called in openGl thread
     return aRes->shape();