From b1f715759374b9384542a1a459f930d0dfa522c4 Mon Sep 17 00:00:00 2001 From: James E McClure Date: Sun, 16 Sep 2018 13:36:43 -0400 Subject: [PATCH] refactor local isosurfacing for performance --- analysis/dcel.cpp | 14 +++----------- analysis/dcel.h | 9 +++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/analysis/dcel.cpp b/analysis/dcel.cpp index b1530180..1ff2b6bb 100644 --- a/analysis/dcel.cpp +++ b/analysis/dcel.cpp @@ -76,6 +76,8 @@ int Halfedge::size(){ DECL::DECL(){ + cellvertices=DTMutableList(20); + Triangles.resize(3,20); } DECL::~DECL(){ @@ -95,17 +97,7 @@ void DECL::LocalIsosurface(const DoubleArray A, double value, const int i, const int CubeIndex; int nTris = 0; - int nVert =0; - - Point VertexList[12]; - Point NewVertexList[12]; - int LocalRemap[12]; - - DTMutableList cellvertices = DTMutableList(20); - IntArray Triangles = IntArray(3,20); - - // Values from array 'A' at the cube corners - double CubeValues[8]; + int nVert = 0; // Points corresponding to cube corners C0.x = 0.0; C0.y = 0.0; C0.z = 0.0; diff --git a/analysis/dcel.h b/analysis/dcel.h index 992ba8de..6692b4c7 100644 --- a/analysis/dcel.h +++ b/analysis/dcel.h @@ -60,4 +60,13 @@ public: private: Array FaceData; + + Point VertexList[12]; + Point NewVertexList[12]; + int LocalRemap[12]; + double CubeValues[8]; + + DTMutableList cellvertices;// = DTMutableList(20); + IntArray Triangles;// = IntArray(3,20); + };