theHyp = (*itl); // use only the first hypothesis
string hypName = theHyp->GetName();
- int hypId = theHyp->GetID();
+ //int hypId = theHyp->GetID();
//SCRUTE(hypName);
bool isOk = false;
_edgeLength = ComputeEdgeElementLength(aMesh, aShape);
bool isOk = false;
- const SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
- SMESH_subMesh *theSubMesh = aMesh.GetSubMesh(aShape);
+ //const SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
+ //SMESH_subMesh *theSubMesh = aMesh.GetSubMesh(aShape);
const TopoDS_Face & FF = TopoDS::Face(aShape);
bool faceIsForward = (FF.Orientation() == TopAbs_FORWARD);
{
// MESSAGE("StdMeshers_MEFISTO_2D::LoadPoints");
- SMDS_Mesh * meshDS = aMesh.GetMeshDS();
+ //SMDS_Mesh * meshDS = aMesh.GetMeshDS();
TopoDS_Face F = TopoDS::Face(FF.Oriented(TopAbs_FORWARD));
SMDS_NodeIteratorPtr ite= aMesh.GetSubMesh(E)->GetSubMeshDS()->GetNodes();
- bool isForward = (E.Orientation() == TopAbs_FORWARD);
+ //bool isForward = (E.Orientation() == TopAbs_FORWARD);
map<double, const SMDS_MeshNode*> params;
while(ite->more())
double scalex, double scaley)
{
SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
+ int faceID = meshDS->ShapeToIndex( F );
Z n, m;
Handle(Geom_Surface) S = BRep_Tool::Surface(F);
gp_Pnt P = S->Value(u, v);
SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
- meshDS->SetNodeOnFace(node, F);
+ meshDS->SetNodeOnFace(node, faceID, u, v);
//MESSAGE(P.X()<<" "<<P.Y()<<" "<<P.Z());
mefistoToDS[n + 1] = node;
//MESSAGE("NEW: "<<n<<" "<<mefistoToDS[n+1]);
- SMDS_FacePosition* fpos =
- static_cast<SMDS_FacePosition*>(node->GetPosition().get());
- fpos->SetUParameter(u);
- fpos->SetVParameter(v);
}
}
m = 0;
- int mt = 0;
+ //int mt = 0;
//SCRUTE(faceIsForward);
for (n = 1; n <= nbt; n++)
else
elt = meshDS->AddFace(n1, n3, n2);
- meshDS->SetMeshElementOnShape(elt, F);
+ meshDS->SetMeshElementOnShape(elt, faceID);
m++;
}
// **** a mettre dans SMESH_2D_Algo ?
const TopoDS_Face & FF = TopoDS::Face(aShape);
- bool faceIsForward = (FF.Orientation() == TopAbs_FORWARD);
+ //bool faceIsForward = (FF.Orientation() == TopAbs_FORWARD);
TopoDS_Face F = TopoDS::Face(FF.Oriented(TopAbs_FORWARD));
double meanElementLength = 100;
int nbhoriz = Min(nbdown, nbup);
int nbvertic = Min(nbright, nbleft);
- int nbVertices = nbhoriz * nbvertic;
- int nbQuad = (nbhoriz - 1) * (nbvertic - 1);
+ //int nbVertices = nbhoriz * nbvertic;
+ //int nbQuad = (nbhoriz - 1) * (nbvertic - 1);
//SCRUTE(nbVertices);
//SCRUTE(nbQuad);
// bool faceIsForward = (FF.Orientation() == TopAbs_FORWARD);
// TopoDS_Face F = TopoDS::Face(FF.Oriented(TopAbs_FORWARD));
const TopoDS_Face& F = TopoDS::Face(aShape);
- bool faceIsForward = (F.Orientation() == TopAbs_FORWARD);
+ //bool faceIsForward = (F.Orientation() == TopAbs_FORWARD);
Handle(Geom_Surface) S = BRep_Tool::Surface(F);
// internal mesh nodes
- int i, j;
+ int i, j, faceID = meshDS->ShapeToIndex( F );
for (i = 1; i < nbhoriz - 1; i++) {
for (j = 1; j < nbvertic - 1; j++) {
int ij = j * nbhoriz + i;
double v = quad->uv_grid[ij].v;
gp_Pnt P = S->Value(u, v);
SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
- meshDS->SetNodeOnFace(node, F);
+ meshDS->SetNodeOnFace(node, faceID, u, v);
quad->uv_grid[ij].node = node;
- SMDS_FacePosition* fpos =
- dynamic_cast<SMDS_FacePosition*>(node->GetPosition().get());
- fpos->SetUParameter(u);
- fpos->SetVParameter(v);
}
}
b = quad->uv_grid[j * nbhoriz + i + 1].node;
c = quad->uv_grid[(j + 1) * nbhoriz + i + 1].node;
d = quad->uv_grid[(j + 1) * nbhoriz + i].node;
- // if (isQuadForward) faceId = meshDS->AddFace(a,b,c,d);
- // else faceId = meshDS->AddFace(a,d,c,b);
SMDS_MeshFace * face = meshDS->AddFace(a, b, c, d);
- meshDS->SetMeshElementOnShape(face, F);
+ meshDS->SetMeshElementOnShape(face, faceID);
}
}
else
d = quad->uv_grid[nbhoriz + near - 1].node;
SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d);
- meshDS->SetMeshElementOnShape(face, F);
+ meshDS->SetMeshElementOnShape(face, faceID);
// if node d is not at position g - make additional triangles
if (near - 1 > g) {
else
d = quad->uv_grid[nbhoriz + k - 1].node;
SMDS_MeshFace* face = meshDS->AddFace(a, c, d);
- meshDS->SetMeshElementOnShape(face, F);
+ meshDS->SetMeshElementOnShape(face, faceID);
}
}
g = near;
if (near == g) { // make triangle
SMDS_MeshFace* face = meshDS->AddFace(a, b, c);
- meshDS->SetMeshElementOnShape(face, F);
+ meshDS->SetMeshElementOnShape(face, faceID);
} else { // make quadrangle
if (near + 1 > iup)
d = uv_e1[nbright - 2].node;
else
d = quad->uv_grid[nbhoriz*(nbvertic - 2) + near + 1].node;
SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d);
- meshDS->SetMeshElementOnShape(face, F);
+ meshDS->SetMeshElementOnShape(face, faceID);
if (near + 1 < g) { // if d not is at g - make additional triangles
for (int k = near + 1; k < g; k++) {
else
d = quad->uv_grid[nbhoriz*(nbvertic - 2) + k + 1].node;
SMDS_MeshFace* face = meshDS->AddFace(a, c, d);
- meshDS->SetMeshElementOnShape(face, F);
+ meshDS->SetMeshElementOnShape(face, faceID);
}
}
g = near;
if (near == g) { // make triangle
SMDS_MeshFace* face = meshDS->AddFace(a, b, c);
- meshDS->SetMeshElementOnShape(face, F);
+ meshDS->SetMeshElementOnShape(face, faceID);
} else { // make quadrangle
if (near - 1 < jlow)
d = uv_e0[nbdown - 2].node;
else
d = quad->uv_grid[nbhoriz*near - 2].node;
SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d);
- meshDS->SetMeshElementOnShape(face, F);
+ meshDS->SetMeshElementOnShape(face, faceID);
if (near - 1 > g) { // if d not is at g - make additional triangles
for (int k = near - 1; k > g; k--) {
else
d = quad->uv_grid[nbhoriz*k - 2].node;
SMDS_MeshFace* face = meshDS->AddFace(a, c, d);
- meshDS->SetMeshElementOnShape(face, F);
+ meshDS->SetMeshElementOnShape(face, faceID);
}
}
g = near;
if (near == g) { // make triangle
SMDS_MeshFace* face = meshDS->AddFace(a, b, c);
- meshDS->SetMeshElementOnShape(face, F);
+ meshDS->SetMeshElementOnShape(face, faceID);
} else { // make quadrangle
if (near + 1 > jup)
d = uv_e2[1].node;
else
d = quad->uv_grid[nbhoriz*(near + 1) + 1].node;
SMDS_MeshFace* face = meshDS->AddFace(a, b, c, d);
- meshDS->SetMeshElementOnShape(face, F);
+ meshDS->SetMeshElementOnShape(face, faceID);
if (near + 1 < g) { // if d not is at g - make additional triangles
for (int k = near + 1; k < g; k++) {
else
d = quad->uv_grid[nbhoriz*(k + 1) + 1].node;
SMDS_MeshFace* face = meshDS->AddFace(a, c, d);
- meshDS->SetMeshElementOnShape(face, F);
+ meshDS->SetMeshElementOnShape(face, faceID);
}
}
g = near;
Unexpect aCatch(SalomeException);
// MESSAGE("StdMeshers_Quadrangle_2D::CheckAnd2Dcompute");
- SMESH_subMesh *theSubMesh = aMesh.GetSubMesh(aShape);
+ //SMESH_subMesh *theSubMesh = aMesh.GetSubMesh(aShape);
// const TopoDS_Face& FF = TopoDS::Face(aShape);
// bool faceIsForward = (FF.Orientation() == TopAbs_FORWARD);
// TopoDS_Face F = TopoDS::Face(FF.Oriented(TopAbs_FORWARD));
const TopoDS_Face & F = TopoDS::Face(aShape);
- bool faceIsForward = (F.Orientation() == TopAbs_FORWARD);
+ //bool faceIsForward = (F.Orientation() == TopAbs_FORWARD);
// verify 1 wire only, with 4 edges
{
//MESSAGE("StdMeshers_Quadrangle_2D::LoadEdgePoints");
- SMDS_Mesh* meshDS = aMesh.GetMeshDS();
+ //SMDS_Mesh* meshDS = aMesh.GetMeshDS();
// --- IDNodes of first and last Vertex
const TopoDS_Edge & EE = TopoDS::Edge(aShape);
TopoDS_Edge E = TopoDS::Edge(EE.Oriented(TopAbs_FORWARD));
+ int shapeID = meshDS->ShapeToIndex( E );
double f, l;
Handle(Geom_Curve) Curve = BRep_Tool::Curve(E, f, l);
//Add the Node in the DataStructure
SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
- meshDS->SetNodeOnEdge(node, E);
-
- // **** edgePosition associe au point = param.
- SMDS_EdgePosition* epos =
- dynamic_cast<SMDS_EdgePosition *>(node->GetPosition().get());
- epos->SetUParameter(param);
+ meshDS->SetNodeOnEdge(node, shapeID, param);
SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, node);
- meshDS->SetMeshElementOnShape(edge, E);
+ meshDS->SetMeshElementOnShape(edge, shapeID);
idPrev = node;
}
SMDS_MeshEdge* edge = meshDS->AddEdge(idPrev, idLast);
- meshDS->SetMeshElementOnShape(edge, E);
+ meshDS->SetMeshElementOnShape(edge, shapeID);
}
else
{
{
double param = f + (i - 1) * du;
SMDS_MeshNode * node = meshDS->AddNode(P.X(), P.Y(), P.Z());
- meshDS->SetNodeOnEdge(node, E);
-
- SMDS_EdgePosition* epos =
- dynamic_cast<SMDS_EdgePosition*>(node->GetPosition().get());
- epos->SetUParameter(param);
+ meshDS->SetNodeOnEdge(node, shapeID, param);
SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, node);
- meshDS->SetMeshElementOnShape(edge, E);
+ meshDS->SetMeshElementOnShape(edge, shapeID);
idPrev = node;
}
SMDS_MeshEdge * edge = meshDS->AddEdge(idPrev, idLast);
- meshDS->SetMeshElementOnShape(edge, E);
+ meshDS->SetMeshElementOnShape(edge, shapeID);
}
return true;
}