-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
-// version 2.1 of the License.
+// 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.
//
-// 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 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
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// 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
+// 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>
-//
-#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,
+void CopySource(const TopoDS_Shape& aS,
+ TopTools_IndexedDataMapOfShapeShape& aMapSS,
TopoDS_Shape& aSC);
//=======================================================================
//function : CopyShape
-//purpose :
+//purpose :
//=======================================================================
- void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS,
+ 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,
+ void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS,
TopoDS_Shape& aSC,
TopTools_IndexedDataMapOfShapeShape& aMapSS)
{
}
//=======================================================================
//function : CopySource
-//purpose :
+//purpose :
//=======================================================================
-void CopySource(const TopoDS_Shape& aS,
- TopTools_IndexedDataMapOfShapeShape& aMapSS,
+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,
+ Standard_Integer NMTDS_Tools::ComputeVV(const TopoDS_Vertex& aV1,
const TopoDS_Vertex& aV2)
{
Standard_Real aTolV1, aTolV2, aTolSum, aTolSum2, aD2;
}
//=======================================================================
// 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)
default:
break;
}
- return iRet;
+ return iRet;
}