From: skl Date: Tue, 24 Oct 2006 09:23:11 +0000 (+0000) Subject: Second version of PartAlgo. X-Git-Tag: StablePortAlgo2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c9abd4028bcdcfd002784c9a2a36558859606c4f;p=modules%2Fgeom.git Second version of PartAlgo. --- diff --git a/src/NMTDS/Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx b/src/NMTDS/Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx new file mode 100644 index 000000000..50dd456cb --- /dev/null +++ b/src/NMTDS/Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx @@ -0,0 +1,72 @@ +// Copyright (C) 2005 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 + +#ifndef _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile +#define _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape); + +class Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape) : public Handle(TCollection_MapNode) { + public: + Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)():Handle(TCollection_MapNode)() {} + Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)(const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)(const NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)& operator=(const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)& operator=(const NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape* operator->() const + { + return (NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)(); + + Standard_EXPORT static const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/NMTDS/Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx b/src/NMTDS/Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx new file mode 100644 index 000000000..a1bb5bc11 --- /dev/null +++ b/src/NMTDS/Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx @@ -0,0 +1,72 @@ +// Copyright (C) 2005 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 + +#ifndef _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile +#define _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox); + +class Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox) : public Handle(TCollection_MapNode) { + public: + Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)():Handle(TCollection_MapNode)() {} + Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)(const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)(const NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)& operator=(const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)& operator=(const NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox* operator->() const + { + return (NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)(); + + Standard_EXPORT static const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/NMTDS/Makefile.in b/src/NMTDS/Makefile.in index 0fbc92e6f..66a099522 100644 --- a/src/NMTDS/Makefile.in +++ b/src/NMTDS/Makefile.in @@ -40,11 +40,15 @@ LIB = libNMTDS.la LIB_SRC = \ NMTDS_CArray1OfIndexRange_0.cxx \ NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger_0.cxx \ + NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx \ + NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_0.cxx \ NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger_0.cxx \ + NMTDS_IndexedDataMapOfIntegerShape_0.cxx \ + NMTDS_IndexedDataMapOfShapeBox_0.cxx \ NMTDS_IndexRange.cxx \ NMTDS_Iterator.cxx \ - NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors_0.cxx \ - NMTDS_ListIteratorOfListOfPassKey_0.cxx \ + NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors_0.cxx \ + NMTDS_ListIteratorOfListOfPassKey_0.cxx \ NMTDS_ListIteratorOfListOfPassKeyBoolean_0.cxx \ NMTDS_ListNodeOfListOfIndexedDataMapOfShapeAncestorsSuccessors_0.cxx \ NMTDS_ListNodeOfListOfPassKey_0.cxx \ @@ -69,6 +73,8 @@ LIB_SERVER_IDL = # header files EXPORT_HEADERS = \ Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \ + Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \ + Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \ Handle_NMTDS_ListNodeOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx \ Handle_NMTDS_ListNodeOfListOfPassKeyBoolean.hxx \ Handle_NMTDS_ListNodeOfListOfPassKey.hxx \ @@ -76,7 +82,11 @@ EXPORT_HEADERS = \ Handle_NMTDS_StdMapNodeOfMapOfPassKey.hxx \ NMTDS_CArray1OfIndexRange.hxx \ NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \ + NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \ + NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \ NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \ + NMTDS_IndexedDataMapOfIntegerShape.hxx \ + NMTDS_IndexedDataMapOfShapeBox.hxx \ NMTDS_IndexRange.hxx \ NMTDS_Iterator.hxx \ NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx \ @@ -90,7 +100,7 @@ EXPORT_HEADERS = \ NMTDS_ListOfPassKey.hxx \ NMTDS_MapIteratorOfMapOfPassKeyBoolean.hxx \ NMTDS_MapIteratorOfMapOfPassKey.hxx \ - NMTDS_MapOfPassKeyBoolean.hxx \ + NMTDS_MapOfPassKeyBoolean.hxx \ NMTDS_MapOfPassKey.hxx \ NMTDS_PassKeyBoolean.hxx \ NMTDS_PassKey.hxx \ diff --git a/src/NMTDS/NMTDS.cdl b/src/NMTDS/NMTDS.cdl index fed7a96b6..c023fff9e 100644 --- a/src/NMTDS/NMTDS.cdl +++ b/src/NMTDS/NMTDS.cdl @@ -78,4 +78,16 @@ is Map from TCollection(PassKeyBoolean from NMTDS, PassKeyMapHasher from NMTDS); -- Contribution of Samtech www.samcef.com END + + + class IndexedDataMapOfShapeBox + instantiates IndexedDataMap from TCollection (Shape from TopoDS, + Box from Bnd, + ShapeMapHasher from TopTools); + class IndexedDataMapOfIntegerShape + instantiates IndexedDataMap from TCollection (Integer from Standard, + Shape from TopoDS, + MapIntegerHasher from TColStd); + + end NMTDS; diff --git a/src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx b/src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx new file mode 100644 index 000000000..6cc5bacc1 --- /dev/null +++ b/src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx @@ -0,0 +1,132 @@ +// Copyright (C) 2005 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 + +#ifndef _NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile +#define _NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +class TopoDS_Shape; +class TColStd_MapIntegerHasher; +class NMTDS_IndexedDataMapOfIntegerShape; + + + +class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape(const Standard_Integer& K1,const Standard_Integer K2,const TopoDS_Shape& I,const TCollection_MapNodePtr& n1,const TCollection_MapNodePtr& n2); + + Standard_Integer& Key1() const; + + Standard_Integer& Key2() const; + + TCollection_MapNodePtr& Next2() const; + + TopoDS_Shape& Value() const; +//Standard_EXPORT ~NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +Standard_Integer myKey1; +Standard_Integer myKey2; +TopoDS_Shape myValue; +TCollection_MapNodePtr myNext2; + + +}; + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem TopoDS_Shape +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_IndexedDataMapNode NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape +#define TCollection_IndexedDataMapNode_hxx +#define Handle_TCollection_IndexedDataMapNode Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape +#define TCollection_IndexedDataMapNode_Type_() NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_Type_() +#define TCollection_IndexedDataMap NMTDS_IndexedDataMapOfIntegerShape +#define TCollection_IndexedDataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_IndexedDataMapNode +#undef TCollection_IndexedDataMapNode_hxx +#undef Handle_TCollection_IndexedDataMapNode +#undef TCollection_IndexedDataMapNode_Type_ +#undef TCollection_IndexedDataMap +#undef TCollection_IndexedDataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx b/src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx new file mode 100644 index 000000000..3293ddec1 --- /dev/null +++ b/src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx @@ -0,0 +1,95 @@ +// Copyright (C) 2005 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 + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _NMTDS_IndexedDataMapOfIntegerShape_HeaderFile +#include +#endif +//NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape::~NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape() {} + + + +Standard_EXPORT Handle_Standard_Type& NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape", + sizeof(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape) Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape))) { + _anOtherObject = Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)((Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape::DynamicType() const +{ + return STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape) ; +} +//Standard_Boolean NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape::~Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape() {} +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem TopoDS_Shape +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_IndexedDataMapNode NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape +#define TCollection_IndexedDataMapNode_hxx +#define Handle_TCollection_IndexedDataMapNode Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape +#define TCollection_IndexedDataMapNode_Type_() NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_Type_() +#define TCollection_IndexedDataMap NMTDS_IndexedDataMapOfIntegerShape +#define TCollection_IndexedDataMap_hxx +#include + diff --git a/src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx b/src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx new file mode 100644 index 000000000..698204818 --- /dev/null +++ b/src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx @@ -0,0 +1,136 @@ +// Copyright (C) 2005 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 + +#ifndef _NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile +#define _NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile +#include +#endif + +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Bnd_Box_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +class TopoDS_Shape; +class Bnd_Box; +class TopTools_ShapeMapHasher; +class NMTDS_IndexedDataMapOfShapeBox; + + + +class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox(const TopoDS_Shape& K1,const Standard_Integer K2,const Bnd_Box& I,const TCollection_MapNodePtr& n1,const TCollection_MapNodePtr& n2); + + TopoDS_Shape& Key1() const; + + Standard_Integer& Key2() const; + + TCollection_MapNodePtr& Next2() const; + + Bnd_Box& Value() const; +//Standard_EXPORT ~NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TopoDS_Shape myKey1; +Standard_Integer myKey2; +Bnd_Box myValue; +TCollection_MapNodePtr myNext2; + + +}; + +#define TheKey TopoDS_Shape +#define TheKey_hxx +#define TheItem Bnd_Box +#define TheItem_hxx +#define Hasher TopTools_ShapeMapHasher +#define Hasher_hxx +#define TCollection_IndexedDataMapNode NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox +#define TCollection_IndexedDataMapNode_hxx +#define Handle_TCollection_IndexedDataMapNode Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox +#define TCollection_IndexedDataMapNode_Type_() NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_Type_() +#define TCollection_IndexedDataMap NMTDS_IndexedDataMapOfShapeBox +#define TCollection_IndexedDataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_IndexedDataMapNode +#undef TCollection_IndexedDataMapNode_hxx +#undef Handle_TCollection_IndexedDataMapNode +#undef TCollection_IndexedDataMapNode_Type_ +#undef TCollection_IndexedDataMap +#undef TCollection_IndexedDataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_0.cxx b/src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_0.cxx new file mode 100644 index 000000000..75117613b --- /dev/null +++ b/src/NMTDS/NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_0.cxx @@ -0,0 +1,98 @@ +// Copyright (C) 2005 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 + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _Bnd_Box_HeaderFile +#include +#endif +#ifndef _TopTools_ShapeMapHasher_HeaderFile +#include +#endif +#ifndef _NMTDS_IndexedDataMapOfShapeBox_HeaderFile +#include +#endif +//NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox::~NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox() {} + + + +Standard_EXPORT Handle_Standard_Type& NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox", + sizeof(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox) Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox))) { + _anOtherObject = Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)((Handle(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox::DynamicType() const +{ + return STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox) ; +} +//Standard_Boolean NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox::~Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox() {} +#define TheKey TopoDS_Shape +#define TheKey_hxx +#define TheItem Bnd_Box +#define TheItem_hxx +#define Hasher TopTools_ShapeMapHasher +#define Hasher_hxx +#define TCollection_IndexedDataMapNode NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox +#define TCollection_IndexedDataMapNode_hxx +#define Handle_TCollection_IndexedDataMapNode Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox +#define TCollection_IndexedDataMapNode_Type_() NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_Type_() +#define TCollection_IndexedDataMap NMTDS_IndexedDataMapOfShapeBox +#define TCollection_IndexedDataMap_hxx +#include + diff --git a/src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape.hxx b/src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape.hxx new file mode 100644 index 000000000..e9b04d0e5 --- /dev/null +++ b/src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape.hxx @@ -0,0 +1,169 @@ +// Copyright (C) 2005 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 + +#ifndef _NMTDS_IndexedDataMapOfIntegerShape_HeaderFile +#define _NMTDS_IndexedDataMapOfIntegerShape_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_OutOfRange; +class Standard_NoSuchObject; +class TopoDS_Shape; +class TColStd_MapIntegerHasher; +class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class NMTDS_IndexedDataMapOfIntegerShape : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT NMTDS_IndexedDataMapOfIntegerShape(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT NMTDS_IndexedDataMapOfIntegerShape& Assign(const NMTDS_IndexedDataMapOfIntegerShape& Other) ; + NMTDS_IndexedDataMapOfIntegerShape& operator =(const NMTDS_IndexedDataMapOfIntegerShape& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~NMTDS_IndexedDataMapOfIntegerShape() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Integer Add(const Standard_Integer& K,const TopoDS_Shape& I) ; + + +Standard_EXPORT void Substitute(const Standard_Integer I,const Standard_Integer& K,const TopoDS_Shape& T) ; + + +Standard_EXPORT void RemoveLast() ; + + +Standard_EXPORT Standard_Boolean Contains(const Standard_Integer& K) const; + + +Standard_EXPORT const Standard_Integer& FindKey(const Standard_Integer I) const; + + +Standard_EXPORT const TopoDS_Shape& FindFromIndex(const Standard_Integer I) const; + const TopoDS_Shape& operator ()(const Standard_Integer I) const +{ + return FindFromIndex(I); +} + + + +Standard_EXPORT TopoDS_Shape& ChangeFromIndex(const Standard_Integer I) ; + TopoDS_Shape& operator ()(const Standard_Integer I) +{ + return ChangeFromIndex(I); +} + + + +Standard_EXPORT Standard_Integer FindIndex(const Standard_Integer& K) const; + + +Standard_EXPORT const TopoDS_Shape& FindFromKey(const Standard_Integer& K) const; + + +Standard_EXPORT TopoDS_Shape& ChangeFromKey(const Standard_Integer& K) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT NMTDS_IndexedDataMapOfIntegerShape(const NMTDS_IndexedDataMapOfIntegerShape& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape_0.cxx b/src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape_0.cxx new file mode 100644 index 000000000..144b6a844 --- /dev/null +++ b/src/NMTDS/NMTDS_IndexedDataMapOfIntegerShape_0.cxx @@ -0,0 +1,55 @@ +// Copyright (C) 2005 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 + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _TColStd_MapIntegerHasher_HeaderFile +#include +#endif +#ifndef _NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_HeaderFile +#include +#endif + + +#define TheKey Standard_Integer +#define TheKey_hxx +#define TheItem TopoDS_Shape +#define TheItem_hxx +#define Hasher TColStd_MapIntegerHasher +#define Hasher_hxx +#define TCollection_IndexedDataMapNode NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape +#define TCollection_IndexedDataMapNode_hxx +#define Handle_TCollection_IndexedDataMapNode Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape +#define TCollection_IndexedDataMapNode_Type_() NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_Type_() +#define TCollection_IndexedDataMap NMTDS_IndexedDataMapOfIntegerShape +#define TCollection_IndexedDataMap_hxx +#include + diff --git a/src/NMTDS/NMTDS_IndexedDataMapOfShapeBox.hxx b/src/NMTDS/NMTDS_IndexedDataMapOfShapeBox.hxx new file mode 100644 index 000000000..98752296f --- /dev/null +++ b/src/NMTDS/NMTDS_IndexedDataMapOfShapeBox.hxx @@ -0,0 +1,170 @@ +// Copyright (C) 2005 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 + +#ifndef _NMTDS_IndexedDataMapOfShapeBox_HeaderFile +#define _NMTDS_IndexedDataMapOfShapeBox_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_OutOfRange; +class Standard_NoSuchObject; +class TopoDS_Shape; +class Bnd_Box; +class TopTools_ShapeMapHasher; +class NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class NMTDS_IndexedDataMapOfShapeBox : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT NMTDS_IndexedDataMapOfShapeBox(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT NMTDS_IndexedDataMapOfShapeBox& Assign(const NMTDS_IndexedDataMapOfShapeBox& Other) ; + NMTDS_IndexedDataMapOfShapeBox& operator =(const NMTDS_IndexedDataMapOfShapeBox& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~NMTDS_IndexedDataMapOfShapeBox() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Integer Add(const TopoDS_Shape& K,const Bnd_Box& I) ; + + +Standard_EXPORT void Substitute(const Standard_Integer I,const TopoDS_Shape& K,const Bnd_Box& T) ; + + +Standard_EXPORT void RemoveLast() ; + + +Standard_EXPORT Standard_Boolean Contains(const TopoDS_Shape& K) const; + + +Standard_EXPORT const TopoDS_Shape& FindKey(const Standard_Integer I) const; + + +Standard_EXPORT const Bnd_Box& FindFromIndex(const Standard_Integer I) const; + const Bnd_Box& operator ()(const Standard_Integer I) const +{ + return FindFromIndex(I); +} + + + +Standard_EXPORT Bnd_Box& ChangeFromIndex(const Standard_Integer I) ; + Bnd_Box& operator ()(const Standard_Integer I) +{ + return ChangeFromIndex(I); +} + + + +Standard_EXPORT Standard_Integer FindIndex(const TopoDS_Shape& K) const; + + +Standard_EXPORT const Bnd_Box& FindFromKey(const TopoDS_Shape& K) const; + + +Standard_EXPORT Bnd_Box& ChangeFromKey(const TopoDS_Shape& K) ; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT NMTDS_IndexedDataMapOfShapeBox(const NMTDS_IndexedDataMapOfShapeBox& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/NMTDS/NMTDS_IndexedDataMapOfShapeBox_0.cxx b/src/NMTDS/NMTDS_IndexedDataMapOfShapeBox_0.cxx new file mode 100644 index 000000000..53b8ed306 --- /dev/null +++ b/src/NMTDS/NMTDS_IndexedDataMapOfShapeBox_0.cxx @@ -0,0 +1,58 @@ +// Copyright (C) 2005 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 + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_OutOfRange_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _Bnd_Box_HeaderFile +#include +#endif +#ifndef _TopTools_ShapeMapHasher_HeaderFile +#include +#endif +#ifndef _NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_HeaderFile +#include +#endif + + +#define TheKey TopoDS_Shape +#define TheKey_hxx +#define TheItem Bnd_Box +#define TheItem_hxx +#define Hasher TopTools_ShapeMapHasher +#define Hasher_hxx +#define TCollection_IndexedDataMapNode NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox +#define TCollection_IndexedDataMapNode_hxx +#define Handle_TCollection_IndexedDataMapNode Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox +#define TCollection_IndexedDataMapNode_Type_() NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_Type_() +#define TCollection_IndexedDataMap NMTDS_IndexedDataMapOfShapeBox +#define TCollection_IndexedDataMap_hxx +#include + diff --git a/src/NMTDS/NMTDS_Iterator.cdl b/src/NMTDS/NMTDS_Iterator.cdl index 1f6d5a00f..05a026a73 100755 --- a/src/NMTDS/NMTDS_Iterator.cdl +++ b/src/NMTDS/NMTDS_Iterator.cdl @@ -27,7 +27,8 @@ class Iterator from NMTDS ---Purpose: -uses +uses + DataMapOfIntegerListOfInteger from TColStd, ShapeEnum from TopAbs, ShapesDataStructure from NMTDS, PShapesDataStructure from NMTDS, @@ -63,13 +64,20 @@ is Prepare(me:out); ExpectedLength(me) - returns Integer from Standard; + returns Integer from Standard; + SDVertices(me) + returns DataMapOfIntegerListOfInteger from TColStd; + ---C++:return const & + + fields myPDS :PShapesDataStructure from NMTDS is protected; myLists :ListOfPassKeyBoolean from NMTDS [6] is protected; myIterator :ListIteratorOfListOfPassKeyBoolean from NMTDS is protected; myEmptyList:ListOfPassKeyBoolean from NMTDS is protected; myLength :Integer from Standard is protected; - + -- + myMVSD :DataMapOfIntegerListOfInteger from TColStd is protected; + end Iterator; diff --git a/src/NMTDS/NMTDS_Iterator.cxx b/src/NMTDS/NMTDS_Iterator.cxx index 3dd885bd4..1d090e5f3 100755 --- a/src/NMTDS/NMTDS_Iterator.cxx +++ b/src/NMTDS/NMTDS_Iterator.cxx @@ -34,28 +34,30 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include static - Bnd_Box& ComputeBoxEx(const Standard_Integer iX, - NMTDS_ShapesDataStructure* pDS, - Bnd_Box* pBoxes); -static - Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType); + void ComputeBoxEx(const Standard_Integer aIx, + NMTDS_ShapesDataStructure* pDS, + Bnd_Box& aBoxEx); + +static inline + Standard_Boolean IsValidType(const TopAbs_ShapeEnum aT); static Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1, const TopAbs_ShapeEnum aType2); -static - void PropagateState(const Standard_Integer aIDS1, - const Standard_Integer aIDS2, - const Standard_Integer iStatus, - const Standard_Integer aNb, - NMTDS_ShapesDataStructure* pDS, - Standard_Integer *pTable); -static - void FillSuccessors(const Standard_Integer aIDS, - NMTDS_ShapesDataStructure* pDS, - TColStd_MapOfInteger& aMS); + //======================================================================= //function : NMTDS_Iterator @@ -145,20 +147,32 @@ static aWithSubShape=aPKB.Flag(); } //======================================================================= +// function: SDVertices +// purpose: +//======================================================================= + const TColStd_DataMapOfIntegerListOfInteger& NMTDS_Iterator::SDVertices()const +{ + return myMVSD; +} +//======================================================================= // function: Prepare // purpose: //======================================================================= void NMTDS_Iterator::Prepare() { Standard_Boolean bFlag; - Standard_Integer aNb, aNb2, aNbR, iR, jR1, jR2, jR; - Standard_Integer *pTable, i, j, k, iT1, iT2, i1, i2, j1, j2, iT, jT; - Standard_Integer iStatus, iX; - Bnd_Box *pBoxes, aBox; - TColStd_ListIteratorOfListOfInteger aItIT, aItJT; + Standard_Integer aNb, i, aNbB, aNbR;//,iStatus; + Standard_Integer i1, i2, aNbSD, iX, j, iDS, jB, iR, k, aNbLV; + TColStd_ListIteratorOfListOfInteger aIt; + TColStd_DataMapOfIntegerInteger aMII; + TColStd_MapOfInteger aMFence; + TopTools_DataMapOfShapeInteger aMSI; TopAbs_ShapeEnum aTi, aTj; NMTDS_PassKeyBoolean aPKXB; NMTDS_MapOfPassKeyBoolean aMPKXB; + NMTDS_IndexedDataMapOfShapeBox aMSB; + Handle(Bnd_HArray1OfBox) aHAB; + Bnd_BoundSortBox aBSB; // if (myPDS==NULL){ return; @@ -168,230 +182,139 @@ static for (i=0; i<6; ++i) { myLists[i].Clear(); } - // - aNb=myPDS->NumberOfShapesOfTheObject(); - aNb2=aNb*aNb; - // - pTable=new Standard_Integer [aNb2]; - pBoxes=new Bnd_Box [aNb]; - // - // 1. Set status to Unknown - for (i=0; iRanges(); aNbR=aRanges.Extent(); - for (iR=1; iR<=aNbR; ++iR) { - const NMTDS_IndexRange& aRange=aRanges(iR); - jR1=aRange.First(); - jR2=aRange.Last(); - for (i=jR1; i<=jR2; ++i) { - for (j=i; j<=jR2; ++j) { - k=(i-1)*aNb+(j-1); - pTable[k]=4; //SameRange - } + // + aNb=myPDS->NumberOfShapesOfTheObject(); + for (i=1; i<=aNb; ++i) { + const TopoDS_Shape& aS=myPDS->Shape(i); + aTi=aS.ShapeType(); + if (IsValidType(aTi)) { + Bnd_Box aBoxEx; // - ComputeBoxEx(i, myPDS, pBoxes); + ComputeBoxEx(i, myPDS, aBoxEx); + aMSI.Bind(aS, i); + aMSB.Add(aS, aBoxEx); } } // - // 3. Intersect shapes by ranges - iT1=TypeToInteger(TopAbs_COMPOUND); - iT2=TypeToInteger(TopAbs_VERTEX); + aNbB=aMSB.Extent(); + aHAB=new Bnd_HArray1OfBox(1, aNbB+1); // - for (iR=1; iRSetValue(aNbB+1, aBoxX); + } + // + for (i=1; i<=aNbB; ++i) { + const TopoDS_Shape& aS=aMSB.FindKey(i); + const Bnd_Box& aBoxEx=aMSB(i); // - const NMTDS_IndexRange& aRi=aRanges(iR); - i1=aRi.First(); - i2=aRi.Last(); - for (i=i1; i<=i2; ++i) { - aALIR(TypeToInteger(myPDS->GetShapeType(i))).Append(i); - } + aHAB->SetValue(i, aBoxEx); // - for (jR=2; jR<=aNbR; ++jR) { - const NMTDS_IndexRange& aRj=aRanges(jR); - j1=aRj.First(); - j2=aRj.Last(); - for (j=j1; j<=j2; ++j) { - aALJR(TypeToInteger(myPDS->GetShapeType(j))).Append(j); + iDS=aMSI.Find(aS); + aMII.Bind(i, iDS); + } + // + aBSB.Initialize(aHAB); + // + for (iR=1; iRShape(i); + aTi=aSi.ShapeType(); + if (!IsValidType(aTi)){ + continue; } - } - // - for (iT=iT1; iT<=iT2; ++iT) { - const TColStd_ListOfInteger& aLIT=aALIR(iT); - if (aLIT.IsEmpty()) { + const Bnd_Box& aBoxEx=aMSB.FindFromKey(aSi); + // + const TColStd_ListOfInteger& aLI=aBSB.Compare(aBoxEx); + // + aNbSD=aLI.Extent(); + if (aNbSD<2){ continue; } - for (jT=iT1; jT<=iT2; ++jT) { - const TColStd_ListOfInteger& aLJT=aALJR(jT); - if (aLJT.IsEmpty()) { - continue; + // + k=0; + TColStd_ListOfInteger aLV; + // + aIt.Initialize(aLI); + for (; aIt.More(); aIt.Next()) { + jB=aIt.Value(); // box index in MII + j=aMII.Find(jB); // DS index + if (j>=i1 && j<=i2) { + continue;// same range } // - aItIT.Initialize(aLIT); - for (; aItIT.More(); aItIT.Next()) { - aItJT.Initialize(aLJT); - for (; aItJT.More(); aItJT.Next()) { - i1=aItIT.Value(); - j1=aItJT.Value(); - if (i1>j1) { - iX=i1; - i1=j1; - j1=iX; - } - // - i=i1-1; - j=j1-1; - k=i*aNb+j; - // - if (pTable[k]!=0 && pTable[k]!=2) { - continue; + aPKXB.SetIds(i, j); + if (aMPKXB.Add(aPKXB)) { + bFlag=Standard_False;// Bounding boxes are intersected + const Bnd_Box& aBoxi=myPDS->GetBoundingBox(i); + const Bnd_Box& aBoxj=myPDS->GetBoundingBox(j); + if (aBoxi.IsOut(aBoxj)) { + bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected + } + const TopoDS_Shape& aSj=myPDS->Shape(j); + aTj=aSj.ShapeType(); + iX=TypeToInteger(aTi, aTj); + //bFlag=(iStatus==2); + aPKXB.SetFlag(bFlag); + myLists[iX].Append(aPKXB); + // + // VSD prepare + if (iX==5) { //VV + if (aMFence.Add(j)) { + aLV.Append(j); } - // enlarged boxes - const Bnd_Box& aBoxEi=pBoxes[i]; - const Bnd_Box& aBoxEj=pBoxes[j]; - if (aBoxEi.IsOut(aBoxEj)) { - iStatus=3; // Non-intersected - PropagateState(i1, j1, iStatus, aNb, myPDS, pTable); - } - else { - iStatus=1; // Bounding boxes are intersected - const Bnd_Box& aBoxi=myPDS->GetBoundingBox(i1); - const Bnd_Box& aBoxj=myPDS->GetBoundingBox(j1); - if (aBoxi.IsOut(aBoxj)) { - iStatus=2; // Bounding boxes of Sub-shapes are intersected - } - pTable[k]=iStatus; - // - aTi=myPDS->GetShapeType(i1); - aTj=myPDS->GetShapeType(j1); - iX=TypeToInteger(aTi, aTj); - // - if (iX>=0) { - aPKXB.SetIds(i1, j1); - if (aMPKXB.Add(aPKXB)) { - bFlag=Standard_False; - if(iStatus==2) { - bFlag=!bFlag; - } - aPKXB.SetFlag(bFlag); - myLists[iX].Append(aPKXB); - } - }//if (iX>=0) { - }// else { - }//for (; aItJT.More(); aItJT.Next()) { - }//for (; aItIT.More(); aItIT.Next()) { - }//for (jT=iT1; jT<=iT2; ++jT) { - }//for (iT=iT1; iT<=iT2; ++iT) { - } - // - // - delete [] (Bnd_Box*)pBoxes; - delete [] (Standard_Integer*)pTable; -} -//======================================================================= -// function: PropagateState -// purpose: -//======================================================================= -void PropagateState(const Standard_Integer aIDS1, - const Standard_Integer aIDS2, - const Standard_Integer iStatus, - const Standard_Integer aNb, - NMTDS_ShapesDataStructure* pDS, - Standard_Integer *pTable) -{ - Standard_Integer i, j, k, i1, j1, iX, i11, j11; - TColStd_MapOfInteger aMS1, aMS2; - TColStd_MapIteratorOfMapOfInteger aIt1, aIt2; - // - FillSuccessors(aIDS1, pDS, aMS1); - FillSuccessors(aIDS2, pDS, aMS2); - // - aIt1.Initialize(aMS1); - for (; aIt1.More(); aIt1.Next()) { - i1=aIt1.Key(); - // - aIt2.Initialize(aMS2); - for (; aIt2.More(); aIt2.Next()) { - j1=aIt2.Key(); - // - i11=i1; - j11=j1; + } + }// if (aMPKXB.Add(aPKXB)) { + }// for (; aIt.More(); aIt.Next()) { // - if (i1>j1) { - iX=i11; - i11=j11; - j11=iX; + // VSD treatment + aNbLV=aLV.Extent(); + if (aNbLV) { + myMVSD.Bind(i, aLV); } - i=i11-1; - j=j11-1; - k=i*aNb+j; - if (!pTable[k]) { - pTable[k]=iStatus; - } - } - } + }//for (i=i1; i<=i2; ++i) { + }//for (iR=1; iRNumberOfSuccessors(aIDS); - for (i=1; i<=aNbS; ++i) { - iDS1=pDS->GetSuccessor(aIDS, i); - FillSuccessors(iDS1, pDS, aMS); - } + return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE); } //======================================================================= // function: ComputeBoxEx // purpose: //======================================================================= -Bnd_Box& ComputeBoxEx(const Standard_Integer aIndexDS, - NMTDS_ShapesDataStructure* pDS, - Bnd_Box* pBoxes) + void ComputeBoxEx(const Standard_Integer aIx, + NMTDS_ShapesDataStructure* pDS, + Bnd_Box& aBoxEx) { - Standard_Boolean bIsVoid; - Standard_Integer iX; + Standard_Integer i, aNbS, iS; // - iX=aIndexDS-1; - Bnd_Box& aBoxEx=pBoxes[iX]; + const Bnd_Box& aBox=pDS->GetBoundingBox(aIx); + aBoxEx.Add(aBox); // - bIsVoid=aBoxEx.IsVoid(); - if (bIsVoid) { - Standard_Integer i, aNb, iS; - // - const Bnd_Box& aBox=pDS->GetBoundingBox(aIndexDS); - aBoxEx.Add(aBox); - // - aNb=pDS->NumberOfSuccessors(aIndexDS); - for (i=1; i<=aNb; ++i) { - iS=pDS->GetSuccessor(aIndexDS, i); - Bnd_Box& aBoxS=ComputeBoxEx(iS, pDS, pBoxes); - aBoxEx.Add(aBoxS); - } + aNbS=pDS->NumberOfSuccessors(aIx); + for (i=1; i<=aNbS; ++i) { + Bnd_Box aBoxS; + iS=pDS->GetSuccessor(aIx, i); + ComputeBoxEx(iS, pDS, aBoxS); + aBoxEx.Add(aBoxS); } - return aBoxEx; -} -//======================================================================= -// function: TypeToInteger -// purpose: -//======================================================================= -Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType) -{ - return (Standard_Integer)aType; } + //======================================================================= // function: TypeToInteger // purpose: @@ -435,12 +358,33 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1, } /* - printf(" *** pTable ***\n"); - for (i=0; i #endif +#ifndef _TColStd_DataMapOfIntegerListOfInteger_HeaderFile +#include +#endif #ifndef _TopAbs_ShapeEnum_HeaderFile #include #endif @@ -39,6 +42,7 @@ #include #endif class NMTDS_ShapesDataStructure; +class TColStd_DataMapOfIntegerListOfInteger; #ifndef _Standard_HeaderFile @@ -97,6 +101,9 @@ Standard_EXPORT void Prepare() ; Standard_EXPORT Standard_Integer ExpectedLength() const; +Standard_EXPORT const TColStd_DataMapOfIntegerListOfInteger& SDVertices() const; + + @@ -113,6 +120,7 @@ NMTDS_ListOfPassKeyBoolean myLists[6]; NMTDS_ListIteratorOfListOfPassKeyBoolean myIterator; NMTDS_ListOfPassKeyBoolean myEmptyList; Standard_Integer myLength; +TColStd_DataMapOfIntegerListOfInteger myMVSD; private: diff --git a/src/NMTDS/NMTDS_Iterator.jxx b/src/NMTDS/NMTDS_Iterator.jxx index dfe46d0cb..4a0e4fb7c 100644 --- a/src/NMTDS/NMTDS_Iterator.jxx +++ b/src/NMTDS/NMTDS_Iterator.jxx @@ -20,6 +20,9 @@ #ifndef _NMTDS_ShapesDataStructure_HeaderFile #include #endif +#ifndef _TColStd_DataMapOfIntegerListOfInteger_HeaderFile +#include +#endif #ifndef _NMTDS_Iterator_HeaderFile #include #endif diff --git a/src/NMTTools/Makefile.in b/src/NMTTools/Makefile.in index e65fb99f8..02e38dd35 100644 --- a/src/NMTTools/Makefile.in +++ b/src/NMTTools/Makefile.in @@ -75,11 +75,14 @@ LIB_SERVER_IDL = # header files EXPORT_HEADERS = \ + Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \ + Handle_NMTDS_ListNodeOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx \ Handle_NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger.hxx \ Handle_NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape.hxx \ Handle_NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock.hxx \ Handle_NMTTools_ListNodeOfListOfCommonBlock.hxx \ Handle_NMTTools_ListNodeOfListOfCoupleOfShape.hxx \ + NMTDS_Iterator.hxx \ NMTTools_CommonBlockAPI.hxx \ NMTTools_CommonBlock.hxx \ NMTTools_CommonBlockPool.hxx \ diff --git a/src/NMTTools/NMTTools_PaveFiller.cdl b/src/NMTTools/NMTTools_PaveFiller.cdl index fa2cda76e..3cee74a1a 100644 --- a/src/NMTTools/NMTTools_PaveFiller.cdl +++ b/src/NMTTools/NMTTools_PaveFiller.cdl @@ -31,7 +31,8 @@ uses -- Modified to add new definitions Thu Sep 14 14:35:18 2006 -- Contribution of Samtech www.samcef.com BEGIN ListOfInteger from TColStd, - -- Contribution of Samtech www.samcef.com END + -- Contribution of Samtech www.samcef.com END + DataMapOfIntegerInteger from TColStd, Pnt from gp, ShapeEnum from TopAbs, Vertex from TopoDS, @@ -518,5 +519,8 @@ fields -- myContext : Context from IntTools is protected; mySectionAttribute : SSIntersectionAttribute from BOPTools is protected; - myAloneVertices : IndexedDataMapOfIndexedMapOfInteger from NMTTools is protected; + myAloneVertices : IndexedDataMapOfIndexedMapOfInteger from NMTTools is protected; + -- + myVSD : DataMapOfIntegerInteger from TColStd is protected; + -- end PaveFiller; diff --git a/src/NMTTools/NMTTools_PaveFiller.cxx b/src/NMTTools/NMTTools_PaveFiller.cxx index a76309d07..9c76d8910 100644 --- a/src/NMTTools/NMTTools_PaveFiller.cxx +++ b/src/NMTTools/NMTTools_PaveFiller.cxx @@ -27,7 +27,7 @@ #include #include #include -// + // //======================================================================= // function: NMTTools_PaveFiller::NMTTools_PaveFiller @@ -192,7 +192,9 @@ // // 2.VE myPavePool.Resize (myNbEdges); + PrepareEdges(); + PerformVE(); // // 3.VF @@ -215,12 +217,15 @@ // // 5.EF PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE); + PerformEF(); // RefinePavePool(); // myPavePoolNew.Destroy(); + MakeSplitEdges(); + UpdateCommonBlocks(); // // 6. FF diff --git a/src/NMTTools/NMTTools_PaveFiller.hxx b/src/NMTTools/NMTTools_PaveFiller.hxx index 116583078..ab479896e 100644 --- a/src/NMTTools/NMTTools_PaveFiller.hxx +++ b/src/NMTTools/NMTTools_PaveFiller.hxx @@ -53,6 +53,9 @@ #ifndef _NMTTools_IndexedDataMapOfIndexedMapOfInteger_HeaderFile #include #endif +#ifndef _TColStd_DataMapOfIntegerInteger_HeaderFile +#include +#endif #ifndef _TopAbs_ShapeEnum_HeaderFile #include #endif @@ -402,6 +405,7 @@ BOPTools_SplitShapesPool mySplitShapesPool; IntTools_Context myContext; BOPTools_SSIntersectionAttribute mySectionAttribute; NMTTools_IndexedDataMapOfIndexedMapOfInteger myAloneVertices; +TColStd_DataMapOfIntegerInteger myVSD; private: diff --git a/src/NMTTools/NMTTools_PaveFiller_1.cxx b/src/NMTTools/NMTTools_PaveFiller_1.cxx index fbb035ef0..086e395f6 100644 --- a/src/NMTTools/NMTTools_PaveFiller_1.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_1.cxx @@ -1,18 +1,18 @@ // Copyright (C) 2005 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 +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com @@ -21,12 +21,13 @@ // Created: Mon Dec 8 11:47:55 2003 // Author: Peter KURNEV // - - #include -#include - +#include +#include +#include +#include + #include #include #include @@ -38,12 +39,10 @@ #include #include #include -#include #include #include -#include - + //======================================================================= // function: PerformVV // purpose: @@ -52,8 +51,15 @@ { myIsDone=Standard_False; // - Standard_Integer n1, n2,anIndexIn, aFlag, aWhat, aWith, aNbVVs, aBlockLength; - Standard_Boolean bJustAddInterference; + Standard_Integer anIndexIn, aWhat, aWith, aNbVVs, aBlockLength, aNbVSD; + Standard_Integer nVnew; + TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1; + TColStd_ListIteratorOfListOfInteger aIt; + TopTools_ListOfShape aLV; + TopoDS_Vertex aVnew; + TopoDS_Shape aS; + // + myVSD.Clear(); // BOPTools_CArray1OfVVInterference& aVVs=myIntrPool->VVInterferences(); // @@ -64,41 +70,51 @@ aVVs.SetBlockLength(aNbVVs); } // - // V/V BooleanOperations_VertexVertex - myDSIt.Initialize(TopAbs_VERTEX, TopAbs_VERTEX); + const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt.SDVertices(); + aNbVSD=aMVSD.Extent(); + if (!aNbVSD) { + return; + } // - for (; myDSIt.More(); myDSIt.Next()) { - myDSIt.Current(n1, n2, bJustAddInterference); + aIt1.Initialize(aMVSD); + for (; aIt1.More(); aIt1.Next()) { + aLV.Clear(); // - if (!myIntrPool->IsComputed(n1, n2)) { - anIndexIn=0; - aWhat=n1; - aWith=n2; - SortTypes(aWhat, aWith); - // - if (!bJustAddInterference) { - const TopoDS_Shape aS1=myDS->GetShape(aWhat);//mpv - const TopoDS_Shape aS2=myDS->GetShape(aWith);//mpv - // - // Modified Thu Sep 14 14:35:18 2006 - // Contribution of Samtech www.samcef.com BEGIN - if (aS1.IsSame(aS2)) { - continue; - } - // Contribution of Samtech www.samcef.com END - // - const TopoDS_Vertex& aV1=TopoDS::Vertex(aS1); - const TopoDS_Vertex& aV2=TopoDS::Vertex(aS2); - aFlag=IntTools_Tools::ComputeVV (aV1, aV2); - // - if (!aFlag) { - BOPTools_VVInterference anInterf (aWhat, aWith); - anIndexIn=aVVs.Append(anInterf); - } - } + aWhat=aIt1.Key(); + const TColStd_ListOfInteger& aLIV=aIt1.Value(); + // + // new vertex + aIt.Initialize(aLIV); + for (; aIt.More(); aIt.Next()) { + aWith=aIt.Value(); + aS=myDS->Shape(aWith); + aLV.Append(aS); + } + aS=myDS->Shape(aWhat); + aLV.Append(aS); + // + NMTTools_Tools::MakeNewVertex(aLV, aVnew); + // + BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq; + // + myDS->InsertShapeAndAncestorsSuccessors(aVnew, anASSeq); + nVnew=myDS->NumberOfInsertedShapes(); + myDS->SetState (nVnew, BooleanOperations_ON); + // + // interferences + aIt.Initialize(aLIV); + for (; aIt.More(); aIt.Next()) { + aWith=aIt.Value(); + BOPTools_VVInterference aVV(aWhat, aWith); + aVV.SetNewShape(nVnew); + anIndexIn=aVVs.Append(aVV); myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexVertex, anIndexIn); + // + // to find SD-Vertices + myVSD.Bind(aWith, nVnew); } - } + myVSD.Bind(aWhat, nVnew); + }//for (; aIt1.More(); aIt1.Next()) { myIsDone=Standard_True; } //======================================================================= @@ -107,89 +123,18 @@ //======================================================================= void NMTTools_PaveFiller::PerformNewVertices() { - myIsDone=Standard_False; - // - Standard_Integer i, aNb, anIndex1, anIndex2, aNewShape; - TopoDS_Vertex aNewVertex; - BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq; - // - Standard_Integer aNbChains, j, aNbV, aIdV, aNbL; - TColStd_IndexedMapOfInteger aMapWhole; - BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger aMapChains;//aMCV - TopTools_ListOfShape aLV; - TopTools_IndexedMapOfShape aM; - // - // 1. VV Interferences - BOPTools_CArray1OfVVInterference& VVs=myIntrPool->VVInterferences(); - // - NMTTools_Tools::FindChains(VVs, aMapChains); - // - aNbChains=aMapChains.Extent(); - for (i=1; i<=aNbChains; ++i) { - const TColStd_IndexedMapOfInteger& aChain=aMapChains(i); - // - aM.Clear(); - aLV.Clear(); - aNbV=aChain.Extent(); - for (j=1; j<=aNbV; ++j) { - aIdV=aChain(j); - const TopoDS_Shape aV=myDS->Shape(aIdV);//mpv - if (!aM.Contains(aV)) { - aM.Add(aV); - aLV.Append(aV); - } - } - // - aNbL=aLV.Extent(); - if (aNbL==1){ - aNewShape=aChain(1); - } - else if (aNbL>1) { - // - // Make new Vertex - NMTTools_Tools::MakeNewVertex(aLV, aNewVertex); - // Insert New Vertex in DS; - // aNewShape is # of DS-line, where aNewVertex is kept - myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq); - aNewShape=myDS->NumberOfInsertedShapes(); - // - // State of New Vertex is ON - myDS->SetState (aNewShape, BooleanOperations_ON); - } - // - // Insert New Vertex in Interference - aNb=VVs.Extent(); - for (j=1; j<=aNb; ++j) { - BOPTools_VVInterference& VV=VVs(j); - anIndex1=VV.Index1(); - anIndex2=VV.Index2(); - if (aChain.Contains(anIndex1) || aChain.Contains(anIndex2)) { - VV.SetNewShape(aNewShape); - } - } - } - myIsDone=Standard_True; } - //======================================================================= // function: FindSDVertex // purpose: //======================================================================= Standard_Integer NMTTools_PaveFiller::FindSDVertex(const Standard_Integer nV)const { - Standard_Integer i, aNb, anIndex1, anIndex2, aNewShape=0; - - BOPTools_CArray1OfVVInterference& VVs=myIntrPool->VVInterferences(); - aNb=VVs.Extent(); - - for (i=1; i<=aNb; i++) { - const BOPTools_VVInterference& VV=VVs(i); - anIndex1=VV.Index1(); - anIndex2=VV.Index2(); - if (nV==anIndex1 || nV==anIndex2) { - aNewShape=VV.NewShape(); - return aNewShape; - } + Standard_Integer nVSD; + // + nVSD=0; + if (myVSD.IsBound(nV)) { + nVSD=myVSD.Find(nV); } - return aNewShape; + return nVSD; }