From ec2b286b721bcdb6673056cda8bb987c995e14ff Mon Sep 17 00:00:00 2001
From: laurence <laurence>
Date: Tue, 7 Feb 2012 12:03:03 +0000
Subject: [PATCH] ENH: cvMesh: Add variable to indexedVertex denoting whether
 the vertex is fixed

---
 .../conformalVoronoiMesh/indexedVertex.H      | 18 ++++++++++--
 .../conformalVoronoiMesh/indexedVertexI.H     | 29 +++++++++++++++----
 2 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex.H
index a9b997f6cb8..246020fd172 100644
--- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex.H
+++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex.H
@@ -92,12 +92,15 @@ class indexedVertex
         //                         Lowest numbered is inside one (master).
         int type_;
 
-        // Required alignment of the dual cell of this vertex
+        //- Required alignment of the dual cell of this vertex
         Foam::tensor alignment_;
 
-        // Target size of the dual cell of this vertex
+        //- Target size of the dual cell of this vertex
         Foam::scalar targetCellSize_;
 
+        //- Specify whether the vertex is fixed or movable.
+        bool vertexFixed_;
+
 
 public:
 
@@ -108,6 +111,12 @@ public:
         vtFar           = INT_MIN + 2
     };
 
+    enum vertexMotion
+    {
+        fixed   = 0,
+        movable = 1
+    };
+
     typedef typename Vb::Vertex_handle      Vertex_handle;
     typedef typename Vb::Cell_handle        Cell_handle;
     typedef typename Vb::Point              Point;
@@ -214,6 +223,11 @@ public:
         //- Either a real or referred internal or boundary point
         inline bool anyInternalOrBoundaryPoint() const;
 
+        //- Is the vertex fixed or movable
+        inline bool isVertexFixed() const;
+
+        //- Fix the vertex so that it can't be moved
+        inline void setVertexFixed() const;
 
     // inline void operator=(const Delaunay::Finite_vertices_iterator vit)
     // {
diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertexI.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertexI.H
index 86479321a93..c02ec4df200 100644
--- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertexI.H
+++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertexI.H
@@ -37,7 +37,8 @@ inline CGAL::indexedVertex<Gt, Vb>::indexedVertex()
     index_(vtInternal),
     type_(vtInternal),
     alignment_(),
-    targetCellSize_(0.0)
+    targetCellSize_(0.0),
+    vertexFixed_(false)
 {}
 
 
@@ -48,7 +49,8 @@ inline CGAL::indexedVertex<Gt, Vb>::indexedVertex(const Point& p)
     index_(vtInternal),
     type_(vtInternal),
     alignment_(),
-    targetCellSize_(0.0)
+    targetCellSize_(0.0),
+    vertexFixed_(false)
 {}
 
 
@@ -64,7 +66,8 @@ inline CGAL::indexedVertex<Gt, Vb>::indexedVertex
     index_(index),
     type_(type),
     alignment_(),
-    targetCellSize_(0.0)
+    targetCellSize_(0.0),
+    vertexFixed_(false)
 {}
 
 
@@ -75,7 +78,8 @@ inline CGAL::indexedVertex<Gt, Vb>::indexedVertex(const Point& p, Cell_handle f)
     index_(vtInternal),
     type_(vtInternal),
     alignment_(),
-    targetCellSize_(0.0)
+    targetCellSize_(0.0),
+    vertexFixed_(false)
 {}
 
 
@@ -86,7 +90,8 @@ inline CGAL::indexedVertex<Gt, Vb>::indexedVertex(Cell_handle f)
     index_(vtInternal),
     type_(vtInternal),
     alignment_(),
-    targetCellSize_(0.0)
+    targetCellSize_(0.0),
+    vertexFixed_(false)
 {}
 
 
@@ -318,4 +323,18 @@ inline bool CGAL::indexedVertex<Gt, Vb>::anyInternalOrBoundaryPoint() const
 }
 
 
+template<class Gt, class Vb>
+inline bool CGAL::indexedVertex<Gt, Vb>::isVertexFixed() const
+{
+    return vertexFixed_;
+}
+
+
+template<class Gt, class Vb>
+inline void CGAL::indexedVertex<Gt, Vb>::setVertexFixed() const
+{
+    vertexFixed_ = true;
+}
+
+
 // * * * * * * * * * * * * * * * Friend Functions  * * * * * * * * * * * * * //
-- 
GitLab