Wildmeshing Toolkit
Loading...
Searching...
No Matches
EdgeSplitter.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_EDGESPLITTER_H
13#define NEW_GTET_EDGESPLITTER_H
14
15#include <queue>
16#include "LocalOperations.h"
17
18namespace wmtk::components::tetwild::orig {
19
21{
22public:
23 std::array<int, 2> v_ids;
24 double weight;
25
27 ElementInQueue_es(const std::array<int, 2>& ids, double w)
28 : v_ids(ids)
29 , weight(w)
30 {}
31};
32
33struct cmp_es
34{
35 bool operator()(const ElementInQueue_es& e1, const ElementInQueue_es& e2)
36 {
37 return e1.weight < e2.weight;
38 }
39};
40
42{
43public:
44 bool is_check_quality = false;
45 bool is_cal_quality_end = false;
46
47 std::priority_queue<ElementInQueue_es, std::vector<ElementInQueue_es>, cmp_es> es_queue;
48
49 int t_empty_start = 0;
50 int v_empty_start = 0;
51
52 double max_weight = 0;
53 double ideal_weight = 0;
54
55 EdgeSplitter(LocalOperations lo, double ideal_w)
56 : LocalOperations(lo)
57 , ideal_weight(ideal_w)
58 {}
59
60 void init();
61 void split();
62
63 bool is_over_refine = false;
64 int getOverRefineScale(int v1_id, int v2_id);
65 bool splitAnEdge(const std::array<int, 2>& edge);
66
67 bool isSplittable_cd1(double weight);
68 bool isSplittable_cd1(int v1_id, int v2_id, double weight);
69 void getNewTetSlots(int n, std::vector<int>& new_conn_tets);
70 // igl::viewer::Viewer viewer;
71 void
72 getMesh_ui(const std::vector<std::array<int, 4>>& tets, Eigen::MatrixXd& V, Eigen::MatrixXi& F);
73
74 unsigned int budget = 0;
75};
76
77} // namespace wmtk::components::tetwild::orig
78
79#endif // NEW_GTET_EDGESPLITTER_H
void getMesh_ui(const std::vector< std::array< int, 4 > > &tets, Eigen::MatrixXd &V, Eigen::MatrixXi &F)
Definition EdgeSplitter.cpp:19
Definition EdgeSplitter.h:34