-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#include <Geom2d_Curve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
- // store shapes indices
- mySeamShapeIds.insert( meshDS->ShapeToIndex( edge ));
- for ( TopExp_Explorer v( edge, TopAbs_VERTEX ); v.More(); v.Next() )
- mySeamShapeIds.insert( meshDS->ShapeToIndex( v.Current() ));
+ // store seam shape indices, negative if shape encounters twice
+ int edgeID = meshDS->ShapeToIndex( edge );
+ mySeamShapeIds.insert( IsSeamShape( edgeID ) ? -edgeID : edgeID );
+ for ( TopExp_Explorer v( edge, TopAbs_VERTEX ); v.More(); v.Next() ) {
+ int vertexID = meshDS->ShapeToIndex( v.Current() );
+ mySeamShapeIds.insert( IsSeamShape( vertexID ) ? -vertexID : vertexID );
+ }
Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
uv = C2d->Value( epos->GetUParameter() );
// for a node on a seam edge select one of UVs on 2 pcurves
Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l);
uv = C2d->Value( epos->GetUParameter() );
// for a node on a seam edge select one of UVs on 2 pcurves
uv = GetUVOnSeam( uv, GetNodeUV( F, n2, 0 ));
}
else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX)
uv = GetUVOnSeam( uv, GetNodeUV( F, n2, 0 ));
}
else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX)
- cout << "SMESH_MesherHelper::GetNodeUV(); Vertex " << vertexID
- << " not in face " << GetMeshDS()->ShapeToIndex( F ) << endl;
+ MESSAGE ( "SMESH_MesherHelper::GetNodeUV(); Vertex " << vertexID
+ << " not in face " << GetMeshDS()->ShapeToIndex( F ) );
uv = GetUVOnSeam( uv, GetNodeUV( F, n2, 0 ));
}
}
uv = GetUVOnSeam( uv, GetNodeUV( F, n2, 0 ));
}
}
gp_XY p1 = GetNodeUV(F,n1,n2);
gp_XY p2 = GetNodeUV(F,n2,n1);
gp_XY p1 = GetNodeUV(F,n1,n2);
gp_XY p2 = GetNodeUV(F,n2,n1);
+ if ( IsDegenShape( Pos1->GetShapeId() ))
+ p1.SetCoord( myParIndex, p2.Coord( myParIndex ));
+ else if ( IsDegenShape( Pos2->GetShapeId() ))
+ p2.SetCoord( myParIndex, p1.Coord( myParIndex ));
+
//checking if surface is periodic
Handle(Geom_Surface) S = BRep_Tool::Surface(F);
Standard_Real UF,UL,VF,VL;
//checking if surface is periodic
Handle(Geom_Surface) S = BRep_Tool::Surface(F);
Standard_Real UF,UL,VF,VL;
- /*!
- * \brief Load nodes bound to face into a map of node columns
- * \param theParam2ColumnMap - map of node columns to fill
- * \param theFace - the face on which nodes are searched for
- * \param theBaseEdge - the edge nodes of which are columns' bases
- * \param theMesh - the mesh containing nodes
- * \retval bool - false if something is wrong
- *
- * The key of the map is a normalized parameter of each
- * base node on theBaseEdge.
- * This method works in supposition that nodes on the face
- * forms a rectangular grid and elements can be quardrangles or triangles
- */
+/*!
+ * \brief Load nodes bound to face into a map of node columns
+ * \param theParam2ColumnMap - map of node columns to fill
+ * \param theFace - the face on which nodes are searched for
+ * \param theBaseEdge - the edge nodes of which are columns' bases
+ * \param theMesh - the mesh containing nodes
+ * \retval bool - false if something is wrong
+ *
+ * The key of the map is a normalized parameter of each
+ * base node on theBaseEdge.
+ * This method works in supposition that nodes on the face
+ * forms a rectangular grid and elements can be quardrangles or triangles
+ */
//=======================================================================
bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
//=======================================================================
bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap,
nVecf.resize( vsize, nullNode );
loadedNodes.insert( nVecf[ 0 ] = smVfb->GetNodes()->next() );
nVecf.resize( vsize, nullNode );
loadedNodes.insert( nVecf[ 0 ] = smVfb->GetNodes()->next() );
nVecl.resize( vsize, nullNode );
loadedNodes.insert( nVecl[ 0 ] = smVlb->GetNodes()->next() );
nVecl.resize( vsize, nullNode );
loadedNodes.insert( nVecl[ 0 ] = smVlb->GetNodes()->next() );
nVec.resize( vsize, nullNode );
loadedNodes.insert( nVec[ 0 ] = node );
}
nVec.resize( vsize, nullNode );
loadedNodes.insert( nVec[ 0 ] = node );
}
int row = rev1 ? vsize - 1 : 0;
int dRow = rev1 ? -1 : +1;
for ( ; u_n != sortedNodes.end(); u_n++ ) {
int row = rev1 ? vsize - 1 : 0;
int dRow = rev1 ? -1 : +1;
for ( ; u_n != sortedNodes.end(); u_n++ ) {
/**
* Check mesh without geometry for: if all elements on this shape are quadratic,
* quadratic elements will be created.
* Used then generated 3D mesh without geometry.
/**
* Check mesh without geometry for: if all elements on this shape are quadratic,
* quadratic elements will be created.
* Used then generated 3D mesh without geometry.
+//=======================================================================
+/*!
+ * \brief Return an alternative parameter for a node on seam
+ */
+//=======================================================================
+
+double SMESH_MesherHelper::GetOtherParam(const double param) const
+{
+ return fabs(param-myPar1) < fabs(param-myPar2) ? myPar2 : myPar1;
+}