Wildmeshing Toolkit
Loading...
Searching...
No Matches
MeshRefinement.h
1// This file is part of TetWild, a software for generating tetrahedral meshes.
2//
3// Copyright (C) 2018 Yixin Hu <yixin.hu@nyu.edu>
4//
5// This Source Code Form is subject to the terms of the Mozilla Public License
6// v. 2.0. If a copy of the MPL was not distributed with this file, You can
7// obtain one at http://mozilla.org/MPL/2.0/.
8//
9// Created by Yixin Hu on 4/11/17.
10//
11
12#ifndef NEW_GTET_MESHREFINEMENT_H
13#define NEW_GTET_MESHREFINEMENT_H
14
15#include <igl/Timer.h>
16
17#include "ForwardDecls.h"
18#include "TetmeshElements.h"
19
20namespace wmtk::components::tetwild::orig {
21
23{
24public:
25 const Args& args;
26 State& state;
27
28 SampleEnvelope& env_sf; // surface envelope
29 SampleEnvelope& env_b; // boundary envelope
30
31 // init
32 std::vector<TetVertex> tet_vertices;
33 std::vector<std::array<int, 4>> tets;
34 // prepare data
35 std::vector<bool> v_is_removed;
36 std::vector<bool> t_is_removed;
37 std::vector<TetQuality> tet_qualities;
38 std::vector<std::array<int, 4>> is_surface_fs;
39
40 igl::Timer igl_timer;
41
42 int old_pass = 0;
43
44 MeshRefinement(SampleEnvelope& env_surf, SampleEnvelope& env_bound, const Args& ar, State& st)
45 : env_sf(env_surf)
46 , env_b(env_bound)
47 , args(ar)
48 , state(st)
49 {}
50
51 void prepareData(bool is_init = true);
52 void round();
53 void clear();
54
55 int sf_id = 0;
56 int doOperations(
57 EdgeSplitter& splitter,
58 EdgeCollapser& collapser,
59 EdgeRemover& edge_remover,
60 VertexSmoother& smoother,
61 const std::array<bool, 4>& ops = {{true, true, true, true}});
62 int doOperationLoops(
63 EdgeSplitter& splitter,
64 EdgeCollapser& collapser,
65 EdgeRemover& edge_remover,
66 VertexSmoother& smoother,
67 int max_pass,
68 const std::array<bool, 4>& ops = {{true, true, true, true}});
69 bool is_dealing_unrounded = false;
70 bool is_dealing_local = false;
71
72 void refine(
73 const std::array<bool, 4>& ops = {{true, true, true, true}},
74 bool is_pre = true,
75 bool is_post = true,
76 int scalar_update = 3);
77 void refine_pre(
78 EdgeSplitter& splitter,
79 EdgeCollapser& collapser,
80 EdgeRemover& edge_remover,
81 VertexSmoother& smoother);
82 void refine_post(
83 EdgeSplitter& splitter,
84 EdgeCollapser& collapser,
85 EdgeRemover& edge_remover,
86 VertexSmoother& smoother);
87
88 double min_adaptive_scale;
89 bool is_hit_min = false;
90 void updateScalarField(
91 bool is_clean_up_unrounded,
92 bool is_clean_up_local,
93 double filter_energy,
94 bool is_lock = false);
95
96 int getInsideVertexSize();
97 void markInOut(std::vector<bool>& tmp_t_is_removed);
98
99 int mid_result = 0;
100 void getSurface(Eigen::MatrixXd& V, Eigen::MatrixXi& F);
101 void getTrackedSurface(Eigen::MatrixXd& V, Eigen::MatrixXi& F);
102 void getTrackedSurface_continuous(Eigen::MatrixXd& V, Eigen::MatrixXi& F);
103};
104
105} // namespace wmtk::components::tetwild::orig
106
107#endif // NEW_GTET_MESHREFINEMENT_H
Definition Envelope.hpp:56
void refine(const std::array< bool, 4 > &ops={{true, true, true, true}}, bool is_pre=true, bool is_post=true, int scalar_update=3)
Definition MeshRefinement.cpp:223