From 537f1ba1640848e4d0d247e49c3f4f7b24e01efe Mon Sep 17 00:00:00 2001 From: Philippose Rajan Date: Mon, 9 Aug 2010 17:58:24 +0000 Subject: [PATCH] * Added a flag into the surface element class to control the visibility of each element individually. * Added functions to access the visibility flag. * By default the visibility flag is set to "1" implying that the element is visible. --- libsrc/meshing/meshtype.cpp | 5 +++++ libsrc/meshing/meshtype.hpp | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/libsrc/meshing/meshtype.cpp b/libsrc/meshing/meshtype.cpp index 29ddca06..c1bf9592 100644 --- a/libsrc/meshing/meshtype.cpp +++ b/libsrc/meshing/meshtype.cpp @@ -141,6 +141,7 @@ namespace netgen index = 0; badel = 0; deleted = 0; + visible = 1; typ = TRIG; orderx = ordery = 1; refflag = 1; @@ -162,6 +163,7 @@ namespace netgen index = 0; badel = 0; deleted = 0; + visible = 1; switch (np) { case 3: typ = TRIG; break; @@ -190,6 +192,7 @@ namespace netgen index = 0; badel = 0; deleted = 0; + visible = 1; orderx = ordery = 1; refflag = 1; strongrefflag = false; @@ -219,6 +222,7 @@ namespace netgen refflag = 1; strongrefflag = false; deleted = 0; + visible = 1; orderx = ordery = 1; #ifdef PARALLEL @@ -246,6 +250,7 @@ namespace netgen refflag = 1; strongrefflag = false; deleted = 0; + visible = 1; orderx = ordery = 1; #ifdef PARALLEL diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index 05ac8cac..b4782738 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -309,6 +309,11 @@ class Element2d bool strongrefflag:1; bool deleted:1; // element is deleted + // Philippose - 08 August 2010 + // Set a new property for each element, to + // control whether it is visible or not + bool visible:1; // element visible + /// order for hp-FEM unsigned int orderx:6; unsigned int ordery:6; @@ -465,6 +470,13 @@ public: return deleted; } + // Philippose - 08 August 2010 + // Access functions for the new property: visible + void Visible(bool vis = 1) + { visible = vis; } + bool IsVisible () const + { return visible; } + void SetRefinementFlag (bool rflag = 1) { refflag = rflag; } bool TestRefinementFlag () const