-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2007-2012 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
+// License as published by the Free Software Foundation; either
// version 2.1 of the License.
-//
-// 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
+//
+// 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.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// 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
//
-// File: NMTDS_Tools.cxx
-// Created: Tue Feb 20 14:57:28 2007
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: NMTDS_Tools.cxx
+// Created: Tue Feb 20 14:57:28 2007
+// Author: Peter KURNEV
-#include <NMTDS_Tools.ixx>
+#include <NMTDS_Tools.hxx>
#include <TopoDS_Vertex.hxx>
#include <gp_Pnt.hxx>
#include <BRep_Tool.hxx>
#include <TopoDS_Iterator.hxx>
#include <BRep_Builder.hxx>
-void CopySource(const TopoDS_Shape& aS,
- TopTools_IndexedDataMapOfShapeShape& aMapSS,
- TopoDS_Shape& aSC);
+void CopySource(const TopoDS_Shape& aS,
+ TopTools_IndexedDataMapOfShapeShape& aMapSS,
+ TopoDS_Shape& aSC);
//=======================================================================
//function : CopyShape
-//purpose :
+//purpose :
//=======================================================================
- void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS,
- TopoDS_Shape& aSC)
+ void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS,
+ TopoDS_Shape& aSC)
{
TopTools_IndexedDataMapOfShapeShape aMapSS;
//
}
//=======================================================================
//function : CopyShape
-//purpose :
+//purpose :
//=======================================================================
- void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS,
- TopoDS_Shape& aSC,
- TopTools_IndexedDataMapOfShapeShape& aMapSS)
+ void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS,
+ TopoDS_Shape& aSC,
+ TopTools_IndexedDataMapOfShapeShape& aMapSS)
{
CopySource(aS, aMapSS, aSC);
}
//=======================================================================
//function : CopySource
-//purpose :
+//purpose :
//=======================================================================
-void CopySource(const TopoDS_Shape& aS,
- TopTools_IndexedDataMapOfShapeShape& aMapSS,
- TopoDS_Shape& aSC)
+void CopySource(const TopoDS_Shape& aS,
+ TopTools_IndexedDataMapOfShapeShape& aMapSS,
+ TopoDS_Shape& aSC)
{
Standard_Boolean bFree;
TopAbs_ShapeEnum aT;
TopoDS_Iterator aIt;
+ TopoDS_Shape aSF;
BRep_Builder BB;
//
aT=aS.ShapeType();
//
bFree=aSC.Free();
aSC.Free(Standard_True);
- aIt.Initialize(aS);
+ aSF=aS;
+ if (aT==TopAbs_EDGE){
+ TopAbs_Orientation aOr;
+ //
+ aOr=aS.Orientation();
+ if(aOr==TopAbs_INTERNAL) {
+ aSF.Orientation(TopAbs_FORWARD);
+ }
+ }
+ aIt.Initialize(aSF);
for (; aIt.More(); aIt.Next()) {
TopoDS_Shape aSCx;
//
const TopoDS_Shape& aSx=aIt.Value();
//
- CopySource (aSx, aMapSS, aSCx);
+ CopySource (aSx, aMapSS, aSCx);
//
aSCx.Orientation(aSx.Orientation());
BB.Add(aSC, aSCx);
}
//=======================================================================
// function: ComputeVV
-// purpose:
+// purpose:
//=======================================================================
- Standard_Integer NMTDS_Tools::ComputeVV(const TopoDS_Vertex& aV1,
- const TopoDS_Vertex& aV2)
+ Standard_Integer NMTDS_Tools::ComputeVV(const TopoDS_Vertex& aV1,
+ const TopoDS_Vertex& aV2)
{
Standard_Real aTolV1, aTolV2, aTolSum, aTolSum2, aD2;
gp_Pnt aP1, aP2;
}
//=======================================================================
// function: HasBRep
-// purpose:
+// purpose:
//=======================================================================
Standard_Boolean NMTDS_Tools::HasBRep(const TopAbs_ShapeEnum aTi)
{
}
//=======================================================================
//function : TypeToInteger
-//purpose :
+//purpose :
//=======================================================================
Standard_Integer NMTDS_Tools::TypeToInteger(const TopAbs_ShapeEnum aType1,
- const TopAbs_ShapeEnum aType2)
+ const TopAbs_ShapeEnum aType2)
{
Standard_Integer iRet, iT1, iT2, iX;
//
default:
break;
}
- return iRet;
+ return iRet;
}