From: Anthony Geay Date: Mon, 11 Apr 2022 12:13:25 +0000 (+0200) Subject: [EDF25207] : Fix bbox computation in the polhedron with more than 255 nodes context X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3cdf07f8688e1b4807e3ccd8347613b3f9cfd655;p=tools%2Fmedcoupling.git [EDF25207] : Fix bbox computation in the polhedron with more than 255 nodes context --- diff --git a/src/INTERP_KERNEL/MeshElement.hxx b/src/INTERP_KERNEL/MeshElement.hxx index 6324f594e..2953cf960 100644 --- a/src/INTERP_KERNEL/MeshElement.hxx +++ b/src/INTERP_KERNEL/MeshElement.hxx @@ -22,6 +22,8 @@ #include "BoundingBox.hxx" +#include + namespace INTERP_KERNEL { @@ -42,7 +44,7 @@ namespace INTERP_KERNEL ConnType getIndex() const { return _index; } - unsigned char getNumberOfNodes() const { return _number; } + std::uint16_t getNumberOfNodes() const { return _number; } const BoundingBox* getBoundingBox() const { return _box; } @@ -56,7 +58,7 @@ namespace INTERP_KERNEL /// global number of the element const ConnType _index; - const unsigned char _number; + const std::uint16_t _number; /// bounding box of the element - does not change after having been initialised BoundingBox* _box; diff --git a/src/INTERP_KERNEL/MeshElement.txx b/src/INTERP_KERNEL/MeshElement.txx index 5fa0d6a02..e73d8074c 100755 --- a/src/INTERP_KERNEL/MeshElement.txx +++ b/src/INTERP_KERNEL/MeshElement.txx @@ -39,11 +39,11 @@ namespace INTERP_KERNEL template template MeshElement::MeshElement(const ConnType index, const MyMeshType& mesh) - : _index(index), _number((unsigned char)mesh.getNumberOfNodesOfElement(OTT::indFC(index))), _box(0) + : _index(index), _number( static_cast(mesh.getNumberOfNodesOfElement(OTT::indFC(index))) ), _box(nullptr) { const double**vertices = new const double*[_number]; - for(unsigned char i = 0 ; i < _number ; ++i) + for(std::uint16_t i = 0 ; i < _number ; ++i) vertices[i] = getCoordsOfNode(i , OTT::indFC(index), mesh); // create bounding box