本文整理汇总了C++中GEdge::reparamOnFace方法的典型用法代码示例。如果您正苦于以下问题:C++ GEdge::reparamOnFace方法的具体用法?C++ GEdge::reparamOnFace怎么用?C++ GEdge::reparamOnFace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GEdge
的用法示例。
在下文中一共展示了GEdge::reparamOnFace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getAllParameters
static void getAllParameters(MVertex *v, GFace *gf, std::vector<SPoint2> ¶ms)
{
params.clear();
if (gf->geomType() == GEntity::CompoundSurface ){
GFaceCompound *gfc = (GFaceCompound*) gf;
params.push_back(gfc->parFromVertex(v));
return;
}
if(v->onWhat()->dim() == 0){
GVertex *gv = (GVertex*)v->onWhat();
std::list<GEdge*> ed = gv->edges();
bool seam = false;
for(std::list<GEdge*>::iterator it = ed.begin(); it != ed.end(); it++){
if((*it)->isSeam(gf)) {
Range<double> range = (*it)->parBounds(0);
if (gv == (*it)->getBeginVertex()){
params.push_back((*it)->reparamOnFace(gf, range.low(),-1));
params.push_back((*it)->reparamOnFace(gf, range.low(), 1));
}
if (gv == (*it)->getEndVertex()){
params.push_back((*it)->reparamOnFace(gf, range.high(),-1));
params.push_back((*it)->reparamOnFace(gf, range.high(), 1));
}
if (gv != (*it)->getBeginVertex() && gv != (*it)->getEndVertex()){
Msg::Warning("Strange!");
}
seam = true;
}
}
if (!seam)
params.push_back(gv->reparamOnFace(gf, 1));
}
else if(v->onWhat()->dim() == 1){
GEdge *ge = (GEdge*)v->onWhat();
if(!ge->haveParametrization()) return;
double UU;
v->getParameter(0, UU);
if (UU == 0.0)
UU = ge->parFromPoint(v->point());
params.push_back(ge->reparamOnFace(gf, UU, 1));
if(ge->isSeam(gf))
params.push_back(ge->reparamOnFace(gf, UU, -1));
}
else{
double UU, VV;
if(v->onWhat() == gf && v->getParameter(0, UU) && v->getParameter(1, VV))
params.push_back(SPoint2(UU, VV));
}
}
示例2: reparamMeshVertexOnFace
bool reparamMeshVertexOnFace(MVertex *v, const GFace *gf, SPoint2 ¶m,
bool onSurface)
{
if (gf->geomType() == GEntity::CompoundSurface ){
GFaceCompound *gfc = (GFaceCompound*) gf;
param = gfc->parFromVertex(v);
return true;
}
if(v->onWhat()->geomType() == GEntity::DiscreteCurve ||
v->onWhat()->geomType() == GEntity::BoundaryLayerCurve){
param = gf->parFromPoint(SPoint3(v->x(), v->y(), v->z()), onSurface);
return true;
}
if(v->onWhat()->dim() == 0){
GVertex *gv = (GVertex*)v->onWhat();
// hack for bug in periodic curves
if (gv->getNativeType() == GEntity::GmshModel && gf->geomType() == GEntity::Plane)
param = gf->parFromPoint(SPoint3(v->x(), v->y(), v->z()), onSurface);
else
param = gv->reparamOnFace(gf, 1);
// shout, we could be on a seam
std::list<GEdge*> ed = gv->edges();
for(std::list<GEdge*>::iterator it = ed.begin(); it != ed.end(); it++)
if((*it)->isSeam(gf)) return false;
}
else if(v->onWhat()->dim() == 1){
GEdge *ge = (GEdge*)v->onWhat();
double t;
v->getParameter(0, t);
param = ge->reparamOnFace(gf, t, 1);
if(!v->getParameter(0,t)) {
Msg::Error("Vertex %p not MEdgeVertex", v);
return false;
//param = gf->parFromPoint(SPoint3(v->x(), v->y(), v->z()), onSurface);
}
// shout, we are on a seam
if(ge->isSeam(gf))
return false;
}
else{
double uu, vv;
if(v->onWhat() == gf && v->getParameter(0, uu) && v->getParameter(1, vv)){
param = SPoint2(uu, vv);
}
else {
// brute force!
param = gf->parFromPoint(SPoint3(v->x(), v->y(), v->z()), onSurface);
}
}
return true;
}