GEOM_Object GetInPlace (in GEOM_Object theShapeWhere,
in GEOM_Object theShapeWhat);
+ /*!
+ * Old implementation of GetInPlace functionality, based on shape properties.
+ */
+ GEOM_Object GetInPlaceOld (in GEOM_Object theShapeWhere,
+ in GEOM_Object theShapeWhat);
+
/*!
* Get sub-shape(s) of \a theShapeWhere, which are
* coincident with \a theShapeWhat or could be a part of it.
--- Copyright (C) 2005-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+-- Copyright (C) 2007-2011 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
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- File: GEOMAlgo.cdl
-- Created: Sat Dec 04 12:36:22 2004
-- Author: Peter KURNEV
--- <peter@PREFEX>
package GEOMAlgo
class ShapeInfo;
class ShapeInfoFiller;
--
- -- gluer
+ -- Gluer / GetInPlace
+--modified by NIZNHY-PKV Mon Feb 21 10:07:22 2011f
+-- class Gluer1;
class Gluer;
- class Gluer1;
-
---modified by NIZNHY-PKV Mon Feb 21 10:07:22 2011f
+
imported Gluer2 from GEOMAlgo;
imported GlueDetector from GEOMAlgo;
- imported GluerAlgo from GEOMAlgo;
+ imported GluerAlgo from GEOMAlgo;
+ imported GetInPlace from GEOMAlgo;
--modified by NIZNHY-PKV Mon Feb 21 10:07:27 2011t
-
+
class GlueAnalyser;
class CoupleOfShapes;
class PassKey;
class PassKeyMapHasher;
class PassKeyShape;
-
class SurfaceTools;
class Tools;
--
class DataMapOfOrientedShapeShape instantiates
DataMap from TCollection (Shape from TopoDS,
Shape from TopoDS,
- OrientedShapeMapHasher from TopTools);
+ OrientedShapeMapHasher from TopTools);
+
+ --modified by NIZNHY-PKV Thu Apr 28 08:25:36 2011f
+ class DataMapOfShapeMapOfShape instantiates
+ DataMap from TCollection (Shape from TopoDS,
+ MapOfShape from TopTools,
+ ShapeMapHasher from TopTools);
+ class DataMapOfShapePnt instantiates
+ DataMap from TCollection (Shape from TopoDS,
+ Pnt from gp,
+ ShapeMapHasher from TopTools);
+ --modified by NIZNHY-PKV Thu Apr 28 08:25:39 2011t
end GEOMAlgo;
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape_HeaderFile\r
+#define _GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape_HeaderFile\r
+\r
+#ifndef _Standard_HeaderFile\r
+#include <Standard.hxx>\r
+#endif\r
+#ifndef _Standard_Macro_HeaderFile\r
+#include <Standard_Macro.hxx>\r
+#endif\r
+\r
+#ifndef _TCollection_BasicMapIterator_HeaderFile\r
+#include <TCollection_BasicMapIterator.hxx>\r
+#endif\r
+#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile\r
+#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>\r
+#endif\r
+class Standard_NoSuchObject;\r
+class TopoDS_Shape;\r
+class TopTools_MapOfShape;\r
+class TopTools_ShapeMapHasher;\r
+class GEOMAlgo_DataMapOfShapeMapOfShape;\r
+class GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape;\r
+\r
+\r
+\r
+class GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape : public TCollection_BasicMapIterator {\r
+public:\r
+\r
+ void* operator new(size_t,void* anAddress) \r
+ {\r
+ return anAddress;\r
+ }\r
+ void* operator new(size_t size) \r
+ {\r
+ return Standard::Allocate(size); \r
+ }\r
+ void operator delete(void *anAddress) \r
+ {\r
+ if (anAddress) Standard::Free((Standard_Address&)anAddress); \r
+ }\r
+\r
+ \r
+ Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape();\r
+ \r
+ Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape(const GEOMAlgo_DataMapOfShapeMapOfShape& aMap);\r
+ \r
+ Standard_EXPORT void Initialize(const GEOMAlgo_DataMapOfShapeMapOfShape& aMap) ;\r
+ \r
+ Standard_EXPORT const TopoDS_Shape& Key() const;\r
+ \r
+ Standard_EXPORT const TopTools_MapOfShape& Value() const;\r
+\r
+\r
+\r
+\r
+\r
+protected:\r
+\r
+\r
+\r
+\r
+\r
+private:\r
+\r
+\r
+\r
+\r
+\r
+};\r
+\r
+\r
+\r
+\r
+\r
+// other Inline functions and methods (like "C++: function call" methods)\r
+\r
+\r
+#endif\r
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>\r
+\r
+#ifndef _Standard_NoSuchObject_HeaderFile\r
+#include <Standard_NoSuchObject.hxx>\r
+#endif\r
+#ifndef _TopoDS_Shape_HeaderFile\r
+#include <TopoDS_Shape.hxx>\r
+#endif\r
+#ifndef _TopTools_MapOfShape_HeaderFile\r
+#include <TopTools_MapOfShape.hxx>\r
+#endif\r
+#ifndef _TopTools_ShapeMapHasher_HeaderFile\r
+#include <TopTools_ShapeMapHasher.hxx>\r
+#endif\r
+#ifndef _GEOMAlgo_DataMapOfShapeMapOfShape_HeaderFile\r
+#include <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>\r
+#endif\r
+#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile\r
+#include <GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>\r
+#endif\r
+ \r
+\r
+#define TheKey TopoDS_Shape\r
+#define TheKey_hxx <TopoDS_Shape.hxx>\r
+#define TheItem TopTools_MapOfShape\r
+#define TheItem_hxx <TopTools_MapOfShape.hxx>\r
+#define Hasher TopTools_ShapeMapHasher\r
+#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>\r
+#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape\r
+#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>\r
+#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape\r
+#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>\r
+#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape\r
+#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_Type_()\r
+#define TCollection_DataMap GEOMAlgo_DataMapOfShapeMapOfShape\r
+#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>\r
+#include <TCollection_DataMapIterator.gxx>\r
+\r
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt_HeaderFile\r
+#define _GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt_HeaderFile\r
+\r
+#ifndef _Standard_HeaderFile\r
+#include <Standard.hxx>\r
+#endif\r
+#ifndef _Standard_Macro_HeaderFile\r
+#include <Standard_Macro.hxx>\r
+#endif\r
+\r
+#ifndef _TCollection_BasicMapIterator_HeaderFile\r
+#include <TCollection_BasicMapIterator.hxx>\r
+#endif\r
+#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile\r
+#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>\r
+#endif\r
+class Standard_NoSuchObject;\r
+class TopoDS_Shape;\r
+class gp_Pnt;\r
+class TopTools_ShapeMapHasher;\r
+class GEOMAlgo_DataMapOfShapePnt;\r
+class GEOMAlgo_DataMapNodeOfDataMapOfShapePnt;\r
+\r
+\r
+\r
+class GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt : public TCollection_BasicMapIterator {\r
+public:\r
+\r
+ void* operator new(size_t,void* anAddress) \r
+ {\r
+ return anAddress;\r
+ }\r
+ void* operator new(size_t size) \r
+ {\r
+ return Standard::Allocate(size); \r
+ }\r
+ void operator delete(void *anAddress) \r
+ {\r
+ if (anAddress) Standard::Free((Standard_Address&)anAddress); \r
+ }\r
+\r
+ \r
+ Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt();\r
+ \r
+ Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt(const GEOMAlgo_DataMapOfShapePnt& aMap);\r
+ \r
+ Standard_EXPORT void Initialize(const GEOMAlgo_DataMapOfShapePnt& aMap) ;\r
+ \r
+ Standard_EXPORT const TopoDS_Shape& Key() const;\r
+ \r
+ Standard_EXPORT const gp_Pnt& Value() const;\r
+\r
+\r
+\r
+\r
+\r
+protected:\r
+\r
+\r
+\r
+\r
+\r
+private:\r
+\r
+\r
+\r
+\r
+\r
+};\r
+\r
+\r
+\r
+\r
+\r
+// other Inline functions and methods (like "C++: function call" methods)\r
+\r
+\r
+#endif\r
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx>\r
+\r
+#ifndef _Standard_NoSuchObject_HeaderFile\r
+#include <Standard_NoSuchObject.hxx>\r
+#endif\r
+#ifndef _TopoDS_Shape_HeaderFile\r
+#include <TopoDS_Shape.hxx>\r
+#endif\r
+#ifndef _gp_Pnt_HeaderFile\r
+#include <gp_Pnt.hxx>\r
+#endif\r
+#ifndef _TopTools_ShapeMapHasher_HeaderFile\r
+#include <TopTools_ShapeMapHasher.hxx>\r
+#endif\r
+#ifndef _GEOMAlgo_DataMapOfShapePnt_HeaderFile\r
+#include <GEOMAlgo_DataMapOfShapePnt.hxx>\r
+#endif\r
+#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile\r
+#include <GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>\r
+#endif\r
+ \r
+\r
+#define TheKey TopoDS_Shape\r
+#define TheKey_hxx <TopoDS_Shape.hxx>\r
+#define TheItem gp_Pnt\r
+#define TheItem_hxx <gp_Pnt.hxx>\r
+#define Hasher TopTools_ShapeMapHasher\r
+#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>\r
+#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapePnt\r
+#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>\r
+#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt\r
+#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx>\r
+#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt\r
+#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_Type_()\r
+#define TCollection_DataMap GEOMAlgo_DataMapOfShapePnt\r
+#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapePnt.hxx>\r
+#include <TCollection_DataMapIterator.gxx>\r
+\r
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile\r
+#define _GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile\r
+\r
+#ifndef _Standard_HeaderFile\r
+#include <Standard.hxx>\r
+#endif\r
+#ifndef _Standard_DefineHandle_HeaderFile\r
+#include <Standard_DefineHandle.hxx>\r
+#endif\r
+#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile\r
+#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>\r
+#endif\r
+\r
+#ifndef _TopoDS_Shape_HeaderFile\r
+#include <TopoDS_Shape.hxx>\r
+#endif\r
+#ifndef _TopTools_MapOfShape_HeaderFile\r
+#include <TopTools_MapOfShape.hxx>\r
+#endif\r
+#ifndef _TCollection_MapNode_HeaderFile\r
+#include <TCollection_MapNode.hxx>\r
+#endif\r
+#ifndef _TCollection_MapNodePtr_HeaderFile\r
+#include <TCollection_MapNodePtr.hxx>\r
+#endif\r
+class TopoDS_Shape;\r
+class TopTools_MapOfShape;\r
+class TopTools_ShapeMapHasher;\r
+class GEOMAlgo_DataMapOfShapeMapOfShape;\r
+class GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape;\r
+\r
+\r
+\r
+class GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape : public TCollection_MapNode {\r
+\r
+public:\r
+\r
+ \r
+ GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape(const TopoDS_Shape& K,const TopTools_MapOfShape& I,const TCollection_MapNodePtr& n);\r
+ \r
+ TopoDS_Shape& Key() const;\r
+ \r
+ TopTools_MapOfShape& Value() const;\r
+\r
+\r
+\r
+\r
+ DEFINE_STANDARD_RTTI(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape)\r
+\r
+protected:\r
+\r
+\r
+\r
+\r
+private: \r
+\r
+\r
+TopoDS_Shape myKey;\r
+TopTools_MapOfShape myValue;\r
+\r
+\r
+};\r
+\r
+#define TheKey TopoDS_Shape\r
+#define TheKey_hxx <TopoDS_Shape.hxx>\r
+#define TheItem TopTools_MapOfShape\r
+#define TheItem_hxx <TopTools_MapOfShape.hxx>\r
+#define Hasher TopTools_ShapeMapHasher\r
+#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>\r
+#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape\r
+#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>\r
+#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape\r
+#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>\r
+#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape\r
+#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_Type_()\r
+#define TCollection_DataMap GEOMAlgo_DataMapOfShapeMapOfShape\r
+#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>\r
+\r
+#include <TCollection_DataMapNode.lxx>\r
+\r
+#undef TheKey\r
+#undef TheKey_hxx\r
+#undef TheItem\r
+#undef TheItem_hxx\r
+#undef Hasher\r
+#undef Hasher_hxx\r
+#undef TCollection_DataMapNode\r
+#undef TCollection_DataMapNode_hxx\r
+#undef TCollection_DataMapIterator\r
+#undef TCollection_DataMapIterator_hxx\r
+#undef Handle_TCollection_DataMapNode\r
+#undef TCollection_DataMapNode_Type_\r
+#undef TCollection_DataMap\r
+#undef TCollection_DataMap_hxx\r
+\r
+\r
+// other Inline functions and methods (like "C++: function call" methods)\r
+\r
+\r
+#endif\r
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#include <GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>\r
+\r
+#ifndef _Standard_TypeMismatch_HeaderFile\r
+#include <Standard_TypeMismatch.hxx>\r
+#endif\r
+\r
+#ifndef _TopoDS_Shape_HeaderFile\r
+#include <TopoDS_Shape.hxx>\r
+#endif\r
+#ifndef _TopTools_MapOfShape_HeaderFile\r
+#include <TopTools_MapOfShape.hxx>\r
+#endif\r
+#ifndef _TopTools_ShapeMapHasher_HeaderFile\r
+#include <TopTools_ShapeMapHasher.hxx>\r
+#endif\r
+#ifndef _GEOMAlgo_DataMapOfShapeMapOfShape_HeaderFile\r
+#include <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>\r
+#endif\r
+#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape_HeaderFile\r
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>\r
+#endif\r
+\r
+ \r
+\r
+\r
+Standard_EXPORT Handle_Standard_Type& GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_Type_()\r
+{\r
+\r
+ static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);\r
+ static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);\r
+ static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);\r
+ \r
+\r
+ static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};\r
+ static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape",\r
+ sizeof(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape),\r
+ 1,\r
+ (Standard_Address)_Ancestors,\r
+ (Standard_Address)NULL);\r
+\r
+ return _aType;\r
+}\r
+\r
+\r
+// DownCast method\r
+// allow safe downcasting\r
+//\r
+const Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape) Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape)::DownCast(const Handle(Standard_Transient)& AnObject) \r
+{\r
+ Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape) _anOtherObject;\r
+\r
+ if (!AnObject.IsNull()) {\r
+ if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape))) {\r
+ _anOtherObject = Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape)((Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape)&)AnObject);\r
+ }\r
+ }\r
+\r
+ return _anOtherObject ;\r
+}\r
+const Handle(Standard_Type)& GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape::DynamicType() const \r
+{ \r
+ return STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape) ; \r
+}\r
+//Standard_Boolean GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape::IsKind(const Handle(Standard_Type)& AType) const \r
+//{ \r
+// return (STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape) == AType || TCollection_MapNode::IsKind(AType)); \r
+//}\r
+//Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape::~Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape() {}\r
+#define TheKey TopoDS_Shape\r
+#define TheKey_hxx <TopoDS_Shape.hxx>\r
+#define TheItem TopTools_MapOfShape\r
+#define TheItem_hxx <TopTools_MapOfShape.hxx>\r
+#define Hasher TopTools_ShapeMapHasher\r
+#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>\r
+#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape\r
+#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>\r
+#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape\r
+#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>\r
+#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape\r
+#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_Type_()\r
+#define TCollection_DataMap GEOMAlgo_DataMapOfShapeMapOfShape\r
+#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>\r
+#include <TCollection_DataMapNode.gxx>\r
+\r
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile\r
+#define _GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile\r
+\r
+#ifndef _Standard_HeaderFile\r
+#include <Standard.hxx>\r
+#endif\r
+#ifndef _Standard_DefineHandle_HeaderFile\r
+#include <Standard_DefineHandle.hxx>\r
+#endif\r
+#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile\r
+#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>\r
+#endif\r
+\r
+#ifndef _TopoDS_Shape_HeaderFile\r
+#include <TopoDS_Shape.hxx>\r
+#endif\r
+#ifndef _gp_Pnt_HeaderFile\r
+#include <gp_Pnt.hxx>\r
+#endif\r
+#ifndef _TCollection_MapNode_HeaderFile\r
+#include <TCollection_MapNode.hxx>\r
+#endif\r
+#ifndef _TCollection_MapNodePtr_HeaderFile\r
+#include <TCollection_MapNodePtr.hxx>\r
+#endif\r
+class TopoDS_Shape;\r
+class gp_Pnt;\r
+class TopTools_ShapeMapHasher;\r
+class GEOMAlgo_DataMapOfShapePnt;\r
+class GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt;\r
+\r
+\r
+\r
+class GEOMAlgo_DataMapNodeOfDataMapOfShapePnt : public TCollection_MapNode {\r
+\r
+public:\r
+\r
+ \r
+ GEOMAlgo_DataMapNodeOfDataMapOfShapePnt(const TopoDS_Shape& K,const gp_Pnt& I,const TCollection_MapNodePtr& n);\r
+ \r
+ TopoDS_Shape& Key() const;\r
+ \r
+ gp_Pnt& Value() const;\r
+\r
+\r
+\r
+\r
+ DEFINE_STANDARD_RTTI(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt)\r
+\r
+protected:\r
+\r
+\r
+\r
+\r
+private: \r
+\r
+\r
+TopoDS_Shape myKey;\r
+gp_Pnt myValue;\r
+\r
+\r
+};\r
+\r
+#define TheKey TopoDS_Shape\r
+#define TheKey_hxx <TopoDS_Shape.hxx>\r
+#define TheItem gp_Pnt\r
+#define TheItem_hxx <gp_Pnt.hxx>\r
+#define Hasher TopTools_ShapeMapHasher\r
+#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>\r
+#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapePnt\r
+#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>\r
+#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt\r
+#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx>\r
+#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt\r
+#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_Type_()\r
+#define TCollection_DataMap GEOMAlgo_DataMapOfShapePnt\r
+#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapePnt.hxx>\r
+\r
+#include <TCollection_DataMapNode.lxx>\r
+\r
+#undef TheKey\r
+#undef TheKey_hxx\r
+#undef TheItem\r
+#undef TheItem_hxx\r
+#undef Hasher\r
+#undef Hasher_hxx\r
+#undef TCollection_DataMapNode\r
+#undef TCollection_DataMapNode_hxx\r
+#undef TCollection_DataMapIterator\r
+#undef TCollection_DataMapIterator_hxx\r
+#undef Handle_TCollection_DataMapNode\r
+#undef TCollection_DataMapNode_Type_\r
+#undef TCollection_DataMap\r
+#undef TCollection_DataMap_hxx\r
+\r
+\r
+// other Inline functions and methods (like "C++: function call" methods)\r
+\r
+\r
+#endif\r
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#include <GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>\r
+\r
+#ifndef _Standard_TypeMismatch_HeaderFile\r
+#include <Standard_TypeMismatch.hxx>\r
+#endif\r
+\r
+#ifndef _TopoDS_Shape_HeaderFile\r
+#include <TopoDS_Shape.hxx>\r
+#endif\r
+#ifndef _gp_Pnt_HeaderFile\r
+#include <gp_Pnt.hxx>\r
+#endif\r
+#ifndef _TopTools_ShapeMapHasher_HeaderFile\r
+#include <TopTools_ShapeMapHasher.hxx>\r
+#endif\r
+#ifndef _GEOMAlgo_DataMapOfShapePnt_HeaderFile\r
+#include <GEOMAlgo_DataMapOfShapePnt.hxx>\r
+#endif\r
+#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt_HeaderFile\r
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx>\r
+#endif\r
+\r
+ \r
+\r
+\r
+Standard_EXPORT Handle_Standard_Type& GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_Type_()\r
+{\r
+\r
+ static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);\r
+ static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);\r
+ static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);\r
+ \r
+\r
+ static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};\r
+ static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_DataMapNodeOfDataMapOfShapePnt",\r
+ sizeof(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt),\r
+ 1,\r
+ (Standard_Address)_Ancestors,\r
+ (Standard_Address)NULL);\r
+\r
+ return _aType;\r
+}\r
+\r
+\r
+// DownCast method\r
+// allow safe downcasting\r
+//\r
+const Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt) Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt)::DownCast(const Handle(Standard_Transient)& AnObject) \r
+{\r
+ Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt) _anOtherObject;\r
+\r
+ if (!AnObject.IsNull()) {\r
+ if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt))) {\r
+ _anOtherObject = Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt)((Handle(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt)&)AnObject);\r
+ }\r
+ }\r
+\r
+ return _anOtherObject ;\r
+}\r
+const Handle(Standard_Type)& GEOMAlgo_DataMapNodeOfDataMapOfShapePnt::DynamicType() const \r
+{ \r
+ return STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt) ; \r
+}\r
+//Standard_Boolean GEOMAlgo_DataMapNodeOfDataMapOfShapePnt::IsKind(const Handle(Standard_Type)& AType) const \r
+//{ \r
+// return (STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt) == AType || TCollection_MapNode::IsKind(AType)); \r
+//}\r
+//Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt::~Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt() {}\r
+#define TheKey TopoDS_Shape\r
+#define TheKey_hxx <TopoDS_Shape.hxx>\r
+#define TheItem gp_Pnt\r
+#define TheItem_hxx <gp_Pnt.hxx>\r
+#define Hasher TopTools_ShapeMapHasher\r
+#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>\r
+#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapePnt\r
+#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>\r
+#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt\r
+#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx>\r
+#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt\r
+#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_Type_()\r
+#define TCollection_DataMap GEOMAlgo_DataMapOfShapePnt\r
+#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapePnt.hxx>\r
+#include <TCollection_DataMapNode.gxx>\r
+\r
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#ifndef _GEOMAlgo_DataMapOfShapeMapOfShape_HeaderFile\r
+#define _GEOMAlgo_DataMapOfShapeMapOfShape_HeaderFile\r
+\r
+#ifndef _Standard_HeaderFile\r
+#include <Standard.hxx>\r
+#endif\r
+#ifndef _Standard_Macro_HeaderFile\r
+#include <Standard_Macro.hxx>\r
+#endif\r
+\r
+#ifndef _TCollection_BasicMap_HeaderFile\r
+#include <TCollection_BasicMap.hxx>\r
+#endif\r
+#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile\r
+#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>\r
+#endif\r
+#ifndef _Standard_Integer_HeaderFile\r
+#include <Standard_Integer.hxx>\r
+#endif\r
+#ifndef _Standard_Boolean_HeaderFile\r
+#include <Standard_Boolean.hxx>\r
+#endif\r
+class Standard_DomainError;\r
+class Standard_NoSuchObject;\r
+class TopoDS_Shape;\r
+class TopTools_MapOfShape;\r
+class TopTools_ShapeMapHasher;\r
+class GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape;\r
+class GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape;\r
+\r
+\r
+\r
+class GEOMAlgo_DataMapOfShapeMapOfShape : public TCollection_BasicMap {\r
+public:\r
+\r
+ void* operator new(size_t,void* anAddress) \r
+ {\r
+ return anAddress;\r
+ }\r
+ void* operator new(size_t size) \r
+ {\r
+ return Standard::Allocate(size); \r
+ }\r
+ void operator delete(void *anAddress) \r
+ {\r
+ if (anAddress) Standard::Free((Standard_Address&)anAddress); \r
+ }\r
+\r
+ \r
+ Standard_EXPORT GEOMAlgo_DataMapOfShapeMapOfShape(const Standard_Integer NbBuckets = 1);\r
+ \r
+ Standard_EXPORT GEOMAlgo_DataMapOfShapeMapOfShape& Assign(const GEOMAlgo_DataMapOfShapeMapOfShape& Other) ;\r
+ GEOMAlgo_DataMapOfShapeMapOfShape& operator =(const GEOMAlgo_DataMapOfShapeMapOfShape& Other) \r
+{\r
+ return Assign(Other);\r
+}\r
+ \r
+ Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;\r
+ \r
+ Standard_EXPORT void Clear() ;\r
+~GEOMAlgo_DataMapOfShapeMapOfShape()\r
+{\r
+ Clear();\r
+}\r
+ \r
+ Standard_EXPORT Standard_Boolean Bind(const TopoDS_Shape& K,const TopTools_MapOfShape& I) ;\r
+ \r
+ Standard_EXPORT Standard_Boolean IsBound(const TopoDS_Shape& K) const;\r
+ \r
+ Standard_EXPORT Standard_Boolean UnBind(const TopoDS_Shape& K) ;\r
+ \r
+ Standard_EXPORT const TopTools_MapOfShape& Find(const TopoDS_Shape& K) const;\r
+ const TopTools_MapOfShape& operator()(const TopoDS_Shape& K) const\r
+{\r
+ return Find(K);\r
+}\r
+ \r
+ Standard_EXPORT TopTools_MapOfShape& ChangeFind(const TopoDS_Shape& K) ;\r
+ TopTools_MapOfShape& operator()(const TopoDS_Shape& K) \r
+{\r
+ return ChangeFind(K);\r
+}\r
+\r
+\r
+\r
+\r
+\r
+protected:\r
+\r
+\r
+\r
+\r
+\r
+private:\r
+\r
+ \r
+ Standard_EXPORT GEOMAlgo_DataMapOfShapeMapOfShape(const GEOMAlgo_DataMapOfShapeMapOfShape& Other);\r
+\r
+\r
+\r
+\r
+};\r
+\r
+\r
+\r
+\r
+\r
+// other Inline functions and methods (like "C++: function call" methods)\r
+\r
+\r
+#endif\r
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#include <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>\r
+\r
+#ifndef _Standard_DomainError_HeaderFile\r
+#include <Standard_DomainError.hxx>\r
+#endif\r
+#ifndef _Standard_NoSuchObject_HeaderFile\r
+#include <Standard_NoSuchObject.hxx>\r
+#endif\r
+#ifndef _TopoDS_Shape_HeaderFile\r
+#include <TopoDS_Shape.hxx>\r
+#endif\r
+#ifndef _TopTools_MapOfShape_HeaderFile\r
+#include <TopTools_MapOfShape.hxx>\r
+#endif\r
+#ifndef _TopTools_ShapeMapHasher_HeaderFile\r
+#include <TopTools_ShapeMapHasher.hxx>\r
+#endif\r
+#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile\r
+#include <GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>\r
+#endif\r
+#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape_HeaderFile\r
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>\r
+#endif\r
+ \r
+\r
+#define TheKey TopoDS_Shape\r
+#define TheKey_hxx <TopoDS_Shape.hxx>\r
+#define TheItem TopTools_MapOfShape\r
+#define TheItem_hxx <TopTools_MapOfShape.hxx>\r
+#define Hasher TopTools_ShapeMapHasher\r
+#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>\r
+#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape\r
+#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx>\r
+#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape\r
+#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx>\r
+#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape\r
+#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_Type_()\r
+#define TCollection_DataMap GEOMAlgo_DataMapOfShapeMapOfShape\r
+#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>\r
+#include <TCollection_DataMap.gxx>\r
+\r
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#ifndef _GEOMAlgo_DataMapOfShapePnt_HeaderFile\r
+#define _GEOMAlgo_DataMapOfShapePnt_HeaderFile\r
+\r
+#ifndef _Standard_HeaderFile\r
+#include <Standard.hxx>\r
+#endif\r
+#ifndef _Standard_Macro_HeaderFile\r
+#include <Standard_Macro.hxx>\r
+#endif\r
+\r
+#ifndef _TCollection_BasicMap_HeaderFile\r
+#include <TCollection_BasicMap.hxx>\r
+#endif\r
+#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile\r
+#include <Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>\r
+#endif\r
+#ifndef _Standard_Integer_HeaderFile\r
+#include <Standard_Integer.hxx>\r
+#endif\r
+#ifndef _Standard_Boolean_HeaderFile\r
+#include <Standard_Boolean.hxx>\r
+#endif\r
+class Standard_DomainError;\r
+class Standard_NoSuchObject;\r
+class TopoDS_Shape;\r
+class gp_Pnt;\r
+class TopTools_ShapeMapHasher;\r
+class GEOMAlgo_DataMapNodeOfDataMapOfShapePnt;\r
+class GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt;\r
+\r
+\r
+\r
+class GEOMAlgo_DataMapOfShapePnt : public TCollection_BasicMap {\r
+public:\r
+\r
+ void* operator new(size_t,void* anAddress) \r
+ {\r
+ return anAddress;\r
+ }\r
+ void* operator new(size_t size) \r
+ {\r
+ return Standard::Allocate(size); \r
+ }\r
+ void operator delete(void *anAddress) \r
+ {\r
+ if (anAddress) Standard::Free((Standard_Address&)anAddress); \r
+ }\r
+\r
+ \r
+ Standard_EXPORT GEOMAlgo_DataMapOfShapePnt(const Standard_Integer NbBuckets = 1);\r
+ \r
+ Standard_EXPORT GEOMAlgo_DataMapOfShapePnt& Assign(const GEOMAlgo_DataMapOfShapePnt& Other) ;\r
+ GEOMAlgo_DataMapOfShapePnt& operator =(const GEOMAlgo_DataMapOfShapePnt& Other) \r
+{\r
+ return Assign(Other);\r
+}\r
+ \r
+ Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ;\r
+ \r
+ Standard_EXPORT void Clear() ;\r
+~GEOMAlgo_DataMapOfShapePnt()\r
+{\r
+ Clear();\r
+}\r
+ \r
+ Standard_EXPORT Standard_Boolean Bind(const TopoDS_Shape& K,const gp_Pnt& I) ;\r
+ \r
+ Standard_EXPORT Standard_Boolean IsBound(const TopoDS_Shape& K) const;\r
+ \r
+ Standard_EXPORT Standard_Boolean UnBind(const TopoDS_Shape& K) ;\r
+ \r
+ Standard_EXPORT const gp_Pnt& Find(const TopoDS_Shape& K) const;\r
+ const gp_Pnt& operator()(const TopoDS_Shape& K) const\r
+{\r
+ return Find(K);\r
+}\r
+ \r
+ Standard_EXPORT gp_Pnt& ChangeFind(const TopoDS_Shape& K) ;\r
+ gp_Pnt& operator()(const TopoDS_Shape& K) \r
+{\r
+ return ChangeFind(K);\r
+}\r
+\r
+\r
+\r
+\r
+\r
+protected:\r
+\r
+\r
+\r
+\r
+\r
+private:\r
+\r
+ \r
+ Standard_EXPORT GEOMAlgo_DataMapOfShapePnt(const GEOMAlgo_DataMapOfShapePnt& Other);\r
+\r
+\r
+\r
+\r
+};\r
+\r
+\r
+\r
+\r
+\r
+// other Inline functions and methods (like "C++: function call" methods)\r
+\r
+\r
+#endif\r
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#include <GEOMAlgo_DataMapOfShapePnt.hxx>\r
+\r
+#ifndef _Standard_DomainError_HeaderFile\r
+#include <Standard_DomainError.hxx>\r
+#endif\r
+#ifndef _Standard_NoSuchObject_HeaderFile\r
+#include <Standard_NoSuchObject.hxx>\r
+#endif\r
+#ifndef _TopoDS_Shape_HeaderFile\r
+#include <TopoDS_Shape.hxx>\r
+#endif\r
+#ifndef _gp_Pnt_HeaderFile\r
+#include <gp_Pnt.hxx>\r
+#endif\r
+#ifndef _TopTools_ShapeMapHasher_HeaderFile\r
+#include <TopTools_ShapeMapHasher.hxx>\r
+#endif\r
+#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile\r
+#include <GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>\r
+#endif\r
+#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt_HeaderFile\r
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx>\r
+#endif\r
+ \r
+\r
+#define TheKey TopoDS_Shape\r
+#define TheKey_hxx <TopoDS_Shape.hxx>\r
+#define TheItem gp_Pnt\r
+#define TheItem_hxx <gp_Pnt.hxx>\r
+#define Hasher TopTools_ShapeMapHasher\r
+#define Hasher_hxx <TopTools_ShapeMapHasher.hxx>\r
+#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfShapePnt\r
+#define TCollection_DataMapNode_hxx <GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx>\r
+#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt\r
+#define TCollection_DataMapIterator_hxx <GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx>\r
+#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt\r
+#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_Type_()\r
+#define TCollection_DataMap GEOMAlgo_DataMapOfShapePnt\r
+#define TCollection_DataMap_hxx <GEOMAlgo_DataMapOfShapePnt.hxx>\r
+#include <TCollection_DataMap.gxx>\r
+\r
--- /dev/null
+// Copyright (C) 2007-2011 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
+//
+// 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.
+//
+// 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: GEOMAlgo_GetInPlace.cxx
+// Created:
+// Author: Peter KURNEV
+
+#include <GEOMAlgo_GetInPlace.hxx>
+
+#include <NMTDS_BoxBndTree.hxx>
+#include <NCollection_UBTreeFiller.hxx>
+
+#include <Bnd_Box.hxx>
+#include <gp_Pnt.hxx>
+
+#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+
+#include <TopAbs_ShapeEnum.hxx>
+
+#include <TopoDS_Iterator.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Compound.hxx>
+
+#include <BRep_Tool.hxx>
+#include <BRep_Builder.hxx>
+
+#include <BRepBndLib.hxx>
+
+#include <TopExp.hxx>
+
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_DataMapOfShapeListOfShape.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopTools_MapIteratorOfMapOfShape.hxx>
+
+
+#include <NMTTools_CoupleOfShape.hxx>
+#include <GEOMAlgo_Tools.hxx>
+
+
+static
+ void MapBRepShapes(const TopoDS_Shape& aS,
+ TopTools_IndexedMapOfShape& aM);
+
+
+//=======================================================================
+//function : GEOMAlgo_GetInPlace
+//purpose :
+//=======================================================================
+GEOMAlgo_GetInPlace::GEOMAlgo_GetInPlace()
+:
+ GEOMAlgo_GluerAlgo(),
+ GEOMAlgo_Algo()
+{
+ myTolerance=0.0001;
+ myTolMass=0.0001;
+ myTolCG=0.0001;
+ myFound=Standard_False;
+ myCheckGeometry=Standard_True;
+}
+//=======================================================================
+//function : ~
+//purpose :
+//=======================================================================
+GEOMAlgo_GetInPlace::~GEOMAlgo_GetInPlace()
+{
+}
+//=======================================================================
+//function : SetTolMass
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::SetTolMass(const Standard_Real theTol)
+{
+ myTolMass=theTol;
+}
+//=======================================================================
+//function : TolMass
+//purpose :
+//=======================================================================
+Standard_Real GEOMAlgo_GetInPlace::TolMass()const
+{
+ return myTolMass;
+}
+//=======================================================================
+//function : SetTolCG
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::SetTolCG(const Standard_Real theTol)
+{
+ myTolCG=theTol;
+}
+//=======================================================================
+//function : TolCG
+//purpose :
+//=======================================================================
+Standard_Real GEOMAlgo_GetInPlace::TolCG()const
+{
+ return myTolCG;
+}
+//=======================================================================
+//function : IsFound
+//purpose :
+//=======================================================================
+Standard_Boolean GEOMAlgo_GetInPlace::IsFound()const
+{
+ return myFound;
+}
+//=======================================================================
+//function : SetShapeWhere
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::SetShapeWhere(const TopoDS_Shape& theShape)
+{
+ myShapeWhere=theShape;
+}
+//=======================================================================
+//function : ShapeWhere
+//purpose :
+//=======================================================================
+const TopoDS_Shape& GEOMAlgo_GetInPlace::ShapeWhere()const
+{
+ return myShapeWhere;
+}
+//=======================================================================
+//function : ShapesIn
+//purpose :
+//=======================================================================
+const GEOMAlgo_DataMapOfShapeMapOfShape& GEOMAlgo_GetInPlace::ShapesIn()const
+{
+ return myShapesIn;
+}
+//=======================================================================
+//function : ShapesOn
+//purpose :
+//=======================================================================
+const GEOMAlgo_DataMapOfShapeMapOfShape& GEOMAlgo_GetInPlace::ShapesOn()const
+{
+ return myShapesOn;
+}
+//=======================================================================
+//function : Clear
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::Clear()
+{
+ myErrorStatus=0;
+ myWarningStatus=0;
+ //
+ GEOMAlgo_GluerAlgo::Clear();
+ myIterator.Clear();
+ myShapesIn.Clear();
+ myShapesOn.Clear();
+ myMapShapePnt.Clear();
+}
+//=======================================================================
+//function : Perform
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::Perform()
+{
+ myFound=Standard_False;
+ myErrorStatus=0;
+ myWarningStatus=0;
+ //
+ Clear();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ CheckData();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ Intersect();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ PerformVV();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ FillEdgesOn();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ PerformVE();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ PerformEE();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ PerformVF();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ FillFacesOn();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ PerformEF();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ PerformFF();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ FillSolidsOn();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ PerformZF();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ PerformZZ();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ FillImages();
+ if (myErrorStatus) {
+ return;
+ }
+ //
+ CheckGProps();
+ if (myErrorStatus) {
+ return;
+ }
+}
+//=======================================================================
+//function : CheckData
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::CheckData()
+{
+ myErrorStatus=0;
+ myWarningStatus=0;
+ //
+ if (myArgument.IsNull()) {
+ myErrorStatus=2;
+ return;
+ }
+ //
+ if (myShapeWhere.IsNull()) {
+ myErrorStatus=3;
+ return;
+ }
+}
+//=======================================================================
+//function : Intersect
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::Intersect()
+{
+ Standard_Integer i, j, aNbS1, aNbS2, aNbSD;
+ TColStd_ListIteratorOfListOfInteger aItLI;
+ TopTools_IndexedMapOfShape aMS1, aMS2;
+ TopTools_DataMapOfShapeListOfShape aDMSLS;
+ TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItDMSLS;
+ TopTools_ListIteratorOfListOfShape aItLS;
+ NMTTools_CoupleOfShape aCS;
+ //
+ NMTDS_BoxBndTreeSelector aSelector;
+ NMTDS_BoxBndTree aBBTree;
+ NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
+ //
+ myErrorStatus=0;
+ myWarningStatus=0;
+ //
+ myIterator.Clear();
+ //
+ MapBRepShapes(myArgument, aMS1);
+ aNbS1=aMS1.Extent();
+ for (i=1; i<=aNbS1; ++i) {
+ Bnd_Box aBox1;
+ //
+ const TopoDS_Shape& aS1=aMS1(i);
+ BRepBndLib::Add(aS1, aBox1);
+ aBox1.SetGap(myTolerance);
+ //
+ aTreeFiller.Add(i, aBox1);
+ }
+ //
+ aTreeFiller.Fill();
+ //
+ MapBRepShapes(myShapeWhere, aMS2);
+ aNbS2=aMS2.Extent();
+ for (j=1; j<=aNbS2; ++j) {
+ Bnd_Box aBox2;
+ //
+ const TopoDS_Shape& aS2=aMS2(j);
+ BRepBndLib::Add(aS2, aBox2);
+ aBox2.SetGap(myTolerance);
+ //
+ aSelector.Clear();
+ aSelector.SetBox(aBox2);
+ aNbSD=aBBTree.Select(aSelector);
+ if (!aNbSD) {
+ continue; // it should not be
+ }
+ //
+ const TColStd_ListOfInteger& aLI=aSelector.Indices();
+ aItLI.Initialize(aLI);
+ for (; aItLI.More(); aItLI.Next()) {
+ i=aItLI.Value();
+ const TopoDS_Shape& aS1=aMS1(i);
+ //
+ if (aDMSLS.IsBound(aS1)) {
+ TopTools_ListOfShape& aLS=aDMSLS.ChangeFind(aS1);
+ aLS.Append(aS2);
+ }
+ else {
+ TopTools_ListOfShape aLS;
+ //
+ aLS.Append(aS2);
+ aDMSLS.Bind(aS1, aLS);
+ }
+ }
+ }// for (j=1; j<=aNbS2; ++j) {
+ //
+ aItDMSLS.Initialize(aDMSLS);
+ for (; aItDMSLS.More(); aItDMSLS.Next()) {
+ const TopoDS_Shape& aS1=aItDMSLS.Key();
+ const TopTools_ListOfShape& aLS2=aItDMSLS.Value();
+ aCS.SetShape1(aS1);
+ aItLS.Initialize(aLS2);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aS2=aItLS.Value();
+ aCS.SetShape2(aS2);
+ myIterator.AppendPair(aCS);
+ }
+ }
+}
+//=======================================================================
+//function : PerformVV
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::PerformVV()
+{
+ myErrorStatus=0;
+ myWarningStatus=0;
+ //
+ myIterator.Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
+ for (; myIterator.More(); myIterator.Next()) {
+ const NMTTools_CoupleOfShape& aCS=myIterator.Value();
+ const TopoDS_Shape& aV1=aCS.Shape1();
+ const TopoDS_Shape& aV2=aCS.Shape2();
+ //
+ FillShapesOn(aV1, aV2);
+ }
+}
+//=======================================================================
+//function : FillEdgesOn
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::FillEdgesOn()
+{
+ Standard_Integer i, aNbE, aNbSOn;
+ TopoDS_Iterator aIt;
+ TopTools_IndexedMapOfShape aME;
+ TopTools_MapIteratorOfMapOfShape aItMS;
+ //
+ TopExp::MapShapes(myArgument, TopAbs_EDGE, aME);
+ aNbE=aME.Extent();
+ for (i=1; i<=aNbE; ++i) {
+ const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aME(i));
+ if (BRep_Tool::Degenerated(aE1)) {
+ continue;
+ }
+ //
+ aIt.Initialize(aE1);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aV1=aIt.Value();
+ if (myShapesOn.IsBound(aV1)) {
+ const TopTools_MapOfShape& aMSOn=myShapesOn.Find(aV1);
+ aNbSOn=aMSOn.Extent();
+ aItMS.Initialize(aMSOn);
+ for (; aItMS.More(); aItMS.Next()) {
+ const TopoDS_Shape& aV2=aItMS.Key();
+ FillShapesOn(aE1, aV2);
+ }
+ }
+ }
+ }
+}
+//=======================================================================
+//function : PerformVE
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::PerformVE()
+{
+ Standard_Boolean bFound;
+ //
+ myErrorStatus=0;
+ myWarningStatus=0;
+ //
+ // 2. Fill Shapes In
+ myIterator.Initialize(TopAbs_EDGE, TopAbs_VERTEX);
+ for (; myIterator.More(); myIterator.Next()) {
+ const NMTTools_CoupleOfShape& aCS=myIterator.Value();
+ const TopoDS_Shape& aE1=aCS.Shape1();
+ const TopoDS_Shape& aV2=aCS.Shape2();
+ //
+ if (myShapesOn.IsBound(aE1)) {
+ const TopTools_MapOfShape& aMSOn=myShapesOn.Find(aE1);
+ if (aMSOn.Contains(aV2)) {
+ continue;
+ }
+ }
+ //
+ bFound=CheckCoincidence(aE1, aV2);
+ if (myErrorStatus) {
+ return;
+ }
+ if (bFound) {
+ FillShapesIn(aE1, aV2);
+ }
+ }
+}
+//=======================================================================
+//function : PerformEE
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::PerformEE()
+{
+ Standard_Boolean bHasOn, bHasIn, bFound;
+ TopoDS_Iterator aIt;
+ TopTools_MapOfShape aMSX;
+ //
+ myErrorStatus=0;
+ myWarningStatus=0;
+ //
+ myIterator.Initialize(TopAbs_EDGE, TopAbs_EDGE);
+ for (; myIterator.More(); myIterator.Next()) {
+ const NMTTools_CoupleOfShape& aCS=myIterator.Value();
+ const TopoDS_Shape& aE1=aCS.Shape1();
+ const TopoDS_Shape& aE2=aCS.Shape2();
+ //
+ bHasOn=myShapesOn.IsBound(aE1);
+ bHasIn=myShapesIn.IsBound(aE1);
+ const TopTools_MapOfShape& aMSOn=(bHasOn) ? myShapesOn.Find(aE1) : aMSX;
+ const TopTools_MapOfShape& aMSIn=(bHasIn) ? myShapesIn.Find(aE1) : aMSX;
+ //
+ bFound=Standard_True;
+ aIt.Initialize(aE2);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aV2=aIt.Value();
+ if (!(aMSOn.Contains(aV2) || aMSIn.Contains(aV2))) {
+ bFound=!bFound;
+ break;
+ }
+ }
+ if (!bFound) {
+ continue;
+ }
+ //
+ bFound=CheckCoincidence(aE1, aE2);
+ if (myErrorStatus) {
+ return;
+ }
+ if (bFound) {
+ FillShapesIn(aE1, aE2);
+ }
+ }
+}
+//=======================================================================
+//function : PerformVF
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::PerformVF()
+{
+ Standard_Boolean bHasOn, bHasIn, bFound;
+ Standard_Integer i, aNbE;
+ TopTools_MapOfShape aMSX;
+ TopTools_IndexedMapOfShape aME;
+ //
+ myErrorStatus=0;
+ myWarningStatus=0;
+ //
+ myIterator.Initialize(TopAbs_FACE, TopAbs_VERTEX);
+ for (; myIterator.More(); myIterator.Next()) {
+ const NMTTools_CoupleOfShape& aCS=myIterator.Value();
+ const TopoDS_Shape& aF1=aCS.Shape1();
+ const TopoDS_Shape& aV2=aCS.Shape2();
+ //
+ aME.Clear();
+ TopExp::MapShapes(aF1, TopAbs_EDGE, aME);
+ //
+ bFound=Standard_False;
+ aNbE=aME.Extent();
+ for (i=1; i<=aNbE; ++i) {
+ const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aME(i));
+ if (BRep_Tool::Degenerated(aE1)) {
+ continue;
+ }
+ //
+ bHasOn=myShapesOn.IsBound(aE1);
+ bHasIn=myShapesIn.IsBound(aE1);
+ const TopTools_MapOfShape& aMSOn=(bHasOn) ? myShapesOn.Find(aE1) : aMSX;
+ const TopTools_MapOfShape& aMSIn=(bHasIn) ? myShapesIn.Find(aE1) : aMSX;
+ bFound= (aMSOn.Contains(aV2) || aMSIn.Contains(aV2));
+ if (bFound) {
+ break;
+ }
+ }
+ //
+ if (bFound) {
+ continue;
+ }
+ //
+ bFound=CheckCoincidence(aF1, aV2);
+ if (myErrorStatus) {
+ return;
+ }
+ if (bFound) {
+ FillShapesIn(aF1, aV2);
+ }
+ }
+}
+//=======================================================================
+//function : FillFacesOn
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::FillFacesOn()
+{
+ Standard_Integer i, j, aNbF, aNbE, aNbSOn;
+ TopoDS_Iterator aIt;
+ TopTools_IndexedMapOfShape aMF, aME;
+ TopTools_MapIteratorOfMapOfShape aItMS;
+ //
+ TopExp::MapShapes(myArgument, TopAbs_FACE, aMF);
+ aNbF=aMF.Extent();
+ for (i=1; i<=aNbF; ++i) {
+ const TopoDS_Face& aF1=*((TopoDS_Face*)&aMF(i));
+ //
+ aME.Clear();
+ TopExp::MapShapes(aF1, TopAbs_EDGE, aME);
+ aNbE=aME.Extent();
+ for (j=1; j<=aNbE; ++j) {
+ const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aME(j));
+ if (BRep_Tool::Degenerated(aE1)) {
+ continue;
+ }
+ //
+ if (myShapesOn.IsBound(aE1)) {
+ const TopTools_MapOfShape& aMSOn=myShapesOn.Find(aE1);
+ aItMS.Initialize(aMSOn);
+ for (; aItMS.More(); aItMS.Next()) {
+ const TopoDS_Shape& aS2=aItMS.Key();
+ FillShapesOn(aF1, aS2);
+ }
+ }
+ //
+ if (myShapesIn.IsBound(aE1)) {
+ const TopTools_MapOfShape& aMSIn=myShapesIn.Find(aE1);
+ aItMS.Initialize(aMSIn);
+ for (; aItMS.More(); aItMS.Next()) {
+ const TopoDS_Shape& aS2=aItMS.Key();
+ FillShapesOn(aF1, aS2);
+ }
+ }
+ }//for (j=1; j<=aNbE; ++j) {
+ }//for (i=1; i<=aNbF; ++i) {
+}
+//=======================================================================
+//function : PerformEF
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::PerformEF()
+{
+ Standard_Boolean bFound, bHasOnF, bHasInF;
+ Standard_Integer i, aNbE;
+ TopoDS_Iterator aIt;
+ TopTools_MapOfShape aMSX;
+ //
+ myErrorStatus=0;
+ myWarningStatus=0;
+ //
+ myIterator.Initialize(TopAbs_FACE, TopAbs_EDGE);
+ for (; myIterator.More(); myIterator.Next()) {
+ const NMTTools_CoupleOfShape& aCS=myIterator.Value();
+ const TopoDS_Shape& aF1=aCS.Shape1();
+ const TopoDS_Shape& aE2=aCS.Shape2();
+ //
+ // 1.
+ bHasOnF=myShapesOn.IsBound(aF1);
+ const TopTools_MapOfShape& aMSOnF=(bHasOnF) ? myShapesOn.Find(aF1) : aMSX;
+ bFound=aMSOnF.Contains(aE2);
+ if (bFound) {
+ continue;
+ }
+ //
+ // 2.
+ bHasInF=myShapesIn.IsBound(aF1);
+ const TopTools_MapOfShape& aMSInF=(bHasInF) ? myShapesIn.Find(aF1) : aMSX;
+ //
+ aIt.Initialize(aE2);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aV2=aIt.Value();
+ bFound=(aMSOnF.Contains(aV2) || aMSInF.Contains(aV2));
+ if (!bFound) {
+ break;
+ }
+ }
+ if (!bFound) {
+ continue;
+ }
+ //------------------------------
+ bFound=CheckCoincidence(aF1, aE2);
+ if (myErrorStatus) {
+ return;
+ }
+ if (bFound) {
+ FillShapesIn(aF1, aE2);
+ }
+ }
+}
+//=======================================================================
+//function : PerformFF
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::PerformFF()
+{
+ Standard_Boolean bFound, bHasOnF, bHasInF;
+ Standard_Integer i, aNbS2;
+ TopTools_MapOfShape aMSX;
+ TopTools_IndexedMapOfShape aMS2;
+ //
+ myErrorStatus=0;
+ myWarningStatus=0;
+ //
+ myIterator.Initialize(TopAbs_FACE, TopAbs_FACE);
+ for (; myIterator.More(); myIterator.Next()) {
+ const NMTTools_CoupleOfShape& aCS=myIterator.Value();
+ const TopoDS_Shape& aF1=aCS.Shape1();
+ const TopoDS_Shape& aF2=aCS.Shape2();
+ //
+ bHasOnF=myShapesOn.IsBound(aF1);
+ const TopTools_MapOfShape& aMSOnF=(bHasOnF) ? myShapesOn.Find(aF1) : aMSX;
+ //
+ bHasInF=myShapesIn.IsBound(aF1);
+ const TopTools_MapOfShape& aMSInF=(bHasInF) ? myShapesIn.Find(aF1) : aMSX;
+ //
+ aMS2.Clear();
+ MapBRepShapes(aF2, aMS2);
+ //
+ bFound=Standard_False;
+ aNbS2=aMS2.Extent();
+ for (i=1; i<=aNbS2; ++i) {
+ const TopoDS_Shape& aS2=aMS2(i);
+ if (aS2.IsSame(aF2)) {
+ continue;
+ }
+ bFound=(aMSOnF.Contains(aS2) || aMSInF.Contains(aS2));
+ if (!bFound) {
+ break;
+ }
+ }
+ if (!bFound) {
+ continue;
+ }
+ //
+ bFound=CheckCoincidence(aF1, aF2);
+ if (myErrorStatus) {
+ return;
+ }
+ if (bFound) {
+ FillShapesIn(aF1, aF2);
+ }
+ }
+}
+//=======================================================================
+//function : FillSolidsOn
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::FillSolidsOn()
+{
+ Standard_Integer i, j, aNbS, aNbF, aNbSOn;
+ TopTools_IndexedMapOfShape aMS, aMF;
+ TopTools_MapIteratorOfMapOfShape aItMS;
+ //
+ TopExp::MapShapes(myArgument, TopAbs_SOLID, aMS);
+ //
+ aNbS=aMS.Extent();
+ for (i=1; i<=aNbS; ++i) {
+ const TopoDS_Shape& aSD1=aMS(i);
+ //
+ aMF.Clear();
+ TopExp::MapShapes(aSD1, TopAbs_FACE, aMF);
+ aNbF=aMF.Extent();
+ for (j=1; j<=aNbF; ++j) {
+ const TopoDS_Shape& aF1=aMF(j);
+ //
+ if (myShapesOn.IsBound(aF1)) {
+ const TopTools_MapOfShape& aMSOn=myShapesOn.Find(aF1);
+ aItMS.Initialize(aMSOn);
+ for (; aItMS.More(); aItMS.Next()) {
+ const TopoDS_Shape& aS2=aItMS.Key();
+ FillShapesOn(aSD1, aS2);
+ }
+ }
+ //
+ if (myShapesIn.IsBound(aF1)) {
+ const TopTools_MapOfShape& aMSIn=myShapesIn.Find(aF1);
+ aItMS.Initialize(aMSIn);
+ for (; aItMS.More(); aItMS.Next()) {
+ const TopoDS_Shape& aS2=aItMS.Key();
+ FillShapesOn(aSD1, aS2);
+ }
+ }
+ }//for (j=1; j<=aNbF; ++j) {
+ }//for (i=1; i<=aNbS; ++i) {
+}
+//=======================================================================
+//function : PerformZF
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::PerformZF()
+{
+ Standard_Boolean bFound, bHasOnF, bHasInF;
+ Standard_Integer i, aNbE;
+ TopTools_MapOfShape aMSX;
+ //
+ myErrorStatus=0;
+ myWarningStatus=0;
+ //
+ myIterator.Initialize(TopAbs_SOLID, TopAbs_FACE);
+ for (; myIterator.More(); myIterator.Next()) {
+ const NMTTools_CoupleOfShape& aCS=myIterator.Value();
+ const TopoDS_Shape& aSo1=aCS.Shape1();
+ const TopoDS_Shape& aF2=aCS.Shape2();
+ //
+ bHasOnF=myShapesOn.IsBound(aSo1);
+ const TopTools_MapOfShape& aMSOnF=(bHasOnF) ? myShapesOn.Find(aSo1) : aMSX;
+ bFound=aMSOnF.Contains(aF2);
+ if (bFound) {
+ continue;
+ }
+ //------------------------------
+ bFound=CheckCoincidence(aSo1, aF2);
+ if (myErrorStatus) {
+ return;
+ }
+ if (bFound) {
+ FillShapesIn(aSo1, aF2);
+ }
+ }
+}
+//=======================================================================
+//function : PerformZZ
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::PerformZZ()
+{
+ Standard_Boolean bFound, bHasOn, bHasIn;
+ Standard_Integer i, aNbS2, iCntOn, iCntIn, iCntOut;
+ TopTools_MapOfShape aMSX;
+ TopTools_IndexedMapOfShape aMS2;
+ //
+ myErrorStatus=0;
+ myWarningStatus=0;
+ //
+ myIterator.Initialize(TopAbs_SOLID, TopAbs_SOLID);
+ for (; myIterator.More(); myIterator.Next()) {
+ const NMTTools_CoupleOfShape& aCS=myIterator.Value();
+ const TopoDS_Shape& aSo1=aCS.Shape1();
+ const TopoDS_Shape& aSo2=aCS.Shape2();
+ //
+ bHasOn=myShapesOn.IsBound(aSo1);
+ const TopTools_MapOfShape& aMSOn=(bHasOn) ? myShapesOn.Find(aSo1) : aMSX;
+ //
+ bHasIn=myShapesIn.IsBound(aSo1);
+ const TopTools_MapOfShape& aMSIn=(bHasIn) ? myShapesIn.Find(aSo1) : aMSX;
+ //
+ aMS2.Clear();
+ TopExp::MapShapes(aSo2, TopAbs_FACE, aMS2);
+ //
+ iCntIn=0;
+ iCntOn=0;
+ iCntOut=0;
+ bFound=Standard_False;
+ aNbS2=aMS2.Extent();
+ for (i=1; i<=aNbS2; ++i) {
+ const TopoDS_Shape& aF2=aMS2(i);
+ //
+ if (aMSIn.Contains(aF2)) {
+ ++iCntIn;
+ bFound=Standard_True;
+ break;
+ }
+ else if (!aMSOn.Contains(aF2)) {
+ ++iCntOut;
+ bFound=Standard_False;// out
+ break;
+ }
+ else {
+ ++iCntOn; //on
+ }
+ }
+ //
+ if (!bFound && iCntOut) {
+ continue;
+ }
+ //
+ if (!iCntIn) {
+ bFound=CheckCoincidence(aSo1, aSo2);
+ if (myErrorStatus) {
+ return;
+ }
+ }
+ if (bFound) {
+ FillShapesIn(aSo1, aSo2);
+ }
+ }// for (; myIterator.More(); myIterator.Next()) {
+}
+//=======================================================================
+//function : FillImages
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::FillImages()
+{
+ Standard_Integer i, aNbS, aNbSx, aNbSi;
+ TopAbs_ShapeEnum aType;
+ TopoDS_Iterator aIt;
+ TopTools_ListOfShape aLSx;
+ TopTools_ListIteratorOfListOfShape aItLS;
+ TopTools_IndexedMapOfShape aMS;
+ TopTools_MapIteratorOfMapOfShape aItMS;
+ //
+ myErrorStatus=0;
+ myWarningStatus=0;
+ //
+ myImages.Clear();
+ //
+ // 1. Vertices
+ aMS.Clear();
+ TopExp::MapShapes(myArgument, TopAbs_VERTEX, aMS);
+ aNbS=aMS.Extent();
+ for (i=1; i<=aNbS; ++i) {
+ const TopoDS_Shape& aV=aMS(i);
+ if (myShapesOn.IsBound(aV)) {
+ const TopTools_MapOfShape& aMSx=myShapesOn.Find(aV);
+ aNbSx=aMSx.Extent();
+ //
+ aLSx.Clear();
+ aItMS.Initialize(aMSx);
+ for (; aItMS.More(); aItMS.Next()) {
+ const TopoDS_Shape& aVx=aItMS.Key();
+ aLSx.Append(aVx);
+ }
+ //
+ myImages.Bind(aV, aLSx);
+ }
+ }
+ //
+ // 2. Edges
+ aMS.Clear();
+ TopExp::MapShapes(myArgument, TopAbs_EDGE, aMS);
+ aNbS=aMS.Extent();
+ for (i=1; i<=aNbS; ++i) {
+ const TopoDS_Shape& aE=aMS(i);
+ if (myShapesIn.IsBound(aE)) {
+ const TopTools_MapOfShape& aMSx=myShapesIn.Find(aE);
+ aNbSx=aMSx.Extent();
+ //
+ aLSx.Clear();
+ aItMS.Initialize(aMSx);
+ for (; aItMS.More(); aItMS.Next()) {
+ const TopoDS_Shape& aEx=aItMS.Key();
+ aType=aEx.ShapeType();
+ if (aType==TopAbs_EDGE){
+ aLSx.Append(aEx);
+ }
+ }
+ //
+ myImages.Bind(aE, aLSx);
+ }
+ }
+ //
+ // 3. Wires
+ aMS.Clear();
+ TopExp::MapShapes(myArgument, TopAbs_WIRE, aMS);
+ aNbS=aMS.Extent();
+ for (i=1; i<=aNbS; ++i) {
+ const TopoDS_Shape& aW=aMS(i);
+ aLSx.Clear();
+ aIt.Initialize(aW);
+ for(; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aE=aIt.Value();
+ if (myImages.IsBound(aE)) {
+ const TopTools_ListOfShape& aLSi=myImages.Find(aE);
+ aNbSi=aLSi.Extent();
+ //
+ aItLS.Initialize(aLSi);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aEi=aItLS.Value();
+ aLSx.Append(aEi);
+ }
+ }
+ }
+ myImages.Bind(aW, aLSx);
+ }
+ //
+ // 4. Faces
+ aMS.Clear();
+ TopExp::MapShapes(myArgument, TopAbs_FACE, aMS);
+ aNbS=aMS.Extent();
+ for (i=1; i<=aNbS; ++i) {
+ const TopoDS_Shape& aF=aMS(i);
+ if (myShapesIn.IsBound(aF)) {
+ const TopTools_MapOfShape& aMSx=myShapesIn.Find(aF);
+ aNbSx=aMSx.Extent();
+ //
+ aLSx.Clear();
+ aItMS.Initialize(aMSx);
+ for (; aItMS.More(); aItMS.Next()) {
+ const TopoDS_Shape& aFx=aItMS.Key();
+ aType=aFx.ShapeType();
+ if (aType==TopAbs_FACE){
+ aLSx.Append(aFx);
+ }
+ }
+ //
+ myImages.Bind(aF, aLSx);
+ }
+ }
+ //
+ // 5. Shells
+ aMS.Clear();
+ TopExp::MapShapes(myArgument, TopAbs_SHELL, aMS);
+ aNbS=aMS.Extent();
+ for (i=1; i<=aNbS; ++i) {
+ const TopoDS_Shape& aSh=aMS(i);
+ aLSx.Clear();
+ aIt.Initialize(aSh);
+ for(; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aF=aIt.Value();
+ if (myImages.IsBound(aF)) {
+ const TopTools_ListOfShape& aLSi=myImages.Find(aF);
+ aNbSi=aLSi.Extent();
+ //
+ aItLS.Initialize(aLSi);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aFi=aItLS.Value();
+ aLSx.Append(aFi);
+ }
+ }
+ }
+ myImages.Bind(aSh, aLSx);
+ }
+ //
+ // 6. Solids
+ aMS.Clear();
+ TopExp::MapShapes(myArgument, TopAbs_SOLID, aMS);
+ aNbS=aMS.Extent();
+ for (i=1; i<=aNbS; ++i) {
+ const TopoDS_Shape& aZ=aMS(i);
+ if (myShapesIn.IsBound(aZ)) {
+ const TopTools_MapOfShape& aMSx=myShapesIn.Find(aZ);
+ aNbSx=aMSx.Extent();
+ //
+ aLSx.Clear();
+ aItMS.Initialize(aMSx);
+ for (; aItMS.More(); aItMS.Next()) {
+ const TopoDS_Shape& aZx=aItMS.Key();
+ aType=aZx.ShapeType();
+ if (aType==TopAbs_SOLID){
+ aLSx.Append(aZx);
+ }
+ }
+ //
+ myImages.Bind(aZ, aLSx);
+ }
+ }
+ //
+ // 7. CompSolids
+ aMS.Clear();
+ TopExp::MapShapes(myArgument, TopAbs_COMPSOLID, aMS);
+ aNbS=aMS.Extent();
+ for (i=1; i<=aNbS; ++i) {
+ const TopoDS_Shape& aCs=aMS(i);
+ aLSx.Clear();
+ aIt.Initialize(aCs);
+ for(; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aZ=aIt.Value();
+ if (myImages.IsBound(aZ)) {
+ const TopTools_ListOfShape& aLSi=myImages.Find(aZ);
+ aNbSi=aLSi.Extent();
+ //
+ aItLS.Initialize(aLSi);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aZi=aItLS.Value();
+ aLSx.Append(aZi);
+ }
+ }
+ }
+ myImages.Bind(aCs, aLSx);
+ }
+ //
+ // 8. Compounds
+ aType=myArgument.ShapeType();
+ if (aType==TopAbs_COMPOUND) {
+ FillImagesCompound(myArgument);
+ }
+}
+//=======================================================================
+//function : FillImagesCompound
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::FillImagesCompound(const TopoDS_Shape& aS)
+{
+ TopAbs_ShapeEnum aType;
+ TopoDS_Iterator aIt;
+ TopTools_ListOfShape aLSx;
+ TopTools_ListIteratorOfListOfShape aItLS;
+ //
+ aIt.Initialize(aS);
+ for(; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aSx=aIt.Value();
+ aType=aSx.ShapeType();
+ //
+ if (aType==TopAbs_COMPOUND) {
+ FillImagesCompound(aSx);
+ }
+ //
+ if (myImages.IsBound(aSx)) {
+ const TopTools_ListOfShape& aLSi=myImages.Find(aSx);
+ aItLS.Initialize(aLSi);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aSi=aItLS.Value();
+ aLSx.Append(aSi);
+ }
+ }
+ }
+ myImages.Bind(aS, aLSx);
+}
+
+//=======================================================================
+//function : FillShapesIn
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::FillShapesIn(const TopoDS_Shape& aS1,
+ const TopoDS_Shape& aS2)
+{
+ if (myShapesIn.IsBound(aS1)) {
+ TopTools_MapOfShape& aMS=myShapesIn.ChangeFind(aS1);
+ aMS.Add(aS2);
+ }
+ else {
+ TopTools_MapOfShape aMS;
+ //
+ aMS.Add(aS2);
+ myShapesIn.Bind(aS1, aMS);
+ }
+}
+//=======================================================================
+//function : FillShapesOn
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::FillShapesOn(const TopoDS_Shape& aS1,
+ const TopoDS_Shape& aS2)
+{
+ if (myShapesOn.IsBound(aS1)) {
+ TopTools_MapOfShape& aMS=myShapesOn.ChangeFind(aS1);
+ aMS.Add(aS2);
+ }
+ else {
+ TopTools_MapOfShape aMS;
+ //
+ aMS.Add(aS2);
+ myShapesOn.Bind(aS1, aMS);
+ }
+}
+//=======================================================================
+//function : MapBRepShapes
+//purpose :
+//=======================================================================
+void MapBRepShapes(const TopoDS_Shape& aS,
+ TopTools_IndexedMapOfShape& aM)
+{
+ Standard_Boolean bHasBRep, bDegenerated;
+ TopAbs_ShapeEnum aType;
+ TopoDS_Iterator aIt;
+ //
+ aType=aS.ShapeType();
+ if (aType==TopAbs_VERTEX || aType==TopAbs_EDGE ||
+ aType==TopAbs_FACE || aType==TopAbs_SOLID) {
+ bDegenerated=Standard_False;
+ if (aType==TopAbs_EDGE) {
+ TopoDS_Edge *pE=(TopoDS_Edge*)&aS;
+ bDegenerated=BRep_Tool::Degenerated(*pE);
+ }
+ if (!bDegenerated) {
+ aM.Add(aS);
+ }
+ }
+ //
+ aIt.Initialize(aS);
+ for(; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aSx=aIt.Value();
+ aType=aSx.ShapeType();
+ MapBRepShapes(aSx, aM);
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2011 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
+//
+// 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.
+//
+// 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: GEOMAlgo_GetInPlace.hxx
+// Created:
+// Author: Peter KURNEV
+
+#ifndef _GEOMAlgo_GetInPlace_HeaderFile
+#define _GEOMAlgo_GetInPlace_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_Macro.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_Real.hxx>
+#include <Standard_Boolean.hxx>
+
+#include <TopAbs_ShapeEnum.hxx>
+#include <TopoDS_Shape.hxx>
+
+#include <NMTTools_CoupleOfShape.hxx>
+#include <NMTTools_ListOfCoupleOfShape.hxx>
+#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
+
+#include <GEOMAlgo_DataMapOfShapeMapOfShape.hxx>
+#include <GEOMAlgo_GluerAlgo.hxx>
+#include <GEOMAlgo_Algo.hxx>
+#include <GEOMAlgo_DataMapOfShapePnt.hxx>
+
+
+//=======================================================================
+/**
+ * The implementation of iterator of intersected shapes
+ * for Get In Place Algorithm.
+ * The intersection is in terms of 3D bounding boxes.
+ */
+//=======================================================================
+//class : GEOMAlgo_GetInPlaceIterator
+//purpose :
+//=======================================================================
+class GEOMAlgo_GetInPlaceIterator {
+ public:
+ /**
+ * Constructor.
+ */
+ //Standard_EXPORT
+ GEOMAlgo_GetInPlaceIterator();
+
+ /**
+ * Destructor.
+ */
+ //Standard_EXPORT
+ virtual ~GEOMAlgo_GetInPlaceIterator();
+
+ /**
+ * Clear the internal content.
+ */
+ //Standard_EXPORT
+ void Clear() ;
+
+ /**
+ * Append the pair of intersected shapes.
+ * @param theCS
+ * The pair of intersected shapes.
+ */
+ //Standard_EXPORT
+ void AppendPair(const NMTTools_CoupleOfShape& theCS) ;
+
+ /**
+ * Initialize the iterator.
+ * @param theT1
+ * The type of (sub)shape What.
+ * @param theT2
+ * The type of (sub)shape Where.
+ */
+ //Standard_EXPORT
+ void Initialize(const TopAbs_ShapeEnum theT1,
+ const TopAbs_ShapeEnum theT2) ;
+ /**
+ * Check the existence of pairs to iterare.
+ * @return
+ * Standard_True if there are pairs to iterare.
+ */
+ //Standard_EXPORT
+ Standard_Boolean More() const;
+
+ /**
+ * Shift to the next pair.
+ */
+ //Standard_EXPORT
+ void Next() ;
+
+ /**
+ * Returns the pair of intersected shapes.
+ * @return
+ * The pair of intersected shapes.
+ */
+ //Standard_EXPORT
+ const NMTTools_CoupleOfShape& Value() const;
+
+protected:
+ Standard_Integer myDim;
+ NMTTools_ListOfCoupleOfShape myLists[10];
+ NMTTools_ListOfCoupleOfShape myEmptyList;
+ NMTTools_ListIteratorOfListOfCoupleOfShape myIterator;
+
+private:
+};
+
+
+//=======================================================================
+/**
+ * The implementation of Get In Place Algorithm.
+ * The algorithm provides the search the argument [What]
+ * in the shape [Where].
+ */
+//=======================================================================
+//class : GEOMAlgo_GetInPlace
+//purpose :
+//=======================================================================
+class GEOMAlgo_GetInPlace : public GEOMAlgo_GluerAlgo,
+ public GEOMAlgo_Algo
+{
+ public:
+ /**
+ * Constructor.
+ */
+ Standard_EXPORT
+ GEOMAlgo_GetInPlace();
+ /**
+ * Destructor.
+ */
+ Standard_EXPORT
+ virtual ~GEOMAlgo_GetInPlace();
+ /**
+ * Modifier. Sets the shape where the search is intended.
+ * @param theShape
+ * The shape where the search is intended.
+ */
+ Standard_EXPORT
+ virtual void SetShapeWhere(const TopoDS_Shape& theShape) ;
+
+ /**
+ * Selector. Returns the shape where the search is intended.
+ * @return
+ * The shape where the search is intended.
+ */
+ Standard_EXPORT
+ const TopoDS_Shape& ShapeWhere() const;
+
+ /**
+ * Modifier. Sets the tolerance of mass.
+ * @param theTol
+ * The value tolerance of mass.
+ */
+ Standard_EXPORT
+ void SetTolMass(const Standard_Real theTol) ;
+
+ /**
+ * Selector. Returns the value tolerance of mass.
+ * @return
+ * The value tolerance of mass.
+ */
+ Standard_EXPORT
+ Standard_Real TolMass() const;
+
+ /**
+ * Modifier. Sets the tolerance of center of gravily.
+ * @param theTol
+ * The value tolerance of center of gravily.
+ */
+ Standard_EXPORT
+ void SetTolCG(const Standard_Real theTol) ;
+
+ /**
+ * Selector. Returns the tolerance of center of gravily.
+ * @return
+ * The value tolerance of center of gravily.
+ */
+ Standard_EXPORT
+ Standard_Real TolCG() const;
+
+ /**
+ * Perform the algorithm.
+ */
+ Standard_EXPORT
+ virtual void Perform() ;
+
+ /**
+ * Returns state of the search.
+ * @return
+ * Standard_True if the argument is found.
+ */
+ Standard_EXPORT
+ Standard_Boolean IsFound() const;
+
+ /**
+ * Checks data
+ */
+ Standard_EXPORT
+ virtual void CheckData() ;
+
+ /**
+ * Clear the internal content.
+ */
+ Standard_EXPORT
+ virtual void Clear() ;
+
+ /**
+ * Returns the map of shapes IN.
+ * @return
+ ** Returns the map of shapes IN.
+ * The Key - the (sub)shape of the argument [What].
+ * The Item- the (sub)shapes of the shape [Where] that have
+ * the state IN in respect of [What].
+ */
+ Standard_EXPORT
+ const GEOMAlgo_DataMapOfShapeMapOfShape& ShapesIn() const;
+
+ /**
+ * Returns the map of shapes ON.
+ * @return
+ * Returns the map of shapes ON.
+ * The Key - the (sub)shape of the argument [What].
+ * The Item- the (sub)shapes of the shape [Where] that have
+ * the state ON in respect of [What].
+ */
+ Standard_EXPORT
+ const GEOMAlgo_DataMapOfShapeMapOfShape& ShapesOn() const;
+
+protected:
+ Standard_EXPORT
+ void Intersect() ;
+
+ Standard_EXPORT
+ void PerformVV() ;
+
+ Standard_EXPORT
+ void PerformVE() ;
+
+ Standard_EXPORT
+ void PerformEE() ;
+
+ Standard_EXPORT
+ void PerformVF() ;
+
+ Standard_EXPORT
+ void PerformEF() ;
+
+ Standard_EXPORT
+ void PerformFF() ;
+
+ Standard_EXPORT
+ void FillEdgesOn() ;
+
+ Standard_EXPORT
+ void FillFacesOn() ;
+
+ Standard_EXPORT
+ void FillSolidsOn() ;
+
+ Standard_EXPORT
+ void PerformZF() ;
+
+ Standard_EXPORT
+ void PerformZZ() ;
+
+ Standard_EXPORT
+ void FillImages() ;
+
+ Standard_EXPORT
+ void FillImagesCompound(const TopoDS_Shape& theS) ;
+
+ Standard_EXPORT
+ void CheckGProps() ;
+
+ Standard_EXPORT
+ void CheckGProps(const TopoDS_Shape& theS) ;
+
+ Standard_EXPORT
+ void FillShapesIn(const TopoDS_Shape& theS1,
+ const TopoDS_Shape& theS2) ;
+
+ Standard_EXPORT
+ void FillShapesOn(const TopoDS_Shape& theS1,
+ const TopoDS_Shape& theS2) ;
+
+ Standard_EXPORT
+ Standard_Boolean CheckCoincidence(const TopoDS_Shape& theS1,
+ const TopoDS_Shape& theS2);
+
+
+ TopoDS_Shape myShapeWhere;
+ GEOMAlgo_GetInPlaceIterator myIterator;
+ GEOMAlgo_DataMapOfShapeMapOfShape myShapesIn;
+ GEOMAlgo_DataMapOfShapeMapOfShape myShapesOn;
+ Standard_Real myTolMass;
+ Standard_Real myTolCG;
+ Standard_Boolean myFound;
+ GEOMAlgo_DataMapOfShapePnt myMapShapePnt;
+
+private:
+};
+
+
+
+#endif
--- /dev/null
+// Copyright (C) 2007-2011 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
+//
+// 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.
+//
+// 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: GEOMAlgo_GetInPlace_1.cxx
+// Created:
+// Author: Peter KURNEV
+
+#include <GEOMAlgo_GetInPlace.hxx>
+
+#include <math.h>
+
+#include <gp_Pnt.hxx>
+#include <gp_Vec.hxx>
+#include <gp_Pnt2d.hxx>
+#include <gp_Dir2d.hxx>
+
+#include <Geom_Surface.hxx>
+#include <Geom2d_Curve.hxx>
+#include <Geom2d_Line.hxx>
+#include <Geom2d_TrimmedCurve.hxx>
+#include <Geom2dAdaptor_Curve.hxx>
+#include <Geom2dHatch_Hatcher.hxx>
+#include <Geom2dHatch_Intersector.hxx>
+#include <HatchGen_Domain.hxx>
+#include <GeomAPI_ProjectPointOnCurve.hxx>
+
+#include <TopAbs_State.hxx>
+#include <TopAbs_ShapeEnum.hxx>
+#include <TopAbs_Orientation.hxx>
+
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Solid.hxx>
+#include <TopoDS_Face.hxx>
+
+#include <BRep_Tool.hxx>
+#include <TopExp_Explorer.hxx>
+
+#include <BRepTools.hxx>
+#include <BRepClass3d_SolidClassifier.hxx>
+
+#include <IntTools_Tools.hxx>
+
+#include <BOPTools_Tools3D.hxx>
+#include <BOPTools_Tools2D.hxx>
+
+
+
+static
+ Standard_Integer PntInEdge(const TopoDS_Edge& aF,
+ gp_Pnt& aP);
+static
+ Standard_Integer PntInEdge(const TopoDS_Edge& aF,
+ gp_Pnt& aP,
+ Standard_Real& aT);
+static
+ Standard_Integer PntInFace(const TopoDS_Face& aF,
+ gp_Pnt& aP);
+static
+ Standard_Integer PntInFace(const TopoDS_Face& aF,
+ gp_Pnt& aP,
+ gp_Pnt2d& theP2D);
+static
+ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
+ const Standard_Real aTol,
+ gp_Pnt& aP);
+
+
+//=======================================================================
+//function : CheckCoincidence
+//purpose :
+//=======================================================================
+Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
+ const TopoDS_Shape& aS2)
+{
+ Standard_Boolean bOk, bIsDone;
+ Standard_Integer iErr;
+ Standard_Real aTol2, aD2;
+ TopAbs_ShapeEnum aType1, aType2;
+ TopAbs_State aState;
+ gp_Pnt aP1, aP2;
+ //
+ myErrorStatus=0;
+ //
+ iErr=0;
+ bOk=Standard_False;
+ aTol2=myTolerance*myTolerance;
+ aType1=aS1.ShapeType();
+ aType2=aS2.ShapeType();
+ //
+ // 1. A point on shape #2 -> aP2
+ if (myMapShapePnt.IsBound(aS2)) {
+ aP2=myMapShapePnt.Find(aS2);
+ }
+ else {//else 1
+ if (aType2==TopAbs_VERTEX) {
+ const TopoDS_Vertex& aV2=*((TopoDS_Vertex*)&aS2);
+ aP2=BRep_Tool::Pnt(aV2);
+ }
+ //
+ else if (aType2==TopAbs_EDGE) {
+ const TopoDS_Edge& aE2=*((TopoDS_Edge*)&aS2);
+ iErr=PntInEdge(aE2, aP2);
+ }
+ //
+ else if (aType2==TopAbs_FACE) {
+ const TopoDS_Face& aF2=*((TopoDS_Face*)&aS2);
+ iErr=PntInFace(aF2, aP2);
+ }
+ //
+ else if (aType2==TopAbs_SOLID) {
+ const TopoDS_Solid& aZ2=*((TopoDS_Solid*)&aS2);
+ iErr=PntInSolid(aZ2, myTolerance, aP2);
+ }
+ //
+ else {
+ iErr=1;
+ }
+ //
+ if (iErr) {
+ myErrorStatus=50;
+ return bOk;
+ }
+ //
+ myMapShapePnt.Bind(aS2, aP2);
+ } //else 1
+ //
+ // 2. Project the point aP2 on shape #1 and check
+ if (aType1==TopAbs_EDGE) {
+ Standard_Integer aNbPoints;
+ Standard_Real aDmin, aT, aT1, aT2, dT;
+ //
+ const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aS1);
+ //
+ GeomAPI_ProjectPointOnCurve& aPPC=myContext.ProjPC(aE1);
+ aPPC.Perform(aP2);
+ aNbPoints=aPPC.NbPoints();
+ if (aNbPoints) {
+ aDmin=aPPC.LowerDistance();
+ aT=aPPC.LowerDistanceParameter();
+ if (aDmin < myTolerance) {
+ dT=1.e-12;
+ BRep_Tool::Curve(aE1, aT1, aT2);
+ if(aT > (aT1-dT) && aT < (aT2+dT)) {
+ bOk=Standard_True;
+ }
+ }
+ }
+ //else {
+ // iErr=2;
+ //}
+ }//if (aType1==TopAbs_EDGE) {
+ //
+ else if (aType1==TopAbs_FACE) {
+ const TopoDS_Face& aF1=*((TopoDS_Face*)&aS1);
+ //
+ bOk=myContext.IsValidPointForFace(aP2, aF1, myTolerance);
+ }
+ //
+ else if (aType1==TopAbs_SOLID) {
+ const TopoDS_Solid& aZ1=*((TopoDS_Solid*)&aS1);
+ //
+ BRepClass3d_SolidClassifier& aSC=myContext.SolidClassifier(aZ1);
+ aSC.Perform(aP2, myTolerance);
+ aState=aSC.State();
+ bOk=(aState==TopAbs_IN);
+ }
+ //
+ if (iErr) {
+ myErrorStatus=50;
+ }
+ //
+ return bOk;
+}
+//=======================================================================
+//
+//=======================================================================
+//function : PntInEdge
+//purpose :
+//=======================================================================
+Standard_Integer PntInEdge(const TopoDS_Edge& aE,
+ gp_Pnt& aP)
+
+{
+ Standard_Integer iErr;
+ Standard_Real aT;
+ //
+ iErr=PntInEdge(aE, aP, aT);
+ //
+ return iErr;
+}
+//=======================================================================
+//function : PntInEdge
+//purpose :
+//=======================================================================
+Standard_Integer PntInEdge(const TopoDS_Edge& aE,
+ gp_Pnt& aP,
+ Standard_Real& aT)
+{
+ Standard_Integer iErr;
+ Standard_Real aT1, aT2;
+ Handle(Geom_Curve) aC3D;
+ //
+ iErr=0;
+ //
+ aC3D=BRep_Tool::Curve(aE, aT1, aT2);
+ aT=IntTools_Tools::IntermediatePoint(aT1, aT2);
+ aC3D->D0(aT, aP);
+ //
+ return iErr;
+}
+//=======================================================================
+//function : PntInSolid
+//purpose :
+//=======================================================================
+Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
+ const Standard_Real aTol,
+ gp_Pnt& aP)
+{
+ Standard_Integer iErr;
+ Standard_Real aUx, aVx, aCoef;
+ gp_Pnt aPx;
+ gp_Pnt2d aP2Dx;
+ gp_Vec aDNx;
+
+ TopoDS_Face aF;
+ TopExp_Explorer aExp;
+ //
+ iErr=0;
+ aCoef=10.;
+ //
+ aExp.Init (aZ, TopAbs_FACE);
+ for (; aExp.More() ; aExp.Next()) {
+ aF=*((TopoDS_Face*)&aExp.Current());
+ break;
+ }
+ //
+ iErr=PntInFace(aF, aPx, aP2Dx);
+ if (iErr) {
+ return iErr;
+ }
+ //
+ aP2Dx.Coord(aUx, aVx);
+ BOPTools_Tools2D::FaceNormal(aF, aUx, aVx, aDNx);
+ aDNx.Reverse();
+ //
+ aP.SetXYZ(aPx.XYZ()+aCoef*aTol*aDNx.XYZ());
+ //
+ return iErr;
+}
+//=======================================================================
+//function : PntInFace
+//purpose :
+//=======================================================================
+Standard_Integer PntInFace(const TopoDS_Face& aF,
+ gp_Pnt& aP)
+{
+ Standard_Integer iErr;
+ //
+ gp_Pnt2d aP2Dx;
+ //
+ iErr=PntInFace(aF, aP, aP2Dx);
+ //
+ return iErr;
+}
+//=======================================================================
+//function : PntInFace
+//purpose :
+//=======================================================================
+Standard_Integer PntInFace(const TopoDS_Face& aF,
+ gp_Pnt& theP,
+ gp_Pnt2d& theP2D)
+{
+ Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
+ Standard_Integer iErr, aIx, aNbDomains, i;
+ Standard_Real aUMin, aUMax, aVMin, aVMax;
+ Standard_Real aVx, aUx, aV1, aV2, aU1, aU2, aEpsT;
+ Standard_Real aTotArcIntr, aTolTangfIntr, aTolHatch2D, aTolHatch3D;
+ gp_Dir2d aD2D (0., 1.);
+ gp_Pnt2d aP2D;
+ gp_Pnt aPx;
+ Handle(Geom2d_Curve) aC2D;
+ Handle(Geom2d_TrimmedCurve) aCT2D;
+ Handle(Geom2d_Line) aL2D;
+ Handle(Geom_Surface) aS;
+ TopAbs_Orientation aOrE;
+ TopoDS_Face aFF;
+ TopExp_Explorer aExp;
+ //
+ aTolHatch2D=1.e-8;
+ aTolHatch3D=1.e-8;
+ aTotArcIntr=1.e-10;
+ aTolTangfIntr=1.e-10;
+ //
+ Geom2dHatch_Intersector aIntr(aTotArcIntr, aTolTangfIntr);
+ Geom2dHatch_Hatcher aHatcher(aIntr,
+ aTolHatch2D, aTolHatch3D,
+ Standard_True, Standard_False);
+ //
+ iErr=0;
+ aEpsT=1.e-12;
+ //
+ aFF=aF;
+ aFF.Orientation (TopAbs_FORWARD);
+ //
+ aS=BRep_Tool::Surface(aFF);
+ BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
+ //
+ // 1
+ aExp.Init (aFF, TopAbs_EDGE);
+ for (; aExp.More() ; aExp.Next()) {
+ const TopoDS_Edge& aE=*((TopoDS_Edge*)&aExp.Current());
+ aOrE=aE.Orientation();
+ //
+ aC2D=BRep_Tool::CurveOnSurface (aE, aFF, aU1, aU2);
+ if (aC2D.IsNull() ) {
+ iErr=1;
+ return iErr;
+ }
+ if (fabs(aU1-aU2) < aEpsT) {
+ iErr=2;
+ return iErr;
+ }
+ //
+ aCT2D=new Geom2d_TrimmedCurve(aC2D, aU1, aU2);
+ aHatcher.AddElement(aCT2D, aOrE);
+ }// for (; aExp.More() ; aExp.Next()) {
+ //
+ // 2
+ aUx=IntTools_Tools::IntermediatePoint(aUMin, aUMax);
+ aP2D.SetCoord(aUx, 0.);
+ aL2D=new Geom2d_Line (aP2D, aD2D);
+ Geom2dAdaptor_Curve aHCur(aL2D);
+ //
+ aIx=aHatcher.AddHatching(aHCur) ;
+ //
+ // 3.
+ aHatcher.Trim();
+ bIsDone=aHatcher.TrimDone(aIx);
+ if (!bIsDone) {
+ iErr=3;
+ return iErr;
+ }
+ //
+ aHatcher.ComputeDomains(aIx);
+ bIsDone=aHatcher.IsDone(aIx);
+ if (!bIsDone) {
+ iErr=4;
+ return iErr;
+ }
+ //
+ // 4.
+ aNbDomains=aHatcher.NbDomains(aIx);
+ for (i=1; i<=aNbDomains; ++i) {
+ const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
+ bHasFirstPoint=aDomain.HasFirstPoint();
+ if (!bHasFirstPoint) {
+ iErr=5;
+ return iErr;
+ }
+ //
+ aV1=aDomain.FirstPoint().Parameter();
+ //
+ bHasSecondPoint=aDomain.HasSecondPoint();
+ if (!bHasSecondPoint) {
+ iErr=6;
+ return iErr;
+ }
+ //
+ aV2=aDomain.SecondPoint().Parameter();
+ //
+ aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
+ //
+ break;
+ }
+ //
+ aS->D0(aUx, aVx, aPx);
+ //
+ theP2D.SetCoord(aUx, aVx);
+ theP=aPx;
+ //
+ return iErr;
+}
+
--- /dev/null
+// Copyright (C) 2007-2011 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
+//
+// 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.
+//
+// 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: GEOMAlgo_GetInPlace_2.cxx
+// Created:
+// Author: Peter KURNEV
+
+#include <GEOMAlgo_GetInPlace.hxx>
+
+#include <TopAbs_ShapeEnum.hxx>
+
+#include <gp_Pnt.hxx>
+
+#include <TopoDS_Iterator.hxx>
+#include <TopoDS_Compound.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
+
+#include <BRep_Tool.hxx>
+#include <BRep_Builder.hxx>
+
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+
+#include <TopExp.hxx>
+
+#include <GProp_GProps.hxx>
+#include <BRepGProp.hxx>
+
+
+static
+ Standard_Integer Dimension(const TopAbs_ShapeEnum aType);
+static
+ void PointProperties(const TopoDS_Shape& aS,
+ GProp_GProps& aGProps);
+
+//=======================================================================
+//function : CheckGProps
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::CheckGProps()
+{
+ myFound=Standard_False;
+ CheckGProps(myArgument);
+}
+//=======================================================================
+//function : CheckGProps
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlace::CheckGProps(const TopoDS_Shape& aS1)
+{
+ Standard_Boolean bOnlyClosed;
+ Standard_Integer iDim, aNbS2;
+ Standard_Real aMass1, aMass2, aD2, aTolCG2, dM;
+ TopAbs_ShapeEnum aType1;
+ gp_Pnt aCG1, aCG2;
+ TopoDS_Iterator aIt;
+ TopoDS_Compound aC2;
+ BRep_Builder aBB;
+ TopTools_ListIteratorOfListOfShape aItLS;
+ //
+ myErrorStatus=0;
+ //
+ aType1=aS1.ShapeType();
+ if (aType1==TopAbs_COMPOUND) {
+ aIt.Initialize(aS1);
+ for(; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aS1x=aIt.Value();
+ CheckGProps(aS1x);
+ if (!myFound) {
+ return;
+ }
+ }
+ }
+ //
+ iDim=Dimension(aType1);
+ //
+ if (!myImages.IsBound(aS1)) {
+ // it should not be.
+ return;
+ }
+ const TopTools_ListOfShape& aLS2=myImages.Find(aS1);
+ aNbS2=aLS2.Extent();
+ if (!aNbS2) {
+ // it should not be.
+ return;
+ }
+ //
+ aBB.MakeCompound(aC2);
+ aItLS.Initialize(aLS2);
+ for (; aItLS.More(); aItLS.Next()) {
+ const TopoDS_Shape& aS2x=aItLS.Value();
+ aBB.Add(aC2, aS2x);
+ }
+ //-------------------------
+ GProp_GProps aG1, aG2;
+ //
+ aTolCG2=myTolCG*myTolCG;
+ bOnlyClosed=Standard_False;
+ //
+ if (iDim==0) {
+ PointProperties(aS1, aG1);
+ PointProperties(aC2, aG2);
+ }
+ else if (iDim==1) {
+ BRepGProp::LinearProperties(aS1, aG1);
+ BRepGProp::LinearProperties(aC2, aG2);
+ }
+ else if (iDim==2) {
+ BRepGProp::SurfaceProperties(aS1, aG1);
+ BRepGProp::SurfaceProperties(aC2, aG2);
+ }
+ else if (iDim==3) {
+ BRepGProp::VolumeProperties(aS1, aG1, bOnlyClosed);
+ BRepGProp::VolumeProperties(aC2, aG2, bOnlyClosed);
+ }
+ //
+ aMass1=aG1.Mass();
+ aMass2=aG2.Mass();
+ aCG1=aG1.CentreOfMass();
+ aCG2=aG2.CentreOfMass();
+ //
+ dM=fabs(aMass1-aMass2);
+ if (aMass1 > myTolMass) {
+ dM=dM/aMass1;
+ }
+ //
+ aD2=aCG1.SquareDistance(aCG2);
+ //
+ if ((dM > myTolMass) || (aD2 > aTolCG2)) {
+ myFound=Standard_False;
+ return;
+ }
+ myFound=Standard_True;
+}
+//=======================================================================
+//function : Dimension
+//purpose :
+//=======================================================================
+Standard_Integer Dimension(const TopAbs_ShapeEnum aType)
+{
+ Standard_Integer iDim;
+ //
+ iDim=-1;
+ switch (aType) {
+ case TopAbs_VERTEX:
+ iDim=0;
+ break;
+ case TopAbs_EDGE:
+ case TopAbs_WIRE:
+ iDim=1;
+ break;
+ case TopAbs_FACE:
+ case TopAbs_SHELL:
+ iDim=2;
+ break;
+ case TopAbs_SOLID:
+ case TopAbs_COMPSOLID:
+ iDim=3;
+ break;
+ default:
+ break;
+ }
+ return iDim;
+}
+//=======================================================================
+//class : GEOMAlgo_GProps
+//purpose :
+//=======================================================================
+class GEOMAlgo_GProps : public GProp_GProps {
+ public:
+ GEOMAlgo_GProps() : GProp_GProps() {
+ };
+ //
+ GEOMAlgo_GProps(const gp_Pnt& aPLoc) : GProp_GProps(aPLoc) {
+ };
+ //
+ ~GEOMAlgo_GProps() {
+ };
+ //
+ void SetMass(const Standard_Real aMass) {
+ dim=aMass;
+ }
+ //
+ void SetCG(const gp_Pnt& aPCG) {
+ g=aPCG;
+ }
+};
+//=======================================================================
+//function : PointProperties
+//purpose :
+//=======================================================================
+void PointProperties(const TopoDS_Shape& aS, GProp_GProps& aGProps)
+{
+ Standard_Integer i, aNbS;
+ Standard_Real aDensity;
+ gp_Pnt aPX;
+ TopTools_IndexedMapOfShape aMS;
+ //
+ aDensity=1.;
+ //
+ TopExp::MapShapes(aS, TopAbs_VERTEX, aMS);
+ aNbS=aMS.Extent();
+ for (i=1; i<=aNbS; ++i) {
+ GEOMAlgo_GProps aGPropsX;
+ //
+ const TopoDS_Vertex& aVX=*((TopoDS_Vertex*)&aMS(i));
+ aPX=BRep_Tool::Pnt(aVX);
+ aGPropsX.SetMass(1.);
+ aGPropsX.SetCG(aPX);
+ aGProps.Add(aGPropsX, aDensity);
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2011 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
+//
+// 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.
+//
+// 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: GEOMAlgo_GetInPlaceIterator.cxx
+// Created:
+// Author: Peter KURNEV
+
+#include <GEOMAlgo_GetInPlace.hxx>
+
+#include <NMTTools_CoupleOfShape.hxx>
+
+static
+ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
+ const TopAbs_ShapeEnum aType2);
+
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+GEOMAlgo_GetInPlaceIterator::GEOMAlgo_GetInPlaceIterator()
+{
+ myDim=10;
+}
+//=======================================================================
+//function : ~
+//purpose :
+//=======================================================================
+GEOMAlgo_GetInPlaceIterator::~GEOMAlgo_GetInPlaceIterator()
+{
+}
+//=======================================================================
+//function : Clear
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlaceIterator::Clear()
+{
+ Standard_Integer i;
+ //
+ for (i=0; i<myDim; ++i) {
+ myLists[i].Clear();
+ }
+}
+//=======================================================================
+//function : AppendPair
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlaceIterator::AppendPair(const NMTTools_CoupleOfShape& theCS)
+{
+ Standard_Integer iX;
+ TopAbs_ShapeEnum aType1, aType2;
+ //
+ const TopoDS_Shape& aS1=theCS.Shape1();
+ const TopoDS_Shape& aS2=theCS.Shape2();
+ aType1=aS1.ShapeType();
+ aType2=aS2.ShapeType();
+ //
+ iX=TypeToInteger(aType1, aType2);
+ if (iX>=0) {
+ myLists[iX].Append(theCS);
+ }
+}
+//=======================================================================
+//function : ShapeWhere
+//purpose :
+//=======================================================================
+void GEOMAlgo_GetInPlaceIterator::Initialize(const TopAbs_ShapeEnum aType1,
+ const TopAbs_ShapeEnum aType2)
+{
+ Standard_Integer iX;
+ //
+ iX=TypeToInteger(aType1, aType2);
+ if (iX>=0) {
+ myIterator.Initialize(myLists[iX]);
+ }
+ else {
+ myIterator.Initialize(myEmptyList);
+ }
+}
+//=======================================================================
+// function: More
+// purpose:
+//=======================================================================
+Standard_Boolean GEOMAlgo_GetInPlaceIterator::More()const
+{
+ return myIterator.More();
+}
+//=======================================================================
+// function: Next
+// purpose:
+//=======================================================================
+void GEOMAlgo_GetInPlaceIterator::Next()
+{
+ myIterator.Next();
+}
+//=======================================================================
+// function: Value
+// purpose:
+//=======================================================================
+const NMTTools_CoupleOfShape& GEOMAlgo_GetInPlaceIterator::Value()const
+{
+ return myIterator.Value();
+}
+//=======================================================================
+//function : TypeToInteger
+//purpose :
+//=======================================================================
+Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
+ const TopAbs_ShapeEnum aType2)
+{
+ Standard_Integer iRet, iT1, iT2, iX;
+ //
+ iRet=-1;
+ //
+ if (aType1==TopAbs_VERTEX) {
+ if (aType2==TopAbs_VERTEX) {
+ iRet=0;
+ }
+ }
+ else if (aType1==TopAbs_EDGE) {
+ if (aType2==TopAbs_VERTEX) {
+ iRet=1;
+ }
+ else if (aType2==TopAbs_EDGE) {
+ iRet=2;
+ }
+ }
+ else if (aType1==TopAbs_FACE) {
+ if (aType2==TopAbs_VERTEX) {
+ iRet=3;
+ }
+ else if (aType2==TopAbs_EDGE) {
+ iRet=4;
+ }
+ else if (aType2==TopAbs_FACE) {
+ iRet=5;
+ }
+ }
+ // So_1,*_2
+ else if (aType1==TopAbs_SOLID) {
+ if (aType2==TopAbs_VERTEX) {
+ iRet=6;
+ }
+ else if (aType2==TopAbs_EDGE) {
+ iRet=7;
+ }
+ else if (aType2==TopAbs_FACE) {
+ iRet=8;
+ }
+ else if (aType2==TopAbs_SOLID) {
+ iRet=9;
+ }
+ }
+ return iRet;
+}
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile\r
+#define _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_HeaderFile\r
+\r
+#ifndef _Standard_HeaderFile\r
+#include <Standard.hxx>\r
+#endif\r
+#ifndef _Standard_DefineHandle_HeaderFile\r
+#include <Standard_DefineHandle.hxx>\r
+#endif\r
+\r
+#ifndef _Handle_TCollection_MapNode_HeaderFile\r
+#include <Handle_TCollection_MapNode.hxx>\r
+#endif\r
+\r
+class Standard_Transient;\r
+class Handle(Standard_Type);\r
+class Handle(TCollection_MapNode);\r
+class GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape;\r
+\r
+DEFINE_STANDARD_HANDLE(GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape,TCollection_MapNode)\r
+\r
+#endif\r
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+\r
+#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile\r
+#define _Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_HeaderFile\r
+\r
+#ifndef _Standard_HeaderFile\r
+#include <Standard.hxx>\r
+#endif\r
+#ifndef _Standard_DefineHandle_HeaderFile\r
+#include <Standard_DefineHandle.hxx>\r
+#endif\r
+\r
+#ifndef _Handle_TCollection_MapNode_HeaderFile\r
+#include <Handle_TCollection_MapNode.hxx>\r
+#endif\r
+\r
+class Standard_Transient;\r
+class Handle(Standard_Type);\r
+class Handle(TCollection_MapNode);\r
+class GEOMAlgo_DataMapNodeOfDataMapOfShapePnt;\r
+\r
+DEFINE_STANDARD_HANDLE(GEOMAlgo_DataMapNodeOfDataMapOfShapePnt,TCollection_MapNode)\r
+\r
+#endif\r
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-
-# GEOM GEOMAlgo : tools for Glue Faces algorithm
-# File : Makefile.in
-# Author : Julia DOROVSKIKH
-# Module : GEOM
+# GEOM GEOMAlgo : tools for Glue Faces algorithm
+# File : Makefile.am
+# Author : Julia DOROVSKIKH
+# Module : GEOM
include $(top_srcdir)/adm_local/unix/make_common_starter.am
GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger_0.cxx \
GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape_0.cxx \
GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape_0.cxx \
+ GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape_0.cxx \
+ GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt_0.cxx \
GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal_0.cxx \
GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet_0.cxx \
GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_0.cxx \
GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_0.cxx \
GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_0.cxx \
GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_0.cxx \
+ GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape_0.cxx \
+ GEOMAlgo_DataMapNodeOfDataMapOfShapePnt_0.cxx \
GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_0.cxx \
GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_0.cxx \
GEOMAlgo_DataMapOfOrientedShapeShape_0.cxx \
GEOMAlgo_DataMapOfPassKeyInteger_0.cxx \
GEOMAlgo_DataMapOfPassKeyShapeShape_0.cxx \
GEOMAlgo_DataMapOfRealListOfShape_0.cxx \
+ GEOMAlgo_DataMapOfShapeMapOfShape_0.cxx \
+ GEOMAlgo_DataMapOfShapePnt_0.cxx \
GEOMAlgo_DataMapOfShapeReal_0.cxx \
GEOMAlgo_DataMapOfShapeShapeSet_0.cxx \
GEOMAlgo_FinderShapeOn1.cxx \
GEOMAlgo_FinderShapeOn2.cxx \
GEOMAlgo_FinderShapeOn.cxx \
GEOMAlgo_FinderShapeOnQuad.cxx \
+ GEOMAlgo_GetInPlace.cxx \
+ GEOMAlgo_GetInPlace_1.cxx \
+ GEOMAlgo_GetInPlace_2.cxx \
+ GEOMAlgo_GetInPlace_3.cxx \
GEOMAlgo_GlueAnalyser.cxx \
GEOMAlgo_Gluer.cxx \
GEOMAlgo_GlueDetector.cxx \
GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx \
GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape.hxx \
GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape.hxx \
+ GEOMAlgo_DataMapIteratorOfDataMapOfShapeMapOfShape.hxx \
+ GEOMAlgo_DataMapIteratorOfDataMapOfShapePnt.hxx \
GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal.hxx \
GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx \
GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape.hxx \
GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx \
GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx \
GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx \
+ GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx \
+ GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx \
GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx \
GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx \
GEOMAlgo_DataMapOfOrientedShapeShape.hxx \
GEOMAlgo_DataMapOfPassKeyInteger.hxx \
GEOMAlgo_DataMapOfPassKeyShapeShape.hxx \
GEOMAlgo_DataMapOfRealListOfShape.hxx \
+ GEOMAlgo_DataMapOfShapeMapOfShape.hxx \
+ GEOMAlgo_DataMapOfShapePnt.hxx \
GEOMAlgo_DataMapOfShapeReal.hxx \
GEOMAlgo_DataMapOfShapeShapeSet.hxx \
GEOMAlgo_FinderShapeOn1.ixx \
GEOMAlgo_FinderShapeOn.ixx \
GEOMAlgo_FinderShapeOn.jxx \
GEOMAlgo_FinderShapeOnQuad.hxx \
+ GEOMAlgo_GetInPlace.hxx \
GEOMAlgo_GlueAnalyser.hxx \
GEOMAlgo_GlueAnalyser.ixx \
GEOMAlgo_GlueAnalyser.jxx \
Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx \
Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx \
Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx \
+ Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeMapOfShape.hxx \
+ Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapePnt.hxx \
Handle_GEOMAlgo_HAlgo.hxx \
Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx \
#include "GEOM_ISubShape.hxx"
#include "GEOM_PythonDump.hxx"
+#include "GEOMAlgo_ClsfBox.hxx"
+#include "GEOMAlgo_ClsfSolid.hxx"
+#include "GEOMAlgo_CoupleOfShapes.hxx"
#include "GEOMAlgo_FinderShapeOn1.hxx"
#include "GEOMAlgo_FinderShapeOnQuad.hxx"
#include "GEOMAlgo_FinderShapeOn2.hxx"
-#include "GEOMAlgo_ClsfBox.hxx"
-#include "GEOMAlgo_ClsfSolid.hxx"
+#include "GEOMAlgo_GetInPlace.hxx"
#include "GEOMAlgo_GlueDetector.hxx"
#include "GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx"
-#include "GEOMAlgo_CoupleOfShapes.hxx"
#include "GEOMAlgo_ListOfCoupleOfShapes.hxx"
#include "utilities.h"
TopTools_IndexedMapOfShape aWhereIndices;
TopExp::MapShapes(aWhere, aWhereIndices);
+ TopAbs_ShapeEnum iType = TopAbs_SOLID;
+ Standard_Real dl_l = 1e-3;
+ Standard_Real min_l, Tol_0D, Tol_1D, Tol_2D, Tol_3D, Tol_Mass;
+ Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+ Bnd_Box BoundingBox;
+ gp_Pnt aPnt, aPnt_aWhat, tab_Pnt[2];
+ GProp_GProps aProps;
+
+ // Find the iType of the aWhat shape
+ iType = GetTypeOfSimplePart(aWhat);
+ if (iType == TopAbs_SHAPE) {
+ SetErrorCode("Error: An attempt to extract a shape of not supported type.");
+ return NULL;
+ }
+
+ TopExp_Explorer Exp_aWhat ( aWhat, iType );
+ TopExp_Explorer Exp_aWhere ( aWhere, iType );
+ TopExp_Explorer Exp_Edge ( aWhere, TopAbs_EDGE );
+
+ // Find the shortest edge in theShapeWhere shape
+ BRepBndLib::Add(aWhere, BoundingBox);
+ BoundingBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
+ min_l = fabs(aXmax - aXmin);
+ if( min_l < fabs(aYmax - aYmin) ) min_l = fabs(aYmax - aYmin);
+ if( min_l < fabs(aZmax - aZmin) ) min_l = fabs(aZmax - aZmin);
+ min_l /= dl_l;
+ // Mantis issue 0020908 BEGIN
+ if (!Exp_Edge.More()) {
+ min_l = Precision::Confusion();
+ }
+ // Mantis issue 0020908 END
+ for ( Standard_Integer nbEdge = 0; Exp_Edge.More(); Exp_Edge.Next(), nbEdge++ ) {
+ TopExp_Explorer Exp_Vertex( Exp_Edge.Current(), TopAbs_VERTEX);
+ for ( Standard_Integer nbVertex = 0; Exp_Vertex.More(); Exp_Vertex.Next(), nbVertex++ ) {
+ aPnt = BRep_Tool::Pnt( TopoDS::Vertex( Exp_Vertex.Current() ) );
+ tab_Pnt[nbVertex] = aPnt;
+ }
+ if ( ! tab_Pnt[0].IsEqual(tab_Pnt[1], dl_l) ) {
+ BRepGProp::LinearProperties(Exp_Edge.Current(), aProps);
+ if ( aProps.Mass() < min_l ) min_l = aProps.Mass();
+ }
+ }
+
+ // Compute tolerances
+ Tol_0D = dl_l;
+ Tol_1D = dl_l * min_l;
+ Tol_2D = dl_l * ( min_l * min_l) * ( 2. + dl_l);
+ Tol_3D = dl_l * ( min_l * min_l * min_l ) * ( 3. + (3 * dl_l) + (dl_l * dl_l) );
+
+ if (Tol_0D < Precision::Confusion()) Tol_0D = Precision::Confusion();
+ if (Tol_1D < Precision::Confusion()) Tol_1D = Precision::Confusion();
+ if (Tol_2D < Precision::Confusion()) Tol_2D = Precision::Confusion();
+ if (Tol_3D < Precision::Confusion()) Tol_3D = Precision::Confusion();
+
+ Tol_Mass = Tol_3D;
+ if ( iType == TopAbs_VERTEX ) Tol_Mass = Tol_0D;
+ else if ( iType == TopAbs_EDGE ) Tol_Mass = Tol_1D;
+ else if ( iType == TopAbs_FACE ) Tol_Mass = Tol_2D;
+
+ // Searching for the sub-shapes inside the ShapeWhere shape
+ GEOMAlgo_GetInPlace aGIP;
+ aGIP.SetTolerance(Tol_1D);
+ aGIP.SetTolMass(Tol_Mass);
+ aGIP.SetTolCG(Tol_1D);
+
+ aGIP.SetArgument(aWhat);
+ aGIP.SetShapeWhere(aWhere);
+
+ aGIP.Perform();
+ int iErr = aGIP.ErrorStatus();
+ if (iErr) {
+ SetErrorCode("Error in GEOMAlgo_GetInPlace");
+ return NULL;
+ }
+
+ if (!aGIP.IsFound()) {
+ SetErrorCode(NOT_FOUND_ANY);
+ return NULL;
+ }
+
+ const TopTools_DataMapOfShapeListOfShape& aDMSLS = aGIP.Images();
+ if (!aDMSLS.IsBound(aWhat)) {
+ SetErrorCode(NOT_FOUND_ANY);
+ return NULL;
+ }
+
+ // the list of shapes aLSA contains the shapes
+ // of the Shape For Search that corresponds
+ // to the Argument aWhat
+ const TopTools_ListOfShape& aLSA = aDMSLS.Find(aWhat);
+ if (aLSA.Extent() == 0) {
+ SetErrorCode(NOT_FOUND_ANY); // Not found any Results
+ return NULL;
+ }
+
+ Handle(TColStd_HArray1OfInteger) aModifiedArray = new TColStd_HArray1OfInteger (1, aLSA.Extent());
+ TopTools_ListIteratorOfListOfShape anIterModif (aLSA);
+ for (Standard_Integer imod = 1; anIterModif.More(); anIterModif.Next(), imod++) {
+ if (aWhereIndices.Contains(anIterModif.Value())) {
+ aModifiedArray->SetValue(imod, aWhereIndices.FindIndex(anIterModif.Value()));
+ }
+ else {
+ SetErrorCode("Error: wrong sub shape returned");
+ return NULL;
+ }
+ }
+
+ //Add a new object
+ Handle(GEOM_Object) aResult = GetEngine()->AddSubShape(theShapeWhere, aModifiedArray);
+ if (aResult.IsNull()) {
+ SetErrorCode("Error in algorithm: result found, but cannot be returned.");
+ return NULL;
+ }
+
+ if (aModifiedArray->Length() > 1) {
+ //Set a GROUP type
+ aResult->SetType(GEOM_GROUP);
+
+ //Set a sub shape type
+ TopoDS_Shape aFirstFound = aLSA.First();
+ TopAbs_ShapeEnum aShapeType = aFirstFound.ShapeType();
+
+ TDF_Label aFreeLabel = aResult->GetFreeLabel();
+ TDataStd_Integer::Set(aFreeLabel, (Standard_Integer)aShapeType);
+ }
+
+ //Make a Python command
+ Handle(GEOM_Function) aFunction = aResult->GetFunction(1);
+
+ GEOM::TPythonDump(aFunction) << aResult << " = geompy.GetInPlace("
+ << theShapeWhere << ", " << theShapeWhat << ", True)";
+
+ SetErrorCode(OK);
+ return aResult;
+}
+
+//=============================================================================
+/*!
+ * case GetInPlaceOld:
+ * default:
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceOld (Handle(GEOM_Object) theShapeWhere,
+ Handle(GEOM_Object) theShapeWhat)
+{
+ SetErrorCode(KO);
+
+ if (theShapeWhere.IsNull() || theShapeWhat.IsNull()) return NULL;
+
+ TopoDS_Shape aWhere = theShapeWhere->GetValue();
+ TopoDS_Shape aWhat = theShapeWhat->GetValue();
+ TopoDS_Shape aPntShape;
+ TopoDS_Vertex aVertex;
+
+ if (aWhere.IsNull() || aWhat.IsNull()) {
+ SetErrorCode("Error: aWhere and aWhat TopoDS_Shape are Null.");
+ return NULL;
+ }
+
+ Handle(GEOM_Function) aWhereFunction = theShapeWhere->GetLastFunction();
+ if (aWhereFunction.IsNull()) {
+ SetErrorCode("Error: aWhereFunction is Null.");
+ return NULL;
+ }
+
+ TopTools_IndexedMapOfShape aWhereIndices;
+ TopExp::MapShapes(aWhere, aWhereIndices);
+
TColStd_ListOfInteger aModifiedList;
Standard_Integer aWhereIndex;
Handle(TColStd_HArray1OfInteger) aModifiedArray;
Handle(GEOM_Function) aFunction = aResult->GetFunction(1);
GEOM::TPythonDump(aFunction) << aResult << " = geompy.GetInPlace("
- << theShapeWhere << ", " << theShapeWhat << ")";
+ << theShapeWhere << ", " << theShapeWhat << ", False)";
SetErrorCode(OK);
return aResult;
Standard_EXPORT Handle(GEOM_Object) GetInPlace (Handle(GEOM_Object) theShapeWhere,
Handle(GEOM_Object) theShapeWhat);
+ Standard_EXPORT Handle(GEOM_Object) GetInPlaceOld (Handle(GEOM_Object) theShapeWhere,
+ Handle(GEOM_Object) theShapeWhat);
+
Standard_EXPORT Handle(GEOM_Object) GetInPlaceByHistory (Handle(GEOM_Object) theShapeWhere,
Handle(GEOM_Object) theShapeWhat);
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * GetInPlaceOld
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetInPlaceOld
+ (GEOM::GEOM_Object_ptr theShapeWhere,
+ GEOM::GEOM_Object_ptr theShapeWhat)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ //Get the reference objects
+ Handle(GEOM_Object) aShapeWhere = GetObjectImpl(theShapeWhere);
+ Handle(GEOM_Object) aShapeWhat = GetObjectImpl(theShapeWhat);
+
+ if (aShapeWhere.IsNull() ||
+ aShapeWhat.IsNull()) return aGEOMObject._retn();
+
+ //Get Shapes in place of aShapeWhat
+ Handle(GEOM_Object) anObject =
+ GetOperations()->GetInPlaceOld(aShapeWhere, aShapeWhat);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
//=============================================================================
/*!
* GetInPlaceByHistory
GEOM::GEOM_Object_ptr GetInPlace (GEOM::GEOM_Object_ptr theShapeWhere,
GEOM::GEOM_Object_ptr theShapeWhat);
+ GEOM::GEOM_Object_ptr GetInPlaceOld (GEOM::GEOM_Object_ptr theShapeWhere,
+ GEOM::GEOM_Object_ptr theShapeWhat);
+
GEOM::GEOM_Object_ptr GetInPlaceByHistory (GEOM::GEOM_Object_ptr theShapeWhere,
GEOM::GEOM_Object_ptr theShapeWhat);
# @image html get_in_place_lost_part.png
#
# @ref swig_GetInPlace "Example"
- def GetInPlace(self, theShapeWhere, theShapeWhat):
+ def GetInPlace(self, theShapeWhere, theShapeWhat, isNewImplementation = False):
# Example: see GEOM_TestOthers.py
- anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
+ anObj = None
+ if isNewImplementation:
+ anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
+ else:
+ anObj = self.ShapesOp.GetInPlaceOld(theShapeWhere, theShapeWhat)
+ pass
RaiseIfFailed("GetInPlace", self.ShapesOp)
return anObj