本文整理汇总了C++中GEdge::addFace方法的典型用法代码示例。如果您正苦于以下问题:C++ GEdge::addFace方法的具体用法?C++ GEdge::addFace怎么用?C++ GEdge::addFace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GEdge
的用法示例。
在下文中一共展示了GEdge::addFace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GFace
gmshFace::gmshFace(GModel *m, Surface *face)
: GFace(m, face->Num), s(face), isSphere(false), radius(0.)
{
resetMeshAttributes();
// edgeCounterparts = s->edgeCounterparts;
// affineTransform = s->affineTransform;
std::vector<GEdge*> eds;
std::vector<int> nums;
for(int i = 0; i < List_Nbr(s->Generatrices); i++){
Curve *c;
List_Read(s->Generatrices, i, &c);
GEdge *e = m->getEdgeByTag(abs(c->Num));
if(e){
eds.push_back(e);
nums.push_back(c->Num);
}
else
Msg::Error("Unknown curve %d", c->Num);
}
for(int i = 0; i < List_Nbr(s->GeneratricesByTag); i++){
int j;
List_Read(s->GeneratricesByTag, i, &j);
GEdge *e = m->getEdgeByTag(abs(j));
if(e){
eds.push_back(e);
nums.push_back(j);
}
else
Msg::Error("Unknown curve %d", j);
}
std::list<GEdge*> l_wire;
GVertex *first = 0;
for(unsigned int i = 0; i < eds.size(); i++){
GEdge *e = eds[i];
int num = nums[i];
GVertex *start = (num > 0) ? e->getBeginVertex() : e->getEndVertex();
GVertex *next = (num > 0) ? e->getEndVertex() : e->getBeginVertex();
if (!first) first = start;
l_wire.push_back(e);
if (next == first){
edgeLoops.push_back(GEdgeLoop(l_wire));
l_wire.clear();
first = 0;
}
l_edges.push_back(e);
e->addFace(this);
l_dirs.push_back((num > 0) ? 1 : -1);
if (List_Nbr(s->Generatrices) == 2){
e->meshAttributes.minimumMeshSegments =
std::max(e->meshAttributes.minimumMeshSegments, 2);
}
}
// always compute and store the mean plane for plane surfaces (using
// the bounding vertices)
if(s->Typ == MSH_SURF_PLAN) computeMeanPlane();
if(s->EmbeddedCurves){
for(int i = 0; i < List_Nbr(s->EmbeddedCurves); i++){
Curve *c;
List_Read(s->EmbeddedCurves, i, &c);
GEdge *e = m->getEdgeByTag(abs(c->Num));
if(e)
addEmbeddedEdge(e);
else
Msg::Error("Unknown curve %d", c->Num);
}
}
if(s->EmbeddedPoints){
for(int i = 0; i < List_Nbr(s->EmbeddedPoints); i++){
Vertex *v;
List_Read(s->EmbeddedPoints, i, &v);
GVertex *gv = m->getVertexByTag(v->Num);
if(gv)
embedded_vertices.push_back(gv);
else
Msg::Error("Unknown point %d", v->Num);
}
}
isSphere = iSRuledSurfaceASphere(s, center, radius);
}