gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
Remove.cpp
Go to the documentation of this file.
1
// Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2
//
3
// See the LICENSE.txt file in the Gmsh root directory for license information.
4
// Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5
6
#include "
Remove.h
"
7
8
StringXNumber
RemoveOptions_Number
[] = {
9
{
GMSH_FULLRC
,
"Text2D"
,
nullptr
, 1.},
10
{
GMSH_FULLRC
,
"Text3D"
,
nullptr
, 1.},
11
{
GMSH_FULLRC
,
"Points"
,
nullptr
, 0.},
12
{
GMSH_FULLRC
,
"Lines"
,
nullptr
, 0.},
13
{
GMSH_FULLRC
,
"Triangles"
,
nullptr
, 0.},
14
{
GMSH_FULLRC
,
"Quadrangles"
,
nullptr
, 0.},
15
{
GMSH_FULLRC
,
"Tetrahedra"
,
nullptr
, 0.},
16
{
GMSH_FULLRC
,
"Hexahedra"
,
nullptr
, 0.},
17
{
GMSH_FULLRC
,
"Prisms"
,
nullptr
, 0.},
18
{
GMSH_FULLRC
,
"Pyramids"
,
nullptr
, 0.},
19
{
GMSH_FULLRC
,
"Scalar"
,
nullptr
, 1.},
20
{
GMSH_FULLRC
,
"Vector"
,
nullptr
, 1.},
21
{
GMSH_FULLRC
,
"Tensor"
,
nullptr
, 1.},
22
{
GMSH_FULLRC
,
"View"
,
nullptr
, -1.}};
23
24
extern
"C"
{
25
GMSH_Plugin
*
GMSH_RegisterRemovePlugin
() {
return
new
GMSH_RemovePlugin
(); }
26
}
27
28
std::string
GMSH_RemovePlugin::getHelp
()
const
29
{
30
return
"Plugin(Remove) removes the marked items from the list-based "
31
"view `View'.\n\nIf `View' < 0, the plugin is run on the current "
32
"view.\n\nPlugin(Remove) is executed in-place."
;
33
}
34
35
int
GMSH_RemovePlugin::getNbOptions
()
const
36
{
37
return
sizeof
(
RemoveOptions_Number
) /
sizeof
(
StringXNumber
);
38
}
39
40
StringXNumber
*
GMSH_RemovePlugin::getOption
(
int
iopt)
41
{
42
return
&
RemoveOptions_Number
[iopt];
43
}
44
45
PView
*
GMSH_RemovePlugin::execute
(
PView
*v)
46
{
47
int
iView = (int)
RemoveOptions_Number
[13].def;
48
49
PView
*v1 =
getView
(iView, v);
50
if
(!v1)
return
v;
51
52
PViewDataList
*data1 =
getDataList
(v1);
53
if
(!data1)
return
v;
54
55
int
scalar = (int)
RemoveOptions_Number
[10].def;
56
int
vector = (int)
RemoveOptions_Number
[11].def;
57
int
tensor = (int)
RemoveOptions_Number
[12].def;
58
59
if
(
RemoveOptions_Number
[0].def) {
60
data1->
NbT2
= 0;
61
data1->
T2D
.clear();
62
data1->
T2C
.clear();
63
}
64
if
(
RemoveOptions_Number
[1].def) {
65
data1->
NbT3
= 0;
66
data1->
T3D
.clear();
67
data1->
T3C
.clear();
68
}
69
if
(
RemoveOptions_Number
[2].def) {
70
if
(scalar) {
71
data1->
NbSP
= 0;
72
data1->
SP
.clear();
73
}
74
if
(vector) {
75
data1->
NbVP
= 0;
76
data1->
VP
.clear();
77
}
78
if
(tensor) {
79
data1->
NbTP
= 0;
80
data1->
TP
.clear();
81
}
82
}
83
if
(
RemoveOptions_Number
[3].def) {
84
if
(scalar) {
85
data1->
NbSL
= 0;
86
data1->
SL
.clear();
87
}
88
if
(vector) {
89
data1->
NbVL
= 0;
90
data1->
VL
.clear();
91
}
92
if
(tensor) {
93
data1->
NbTL
= 0;
94
data1->
TL
.clear();
95
}
96
}
97
if
(
RemoveOptions_Number
[4].def) {
98
if
(scalar) {
99
data1->
NbST
= 0;
100
data1->
ST
.clear();
101
}
102
if
(vector) {
103
data1->
NbVT
= 0;
104
data1->
VT
.clear();
105
}
106
if
(tensor) {
107
data1->
NbTT
= 0;
108
data1->
TT
.clear();
109
}
110
}
111
if
(
RemoveOptions_Number
[5].def) {
112
if
(scalar) {
113
data1->
NbSQ
= 0;
114
data1->
SQ
.clear();
115
}
116
if
(vector) {
117
data1->
NbVQ
= 0;
118
data1->
VQ
.clear();
119
}
120
if
(tensor) {
121
data1->
NbTQ
= 0;
122
data1->
TQ
.clear();
123
}
124
}
125
if
(
RemoveOptions_Number
[6].def) {
126
if
(scalar) {
127
data1->
NbSS
= 0;
128
data1->
SS
.clear();
129
}
130
if
(vector) {
131
data1->
NbVS
= 0;
132
data1->
VS
.clear();
133
}
134
if
(tensor) {
135
data1->
NbTS
= 0;
136
data1->
TS
.clear();
137
}
138
}
139
if
(
RemoveOptions_Number
[7].def) {
140
if
(scalar) {
141
data1->
NbSH
= 0;
142
data1->
SH
.clear();
143
}
144
if
(vector) {
145
data1->
NbVH
= 0;
146
data1->
VH
.clear();
147
}
148
if
(tensor) {
149
data1->
NbTH
= 0;
150
data1->
TH
.clear();
151
}
152
}
153
if
(
RemoveOptions_Number
[8].def) {
154
if
(scalar) {
155
data1->
NbSI
= 0;
156
data1->
SI
.clear();
157
}
158
if
(vector) {
159
data1->
NbVI
= 0;
160
data1->
VI
.clear();
161
}
162
if
(tensor) {
163
data1->
NbTI
= 0;
164
data1->
TI
.clear();
165
}
166
}
167
if
(
RemoveOptions_Number
[9].def) {
168
if
(scalar) {
169
data1->
NbSY
= 0;
170
data1->
SY
.clear();
171
}
172
if
(vector) {
173
data1->
NbVY
= 0;
174
data1->
VY
.clear();
175
}
176
if
(tensor) {
177
data1->
NbTY
= 0;
178
data1->
TY
.clear();
179
}
180
}
181
182
data1->
finalize
();
183
v1->
setChanged
(
true
);
184
185
return
v1;
186
}
PViewDataList::VQ
std::vector< double > VQ
Definition:
PViewDataList.h:33
PViewDataList::TS
std::vector< double > TS
Definition:
PViewDataList.h:37
PViewDataList::NbVY
int NbVY
Definition:
PViewDataList.h:42
PView
Definition:
PView.h:27
PViewDataList::TQ
std::vector< double > TQ
Definition:
PViewDataList.h:33
PViewDataList::NbT3
int NbT3
Definition:
PViewDataList.h:48
PViewDataList::T2C
std::vector< char > T2C
Definition:
PViewDataList.h:50
PViewDataList::NbTL
int NbTL
Definition:
PViewDataList.h:28
PViewDataList::SS
std::vector< double > SS
Definition:
PViewDataList.h:37
PViewDataList::T3D
std::vector< double > T3D
Definition:
PViewDataList.h:49
PViewDataList::TL
std::vector< double > TL
Definition:
PViewDataList.h:29
GMSH_Plugin
Definition:
Plugin.h:26
PViewDataList::NbTP
int NbTP
Definition:
PViewDataList.h:26
PViewDataList::NbTT
int NbTT
Definition:
PViewDataList.h:30
PViewDataList
Definition:
PViewDataList.h:17
GMSH_RemovePlugin
Definition:
Remove.h:15
PViewDataList::NbSP
int NbSP
Definition:
PViewDataList.h:26
StringXNumber
Definition:
Options.h:918
PViewDataList::TI
std::vector< double > TI
Definition:
PViewDataList.h:41
PViewDataList::NbSQ
int NbSQ
Definition:
PViewDataList.h:32
PViewDataList::SY
std::vector< double > SY
Definition:
PViewDataList.h:43
PViewDataList::NbSH
int NbSH
Definition:
PViewDataList.h:38
PViewDataList::VL
std::vector< double > VL
Definition:
PViewDataList.h:29
PViewDataList::VY
std::vector< double > VY
Definition:
PViewDataList.h:43
PViewDataList::NbVH
int NbVH
Definition:
PViewDataList.h:38
GMSH_RemovePlugin::execute
PView * execute(PView *)
Definition:
Remove.cpp:45
PViewDataList::VH
std::vector< double > VH
Definition:
PViewDataList.h:39
GMSH_RemovePlugin::getNbOptions
int getNbOptions() const
Definition:
Remove.cpp:35
PView::setChanged
void setChanged(bool val)
Definition:
PView.cpp:241
PViewDataList::TY
std::vector< double > TY
Definition:
PViewDataList.h:43
PViewDataList::TP
std::vector< double > TP
Definition:
PViewDataList.h:27
PViewDataList::VP
std::vector< double > VP
Definition:
PViewDataList.h:27
PViewDataList::NbTH
int NbTH
Definition:
PViewDataList.h:38
GMSH_RemovePlugin::getOption
StringXNumber * getOption(int iopt)
Definition:
Remove.cpp:40
PViewDataList::SP
std::vector< double > SP
Definition:
PViewDataList.h:27
GMSH_RemovePlugin::getHelp
std::string getHelp() const
Definition:
Remove.cpp:28
GMSH_FULLRC
#define GMSH_FULLRC
Definition:
Options.h:20
PViewDataList::T3C
std::vector< char > T3C
Definition:
PViewDataList.h:50
PViewDataList::SL
std::vector< double > SL
Definition:
PViewDataList.h:29
PViewDataList::NbVS
int NbVS
Definition:
PViewDataList.h:36
Remove.h
RemoveOptions_Number
StringXNumber RemoveOptions_Number[]
Definition:
Remove.cpp:8
PViewDataList::finalize
bool finalize(bool computeMinMax=true, const std::string &interpolationScheme="")
Definition:
PViewDataList.cpp:81
GMSH_RegisterRemovePlugin
GMSH_Plugin * GMSH_RegisterRemovePlugin()
Definition:
Remove.cpp:25
PViewDataList::ST
std::vector< double > ST
Definition:
PViewDataList.h:31
PViewDataList::TT
std::vector< double > TT
Definition:
PViewDataList.h:31
PViewDataList::NbVP
int NbVP
Definition:
PViewDataList.h:26
PViewDataList::NbTS
int NbTS
Definition:
PViewDataList.h:36
PViewDataList::NbT2
int NbT2
Definition:
PViewDataList.h:48
PViewDataList::NbSL
int NbSL
Definition:
PViewDataList.h:28
PViewDataList::TH
std::vector< double > TH
Definition:
PViewDataList.h:39
PViewDataList::SH
std::vector< double > SH
Definition:
PViewDataList.h:39
PViewDataList::NbTI
int NbTI
Definition:
PViewDataList.h:40
PViewDataList::NbSS
int NbSS
Definition:
PViewDataList.h:36
PViewDataList::NbTY
int NbTY
Definition:
PViewDataList.h:42
PViewDataList::T2D
std::vector< double > T2D
Definition:
PViewDataList.h:49
PViewDataList::NbVL
int NbVL
Definition:
PViewDataList.h:28
PViewDataList::NbSI
int NbSI
Definition:
PViewDataList.h:40
GMSH_PostPlugin::getView
virtual PView * getView(int index, PView *view)
Definition:
Plugin.cpp:81
PViewDataList::VS
std::vector< double > VS
Definition:
PViewDataList.h:37
PViewDataList::NbTQ
int NbTQ
Definition:
PViewDataList.h:32
PViewDataList::NbVI
int NbVI
Definition:
PViewDataList.h:40
PViewDataList::SI
std::vector< double > SI
Definition:
PViewDataList.h:41
PViewDataList::NbVT
int NbVT
Definition:
PViewDataList.h:30
PViewDataList::NbVQ
int NbVQ
Definition:
PViewDataList.h:32
PViewDataList::VI
std::vector< double > VI
Definition:
PViewDataList.h:41
PViewDataList::VT
std::vector< double > VT
Definition:
PViewDataList.h:31
PViewDataList::SQ
std::vector< double > SQ
Definition:
PViewDataList.h:33
PViewDataList::NbST
int NbST
Definition:
PViewDataList.h:30
PViewDataList::NbSY
int NbSY
Definition:
PViewDataList.h:42
GMSH_PostPlugin::getDataList
virtual PViewDataList * getDataList(PView *view, bool showError=true)
Definition:
Plugin.cpp:107
src
plugin
Remove.cpp
Generated by
1.8.18