]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Add MainDirections to Nodes
authorEl Hadi Moussi <moussi@phimeca.com>
Wed, 7 Aug 2024 07:36:39 +0000 (09:36 +0200)
committerEl Hadi Moussi <moussi@phimeca.com>
Wed, 7 Aug 2024 07:36:39 +0000 (09:36 +0200)
src/ShapeRecogn/NodeCurvatureCalculator.cxx
src/ShapeRecogn/Nodes.cxx
src/ShapeRecogn/Nodes.hxx

index 22fda87ae98edc1b38bef79e8b9392149a904e19..ae42386298d88cc367893f3df906fb3cc77233db 100644 (file)
@@ -82,6 +82,7 @@ void NodeCurvatureCalculator::computeCurvatures(double tol)
     nodes->kdiff0.resize(nbNodes);
     nodes->primitives.resize(nbNodes);
     nodes->weakDirections.resize(3 * nbNodes);
+    nodes->mainDirections.resize(3 * nbNodes);
     for (mcIdType nodeId = 0; nodeId < nbNodes; nodeId++)
         computeCurvatures(nodeId, tol);
 }
@@ -152,7 +153,10 @@ void NodeCurvatureCalculator::computeCurvatures(mcIdType nodeId, double tol)
     nodes->k2[nodeId] = k2;
     nodes->kdiff0[nodeId] = kdiff0;
     for (size_t i = 0; i < 3; ++i)
+    {
         nodes->weakDirections[3 * nodeId + i] = weakDirection[i];
+        nodes->mainDirections[3 * nodeId + i] = mainDirection[i];
+    }
     nodes->primitives[nodeId] = primitive;
 }
 
index 845e48b5e5de19b7bf67c11fd506872053538982..31610b3d80c82bbb2b7a550b7d207753f0ba0de3 100644 (file)
@@ -32,6 +32,11 @@ const std::vector<double> &Nodes::getWeakDirections() const
     return weakDirections;
 }
 
+const std::vector<double> &Nodes::getMainDirections() const
+{
+    return mainDirections;
+}
+
 const std::vector<double> &Nodes::getK1() const
 {
     return k1;
@@ -80,6 +85,13 @@ std::array<double, 3> Nodes::getWeakDirection(mcIdType nodeId) const
             weakDirections[3 * nodeId + 2]};
 }
 
+std::array<double, 3> Nodes::getMainDirection(mcIdType nodeId) const
+{
+    return {mainDirections[3 * nodeId],
+            mainDirections[3 * nodeId + 1],
+            mainDirections[3 * nodeId + 2]};
+}
+
 std::array<double, 3> Nodes::getCoordinates(mcIdType nodeId) const
 {
     std::array<double, 3> nodeCoords;
index ed8d267c2048a2dae0bec6aea7aa90b29d02db04..ef06d1540d8d9fadcf81ed87c33dd74fade8134b 100644 (file)
@@ -38,6 +38,7 @@ namespace MEDCoupling
         mcIdType getNbNodes() const;
         const std::vector<double> &getNormals() const;
         const std::vector<double> &getWeakDirections() const;
+        const std::vector<double> &getMainDirections() const;
         const std::vector<double> &getK1() const;
 
         std::array<double, 3> getNormal(mcIdType nodeId) const;
@@ -47,6 +48,7 @@ namespace MEDCoupling
         const std::vector<mcIdType> getNeighbors(mcIdType nodeId) const;
         PrimitiveType getPrimitiveType(mcIdType nodeId) const;
         std::array<double, 3> getWeakDirection(mcIdType nodeId) const;
+        std::array<double, 3> getMainDirection(mcIdType nodeId) const;
         std::array<double, 3> getCoordinates(mcIdType nodeId) const;
 
     private:
@@ -64,6 +66,7 @@ namespace MEDCoupling
         std::vector<double> k2;
         std::vector<double> kdiff0;
         std::vector<double> weakDirections;
+        std::vector<double> mainDirections;
         std::vector<PrimitiveType> primitives;
     };
 };