本文整理汇总了C++中GEdge::tag方法的典型用法代码示例。如果您正苦于以下问题:C++ GEdge::tag方法的具体用法?C++ GEdge::tag怎么用?C++ GEdge::tag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GEdge
的用法示例。
在下文中一共展示了GEdge::tag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: importFile
void Centerline::importFile(std::string fileName)
{
current = GModel::current();
std::vector<GFace*> currentFaces(current->firstFace(), current->lastFace());
for (unsigned int i = 0; i < currentFaces.size(); i++){
GFace *gf = currentFaces[i];
if (gf->geomType() == GEntity::DiscreteSurface){
for(unsigned int j = 0; j < gf->triangles.size(); j++)
triangles.push_back(gf->triangles[j]);
if (is_cut){
gf->triangles.clear();
gf->deleteVertexArrays();
current->remove(gf);
}
}
}
if(triangles.empty()){
Msg::Error("Current GModel has no triangles ...");
return;
}
mod = new GModel();
mod->load(fileName);
mod->removeDuplicateMeshVertices(1.e-8);
current->setAsCurrent();
current->setVisibility(1);
int maxN = 0.0;
std::vector<GEdge*> modEdges(mod->firstEdge(), mod->lastEdge());
MVertex *vin = modEdges[0]->lines[0]->getVertex(0);
ptin = SPoint3(vin->x(), vin->y(), vin->z());
for (unsigned int i = 0; i < modEdges.size(); i++){
GEdge *ge = modEdges[i];
for(unsigned int j = 0; j < ge->lines.size(); j++){
MLine *l = ge->lines[j];
MVertex *v0 = l->getVertex(0);
MVertex *v1 = l->getVertex(1);
std::map<MVertex*, int>::iterator it0 = colorp.find(v0);
std::map<MVertex*, int>::iterator it1 = colorp.find(v1);
if (it0 == colorp.end() || it1 == colorp.end()){
lines.push_back(l);
colorl.insert(std::make_pair(l, ge->tag()));
maxN = std::max(maxN, ge->tag());
}
if (it0 == colorp.end()) colorp.insert(std::make_pair(v0, ge->tag()));
if (it1 == colorp.end()) colorp.insert(std::make_pair(v1, ge->tag()));
}
}
createBranches(maxN);
}
示例2: createSplitCompounds
void Centerline::createSplitCompounds()
{
//number of discrete vertices, edges, faces and regions for the mesh
NV = current->getMaxElementaryNumber(0);
NE = current->getMaxElementaryNumber(1);
NF = current->getMaxElementaryNumber(2);
NR = current->getMaxElementaryNumber(3);
// Remesh new faces (Compound Lines and Compound Surfaces)
Msg::Info("Centerline: creating split compounds ...");
//Parametrize Compound Lines
for (int i=0; i < NE; i++){
std::vector<GEdge*>e_compound;
GEdge *pe = current->getEdgeByTag(i+1);//current edge
e_compound.push_back(pe);
int num_gec = NE+i+1;
Msg::Info("Create Compound Line (%d) = %d discrete edge",
num_gec, pe->tag());
GEdge *gec = current->addCompoundEdge(e_compound,num_gec);
if (CTX::instance()->mesh.algo2d != ALGO_2D_BAMG){
gec->meshAttributes.method = MESH_TRANSFINITE;
gec->meshAttributes.nbPointsTransfinite = nbPoints+1;
gec->meshAttributes.typeTransfinite = 0;
gec->meshAttributes.coeffTransfinite = 1.0;
}
}
// Parametrize Compound surfaces
std::list<GEdge*> U0;
for (int i=0; i < NF; i++){
std::vector<GFace*> f_compound;
GFace *pf = current->getFaceByTag(i+1);//current face
f_compound.push_back(pf);
int num_gfc = NF+i+1;
Msg::Info("Create Compound Surface (%d) = %d discrete face",
num_gfc, pf->tag());
//1=conf_spectral 4=convex_circle, 7=conf_fe
GFace *gfc = current->addCompoundFace(f_compound, 7, 0, num_gfc);
gfc->meshAttributes.recombine = recombine;
gfc->addPhysicalEntity(1);
current->setPhysicalName("wall", 2, 1);//tag 1
}
}