gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
Smooth.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 "
Smooth.h
"
7
8
StringXNumber
SmoothOptions_Number
[] = {{
GMSH_FULLRC
,
"View"
,
nullptr
, -1.}};
9
10
extern
"C"
{
11
GMSH_Plugin
*
GMSH_RegisterSmoothPlugin
() {
return
new
GMSH_SmoothPlugin
(); }
12
}
13
14
std::string
GMSH_SmoothPlugin::getHelp
()
const
15
{
16
return
"Plugin(Smooth) averages the values at the nodes "
17
"of the view `View'.\n\n"
18
"If `View' < 0, the plugin is run on the current view.\n\n"
19
"Plugin(Smooth) is executed in-place."
;
20
}
21
22
int
GMSH_SmoothPlugin::getNbOptions
()
const
23
{
24
return
sizeof
(
SmoothOptions_Number
) /
sizeof
(
StringXNumber
);
25
}
26
27
StringXNumber
*
GMSH_SmoothPlugin::getOption
(
int
iopt)
28
{
29
return
&
SmoothOptions_Number
[iopt];
30
}
31
32
PView
*
GMSH_SmoothPlugin::execute
(
PView
*v)
33
{
34
int
iView = (int)
SmoothOptions_Number
[0].def;
35
36
PView
*v1 =
getView
(iView, v);
37
if
(!v1)
return
v;
38
39
v1->
getData
()->
smooth
();
40
v1->
setChanged
(
true
);
41
42
return
v1;
43
}
PView
Definition:
PView.h:27
GMSH_Plugin
Definition:
Plugin.h:26
GMSH_RegisterSmoothPlugin
GMSH_Plugin * GMSH_RegisterSmoothPlugin()
Definition:
Smooth.cpp:11
StringXNumber
Definition:
Options.h:918
GMSH_SmoothPlugin::getHelp
std::string getHelp() const
Definition:
Smooth.cpp:14
PView::setChanged
void setChanged(bool val)
Definition:
PView.cpp:241
GMSH_FULLRC
#define GMSH_FULLRC
Definition:
Options.h:20
PView::getData
PViewData * getData(bool useAdaptiveIfAvailable=false)
Definition:
PView.cpp:233
GMSH_SmoothPlugin::getOption
StringXNumber * getOption(int iopt)
Definition:
Smooth.cpp:27
GMSH_SmoothPlugin::getNbOptions
int getNbOptions() const
Definition:
Smooth.cpp:22
Smooth.h
GMSH_SmoothPlugin
Definition:
Smooth.h:15
SmoothOptions_Number
StringXNumber SmoothOptions_Number[]
Definition:
Smooth.cpp:8
GMSH_SmoothPlugin::execute
PView * execute(PView *)
Definition:
Smooth.cpp:32
GMSH_PostPlugin::getView
virtual PView * getView(int index, PView *view)
Definition:
Plugin.cpp:81
PViewData::smooth
virtual void smooth()
Definition:
PViewData.cpp:231
src
plugin
Smooth.cpp
Generated by
1.8.18