4
4
// bugs and problems to <gmsh@geuz.org>.
6
6
#include "ExtractEdges.h"
9
8
StringXNumber ExtractEdgesOptions_Number[] = {
10
9
{GMSH_FULLRC, "Angle", NULL, 22.},
22
GMSH_ExtractEdgesPlugin::GMSH_ExtractEdgesPlugin()
27
void GMSH_ExtractEdgesPlugin::getName(char *name) const
29
strcpy(name, "Extract Edges");
32
void GMSH_ExtractEdgesPlugin::getInfos(char *author, char *copyright, char *help_text) const
34
strcpy(author, "C. Geuzaine, J.-F. Remacle");
35
strcpy(copyright, "C. Geuzaine, J.-F. Remacle");
37
"Plugin(ExtractEdges) extracts the geometry edges\n"
21
std::string GMSH_ExtractEdgesPlugin::getHelp() const
23
return "Plugin(ExtractEdges) extracts the geometry edges\n"
38
24
"from the surface view `iView', using `Angle' as\n"
39
25
"the dihedral angle tolerance. If `iView' < 0, then\n"
40
26
"plugin is run on the current view.\n"
42
"Plugin(ExtractEdges) creates one new view.\n");
28
"Plugin(ExtractEdges) creates one new view.\n";
45
31
int GMSH_ExtractEdgesPlugin::getNbOptions() const
52
38
return &ExtractEdgesOptions_Number[iopt];
55
void GMSH_ExtractEdgesPlugin::catchErrorMessage(char *errorMessage) const
57
strcpy(errorMessage, "Extract Edges failed...");
60
41
PView *GMSH_ExtractEdgesPlugin::execute(PView *v)
62
43
int iView = (int)ExtractEdgesOptions_Number[1].def;
65
46
PView *v1 = getView(iView, v);
68
PViewDataList *data1 = getDataList(v1);
71
PView *v2 = new PView(true);
49
PViewData *data1 = v1->getData();
51
PView *v2 = new PView();
73
52
PViewDataList *data2 = getDataList(v2);
77
55
//bds.import_view(v1, CTX::instance()->lc * 1.e-12);
78
56
//bds.classify(angle * M_PI / 180.);
80
Msg::Error("BDS->classify(angle, edge_prolongation) must be reinterfaced");
82
std::list<BDS_Edge*>::iterator it = bds.edges.begin();
83
std::list<BDS_Edge*>::iterator ite = bds.edges.end();
85
BDS_GeomEntity *g = (*it)->g;
86
if(g && g->classif_degree == 1) {
87
List_Add(data2->SL, &(*it)->p1->X); List_Add(data2->SL, &(*it)->p2->X);
88
List_Add(data2->SL, &(*it)->p1->Y); List_Add(data2->SL, &(*it)->p2->Y);
89
List_Add(data2->SL, &(*it)->p1->Z); List_Add(data2->SL, &(*it)->p2->Z);
90
double val = g->classif_tag;
91
List_Add(data2->SL, &val);
92
List_Add(data2->SL, &val);
58
Msg::Error("classify(angle, edge_prolongation) must be reinterfaced");
98
60
data2->setName(data1->getName() + "_ExtractEdges");
99
61
data2->setFileName(data1->getName() + "_ExtractEdges.pos");