Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Regression of doc/salome/examples/transforming_meshes_ex11.py
[modules/smesh.git]
/
src
/
SMESHUtils
/
SMESH_Block.cxx
diff --git
a/src/SMESHUtils/SMESH_Block.cxx
b/src/SMESHUtils/SMESH_Block.cxx
index fd40175d8bfb14f5309ef6837a30bb7ce7b88d55..5ff01e3ab01843f9f18fe9cbbd6efaa6da50e662 100644
(file)
--- a/
src/SMESHUtils/SMESH_Block.cxx
+++ b/
src/SMESHUtils/SMESH_Block.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
3
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
6
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-6,7
+6,7
@@
// 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
// 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.
+// version 2.1 of the License
, or (at your option) any later version
.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-166,7
+166,7
@@
void SMESH_Block::TFace::Set( const int faceID,
// pcurves
vector< int > edgeIdVec;
GetFaceEdgesIDs( faceID, edgeIdVec );
// pcurves
vector< int > edgeIdVec;
GetFaceEdgesIDs( faceID, edgeIdVec );
- for (
in
t iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
+ for (
size_
t iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
{
myCoordInd[ iE ] = GetCoordIndOnEdge( edgeIdVec[ iE ] );
if ( myC2d[ iE ]) delete myC2d[ iE ];
{
myCoordInd[ iE ] = GetCoordIndOnEdge( edgeIdVec[ iE ] );
if ( myC2d[ iE ]) delete myC2d[ iE ];
@@
-596,6
+596,7
@@
Standard_Boolean SMESH_Block::Values(const math_Vector& theXYZ,
if ( mag > DBL_MIN )
dPi /= mag;
drv[ iP - 1 ] = dPi;
if ( mag > DBL_MIN )
dPi /= mag;
drv[ iP - 1 ] = dPi;
+ // drv[ iP - 1 ] = dPi / 0.001;
}
for ( int iP = 0; iP < 3; iP++ ) {
#if 1
}
for ( int iP = 0; iP < 3; iP++ ) {
#if 1
@@
-719,13
+720,13
@@
bool SMESH_Block::ComputeParameters(const gp_Pnt& thePoint,
const bool isOnFace = IsFaceID( theShapeID );
double * coef = GetShapeCoef( theShapeID );
const bool isOnFace = IsFaceID( theShapeID );
double * coef = GetShapeCoef( theShapeID );
- // Find the first guess par
e
meters
+ // Find the first guess par
a
meters
gp_XYZ start(0, 0, 0);
bool hasHint = ( 0 <= theParamsHint.X() && theParamsHint.X() <= 1 &&
0 <= theParamsHint.Y() && theParamsHint.Y() <= 1 &&
gp_XYZ start(0, 0, 0);
bool hasHint = ( 0 <= theParamsHint.X() && theParamsHint.X() <= 1 &&
0 <= theParamsHint.Y() && theParamsHint.Y() <= 1 &&
- 0 <= theParamsHint.
Y() && theParamsHint.Y
() <= 1 );
+ 0 <= theParamsHint.
Z() && theParamsHint.Z
() <= 1 );
if ( !hasHint && !myGridComputed )
{
// define the first guess by thePoint projection on lines
if ( !hasHint && !myGridComputed )
{
// define the first guess by thePoint projection on lines
@@
-929,6
+930,7
@@
void SMESH_Block::refineParametersOnFace( const gp_Pnt& thePoint,
{
// find UV of thePoint on the FACE
Standard_Real U,V;
{
// find UV of thePoint on the FACE
Standard_Real U,V;
+ U=V=0;
const TFace& tface = myFace[ theFaceID - ID_FirstF ];
if ( !tface.Surface() ) return;
const TFace& tface = myFace[ theFaceID - ID_FirstF ];
if ( !tface.Surface() ) return;
@@
-1027,7
+1029,7
@@
bool SMESH_Block::findUVByHalfDivision( const gp_Pnt& thePoint,
dy *= 1.2;
xSol = 0.5 * (xMax + xMin) ;
ySol = 0.5 * (yMax + yMin) ;
dy *= 1.2;
xSol = 0.5 * (xMax + xMin) ;
ySol = 0.5 * (yMax + yMin) ;
- if ( xMin == 0. && yMin == 0. && xMax == 1. && yMax == 1. ) // avoid infinit loop
+ if ( xMin == 0. && yMin == 0. && xMax == 1. && yMax == 1. ) // avoid infinit
e
loop
{
#ifdef _DEBUG_REFINE_
cout << "SMESH_Block::refineParametersOnFace(): tface.IsUVInQuad() fails" << endl;
{
#ifdef _DEBUG_REFINE_
cout << "SMESH_Block::refineParametersOnFace(): tface.IsUVInQuad() fails" << endl;
@@
-1112,7
+1114,7
@@
bool SMESH_Block::findUVByHalfDivision( const gp_Pnt& thePoint,
if ( saveBetterSolution( sol, theParams, thePoint.SquareDistance( tface.Point( sol ))))
{
#ifdef _DEBUG_REFINE_
if ( saveBetterSolution( sol, theParams, thePoint.SquareDistance( tface.Point( sol ))))
{
#ifdef _DEBUG_REFINE_
- cout << "SMESH_Block::refineParametersOnFace(): dividing suceeded" << endl;
+ cout << "SMESH_Block::refineParametersOnFace(): dividing suc
c
eeded" << endl;
cout << " nbGetUV = " << nbGetUV << endl;
#endif
return true;
cout << " nbGetUV = " << nbGetUV << endl;
#endif
return true;
@@
-1464,7
+1466,7
@@
int SMESH_Block::GetShapeIDByParams ( const gp_XYZ& theCoord )
/*!
* \brief Return number of wires and a list of oredered edges.
* \param theFace - the face to process
/*!
* \brief Return number of wires and a list of oredered edges.
* \param theFace - the face to process
- * \param theEdges - all ordered edges of theFace (outer edges go
es
first).
+ * \param theEdges - all ordered edges of theFace (outer edges go first).
* \param theNbEdgesInWires - nb of edges (== nb of vertices in closed wire) in each wire
* \param theFirstVertex - the vertex of the outer wire to set first in the returned
* list ( theFirstVertex may be NULL )
* \param theNbEdgesInWires - nb of edges (== nb of vertices in closed wire) in each wire
* \param theFirstVertex - the vertex of the outer wire to set first in the returned
* list ( theFirstVertex may be NULL )
@@
-1583,7
+1585,7
@@
int SMESH_Block::GetOrderedEdges (const TopoDS_Face& theFace,
}
//================================================================================
/*!
}
//================================================================================
/*!
- * \brief Call it after geometry initiali
s
ation
+ * \brief Call it after geometry initiali
z
ation
*/
//================================================================================
*/
//================================================================================
@@
-1606,7
+1608,6
@@
bool SMESH_Block::LoadMeshBlock(const SMDS_MeshVolume* theVolume,
const int theNode001Index,
vector<const SMDS_MeshNode*>& theOrderedNodes)
{
const int theNode001Index,
vector<const SMDS_MeshNode*>& theOrderedNodes)
{
- MESSAGE(" ::LoadMeshBlock()");
init();
SMDS_VolumeTool vTool;
init();
SMDS_VolumeTool vTool;
@@
-1734,7
+1735,6
@@
bool SMESH_Block::LoadBlockShapes(const TopoDS_Shell& theShell,
const TopoDS_Vertex& theVertex001,
TopTools_IndexedMapOfOrientedShape& theShapeIDMap )
{
const TopoDS_Vertex& theVertex001,
TopTools_IndexedMapOfOrientedShape& theShapeIDMap )
{
- MESSAGE(" ::LoadBlockShapes()");
return ( FindBlockShapes( theShell, theVertex000, theVertex001, theShapeIDMap ) &&
LoadBlockShapes( theShapeIDMap ));
}
return ( FindBlockShapes( theShell, theVertex000, theVertex001, theShapeIDMap ) &&
LoadBlockShapes( theShapeIDMap ));
}
@@
-1750,8
+1750,6
@@
bool SMESH_Block::FindBlockShapes(const TopoDS_Shell& theShell,
const TopoDS_Vertex& theVertex001,
TopTools_IndexedMapOfOrientedShape& theShapeIDMap )
{
const TopoDS_Vertex& theVertex001,
TopTools_IndexedMapOfOrientedShape& theShapeIDMap )
{
- MESSAGE(" ::FindBlockShapes()");
-
// 8 vertices
TopoDS_Shape V000, V100, V010, V110, V001, V101, V011, V111;
// 12 edges
// 8 vertices
TopoDS_Shape V000, V100, V010, V110, V001, V101, V011, V111;
// 12 edges
@@
-1777,7
+1775,7
@@
bool SMESH_Block::FindBlockShapes(const TopoDS_Shell& theShell,
if ( V000.IsNull() ) {
// find vertex 000 - the one with smallest coordinates
if ( V000.IsNull() ) {
// find vertex 000 - the one with smallest coordinates
- double minVal = DBL_MAX, minX, val;
+ double minVal = DBL_MAX, minX
= DBL_MAX
, val;
for ( int i = 1; i <= 8; i++ ) {
const TopoDS_Vertex& v = TopoDS::Vertex( vfMap.FindKey( i ));
gp_Pnt P = BRep_Tool::Pnt( v );
for ( int i = 1; i <= 8; i++ ) {
const TopoDS_Vertex& v = TopoDS::Vertex( vfMap.FindKey( i ));
gp_Pnt P = BRep_Tool::Pnt( v );
@@
-1798,8
+1796,11
@@
bool SMESH_Block::FindBlockShapes(const TopoDS_Shell& theShell,
for ( ; eIt.More(); eIt.Next() ) {
const TopoDS_Edge& e = TopoDS::Edge( eIt.Value() );
TopoDS_Vertex v = TopExp::FirstVertex( e );
for ( ; eIt.More(); eIt.Next() ) {
const TopoDS_Edge& e = TopoDS::Edge( eIt.Value() );
TopoDS_Vertex v = TopExp::FirstVertex( e );
- if ( v.IsSame( V000 ))
+ if ( v.IsSame( V000 ))
{
v = TopExp::LastVertex( e );
v = TopExp::LastVertex( e );
+ if ( v.IsSame( V000 ))
+ return false;
+ }
val = dir001 * gp_Vec( p000, BRep_Tool::Pnt( v )).Normalized();
if ( val > maxVal ) {
V001 = v;
val = dir001 * gp_Vec( p000, BRep_Tool::Pnt( v )).Normalized();
if ( val > maxVal ) {
V001 = v;
@@
-1818,7
+1819,7
@@
bool SMESH_Block::FindBlockShapes(const TopoDS_Shell& theShell,
return false;
}
TopTools_ListIteratorOfListOfShape f001It, f000It ( f000List );
return false;
}
TopTools_ListIteratorOfListOfShape f001It, f000It ( f000List );
- int i, j, iFound1
, iFound2
;
+ int i, j, iFound1
=0, iFound2=0
;
for ( j = 0; f000It.More(); f000It.Next(), j++ )
{
if ( NB_FACES_BY_VERTEX == 6 && j % 2 ) continue; // each face encounters twice
for ( j = 0; f000It.More(); f000It.Next(), j++ )
{
if ( NB_FACES_BY_VERTEX == 6 && j % 2 ) continue; // each face encounters twice
@@
-2079,7
+2080,7
@@
bool SMESH_Block::LoadFace(const TopoDS_Face& theFace,
bool isForward[4];
vector< int > edgeIdVec;
GetFaceEdgesIDs( theFaceID, edgeIdVec );
bool isForward[4];
vector< int > edgeIdVec;
GetFaceEdgesIDs( theFaceID, edgeIdVec );
- for (
in
t iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
+ for (
size_
t iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges
{
if ( edgeIdVec[ iE ] > theShapeIDMap.Extent() )
return false;
{
if ( edgeIdVec[ iE ] > theShapeIDMap.Extent() )
return false;