diff --git a/Base/Core/imstkMath.h b/Base/Core/imstkMath.h index 00e26a96d02cfe5ffb741725188d52b6c4b9db93..2fea049be50d04d94b1ff7dc952b6e853640bfa6 100644 --- a/Base/Core/imstkMath.h +++ b/Base/Core/imstkMath.h @@ -26,6 +26,7 @@ #include <Eigen/Geometry> #include <Eigen/Sparse> +#include <Eigen/StdVector> namespace imstk { @@ -33,18 +34,26 @@ namespace imstk // 2D vector using Vec2f = Eigen::Vector2f; using Vec2d = Eigen::Vector2d; +using StdVectorOfVec2f = std::vector<Vec2f, Eigen::aligned_allocator<Vec2f>>; +using StdVectorOfVec2d = std::vector<Vec2d, Eigen::aligned_allocator<Vec2d>>; // 3D vector using Vec3f = Eigen::Vector3f; using Vec3d = Eigen::Vector3d; +using StdVectorOfVec3f = std::vector<Vec3f, Eigen::aligned_allocator<Vec3f>>; +using StdVectorOfVec3d = std::vector<Vec3d, Eigen::aligned_allocator<Vec3d>>; // 4D vector using Vec4f = Eigen::Vector4f; using Vec4d = Eigen::Vector4d; +using StdVectorOfVec4f = std::vector<Vec4f, Eigen::aligned_allocator<Vec4f>>; +using StdVectorOfVec4d = std::vector<Vec4d, Eigen::aligned_allocator<Vec4d>>; // Dynamic size vector using Vectorf = Eigen::VectorXf; using Vectord = Eigen::VectorXd; +using StdVectorOfVectorf = std::vector<Vectorf, Eigen::aligned_allocator<Vectorf>>; +using StdVectorOfVectord = std::vector<Vectord, Eigen::aligned_allocator<Vectord>>; // Quaternion using Quatf = Eigen::Quaternion<float,Eigen::DontAlign>; diff --git a/Base/DynamicalModels/ObjectStates/imstkPbdState.h b/Base/DynamicalModels/ObjectStates/imstkPbdState.h index b63aa11c4de1ca7920c34a1ac0dbae1f427e4f5d..ca9053fd1f3e363081e22358b82328bf67834993 100644 --- a/Base/DynamicalModels/ObjectStates/imstkPbdState.h +++ b/Base/DynamicalModels/ObjectStates/imstkPbdState.h @@ -60,23 +60,23 @@ public: /// /// \brief Returns the vector of current nodal positions /// - std::vector<Vec3d>& getPositions() { return m_pos; }; - void setPositions(const std::vector<Vec3d>& p) { m_pos = p; }; + StdVectorOfVec3d& getPositions() { return m_pos; }; + void setPositions(const StdVectorOfVec3d& p) { m_pos = p; }; /// /// \brief Returns the vector of current nodal velocities /// - std::vector<Vec3d>& getVelocities() { return m_vel; }; + StdVectorOfVec3d& getVelocities() { return m_vel; }; /// /// \brief Returns the vector of current nodal accelerations /// - std::vector<Vec3d>& getAccelerations() { return m_acc; }; + StdVectorOfVec3d& getAccelerations() { return m_acc; }; private: - std::vector<Vec3d> m_pos; ///> Nodal positions - std::vector<Vec3d> m_vel; ///> Nodal velocities - std::vector<Vec3d> m_acc; ///> Nodal acelerations + StdVectorOfVec3d m_pos; ///> Nodal positions + StdVectorOfVec3d m_vel; ///> Nodal velocities + StdVectorOfVec3d m_acc; ///> Nodal acelerations }; } // imstk diff --git a/Base/Geometry/Mesh/imstkHexahedralMesh.cpp b/Base/Geometry/Mesh/imstkHexahedralMesh.cpp index 11b8d7540080aed1761a21f716a23c76d8b74032..f05a3e0d390c1d827c8e6ec3555ea720e784d7c6 100644 --- a/Base/Geometry/Mesh/imstkHexahedralMesh.cpp +++ b/Base/Geometry/Mesh/imstkHexahedralMesh.cpp @@ -25,7 +25,7 @@ namespace imstk { void -HexahedralMesh::initialize(const std::vector<Vec3d>& vertices, +HexahedralMesh::initialize(const StdVectorOfVec3d& vertices, const std::vector<HexaArray>& hexahedra, bool computeAttachedSurfaceMesh) { diff --git a/Base/Geometry/Mesh/imstkHexahedralMesh.h b/Base/Geometry/Mesh/imstkHexahedralMesh.h index 1ab3ad5ff9d12cb1da5f11927ffc9809757c4742..7235391616bb5ccc9b8a3c6a528bd46a69df5b98 100644 --- a/Base/Geometry/Mesh/imstkHexahedralMesh.h +++ b/Base/Geometry/Mesh/imstkHexahedralMesh.h @@ -54,7 +54,7 @@ public: /// \brief Initializes the rest of the data structures given vertex positions and /// hexahedra connectivity /// - void initialize(const std::vector<Vec3d>& vertices, + void initialize(const StdVectorOfVec3d& vertices, const std::vector<HexaArray>& hexahedra, bool computeAttachedSurfaceMesh = false); diff --git a/Base/Geometry/Mesh/imstkMesh.cpp b/Base/Geometry/Mesh/imstkMesh.cpp index d7e076e8c5b5a9856574923ab4bdc843a2ec46fe..8cd92f2583c2738154ec90dd3da0bf85d46385d8 100644 --- a/Base/Geometry/Mesh/imstkMesh.cpp +++ b/Base/Geometry/Mesh/imstkMesh.cpp @@ -25,7 +25,7 @@ namespace imstk { void -Mesh::initialize(const std::vector<Vec3d>& vertices) +Mesh::initialize(const StdVectorOfVec3d& vertices) { this->setInitialVerticesPositions(vertices); this->setVerticesPositions(vertices); @@ -79,13 +79,13 @@ Mesh::computeBoundingBox(Vec3d& min, Vec3d& max, const double percent) const } void -Mesh::setInitialVerticesPositions(const std::vector<Vec3d>& vertices) +Mesh::setInitialVerticesPositions(const StdVectorOfVec3d& vertices) { m_initialVerticesPositions = vertices; m_verticesDisplacements= vertices; } -const std::vector<Vec3d>& +const StdVectorOfVec3d& Mesh::getInitialVerticesPositions() const { return m_initialVerticesPositions; @@ -98,12 +98,12 @@ Mesh::getInitialVertexPosition(const size_t& vertNum) const } void -Mesh::setVerticesPositions(const std::vector<Vec3d>& vertices) +Mesh::setVerticesPositions(const StdVectorOfVec3d& vertices) { m_verticesPositions = vertices; } -const std::vector<Vec3d>& +const StdVectorOfVec3d& Mesh::getVertexPositions() const { return m_verticesPositions; @@ -122,7 +122,7 @@ Mesh::getVertexPosition(const size_t& vertNum) const } void -Mesh::setVerticesDisplacements(const std::vector<Vec3d>& diff) +Mesh::setVerticesDisplacements(const StdVectorOfVec3d& diff) { m_verticesDisplacements = diff; } @@ -143,7 +143,7 @@ Mesh::setVerticesDisplacements(const Vectord& u) } } -const std::vector<Vec3d>& +const StdVectorOfVec3d& Mesh::getVerticesDisplacements() const { return m_verticesDisplacements; @@ -156,19 +156,19 @@ Mesh::getVerticeDisplacement(const size_t& vertNum) const } void -Mesh::setPointDataMap(const std::map<std::string, std::vector<Vectorf>>& pointData) +Mesh::setPointDataMap(const std::map<std::string, StdVectorOfVectorf>& pointData) { m_pointDataMap = pointData; } -const std::map<std::string, std::vector<Vectorf>>& +const std::map<std::string, StdVectorOfVectorf>& Mesh::getPointDataMap() const { return m_pointDataMap; } void -Mesh::setPointDataArray(const std::string& arrayName, const std::vector<Vectorf>& arrayData) +Mesh::setPointDataArray(const std::string& arrayName, const StdVectorOfVectorf& arrayData) { if ( arrayData.size() != this->getNumVertices()) { @@ -179,13 +179,13 @@ Mesh::setPointDataArray(const std::string& arrayName, const std::vector<Vectorf> m_pointDataMap[arrayName] = arrayData; } -const std::vector<Vectorf>& +const StdVectorOfVectorf& Mesh::getPointDataArray(const std::string& arrayName) const { if (!m_pointDataMap.count(arrayName)) { LOG(WARNING) << "No array with such name holds any point data."; - return std::vector<Vectorf>(); + return StdVectorOfVectorf(); } return m_pointDataMap.at(arrayName); } diff --git a/Base/Geometry/Mesh/imstkMesh.h b/Base/Geometry/Mesh/imstkMesh.h index 11c9f6878b54b5c21905fa658a9d3d9c3a20a81f..9ab2fe399627a0aab887a4120a57f40246f36ab2 100644 --- a/Base/Geometry/Mesh/imstkMesh.h +++ b/Base/Geometry/Mesh/imstkMesh.h @@ -44,7 +44,7 @@ public: /// /// \brief Initializes the data structure given vertex positions /// - void initialize(const std::vector<Vec3d>& vertices); + void initialize(const StdVectorOfVec3d& vertices); /// /// \brief Clears all the mesh data @@ -66,12 +66,12 @@ public: /// /// \brief Sets initial positions from an array /// - void setInitialVerticesPositions(const std::vector<Vec3d>& vertices); + void setInitialVerticesPositions(const StdVectorOfVec3d& vertices); /// /// \brief Returns the vector of initial positions of the mesh vertices /// - const std::vector<Vec3d>& getInitialVerticesPositions() const; + const StdVectorOfVec3d& getInitialVerticesPositions() const; /// /// \brief Returns the initial position of a vertex given its index @@ -81,12 +81,12 @@ public: /// /// \brief Sets current vertex positions of the mesh from an array /// - void setVerticesPositions(const std::vector<Vec3d>& vertices); + void setVerticesPositions(const StdVectorOfVec3d& vertices); /// /// \brief Returns the vector of current positions of the mesh vertices /// - const std::vector<Vec3d>& getVertexPositions() const; + const StdVectorOfVec3d& getVertexPositions() const; /// /// \brief Set the current position of a vertex given its index to certain position @@ -101,7 +101,7 @@ public: /// /// \brief Sets the displacements of mesh vertices from an array /// - void setVerticesDisplacements(const std::vector<Vec3d>& diff); + void setVerticesDisplacements(const StdVectorOfVec3d& diff); /// /// \brief Sets the displacements of mesh vertices from a linearized displacement vector @@ -111,7 +111,7 @@ public: /// /// \brief Returns the vector displacements of mesh vertices /// - const std::vector<Vec3d>& getVerticesDisplacements() const; + const StdVectorOfVec3d& getVerticesDisplacements() const; /// /// \brief Returns the displacement of a given vertex @@ -121,22 +121,22 @@ public: /// /// \brief Sets the point data for all arrays at each vertice /// - void setPointDataMap(const std::map<std::string, std::vector<Vectorf>>& pointData); + void setPointDataMap(const std::map<std::string, StdVectorOfVectorf>& pointData); /// /// \brief Get the map of the point data for all arrays at each vertice /// - const std::map<std::string, std::vector<Vectorf>>& getPointDataMap() const; + const std::map<std::string, StdVectorOfVectorf>& getPointDataMap() const; /// /// \brief Set a data array holding some point data /// - void setPointDataArray(const std::string& arrayName, const std::vector<Vectorf>& arrayData); + void setPointDataArray(const std::string& arrayName, const StdVectorOfVectorf& arrayData); /// /// \brief Get a specific data array /// - const std::vector<Vectorf>& getPointDataArray(const std::string& arrayName) const; + const StdVectorOfVectorf& getPointDataArray(const std::string& arrayName) const; /// /// \brief Returns the number of total vertices in the mesh @@ -157,7 +157,7 @@ protected: /// /// \brief Get vertices positions /// - std::vector<Vec3d>& getVerticesPositionsNotConst() + StdVectorOfVec3d& getVerticesPositionsNotConst() { return m_verticesPositions; } @@ -166,11 +166,11 @@ protected: // + Position (Initial translation) // + verticesDisplacements // = verticesPositions - std::vector<Vec3d> m_initialVerticesPositions; //> Initial positions of vertices - std::vector<Vec3d> m_verticesPositions; //> Current positions of vertices - std::vector<Vec3d> m_verticesDisplacements; //> Displacements of vertices + StdVectorOfVec3d m_initialVerticesPositions; //> Initial positions of vertices + StdVectorOfVec3d m_verticesPositions; //> Current positions of vertices + StdVectorOfVec3d m_verticesDisplacements; //> Displacements of vertices - std::map<std::string, std::vector<Vectorf>> m_pointDataMap; ///> vector of data arrays per vertice + std::map<std::string, StdVectorOfVectorf> m_pointDataMap; ///> vector of data arrays per vertice }; } // imstk diff --git a/Base/Geometry/Mesh/imstkSurfaceMesh.cpp b/Base/Geometry/Mesh/imstkSurfaceMesh.cpp index 7e3c63b495b8fc5058676e14680ae1be6f5a2ee7..8d84abf34d51e5767a34fc76e75632733194bc69 100644 --- a/Base/Geometry/Mesh/imstkSurfaceMesh.cpp +++ b/Base/Geometry/Mesh/imstkSurfaceMesh.cpp @@ -25,7 +25,7 @@ namespace imstk { void -SurfaceMesh::initialize(const std::vector<Vec3d>& vertices, +SurfaceMesh::initialize(const StdVectorOfVec3d& vertices, const std::vector<TriangleArray>& triangles, const bool computeDerivedData) { @@ -236,7 +236,7 @@ SurfaceMesh::optimizeForDataLocality() } // C. Initialize this mesh with the newly computed ones - std::vector<Vec3d> optimallyOrderedNodalPos; + StdVectorOfVec3d optimallyOrderedNodalPos; std::vector<TriangleArray> optConnectivityRenumbered; // C.1 Get the positions @@ -276,7 +276,7 @@ SurfaceMesh::setTrianglesVertices(const std::vector<TriangleArray>& triangles) m_trianglesVertices = triangles; } -const std::vector<Vec3d>& +const StdVectorOfVec3d& SurfaceMesh::getTrianglesNormals() const { return m_trianglesNormals; @@ -288,7 +288,7 @@ SurfaceMesh::getTriangleNormal(size_t i) const return m_trianglesNormals.at(i); } -const std::vector<Vec3d>& +const StdVectorOfVec3d& SurfaceMesh::getVerticesNormals() const { return m_verticesNormals; @@ -358,4 +358,4 @@ SurfaceMesh::getTexture(std::string tCoordsName) const return m_textureMap.at(tCoordsName); } -} // imstk \ No newline at end of file +} // imstk diff --git a/Base/Geometry/Mesh/imstkSurfaceMesh.h b/Base/Geometry/Mesh/imstkSurfaceMesh.h index a64d60b024a4e038aeffae0e510526f9869e2018..2aa36cb6ca9c78c2d880554e1c1f57dd098cfd07 100644 --- a/Base/Geometry/Mesh/imstkSurfaceMesh.h +++ b/Base/Geometry/Mesh/imstkSurfaceMesh.h @@ -59,7 +59,7 @@ public: /// \brief Initializes the rest of the data structures given vertex positions and /// triangle connectivity and texture coordinates /// - void initialize(const std::vector<Vec3d>& vertices, + void initialize(const StdVectorOfVec3d& vertices, const std::vector<TriangleArray>& triangles, const bool computeDerivedData = false); @@ -116,7 +116,7 @@ public: /// /// \brief Get vector of normals of all the triangles /// - const std::vector<Vec3d>& getTrianglesNormals() const; + const StdVectorOfVec3d& getTrianglesNormals() const; /// /// \brief Get normal of a triangle given its index @@ -126,7 +126,7 @@ public: /// /// \brief Get vector of normals of all the vertices /// - const std::vector<Vec3d>& getVerticesNormals() const; + const StdVectorOfVec3d& getVerticesNormals() const; /// /// \brief Get normal of a vertex given its index @@ -158,8 +158,8 @@ protected: std::vector<NeighborsType> m_verticesNeighborTriangles; ///> Neighbor triangles to vertices std::vector<NeighborsType> m_verticesNeighborVertices; ///> Neighbor vertices to vertices - std::vector<Vec3d> m_trianglesNormals; ///> Normals to the triangles - std::vector<Vec3d> m_verticesNormals; ///> Normals of the vertices + StdVectorOfVec3d m_trianglesNormals; ///> Normals to the triangles + StdVectorOfVec3d m_verticesNormals; ///> Normals of the vertices std::string m_defaultTCoords = ""; ///> Name of the array used as default texture coordinates std::map<std::string, std::string> m_textureMap; ///> Mapping texture coordinates to texture diff --git a/Base/Geometry/Mesh/imstkTetrahedralMesh.cpp b/Base/Geometry/Mesh/imstkTetrahedralMesh.cpp index 218cbf1aa0222289dbd193ce9cd5da977710ed0a..1034fe85aecf4848f9d20450070815f485ea1e7a 100644 --- a/Base/Geometry/Mesh/imstkTetrahedralMesh.cpp +++ b/Base/Geometry/Mesh/imstkTetrahedralMesh.cpp @@ -25,7 +25,7 @@ namespace imstk { void -TetrahedralMesh::initialize(const std::vector<Vec3d>& vertices, +TetrahedralMesh::initialize(const StdVectorOfVec3d& vertices, const std::vector<TetraArray>& tetrahedra, bool computeAttachedSurfaceMesh) { @@ -198,7 +198,7 @@ TetrahedralMesh::extractSurfaceMesh(std::shared_ptr<SurfaceMesh> surfaceMesh) size_t vertId; std::list<size_t>::iterator it; - std::vector<Vec3d> vertPositions; + StdVectorOfVec3d vertPositions; for (vertId = 0, it = uniqueVertIdList.begin(); it != uniqueVertIdList.end(); ++vertId, it++) { vertPositions.push_back(this->getVertexPosition(*it)); diff --git a/Base/Geometry/Mesh/imstkTetrahedralMesh.h b/Base/Geometry/Mesh/imstkTetrahedralMesh.h index 0a3c3870b9ec66991db6cb67efae04816bd7fe9e..9cf9bd65508c655c7dd90d3f6a3fa39522364885 100644 --- a/Base/Geometry/Mesh/imstkTetrahedralMesh.h +++ b/Base/Geometry/Mesh/imstkTetrahedralMesh.h @@ -58,7 +58,7 @@ public: /// \brief Initializes the rest of the data structures given vertex positions and /// tetrahedra connectivity /// - void initialize(const std::vector<Vec3d>& vertices, + void initialize(const StdVectorOfVec3d& vertices, const std::vector<TetraArray>& tetrahedra, bool computeAttachedSurfaceMesh = false); diff --git a/Base/Geometry/Reader/imstkVTKMeshReader.cpp b/Base/Geometry/Reader/imstkVTKMeshReader.cpp index 888c9b96fa35021a1946d7820d65b67eeb9d5ee9..c543664b66a0a86c5b85b2b0d29e39e9260803f1 100644 --- a/Base/Geometry/Reader/imstkVTKMeshReader.cpp +++ b/Base/Geometry/Reader/imstkVTKMeshReader.cpp @@ -134,7 +134,7 @@ VTKMeshReader::convertVtkPolyDataToSurfaceMesh(vtkPolyData* vtkMesh) return nullptr; } - std::vector<Vec3d> vertices; + StdVectorOfVec3d vertices; VTKMeshReader::copyVertices(vtkMesh->GetPoints(), vertices); std::vector<SurfaceMesh::TriangleArray> triangles; @@ -144,7 +144,7 @@ VTKMeshReader::convertVtkPolyDataToSurfaceMesh(vtkPolyData* vtkMesh) mesh->initialize(vertices, triangles, true); // Point Data - std::map<std::string, std::vector<Vectorf>> dataMap; + std::map<std::string, StdVectorOfVectorf> dataMap; VTKMeshReader::copyPointData(vtkMesh->GetPointData(), dataMap); if (!dataMap.empty()) { @@ -170,7 +170,7 @@ VTKMeshReader::convertVtkUnstructuredGridToVolumetricMesh(vtkUnstructuredGrid* v return nullptr; } - std::vector<Vec3d> vertices; + StdVectorOfVec3d vertices; VTKMeshReader::copyVertices(vtkMesh->GetPoints(), vertices); int cellType = vtkMesh->GetCellType(vtkMesh->GetNumberOfCells()-1); @@ -201,7 +201,7 @@ VTKMeshReader::convertVtkUnstructuredGridToVolumetricMesh(vtkUnstructuredGrid* v } void -VTKMeshReader::copyVertices(vtkPoints* points, std::vector<Vec3d>& vertices) +VTKMeshReader::copyVertices(vtkPoints* points, StdVectorOfVec3d& vertices) { if(!points) { @@ -245,7 +245,7 @@ VTKMeshReader::copyCells(vtkCellArray* vtkCells, std::vector<std::array<size_t,d } void -VTKMeshReader::copyPointData(vtkPointData* pointData, std::map<std::string, std::vector<Vectorf>>& dataMap) +VTKMeshReader::copyPointData(vtkPointData* pointData, std::map<std::string, StdVectorOfVectorf>& dataMap) { if(!pointData) { @@ -258,7 +258,7 @@ VTKMeshReader::copyPointData(vtkPointData* pointData, std::map<std::string, std: std::string name = array->GetName(); int nbrOfComp = array->GetNumberOfComponents(); int nbrOfTuples = array->GetNumberOfTuples(); - std::vector<Vectorf> data; + StdVectorOfVectorf data; for(unsigned int j = 0; j < nbrOfTuples; ++j) { double* tupleData = new double [nbrOfComp]; diff --git a/Base/Geometry/Reader/imstkVTKMeshReader.h b/Base/Geometry/Reader/imstkVTKMeshReader.h index 22f7078dca11e0f9f11d2153417c593f91dc2ca7..24e0b45b3246c3aeb0f2c0c871c3555c9a199beb 100644 --- a/Base/Geometry/Reader/imstkVTKMeshReader.h +++ b/Base/Geometry/Reader/imstkVTKMeshReader.h @@ -95,7 +95,7 @@ protected: /// /// \brief /// - static void copyVertices(vtkPoints* points, std::vector<Vec3d>& vertices); + static void copyVertices(vtkPoints* points, StdVectorOfVec3d& vertices); /// /// \brief @@ -106,7 +106,7 @@ protected: /// /// \brief /// - static void copyPointData(vtkPointData* pointData, std::map<std::string, std::vector<Vectorf>>& dataMap); + static void copyPointData(vtkPointData* pointData, std::map<std::string, StdVectorOfVectorf>& dataMap); }; diff --git a/Base/Geometry/Reader/imstkVegaMeshReader.cpp b/Base/Geometry/Reader/imstkVegaMeshReader.cpp index f0e6f1ca1d348a0ebb6ed02ce22edf3c7ac82c7f..bd621fcf2aba3c64e09bd539cea538e9eb6ec722 100644 --- a/Base/Geometry/Reader/imstkVegaMeshReader.cpp +++ b/Base/Geometry/Reader/imstkVegaMeshReader.cpp @@ -58,7 +58,7 @@ std::shared_ptr<imstk::VolumetricMesh> VegaMeshReader::convertVegaMeshToVolumetricMesh(std::shared_ptr<vega::VolumetricMesh> vegaMesh) { // Copy vertices - std::vector<Vec3d> vertices; + StdVectorOfVec3d vertices; VegaMeshReader::copyVertices(vegaMesh, vertices); // Copy cells @@ -96,7 +96,7 @@ VegaMeshReader::convertVegaMeshToVolumetricMesh(std::shared_ptr<vega::Volumetric void VegaMeshReader::copyVertices(std::shared_ptr<vega::VolumetricMesh> vegaMesh, - std::vector<Vec3d>& vertices) + StdVectorOfVec3d& vertices) { for(size_t i = 0; i < vegaMesh->getNumVertices(); ++i) { diff --git a/Base/Geometry/Reader/imstkVegaMeshReader.h b/Base/Geometry/Reader/imstkVegaMeshReader.h index 8a6f80b33d774f14763a0f100f86b741472e4093..25f950c44a08a3210d21c4773232beebba5539dc 100644 --- a/Base/Geometry/Reader/imstkVegaMeshReader.h +++ b/Base/Geometry/Reader/imstkVegaMeshReader.h @@ -77,7 +77,7 @@ protected: /// /// \brief /// - static void copyVertices(std::shared_ptr<vega::VolumetricMesh> vegaMesh, std::vector<Vec3d>& vertices); + static void copyVertices(std::shared_ptr<vega::VolumetricMesh> vegaMesh, StdVectorOfVec3d& vertices); /// /// \brief diff --git a/Base/Rendering/RenderDelegate/imstkVTKMappedVertexArray.cpp b/Base/Rendering/RenderDelegate/imstkVTKMappedVertexArray.cpp index c6da49444f8dc57c4d09858f5429480e67f6fbbc..62f90d131dc1e52284fa10b07d95019c8d4e7881 100644 --- a/Base/Rendering/RenderDelegate/imstkVTKMappedVertexArray.cpp +++ b/Base/Rendering/RenderDelegate/imstkVTKMappedVertexArray.cpp @@ -42,7 +42,7 @@ VTKMappedVertexArray::PrintSelf(ostream &os, vtkIndent indent) } void -VTKMappedVertexArray::SetVertexArray(std::vector<Vec3d>& vertices) +VTKMappedVertexArray::SetVertexArray(StdVectorOfVec3d& vertices) { this->Initialize(); this->NumberOfComponents = 3; diff --git a/Base/Rendering/RenderDelegate/imstkVTKMappedVertexArray.h b/Base/Rendering/RenderDelegate/imstkVTKMappedVertexArray.h index 665c52354e6bd7cb249db82c5e7392d2fa4603f8..cfe4eccb744335be31caced07f9ffda606c44193 100644 --- a/Base/Rendering/RenderDelegate/imstkVTKMappedVertexArray.h +++ b/Base/Rendering/RenderDelegate/imstkVTKMappedVertexArray.h @@ -49,7 +49,7 @@ public: // Description: // Set the raw scalar arrays for the coordinate set. This class takes // ownership of the arrays and deletes them with delete[]. - void SetVertexArray(std::vector<Vec3d> &vertices); + void SetVertexArray(StdVectorOfVec3d &vertices); // Reimplemented virtuals -- see superclasses for descriptions: void Initialize(); @@ -121,7 +121,7 @@ protected: /// ~VTKMappedVertexArray() {} - std::vector<Vec3d> *vertexArray; ///> + StdVectorOfVec3d *vertexArray; ///> private: VTKMappedVertexArray(const VTKMappedVertexArray &); // Not implemented. @@ -137,4 +137,4 @@ private: } // imstk -#endif // ifndef imstkMappedVertexArray_h \ No newline at end of file +#endif // ifndef imstkMappedVertexArray_h diff --git a/CMake/External/External_SCCD.cmake b/CMake/External/External_SCCD.cmake index 3951604207f3002ba17727e53a40f3ceeeb8d5d4..8fc04b377bf5dd1b0bbdb39a171b487c8ccadb3b 100644 --- a/CMake/External/External_SCCD.cmake +++ b/CMake/External/External_SCCD.cmake @@ -4,7 +4,7 @@ include(imstkAddExternalProject) imstk_add_external_project( SCCD GIT_REPOSITORY git@gitlab.kitware.com:iMSTK/SCCD.git - GIT_TAG 7145cc437ff9f9744a8363736590260e2e660bb6 + GIT_TAG 64550894016d84e80939a1c51ef6df5307c54fae INSTALL_COMMAND ${SKIP_STEP_COMMAND} CMAKE_ARGS -DBUILD_SAMPLE_APP:BOOL=OFF diff --git a/Examples/Sandbox/main.cpp b/Examples/Sandbox/main.cpp index 417e54c854b1397a9160668b37463a8b343caed7..506a6b2577034a83e4d0ada51304a91789593266 100644 --- a/Examples/Sandbox/main.cpp +++ b/Examples/Sandbox/main.cpp @@ -806,7 +806,7 @@ void testTetraTriangleMap() // Tetrahedral mesh auto tetMesh = std::make_shared<imstk::TetrahedralMesh>(); - std::vector<imstk::Vec3d> vertList; + imstk::StdVectorOfVec3d vertList; vertList.push_back(imstk::Vec3d(0, 0, 0)); vertList.push_back(imstk::Vec3d(1.0, 0, 0)); vertList.push_back(imstk::Vec3d(0, 1.0, 0)); @@ -821,7 +821,7 @@ void testTetraTriangleMap() // Triangular mesh auto triMesh = std::make_shared<imstk::SurfaceMesh>(); - std::vector<imstk::Vec3d> SurfVertList; + imstk::StdVectorOfVec3d SurfVertList; SurfVertList.push_back(imstk::Vec3d(0, 0, 1));// coincides with one vertex SurfVertList.push_back(imstk::Vec3d(0.25, 0.25, 0.25));// centroid SurfVertList.push_back(imstk::Vec3d(1.05, 0, 0)); @@ -847,7 +847,7 @@ void testExtractSurfaceMesh() // a.1 add vertex positions auto tetMesh = std::make_shared<imstk::TetrahedralMesh>(); - std::vector<imstk::Vec3d> vertList; + imstk::StdVectorOfVec3d vertList; vertList.push_back(imstk::Vec3d(0, 0, 0)); vertList.push_back(imstk::Vec3d(1.0, 0, 0)); vertList.push_back(imstk::Vec3d(0, 1.0, 0)); @@ -890,7 +890,7 @@ void testOneToOneNodalMap() // a.1 add vertex positions auto tetMesh = std::make_shared<imstk::TetrahedralMesh>(); - std::vector<imstk::Vec3d> vertList; + imstk::StdVectorOfVec3d vertList; vertList.push_back(imstk::Vec3d(0, 0, 0)); vertList.push_back(imstk::Vec3d(1.0, 0, 0)); vertList.push_back(imstk::Vec3d(0, 1.0, 0)); @@ -905,7 +905,7 @@ void testOneToOneNodalMap() auto triMesh = std::make_shared<imstk::SurfaceMesh>(); // b.1 Add vertex positions - std::vector<imstk::Vec3d> SurfVertList; + imstk::StdVectorOfVec3d SurfVertList; SurfVertList.push_back(imstk::Vec3d(0, 0, 0)); SurfVertList.push_back(imstk::Vec3d(1.0, 0, 0)); SurfVertList.push_back(imstk::Vec3d(0, 1.0, 0)); @@ -951,7 +951,7 @@ void testSurfaceMeshOptimizer() // b. Add nodal data auto surfMesh = std::make_shared<imstk::SurfaceMesh>(); - std::vector<imstk::Vec3d> vertList; + imstk::StdVectorOfVec3d vertList; vertList.push_back(imstk::Vec3d(0, 0, 0)); vertList.push_back(imstk::Vec3d(0.5, 0.5, 0)); vertList.push_back(imstk::Vec3d(1, 1, 0)); @@ -1212,7 +1212,7 @@ void testPbdCloth() // b. Add nodal data auto surfMesh = std::make_shared<imstk::SurfaceMesh>(); - std::vector<imstk::Vec3d> vertList; + imstk::StdVectorOfVec3d vertList; const double width = 10.0; const double height = 10.0; const int nRows = 10; @@ -1344,7 +1344,7 @@ void testPbdCollision() bool volumetric = !clothTest; if (clothTest){ auto clothMesh = std::make_shared<imstk::SurfaceMesh>(); - std::vector<imstk::Vec3d> vertList; + imstk::StdVectorOfVec3d vertList; double width = 60.0; double height = 60.0; int nRows = 10; @@ -1497,7 +1497,7 @@ void testPbdCollision() else{ // floor - std::vector<imstk::Vec3d> vertList; + imstk::StdVectorOfVec3d vertList; double width = 100.0; double height = 100.0; int nRows = 2; @@ -1619,7 +1619,7 @@ void testLineMesh() auto lineMeshVisual = std::make_shared<imstk::LineMesh>(); auto lineMeshPhysics = std::make_shared<imstk::LineMesh>(); - std::vector<imstk::Vec3d> vertList; + imstk::StdVectorOfVec3d vertList; vertList.resize(3); vertList[0] = Vec3d(0.0, -10.0, -10.0); vertList[1] = Vec3d(0.0, 0.0, -10.0); @@ -1735,7 +1735,7 @@ void testLineMesh() if (clothTest){ - std::vector<imstk::Vec3d> vertList; + imstk::StdVectorOfVec3d vertList; double width = 60.0; double height = 60.0; int nRows = 20;