diff --git a/Source/CollisionDetection/CollisionData/imstkCollisionData.h b/Source/CollisionDetection/CollisionData/imstkCollisionData.h index 690d231b32485cec5ee0dc1d908ed9b4228059c6..4fee75547d702c032e471a63e4fffc2b266e42a2 100644 --- a/Source/CollisionDetection/CollisionData/imstkCollisionData.h +++ b/Source/CollisionDetection/CollisionData/imstkCollisionData.h @@ -76,9 +76,9 @@ struct CellVertexElement /// struct CellIndexElement { - int ids[4] = { -1, -1, -1, -1 }; - int idCount = 0; - CellType cellType = IMSTK_VERTEX; + int ids[4] = { -1, -1, -1, -1 }; + int idCount = 0; + CellTypeId cellType = IMSTK_VERTEX; }; /// diff --git a/Source/CollisionHandling/imstkPBDCollisionHandling.cpp b/Source/CollisionHandling/imstkPBDCollisionHandling.cpp index 358829666028fda73b67df0da5592fb554d380ce..63ed3a240eeb4b323c8738dd3c32cca0f19e2a80 100644 --- a/Source/CollisionHandling/imstkPBDCollisionHandling.cpp +++ b/Source/CollisionHandling/imstkPBDCollisionHandling.cpp @@ -285,7 +285,7 @@ PBDCollisionHandling::generateMeshNonMeshConstraints( continue; } - const CellType cellTypeA = colElemA.m_element.m_CellIndexElement.cellType; + const CellTypeId cellTypeA = colElemA.m_element.m_CellIndexElement.cellType; // Triangle vs ... if (cellTypeA == IMSTK_TRIANGLE) @@ -429,8 +429,8 @@ PBDCollisionHandling::generateMeshMeshConstraints( continue; } - const CellType cellTypeA = colElemA.m_element.m_CellIndexElement.cellType; - const CellType cellTypeB = colElemB.m_element.m_CellIndexElement.cellType; + const CellTypeId cellTypeA = colElemA.m_element.m_CellIndexElement.cellType; + const CellTypeId cellTypeB = colElemB.m_element.m_CellIndexElement.cellType; // Vertex vs Triangle if (cellTypeA == IMSTK_VERTEX && cellTypeB == IMSTK_TRIANGLE) diff --git a/Source/Common/Testing/imstkDataArrayTest.cpp b/Source/Common/Testing/imstkDataArrayTest.cpp index 2593aad8c1ecef70574a211e33424dc0cb355b9c..d58212102485edcea84dc50f91df42a249f436b5 100644 --- a/Source/Common/Testing/imstkDataArrayTest.cpp +++ b/Source/Common/Testing/imstkDataArrayTest.cpp @@ -188,7 +188,7 @@ TEST(imstkDataArrayTest, Iterators) EXPECT_ANY_THROW(++it); } -TEST(imstkDataArrayTest, ScalarType) +TEST(imstkDataArrayTest, ScalarTypeId) { DataArray<int> a; EXPECT_EQ(IMSTK_INT, a.getScalarType()); diff --git a/Source/Common/imstkAbstractDataArray.h b/Source/Common/imstkAbstractDataArray.h index 5bc27d326d8dd314beb58201b2506bcea25183ec..9172e082d3796a78f7217f3412ae5271d81b80c3 100644 --- a/Source/Common/imstkAbstractDataArray.h +++ b/Source/Common/imstkAbstractDataArray.h @@ -76,7 +76,7 @@ public: /// /// \brief Returns the scalar type of this array /// - inline ScalarType getScalarType() const { return m_scalarType; } + inline ScalarTypeId getScalarType() const { return m_scalarType; } /// /// \brief Return the capacity of the array @@ -92,7 +92,7 @@ public: /// \brief cast the content to the given imstk scalar type without /// having to know the type of the enclosed array /// - virtual std::shared_ptr<AbstractDataArray> cast(ScalarType) = 0; + virtual std::shared_ptr<AbstractDataArray> cast(ScalarTypeId) = 0; public: /// @@ -102,10 +102,10 @@ public: inline void postModified() { this->postEvent(Event(AbstractDataArray::modified())); } protected: - void setType(const ScalarType type) { this->m_scalarType = type; } + void setType(const ScalarTypeId type) { this->m_scalarType = type; } protected: - ScalarType m_scalarType; + ScalarTypeId m_scalarType; int m_size; // Number of values int m_capacity; // Capacity of the vector }; diff --git a/Source/Common/imstkDataArray.h b/Source/Common/imstkDataArray.h index 66b944ff228705a14ed8c5bf32d9eda3d5a07dbe..c69a61398d9d6ac4c76d4250c35c77956b9e1740 100644 --- a/Source/Common/imstkDataArray.h +++ b/Source/Common/imstkDataArray.h @@ -428,7 +428,7 @@ public: /// /// \brief Cast array to the IMSTK type on the abstract interface /// - std::shared_ptr<AbstractDataArray> cast(ScalarType type) override + std::shared_ptr<AbstractDataArray> cast(ScalarTypeId type) override { if (type == AbstractDataArray::m_scalarType) { diff --git a/Source/Common/imstkMath.h b/Source/Common/imstkMath.h index d793a38591d7e0378b0f2797c807e4b08b0198f3..1d2278fd87790ebc895153acf6f6e8fdfea152c2 100644 --- a/Source/Common/imstkMath.h +++ b/Source/Common/imstkMath.h @@ -29,16 +29,7 @@ #include <Eigen/Geometry> #include <Eigen/StdVector> - -#ifdef WIN32 -#pragma warning( push ) -#pragma warning( disable : 4127 ) -#endif #include <Eigen/Sparse> -#ifdef WIN32 -#pragma warning( pop ) -#endif - #ifndef _MSC_VER namespace std diff --git a/Source/Common/imstkTypes.h b/Source/Common/imstkTypes.h index 87fc2565f59d3255fae0c20ee2be97e061efd682..4a78fff28761227f2833fb72cbc1b9272d268558 100644 --- a/Source/Common/imstkTypes.h +++ b/Source/Common/imstkTypes.h @@ -25,7 +25,7 @@ namespace imstk { -using ScalarType = unsigned char; +typedef unsigned char ScalarTypeId; #define IMSTK_VOID 0 #define IMSTK_CHAR 1 #define IMSTK_UNSIGNED_CHAR 2 @@ -40,7 +40,7 @@ using ScalarType = unsigned char; #define IMSTK_LONG_LONG 11 #define IMSTK_UNSIGNED_LONG_LONG 12 -using CellType = unsigned char; +using CellTypeId = unsigned char; #define IMSTK_VERTEX 0 #define IMSTK_EDGE 1 #define IMSTK_TRIANGLE 2 diff --git a/Source/Common/imstkVecDataArray.h b/Source/Common/imstkVecDataArray.h index 7173c0c1c6947b458d1ac02ad3aae824d05f27c4..b43d862d3297734ff499da4ffe1b83347f72de71 100644 --- a/Source/Common/imstkVecDataArray.h +++ b/Source/Common/imstkVecDataArray.h @@ -205,7 +205,7 @@ public: return other; } - std::shared_ptr<AbstractDataArray> cast(ScalarType type) override + std::shared_ptr<AbstractDataArray> cast(ScalarTypeId type) override { if (type == AbstractDataArray::m_scalarType) { diff --git a/Source/Geometry/Mesh/imstkImageData.cpp b/Source/Geometry/Mesh/imstkImageData.cpp index 5d51bb88eba9273897af87a8449a32e3235e3ea6..7761c5b37c5acb89387ce74145b47d23da573687 100644 --- a/Source/Geometry/Mesh/imstkImageData.cpp +++ b/Source/Geometry/Mesh/imstkImageData.cpp @@ -61,7 +61,7 @@ ImageData::getVoidPointer() } std::shared_ptr<ImageData> -ImageData::cast(ScalarType toType) +ImageData::cast(ScalarTypeId toType) { // Create image of new type std::shared_ptr<ImageData> results = std::make_shared<ImageData>(); @@ -71,7 +71,7 @@ ImageData::cast(ScalarType toType) return results; } -const ScalarType +const ScalarTypeId ImageData::getScalarType() const { return m_scalarArray->getScalarType(); @@ -93,7 +93,7 @@ ImageData::setScalars(std::shared_ptr<AbstractDataArray> scalars, const int numC } void -ImageData::allocate(const ScalarType type, const int numComps, const Vec3i& dims, const Vec3d& spacing, const Vec3d& origin) +ImageData::allocate(const ScalarTypeId type, const int numComps, const Vec3i& dims, const Vec3d& spacing, const Vec3d& origin) { m_dims = dims; m_origin = origin; diff --git a/Source/Geometry/Mesh/imstkImageData.h b/Source/Geometry/Mesh/imstkImageData.h index f12c72b19fc5d5de83deda43988897515c8519e6..3190d3411dac7224c582e8bc08e8e809b86a0084 100644 --- a/Source/Geometry/Mesh/imstkImageData.h +++ b/Source/Geometry/Mesh/imstkImageData.h @@ -89,7 +89,7 @@ public: /// inline static size_t getScalarIndex(int x, int y, int z, const Vec3i& dims, int numComps) { return (x + dims[0] * (y + z * dims[1])) * numComps; } - std::shared_ptr<ImageData> cast(ScalarType type); + std::shared_ptr<ImageData> cast(ScalarTypeId type); /// /// \brief Returns the origin of the image @@ -109,7 +109,7 @@ public: /// /// \brief Returns the scalar type of the image /// - const ScalarType getScalarType() const; + const ScalarTypeId getScalarType() const; /// /// \brief Returns bounds of the image (voxel to voxel) @@ -165,7 +165,7 @@ public: /// /// \brief Allocate image by type /// - void allocate(const ScalarType type, const int numComps, const Vec3i& dims, const Vec3d& spacing = Vec3d(1.0, 1.0, 1.0), const Vec3d& origin = Vec3d(0.0, 0.0, 0.0)); + void allocate(const ScalarTypeId type, const int numComps, const Vec3i& dims, const Vec3d& spacing = Vec3d(1.0, 1.0, 1.0), const Vec3d& origin = Vec3d(0.0, 0.0, 0.0)); /// /// \brief Generates points in the geometry from the ImageData (center of each voxel) diff --git a/Source/Geometry/Mesh/imstkLineMesh.cpp b/Source/Geometry/Mesh/imstkLineMesh.cpp index 0694b24d91dcf317cd3292d17a709c55dc296653..35dcfef73d5753c072cd713cdfa04d5ee47a7fe2 100644 --- a/Source/Geometry/Mesh/imstkLineMesh.cpp +++ b/Source/Geometry/Mesh/imstkLineMesh.cpp @@ -136,7 +136,7 @@ LineMesh::getCellScalars() const void LineMesh::setCellActiveAttribute(std::string& activeAttributeName, std::string attributeName, - const int expectedNumComponents, const ScalarType expectedScalarType) + const int expectedNumComponents, const ScalarTypeId expectedScalarType) { std::shared_ptr<AbstractDataArray> attribute = m_cellAttributes[attributeName]; if (attribute->getNumberOfComponents() != expectedNumComponents) diff --git a/Source/Geometry/Mesh/imstkLineMesh.h b/Source/Geometry/Mesh/imstkLineMesh.h index b40455a07a5e28ab467f9f656ef6367b79f9f57d..c2b88b5b89904b1f99af700c45940555c8092f88 100644 --- a/Source/Geometry/Mesh/imstkLineMesh.h +++ b/Source/Geometry/Mesh/imstkLineMesh.h @@ -134,7 +134,7 @@ public: protected: void setCellActiveAttribute(std::string& activeAttributeName, std::string attributeName, - const int expectedNumComponents, const ScalarType expectedScalarType); + const int expectedNumComponents, const ScalarTypeId expectedScalarType); protected: std::shared_ptr<VecDataArray<int, 2>> m_segmentIndices; ///> line connectivity diff --git a/Source/Geometry/Mesh/imstkPointSet.cpp b/Source/Geometry/Mesh/imstkPointSet.cpp index 803a64af47c52ad269fc9cb0d141c02b8bcf0e84..e1d43118685d5fa8c71064917220acf6148de6a4 100644 --- a/Source/Geometry/Mesh/imstkPointSet.cpp +++ b/Source/Geometry/Mesh/imstkPointSet.cpp @@ -348,7 +348,7 @@ PointSet::getVertexTCoords() const void PointSet::setActiveVertexAttribute(std::string& activeAttributeName, std::string attributeName, - const int expectedNumComponents, const ScalarType expectedScalarType) + const int expectedNumComponents, const ScalarTypeId expectedScalarType) { std::shared_ptr<AbstractDataArray> attribute = m_vertexAttributes[attributeName]; if (attribute->getNumberOfComponents() != expectedNumComponents) diff --git a/Source/Geometry/Mesh/imstkPointSet.h b/Source/Geometry/Mesh/imstkPointSet.h index c7d0765ba48e965c9018bd7461da29ce0bf81cfd..753e556338df3a3f5fa2d37240155d3a0f78d505 100644 --- a/Source/Geometry/Mesh/imstkPointSet.h +++ b/Source/Geometry/Mesh/imstkPointSet.h @@ -206,7 +206,7 @@ protected: /// Throws message and casts if incorrect scalar type is provided. /// void setActiveVertexAttribute(std::string& activeAttributeName, const std::string attributeName, - const int expectedNumComponents, const ScalarType expectedScalarType); + const int expectedNumComponents, const ScalarTypeId expectedScalarType); std::shared_ptr<VecDataArray<double, 3>> m_initialVertexPositions; std::shared_ptr<VecDataArray<double, 3>> m_vertexPositions; diff --git a/Source/Geometry/Mesh/imstkSurfaceMesh.cpp b/Source/Geometry/Mesh/imstkSurfaceMesh.cpp index bf6af4180ea37fc6cdc0234921f2981f9ce53202..2310ba78550a826edad5ac85a0f43bfb27a86eda 100644 --- a/Source/Geometry/Mesh/imstkSurfaceMesh.cpp +++ b/Source/Geometry/Mesh/imstkSurfaceMesh.cpp @@ -795,7 +795,7 @@ SurfaceMesh::getCellTangents() const void SurfaceMesh::setCellActiveAttribute(std::string& activeAttributeName, std::string attributeName, - const int expectedNumComponents, const ScalarType expectedScalarType) + const int expectedNumComponents, const ScalarTypeId expectedScalarType) { std::shared_ptr<AbstractDataArray> attribute = m_cellAttributes[attributeName]; if (attribute->getNumberOfComponents() != expectedNumComponents) diff --git a/Source/Geometry/Mesh/imstkSurfaceMesh.h b/Source/Geometry/Mesh/imstkSurfaceMesh.h index 962ef30cad62285a6c16cb4871ccbe514130fe20..200f4291dc9866fc49b7aeb8fa1d53ffaa61dfda 100644 --- a/Source/Geometry/Mesh/imstkSurfaceMesh.h +++ b/Source/Geometry/Mesh/imstkSurfaceMesh.h @@ -278,7 +278,7 @@ public: protected: void setCellActiveAttribute(std::string& activeAttributeName, std::string attributeName, - const int expectedNumComponents, const ScalarType expectedScalarType); + const int expectedNumComponents, const ScalarTypeId expectedScalarType); protected: std::shared_ptr<VecDataArray<int, 3>> m_triangleIndices; diff --git a/Source/Geometry/imstkGeometryUtilities.h b/Source/Geometry/imstkGeometryUtilities.h index 0ce45f250e8d400b228b5fbee6128cea9e7e3394..dab31d40f83e65bb11b0ed2735be905dfb019148 100644 --- a/Source/Geometry/imstkGeometryUtilities.h +++ b/Source/Geometry/imstkGeometryUtilities.h @@ -68,7 +68,7 @@ class Plane; /// namespace GeometryUtils { -static std::unordered_map<int, ScalarType> vtkToImstkScalarType = +static std::unordered_map<int, ScalarTypeId> vtkToImstkScalarType = { { VTK_VOID, IMSTK_VOID }, { VTK_CHAR, IMSTK_CHAR }, @@ -84,7 +84,7 @@ static std::unordered_map<int, ScalarType> vtkToImstkScalarType = { VTK_LONG_LONG, IMSTK_LONG_LONG }, { VTK_UNSIGNED_LONG_LONG, IMSTK_UNSIGNED_LONG_LONG } }; -static std::unordered_map<ScalarType, int> imstkToVtkScalarType = +static std::unordered_map<ScalarTypeId, int> imstkToVtkScalarType = { { IMSTK_VOID, VTK_VOID }, { IMSTK_CHAR, VTK_CHAR }, diff --git a/Source/SceneEntities/Objects/imstkCollisionDataDebugObject.cpp b/Source/SceneEntities/Objects/imstkCollisionDataDebugObject.cpp index ecceca77b33abe541e7bd7597df8ec9cc5bab810..f374da3dd5d853da31303a3ca3e0a56a8bf08b36 100644 --- a/Source/SceneEntities/Objects/imstkCollisionDataDebugObject.cpp +++ b/Source/SceneEntities/Objects/imstkCollisionDataDebugObject.cpp @@ -36,8 +36,8 @@ CollisionDataDebugObject::addCollisionElement(std::shared_ptr<PointSet> pointSet } if (elem.m_type == CollisionElementType::CellIndex) { - const int idCount = elem.m_element.m_CellIndexElement.idCount; - const CellType type = elem.m_element.m_CellIndexElement.cellType; + const int idCount = elem.m_element.m_CellIndexElement.idCount; + const CellTypeId type = elem.m_element.m_CellIndexElement.cellType; if (type == IMSTK_VERTEX) { addPoint(vertices[elem.m_element.m_CellIndexElement.ids[0]]);