-// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 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
// File : SMESH_Pattern.hxx
// Created : Mon Aug 2 10:30:00 2004
// Author : Edward AGAPOV (eap)
-//
+
#include "SMESH_Pattern.hxx"
#include <BRepAdaptor_Curve.hxx>
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
+#include <Basics_OCCTVersion.hxx>
+
#include <Basics_Utils.hxx>
#include "utilities.h"
}
double u, v, minVal = DBL_MAX;
for ( int i = theProjectorPS.NbExt(); i > 0; i-- )
+#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
+ if ( theProjectorPS.SquareDistance( i ) < minVal ) {
+ minVal = theProjectorPS.SquareDistance( i );
+#else
if ( theProjectorPS.Value( i ) < minVal ) {
minVal = theProjectorPS.Value( i );
+#endif
theProjectorPS.Point( i ).Parameter( u, v );
}
return gp_XY( u, v );
bool SMESH_Pattern::Load (SMESH_Mesh* theMesh,
const TopoDS_Face& theFace,
- bool theProject)
+ bool theProject,
+ TopoDS_Vertex the1stVertex)
{
MESSAGE(" ::Load(face) " );
Clear();
// check if face is closed
bool isClosed = helper.HasSeam();
- TopoDS_Vertex bidon;
list<TopoDS_Edge> eList;
list<TopoDS_Edge>::iterator elIt;
- SMESH_Block::GetOrderedEdges( face, bidon, eList, myNbKeyPntInBoundary );
+ SMESH_Block::GetOrderedEdges( face, eList, myNbKeyPntInBoundary, the1stVertex );
// check that requested or needed projection is possible
bool isMainShape = theMesh->IsMainShape( face );
maxLen2 = Max( maxLen2, ( n[1]->myUV - n[2]->myUV ).SquareModulus() );
}
maxLen2 = Max( maxLen2, ( n[2]->myUV - node->myUV ).SquareModulus() );
- minDiag = sqrt( maxLen2 ) * PI / 60.; // ~ maxLen * Sin( 3 deg )
+ minDiag = sqrt( maxLen2 ) * M_PI / 60.; // ~ maxLen * Sin( 3 deg )
}
// check if newUV is behind 3 dirs: n[0]-n[1], n[1]-n[2] and n[0]-n[2]
double initAngle = initTgt1.Angle( initTgt2 );
double angle = node->myDir[0].Angle( node->myDir[1] );
if ( reversed ) angle = -angle;
- if ( initAngle > angle && initAngle - angle > PI / 2.1 ) {
+ if ( initAngle > angle && initAngle - angle > M_PI / 2.1 ) {
// find a close internal node
TIsoNode* nClose = 0;
list< TIsoNode* > testNodes;
list< TopoDS_Edge > eList;
list< int > nbVertexInWires;
- int nbWires = SMESH_Block::GetOrderedEdges( face, theVertexOnKeyPoint1, eList, nbVertexInWires);
+ int nbWires = SMESH_Block::GetOrderedEdges( face, eList, nbVertexInWires, theVertexOnKeyPoint1);
if ( !theVertexOnKeyPoint1.IsSame( TopExp::FirstVertex( eList.front(), true )))
{
MESSAGE( " theVertexOnKeyPoint1 not found in the outer wire ");
// coordinates computed by either of Apply...() methods
// WARNING : StdMeshers_Projection_... relies on MakeMesh() behavior: that
// it does not care of nodes and elements already existing on
-// subshapes. DO NOT MERGE them or modify also StdMeshers_Projection_..
+// sub-shapes. DO NOT MERGE them or modify also StdMeshers_Projection_..
//=======================================================================
bool SMESH_Pattern::MakeMesh(SMESH_Mesh* theMesh,