Geophysical Inversion and Modelling Library v1.5.4
Loading...
Searching...
No Matches
triangleWrapper.h
1/******************************************************************************
2 * Copyright (C) 2005-2024 by the GIMLi development team *
3 * Carsten Rücker carsten@resistivity.net *
4 * *
5 * Licensed under the Apache License, Version 2.0 (the "License"); *
6 * you may not use this file except in compliance with the License. *
7 * You may obtain a copy of the License at *
8 * *
9 * http://www.apache.org/licenses/LICENSE-2.0 *
10 * *
11 * Unless required by applicable law or agreed to in writing, software *
12 * distributed under the License is distributed on an "AS IS" BASIS, *
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
14 * See the License for the specific language governing permissions and *
15 * limitations under the License. *
16 * *
17 ******************************************************************************/
18
19#ifndef _GIMLI_TRIANGLEWRAPPER__H
20#define _GIMLI_TRIANGLEWRAPPER__H
21
22#include "gimli.h"
23
24#include <vector>
25#include <string>
26
27struct triangulateio;
28
29namespace GIMLI{
30
31class DLLEXPORT TriangleWrapper{
32public:
35 TriangleWrapper(const Mesh & inMesh);
36
41 TriangleWrapper(const Mesh & inMesh, Mesh & outMesh,
42 const std::string & triSwitches);
43
45 virtual ~TriangleWrapper();
46
48 void setSwitches(const std::string & s);
49
51 inline const std::string & switches() const { return switches_; }
52
54 void generate(Mesh & mesh);
55
57 Mesh generate();
58
59protected:
61 void init_();
62
64 void transformTriangleToMesh_(const triangulateio & trimesh, Mesh & mesh);
65
67 void transformMeshToTriangle_(const Mesh & mesh, triangulateio & trimesh);
68
70 void allocateOutMemory_();
71
73 void freeMemory_();
74
75 struct triangulateio * mesh_input_;
76 struct triangulateio * mesh_output_;
77 struct triangulateio * mesh_voronoi_output_;
78
79 std::string switches_;
80
81 const Mesh * inMesh_;
82
83};
84
85} // namespace GIMLI
86
87#endif // _GIMLI_TRIANGLEWRAPPER__H
Definition mesh.h:128
void setSwitches(const std::string &s)
Definition triangleWrapper.cpp:120
TriangleWrapper(const Mesh &inMesh)
Definition triangleWrapper.cpp:85
const std::string & switches() const
Definition triangleWrapper.h:51
GIMLi main namespace for the Geophyiscal Inversion and Modelling Library.
Definition baseentity.h:24