本文整理汇总了C++中GEdge::setMeshMaster方法的典型用法代码示例。如果您正苦于以下问题:C++ GEdge::setMeshMaster方法的具体用法?C++ GEdge::setMeshMaster怎么用?C++ GEdge::setMeshMaster使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GEdge
的用法示例。
在下文中一共展示了GEdge::setMeshMaster方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: importGEOInternals
//.........这里部分代码省略.........
add(f);
}
else
f->resetMeshAttributes();
if(!s->Visible) f->setVisibility(0);
if(s->Color.type) f->setColor(s->Color.mesh);
}
List_Delete(surfaces);
}
if(Tree_Nbr(_geo_internals->Volumes)) {
List_T *volumes = Tree2List(_geo_internals->Volumes);
for(int i = 0; i < List_Nbr(volumes); i++){
Volume *v;
List_Read(volumes, i, &v);
GRegion *r = getRegionByTag(v->Num);
if(!r && v->Typ == MSH_VOLUME_COMPOUND){
std::vector<GRegion*> comp;
for(unsigned int j = 0; j < v->compound.size(); j++){
GRegion *gr = getRegionByTag(v->compound[j]);
if(gr) comp.push_back(gr);
}
r = new GRegionCompound(this, v->Num, comp);
if(v->EmbeddedSurfaces){
for(int i = 0; i < List_Nbr(v->EmbeddedSurfaces); i++){
Surface *s;
List_Read(v->EmbeddedSurfaces, i, &s);
GFace *gf = getFaceByTag(abs(s->Num));
if(gf)
r->addEmbeddedFace(gf);
else
Msg::Error("Unknown surface %d", s->Num);
}
}
add(r);
}
else if(!r){
r = new gmshRegion(this, v);
add(r);
}
else
r->resetMeshAttributes();
if(!v->Visible) r->setVisibility(0);
if(v->Color.type) r->setColor(v->Color.mesh);
}
List_Delete(volumes);
}
for(int i = 0; i < List_Nbr(_geo_internals->PhysicalGroups); i++){
PhysicalGroup *p;
List_Read(_geo_internals->PhysicalGroups, i, &p);
for(int j = 0; j < List_Nbr(p->Entities); j++){
int num;
List_Read(p->Entities, j, &num);
GEntity *ge = 0;
int tag = CTX::instance()->geom.orientedPhysicals ? abs(num) : num;
switch(p->Typ){
case MSH_PHYSICAL_POINT: ge = getVertexByTag(tag); break;
case MSH_PHYSICAL_LINE: ge = getEdgeByTag(tag); break;
case MSH_PHYSICAL_SURFACE: ge = getFaceByTag(tag); break;
case MSH_PHYSICAL_VOLUME: ge = getRegionByTag(tag); break;
}
int pnum = CTX::instance()->geom.orientedPhysicals ? (sign(num) * p->Num) : p->Num;
if(ge && std::find(ge->physicals.begin(), ge->physicals.end(), pnum) ==
ge->physicals.end())
ge->physicals.push_back(pnum);
}
}
// create periodic mesh relationships
for (std::map<int,int>::iterator it = _geo_internals->periodicEdges.begin();
it != _geo_internals->periodicEdges.end(); ++it){
GEdge *ge = getEdgeByTag(abs(it->first));
if (ge){
int MASTER = it->second * (it->first > 0 ? 1 : -1);
ge->setMeshMaster(MASTER);
}
}
for (std::map<int,int>::iterator it = _geo_internals->periodicFaces.begin();
it != _geo_internals->periodicFaces.end(); ++it){
GFace *gf = getFaceByTag(abs(it->first));
if (gf)gf->setMeshMaster(it->second * (it->first > 0 ? 1 : -1));
}
for (eiter it = firstEdge() ; it != lastEdge() ; ++it){
int meshMaster = (*it)->meshMaster();
if (meshMaster != (*it)->tag()){
GEdge *ge_master = getEdgeByTag(abs(meshMaster));
if(ge_master)(*it)->getBeginVertex()->setMeshMaster ( (meshMaster > 0) ? ge_master->getBeginVertex()->tag() : ge_master->getEndVertex()->tag());
if(ge_master)(*it)->getEndVertex()->setMeshMaster ( (meshMaster < 0) ? ge_master->getBeginVertex()->tag() : ge_master->getEndVertex()->tag());
}
}
Msg::Debug("Gmsh model (GModel) imported:");
Msg::Debug("%d Vertices", vertices.size());
Msg::Debug("%d Edges", edges.size());
Msg::Debug("%d Faces", faces.size());
Msg::Debug("%d Regions", regions.size());
return 1;
}