From 8aafaf00ad0b116557b752f1daa958500f3a1779 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me?= Date: Thu, 17 Dec 2020 14:06:34 +0100 Subject: [PATCH] #20529 : fix issue --- .vscode/settings.json | 58 ------------------- .../FeaturesPlugin_PointCoordinates.cpp | 16 +++-- 2 files changed, 10 insertions(+), 64 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index f5d069e51..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "restructuredtext.confPath": "", - "files.associations": { - "array": "cpp", - "atomic": "cpp", - "*.tcc": "cpp", - "bitset": "cpp", - "cctype": "cpp", - "chrono": "cpp", - "clocale": "cpp", - "cmath": "cpp", - "cstdarg": "cpp", - "cstddef": "cpp", - "cstdint": "cpp", - "cstdio": "cpp", - "cstdlib": "cpp", - "cstring": "cpp", - "ctime": "cpp", - "cwchar": "cpp", - "cwctype": "cpp", - "deque": "cpp", - "list": "cpp", - "unordered_map": "cpp", - "vector": "cpp", - "exception": "cpp", - "algorithm": "cpp", - "functional": "cpp", - "iterator": "cpp", - "map": "cpp", - "memory": "cpp", - "memory_resource": "cpp", - "numeric": "cpp", - "optional": "cpp", - "ratio": "cpp", - "regex": "cpp", - "set": "cpp", - "string": "cpp", - "string_view": "cpp", - "system_error": "cpp", - "tuple": "cpp", - "type_traits": "cpp", - "utility": "cpp", - "fstream": "cpp", - "initializer_list": "cpp", - "iomanip": "cpp", - "iosfwd": "cpp", - "iostream": "cpp", - "istream": "cpp", - "limits": "cpp", - "new": "cpp", - "ostream": "cpp", - "sstream": "cpp", - "stdexcept": "cpp", - "streambuf": "cpp", - "cinttypes": "cpp", - "typeinfo": "cpp" - } -} \ No newline at end of file diff --git a/src/FeaturesPlugin/FeaturesPlugin_PointCoordinates.cpp b/src/FeaturesPlugin/FeaturesPlugin_PointCoordinates.cpp index 6a6daa9c5..01b8199a0 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_PointCoordinates.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_PointCoordinates.cpp @@ -79,12 +79,16 @@ void FeaturesPlugin_PointCoordinates::attributeChanged(const std::string& theID) } if (aShape) { aPoint = GeomAlgoAPI_PointBuilder::point(aShape); - streamx << std::setprecision(14) << aPoint->x(); - aValues->setValue(0, aPoint->x()); - streamy << std::setprecision(14) << aPoint->y(); - aValues->setValue(1, aPoint->y()); - streamz << std::setprecision(14) << aPoint->z(); - aValues->setValue(2, aPoint->z()); + if (aPoint.get()) { + streamx << std::setprecision(14) << aPoint->x(); + aValues->setValue(0, aPoint->x()); + streamy << std::setprecision(14) << aPoint->y(); + aValues->setValue(1, aPoint->y()); + streamz << std::setprecision(14) << aPoint->z(); + aValues->setValue(2, aPoint->z()); + } else { + aSelection->setValue( aSelection->context(),GeomShapePtr()); + } } string(X_COORD_ID() )->setValue( "X = " + streamx.str() ); -- 2.39.2