From: jfa Date: Fri, 16 Dec 2011 13:32:32 +0000 (+0000) Subject: Mantis issue 0021404: Problem with partition. A fix by Peter Kurnev. X-Git-Tag: V6_5_0a1~113 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f85d1e4bf52199da8da37c62a9030244e2fd53a5;p=modules%2Fgeom.git Mantis issue 0021404: Problem with partition. A fix by Peter Kurnev. --- diff --git a/src/GEOMAlgo/GEOMAlgo_Builder_2.cxx b/src/GEOMAlgo/GEOMAlgo_Builder_2.cxx index e0ded7c48..9818ad60e 100755 --- a/src/GEOMAlgo/GEOMAlgo_Builder_2.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Builder_2.cxx @@ -19,7 +19,6 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - // File: GEOMAlgo_Builder_2.cxx // Author: Peter KURNEV @@ -107,7 +106,7 @@ static //function : FillImagesFaces //purpose : //======================================================================= - void GEOMAlgo_Builder::FillImagesFaces() +void GEOMAlgo_Builder::FillImagesFaces() { myErrorStatus=0; // @@ -122,7 +121,7 @@ static // function: FillIn2DParts // purpose: //======================================================================= - void GEOMAlgo_Builder::FillIn2DParts() +void GEOMAlgo_Builder::FillIn2DParts() { const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); NMTTools_PaveFiller* pPF=myPaveFiller; @@ -155,7 +154,6 @@ static aLSpIn.Clear(); // // 1. In Parts - //modified by NIZNHY-PKV Fri Oct 14 13:58:00 2011f BOPTools_ListOfPaveBlock aLPBIn; // pPF->RealSplitsInFace(nF, aLPBIn); @@ -167,24 +165,6 @@ static const TopoDS_Shape& aSpIn=aDS.Shape(nSpIn); aLSpIn.Append(aSpIn); } - /* - for (j=1; j<=aNbCBP; ++j) { - NMTTools_ListOfCommonBlock& aLCB=aCBP(j); - aItCB.Initialize(aLCB); - for (; aItCB.More(); aItCB.Next()) { - NMTTools_CommonBlock& aCB=aItCB.Value(); - if (aCB.IsPaveBlockOnFace(nF)) { - const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(); - nSpIn=aPB1.Edge(); - const TopoDS_Shape& aSpIn=aDS.Shape(nSpIn); - if (aMFence.Add(aSpIn)){ - aLSpIn.Append(aSpIn); - } - } - } - } - */ - //modified by NIZNHY-PKV Fri Oct 14 13:58:08 2011t // // 2. Section Parts for (j=1; j<=aNbFFs; ++j) { @@ -222,7 +202,7 @@ static // function: BuildSplitFaces // purpose: //======================================================================= - void GEOMAlgo_Builder::BuildSplitFaces() +void GEOMAlgo_Builder::BuildSplitFaces() { const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); NMTTools_PaveFiller* pPF=myPaveFiller; @@ -426,7 +406,7 @@ static // function: FillSameDomainFaces // purpose: //======================================================================= - void GEOMAlgo_Builder::FillSameDomainFaces() +void GEOMAlgo_Builder::FillSameDomainFaces() { Standard_Boolean bIsSDF, bHasImage1, bHasImage2, bForward; Standard_Integer i, j, aNbFF, nF1, nF2, aNbPBInOn, aNbC, aNbSE; @@ -603,7 +583,6 @@ static // NMTTools_Tools::FindChains(aLCS, aMC); // - //modified by NIZNHY-PKV Wed Oct 12 13:33:59 2011f Standard_Boolean bIsImage; Standard_Integer aIx, aIxMin, aNbMSDF, k, aNbMFj; TopoDS_Shape aFOld, aFSDmin; @@ -624,15 +603,12 @@ static } } // - //modified by NIZNHY-PKV Wed Oct 12 13:34:01 2011t - // // 3. Fill the map of SDF mySameDomainFaces aNbC=aMC.Extent(); for (i=1; i<=aNbC; ++i) { // const TopoDS_Shape& aF=aMC.FindKey(i); const TopTools_IndexedMapOfShape& aMSDF=aMC(i); // - //modified by NIZNHY-PKV Wed Oct 12 13:25:16 2011f aNbMSDF=aMSDF.Extent(); for (j=1; j<=aNbMSDF; ++j) { const TopoDS_Shape& aFSD=aMSDF(j); @@ -660,14 +636,6 @@ static const TopoDS_Shape& aFSD=aMSDF(j); mySameDomainShapes.Add(aFSD, aFSDmin); } - /* - aNbFF=aMSDF.Extent(); - for (j=1; j<=aNbFF; ++j) { - const TopoDS_Shape& aFSD=aMSDF(j); - mySameDomainShapes.Add(aFSD, aF); - } - */ - //modified by NIZNHY-PKV Wed Oct 12 13:25:18 2011t } // } @@ -676,7 +644,7 @@ static // function: FillImagesFaces1 // purpose: //======================================================================= - void GEOMAlgo_Builder::FillImagesFaces1() +void GEOMAlgo_Builder::FillImagesFaces1() { Standard_Integer i, aNb, iSense, aNbLFx; TopoDS_Face aF, aFSp, aFSD; @@ -734,14 +702,13 @@ static // function: FillInternalVertices // purpose: //======================================================================= - void GEOMAlgo_Builder::FillInternalVertices() +void GEOMAlgo_Builder::FillInternalVertices() { const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); NMTTools_PaveFiller* pPF=myPaveFiller; NMTDS_InterfPool* pIP=pPF->IP(); IntTools_Context& aCtx= pPF->ChangeContext(); // - /*BOPTools_CArray1OfSSInterference& aFFs=*/pIP->SSInterferences(); BOPTools_CArray1OfVSInterference& aVFs=pIP->VSInterferences(); BOPTools_CArray1OfESInterference& aEFs=pIP->ESInterferences(); const NMTTools_IndexedDataMapOfIndexedMapOfInteger& aMAV=pPF->AloneVertices(); diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx index 4a24fd2c4..5007e4835 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx @@ -39,9 +39,11 @@ #include #include #include -#include +//#include +#include #include -#include +//#include +#include #include @@ -1376,14 +1378,17 @@ bool GEOMImpl_IMeasureOperations::CheckSelfIntersections // 3. Get the pairs of interfered shapes NMTDS_PInterfPool pIP = aCSI.IP(); - const NMTDS_ListOfPassKeyBoolean& aLPKB = pIP->Get(); + //const NMTDS_ListOfPassKeyBoolean& aLPKB = pIP->Get(); + const NMTDS_ListOfPairBoolean& aLPKB = pIP->Get(); Standard_Integer n1, n2; - NMTDS_ListIteratorOfListOfPassKeyBoolean aIt; + //NMTDS_ListIteratorOfListOfPassKeyBoolean aIt; + NMTDS_ListIteratorOfListOfPairBoolean aIt; aIt.Initialize(aLPKB); for (; aIt.More(); aIt.Next()) { - const NMTDS_PassKeyBoolean& aPKB = aIt.Value(); + //const NMTDS_PassKeyBoolean& aPKB = aIt.Value(); + const NMTDS_PairBoolean& aPKB = aIt.Value(); aPKB.Ids(n1, n2); if (n1 > aNbS || n2 > aNbS) diff --git a/src/NMTDS/Handle_NMTDS_ListNodeOfListOfPair.hxx b/src/NMTDS/Handle_NMTDS_ListNodeOfListOfPair.hxx new file mode 100644 index 000000000..39d49e534 --- /dev/null +++ b/src/NMTDS/Handle_NMTDS_ListNodeOfListOfPair.hxx @@ -0,0 +1,43 @@ +// 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 + +#ifndef _Handle_NMTDS_ListNodeOfListOfPair_HeaderFile +#define _Handle_NMTDS_ListNodeOfListOfPair_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_DefineHandle_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle(Standard_Type); +class Handle(TCollection_MapNode); +class NMTDS_ListNodeOfListOfPair; + +DEFINE_STANDARD_HANDLE(NMTDS_ListNodeOfListOfPair,TCollection_MapNode) + +#endif diff --git a/src/NMTDS/Handle_NMTDS_ListNodeOfListOfPairBoolean.hxx b/src/NMTDS/Handle_NMTDS_ListNodeOfListOfPairBoolean.hxx new file mode 100644 index 000000000..bf4025362 --- /dev/null +++ b/src/NMTDS/Handle_NMTDS_ListNodeOfListOfPairBoolean.hxx @@ -0,0 +1,43 @@ +// 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 + +#ifndef _Handle_NMTDS_ListNodeOfListOfPairBoolean_HeaderFile +#define _Handle_NMTDS_ListNodeOfListOfPairBoolean_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_DefineHandle_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle(Standard_Type); +class Handle(TCollection_MapNode); +class NMTDS_ListNodeOfListOfPairBoolean; + +DEFINE_STANDARD_HANDLE(NMTDS_ListNodeOfListOfPairBoolean,TCollection_MapNode) + +#endif diff --git a/src/NMTDS/Handle_NMTDS_StdMapNodeOfMapOfPairBoolean.hxx b/src/NMTDS/Handle_NMTDS_StdMapNodeOfMapOfPairBoolean.hxx new file mode 100644 index 000000000..84112e209 --- /dev/null +++ b/src/NMTDS/Handle_NMTDS_StdMapNodeOfMapOfPairBoolean.hxx @@ -0,0 +1,43 @@ +// 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 + +#ifndef _Handle_NMTDS_StdMapNodeOfMapOfPairBoolean_HeaderFile +#define _Handle_NMTDS_StdMapNodeOfMapOfPairBoolean_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_DefineHandle_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle(Standard_Type); +class Handle(TCollection_MapNode); +class NMTDS_StdMapNodeOfMapOfPairBoolean; + +DEFINE_STANDARD_HANDLE(NMTDS_StdMapNodeOfMapOfPairBoolean,TCollection_MapNode) + +#endif diff --git a/src/NMTDS/Makefile.am b/src/NMTDS/Makefile.am index d18b37a1a..ecef7e050 100644 --- a/src/NMTDS/Makefile.am +++ b/src/NMTDS/Makefile.am @@ -15,15 +15,13 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# # GEOM NMTAlgo : partition algorithm # File : Makefile.in # Author : Julia DOROVSKIKH # Modified by : Alexander BORODIN (OCN) - autotools usage # Module : GEOM -# $Header$ -# + include $(top_srcdir)/adm_local/unix/make_common_starter.am # header files @@ -33,6 +31,9 @@ salomeinclude_HEADERS = \ Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \ Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \ Handle_NMTDS_ListNodeOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx \ + Handle_NMTDS_ListNodeOfListOfPair.hxx \ + Handle_NMTDS_ListNodeOfListOfPairBoolean.hxx \ + Handle_NMTDS_StdMapNodeOfMapOfPairBoolean.hxx \ Handle_NMTDS_ListNodeOfListOfPassKeyBoolean.hxx \ Handle_NMTDS_ListNodeOfListOfPassKey.hxx \ Handle_NMTDS_StdMapNodeOfMapOfPassKeyBoolean.hxx \ @@ -64,6 +65,24 @@ salomeinclude_HEADERS = \ NMTDS_IteratorCheckerSI.ixx \ NMTDS_IteratorCheckerSI.jxx \ NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx \ + NMTDS_ListIteratorOfListOfPair.hxx \ + NMTDS_ListIteratorOfListOfPairBoolean.hxx \ + NMTDS_ListNodeOfListOfPair.hxx \ + NMTDS_ListNodeOfListOfPairBoolean.hxx \ + NMTDS_ListOfPair.hxx \ + NMTDS_ListOfPairBoolean.hxx \ + NMTDS_MapIteratorOfMapOfPairBoolean.hxx \ + NMTDS_MapOfPairBoolean.hxx \ + NMTDS_Pair.hxx \ + NMTDS_Pair.ixx \ + NMTDS_Pair.jxx \ + NMTDS_PairBoolean.hxx \ + NMTDS_PairBoolean.ixx \ + NMTDS_PairBoolean.jxx \ + NMTDS_PairMapHasher.hxx \ + NMTDS_PairMapHasher.ixx \ + NMTDS_PairMapHasher.jxx \ + NMTDS_StdMapNodeOfMapOfPairBoolean.hxx \ NMTDS_ListIteratorOfListOfPassKeyBoolean.hxx \ NMTDS_ListIteratorOfListOfPassKey.hxx \ NMTDS_ListNodeOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx \ @@ -130,6 +149,18 @@ dist_libNMTDS_la_SOURCES = \ NMTDS_Iterator.cxx \ NMTDS_IteratorCheckerSI.cxx \ NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors_0.cxx \ + NMTDS_ListIteratorOfListOfPairBoolean_0.cxx \ + NMTDS_ListIteratorOfListOfPair_0.cxx \ + NMTDS_ListNodeOfListOfPairBoolean_0.cxx \ + NMTDS_ListNodeOfListOfPair_0.cxx \ + NMTDS_ListOfPairBoolean_0.cxx \ + NMTDS_ListOfPair_0.cxx \ + NMTDS_MapIteratorOfMapOfPairBoolean_0.cxx \ + NMTDS_MapOfPairBoolean_0.cxx \ + NMTDS_Pair.cxx \ + NMTDS_PairBoolean.cxx \ + NMTDS_PairMapHasher.cxx \ + NMTDS_StdMapNodeOfMapOfPairBoolean_0.cxx \ NMTDS_ListIteratorOfListOfPassKey_0.cxx \ NMTDS_ListIteratorOfListOfPassKeyBoolean_0.cxx \ NMTDS_ListNodeOfListOfIndexedDataMapOfShapeAncestorsSuccessors_0.cxx \ @@ -173,6 +204,9 @@ CDL_FILES = \ NMTDS_InterfPool.cdl \ NMTDS_Iterator.cdl \ NMTDS_IteratorCheckerSI.cdl \ + NMTDS_Pair.cdl \ + NMTDS_PairBoolean.cdl \ + NMTDS_PairMapHasher.cdl \ NMTDS_PassKey.cdl \ NMTDS_PassKeyBoolean.cdl \ NMTDS_PassKeyMapHasher.cdl \ diff --git a/src/NMTDS/NMTDS.cdl b/src/NMTDS/NMTDS.cdl index b8f92d8d4..8e678d405 100644 --- a/src/NMTDS/NMTDS.cdl +++ b/src/NMTDS/NMTDS.cdl @@ -64,9 +64,12 @@ is class IteratorCheckerSI; class Tools; class InterfPool; - --modified by NIZNHY-PKV Thu Jan 21 09:46:48 2010f - class BndSphere; - --modified by NIZNHY-PKV Thu Jan 21 09:46:53 2010t + class BndSphere; + --modified by NIZNHY-PKV Mon Dec 12 08:39:27 2011f + class Pair; + class PairBoolean; + class PairMapHasher; + --modified by NIZNHY-PKV Mon Dec 12 08:39:30 2011t -- pointer PShapesDataStructure to ShapesDataStructure from NMTDS; pointer PIterator to Iterator from NMTDS; @@ -78,11 +81,6 @@ is class ListOfIndexedDataMapOfShapeAncestorsSuccessors instantiates List from TCollection(IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations); - class IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger instantiates - IndexedDataMap from TCollection(Integer from Standard, - IndexedDataMapOfShapeInteger from BooleanOperations, - MapIntegerHasher from TColStd); - class ListOfPassKey instantiates List from TCollection(PassKey from NMTDS); @@ -111,11 +109,28 @@ is MapOfInteger from TColStd, MapIntegerHasher from TColStd); - --modified by NIZNHY-PKV Thu Jan 21 09:47:13 2010f + class IndexedDataMapOfShapeBndSphere instantiates IndexedDataMap from TCollection(Shape from TopoDS, BndSphere from NMTDS, ShapeMapHasher from TopTools); - --modified by NIZNHY-PKV Thu Jan 21 09:47:26 2010 - + + + --modified by NIZNHY-PKV Mon Dec 12 08:41:50 2011f + class ListOfPair instantiates + List from TCollection(Pair from NMTDS); + + class ListOfPairBoolean instantiates + List from TCollection(PairBoolean from NMTDS); + + class MapOfPairBoolean instantiates + Map from TCollection(PairBoolean from NMTDS, + PairMapHasher from NMTDS); +-- class IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger instantiates +-- IndexedDataMap from TCollection(Integer from Standard, +-- IndexedDataMapOfShapeInteger from BooleanOperations, +-- MapIntegerHasher from TColStd); + --modified by NIZNHY-PKV Mon Dec 12 08:41:54 2011t + + end NMTDS; diff --git a/src/NMTDS/NMTDS_InterfPool.cdl b/src/NMTDS/NMTDS_InterfPool.cdl index ec76fe8ac..188357053 100644 --- a/src/NMTDS/NMTDS_InterfPool.cdl +++ b/src/NMTDS/NMTDS_InterfPool.cdl @@ -18,7 +18,7 @@ -- -- File: NMTDS_InterfPool.cdl --- Created: Wed Feb 21 10:10:58 2007 +-- Created: -- Author: Peter KURNEV -- class InterfPool from NMTDS @@ -26,9 +26,9 @@ class InterfPool from NMTDS ---Purpose: uses - MapOfPassKeyBoolean from NMTDS, - ListOfPassKeyBoolean from NMTDS, - PassKeyBoolean from NMTDS, + MapOfPairBoolean from NMTDS, + ListOfPairBoolean from NMTDS, + PairBoolean from NMTDS, InterfType from NMTDS, -- CArray1OfSSInterference from BOPTools, @@ -47,7 +47,7 @@ is Add (me:out; - aPKB : PassKeyBoolean from NMTDS; + aPKB : PairBoolean from NMTDS; aType: InterfType from NMTDS) returns Boolean from Standard; @@ -65,7 +65,7 @@ is returns Boolean from Standard; Contains(me; - aPKB : PassKeyBoolean from NMTDS) + aPKB : PairBoolean from NMTDS) returns Boolean from Standard; Contains(me; @@ -74,23 +74,23 @@ is returns Boolean from Standard; Get(me) - returns ListOfPassKeyBoolean from NMTDS; + returns ListOfPairBoolean from NMTDS; ---C++: return const & Get(me; aType : InterfType from NMTDS) - returns ListOfPassKeyBoolean from NMTDS; + returns ListOfPairBoolean from NMTDS; ---C++: return const & Get(me; aInd : Integer from Standard) - returns ListOfPassKeyBoolean from NMTDS; + returns ListOfPairBoolean from NMTDS; ---C++: return const & Get(me; aInd : Integer from Standard; aType: InterfType from NMTDS) - returns ListOfPassKeyBoolean from NMTDS; + returns ListOfPairBoolean from NMTDS; ---C++: return const & -- @@ -132,10 +132,12 @@ is ---Purpose: --- Returns the reference to arrray Of V/V interferences --- - + --modified by NIZNHY-PKV Mon Dec 12 09:07:13 2011f + Purge(me:out) ; + --modified by NIZNHY-PKV Mon Dec 12 09:07:16 2011t fields - myTable : MapOfPassKeyBoolean from NMTDS [6] is protected; - myList : ListOfPassKeyBoolean from NMTDS is protected; + myTable : MapOfPairBoolean from NMTDS [6] is protected; + myList : ListOfPairBoolean from NMTDS is protected; myMaxInd: Integer from Standard is protected; -- mySSInterferences : CArray1OfSSInterference from BOPTools is protected; diff --git a/src/NMTDS/NMTDS_InterfPool.cxx b/src/NMTDS/NMTDS_InterfPool.cxx index 8881ebb59..a4b6132df 100644 --- a/src/NMTDS/NMTDS_InterfPool.cxx +++ b/src/NMTDS/NMTDS_InterfPool.cxx @@ -15,18 +15,18 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// File: NMTDS_.InterfPoolcxx -// Created: Wed Feb 21 10:35:35 2007 +// File: NMTDS_InterfPool.cxx // Author: Peter KURNEV -// -// + #include -#include -#include -#include -#include + +#include +#include +#include +#include + +#include static Standard_Integer TypeToInteger(const NMTDS_InterfType aType); @@ -35,7 +35,7 @@ static //function : //purpose : //======================================================================= - NMTDS_InterfPool::NMTDS_InterfPool() +NMTDS_InterfPool::NMTDS_InterfPool() { myMaxInd=6; } @@ -50,8 +50,8 @@ static //function : Add //purpose : //======================================================================= - Standard_Boolean NMTDS_InterfPool::Add (const NMTDS_PassKeyBoolean& aPKB, - const NMTDS_InterfType aType) +Standard_Boolean NMTDS_InterfPool::Add (const NMTDS_PairBoolean& aPKB, + const NMTDS_InterfType aType) { Standard_Boolean bRet; Standard_Integer iType; @@ -68,11 +68,11 @@ static //function : Add //purpose : //======================================================================= - Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1, - const Standard_Integer aInd2, - const NMTDS_InterfType aType) +Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1, + const Standard_Integer aInd2, + const NMTDS_InterfType aType) { - NMTDS_PassKeyBoolean aPKB; + NMTDS_PairBoolean aPKB; // aPKB.SetIds(aInd1, aInd2); return Add(aPKB, aType); @@ -81,12 +81,12 @@ static //function : Add //purpose : //======================================================================= - Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1, - const Standard_Integer aInd2, - const Standard_Boolean bFlag, - const NMTDS_InterfType aType) +Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1, + const Standard_Integer aInd2, + const Standard_Boolean bFlag, + const NMTDS_InterfType aType) { - NMTDS_PassKeyBoolean aPKB; + NMTDS_PairBoolean aPKB; // aPKB.SetIds(aInd1, aInd2); aPKB.SetFlag(bFlag); @@ -96,7 +96,7 @@ static //function : Contains //purpose : //======================================================================= - Standard_Boolean NMTDS_InterfPool::Contains(const NMTDS_PassKeyBoolean& aPKB)const +Standard_Boolean NMTDS_InterfPool::Contains(const NMTDS_PairBoolean& aPKB)const { Standard_Boolean bRet; Standard_Integer i; @@ -116,7 +116,7 @@ static Standard_Boolean NMTDS_InterfPool::Contains(const Standard_Integer aInd1, const Standard_Integer aInd2)const { - NMTDS_PassKeyBoolean aPKB; + NMTDS_PairBoolean aPKB; // aPKB.SetIds(aInd1, aInd2); return Contains(aPKB); @@ -125,20 +125,20 @@ static //function : Get //purpose : //======================================================================= - const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get()const +const NMTDS_ListOfPairBoolean& NMTDS_InterfPool::Get()const { Standard_Integer i; - NMTDS_ListOfPassKeyBoolean* pL; + NMTDS_ListOfPairBoolean* pL; // - pL=(NMTDS_ListOfPassKeyBoolean*)&myList; + pL=(NMTDS_ListOfPairBoolean*)&myList; pL->Clear(); // for (i=0; iAppend(aPKB); } } @@ -148,20 +148,21 @@ static //function : Get //purpose : //======================================================================= - const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const Standard_Integer aInd)const +const NMTDS_ListOfPairBoolean& NMTDS_InterfPool::Get + (const Standard_Integer aInd)const { Standard_Integer i, n1, n2; - NMTDS_ListOfPassKeyBoolean* pL; + NMTDS_ListOfPairBoolean* pL; // - pL=(NMTDS_ListOfPassKeyBoolean*)&myList; + pL=(NMTDS_ListOfPairBoolean*)&myList; pL->Clear(); // for (i=0; iAppend(aPKB); @@ -174,21 +175,22 @@ static //function : Get //purpose : //======================================================================= - const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const NMTDS_InterfType aType)const +const NMTDS_ListOfPairBoolean& NMTDS_InterfPool::Get + (const NMTDS_InterfType aType)const { Standard_Integer iType; - NMTDS_ListOfPassKeyBoolean* pL; + NMTDS_ListOfPairBoolean* pL; // - pL=(NMTDS_ListOfPassKeyBoolean*)&myList; + pL=(NMTDS_ListOfPairBoolean*)&myList; pL->Clear(); // iType=TypeToInteger(aType); if (iType>-1 && iTypeAppend(aPKB); } } @@ -198,21 +200,22 @@ static //function : Get //purpose : //======================================================================= - const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const Standard_Integer aInd, - const NMTDS_InterfType aType)const +const NMTDS_ListOfPairBoolean& NMTDS_InterfPool::Get + (const Standard_Integer aInd, + const NMTDS_InterfType aType)const { Standard_Integer n1, n2; - NMTDS_ListOfPassKeyBoolean *pL, aLPKB; - NMTDS_ListIteratorOfListOfPassKeyBoolean aIt; + NMTDS_ListOfPairBoolean *pL, aLPKB; + NMTDS_ListIteratorOfListOfPairBoolean aIt; // aLPKB=Get(aType); // - pL=(NMTDS_ListOfPassKeyBoolean*)&myList; + pL=(NMTDS_ListOfPairBoolean*)&myList; pL->Clear(); // aIt.Initialize (aLPKB); for (; aIt.More(); aIt.Next()) { - const NMTDS_PassKeyBoolean& aPKB=aIt.Value(); + const NMTDS_PairBoolean& aPKB=aIt.Value(); aPKB.Ids(n1, n2); if(n1==aInd || n2==aInd) { pL->Append(aPKB); @@ -225,7 +228,7 @@ static //function : SSInterferences //purpose : //=========================================================================== - BOPTools_CArray1OfSSInterference& NMTDS_InterfPool::SSInterferences() +BOPTools_CArray1OfSSInterference& NMTDS_InterfPool::SSInterferences() { return mySSInterferences; } @@ -233,7 +236,7 @@ static //function : ESInterferences //purpose : //=========================================================================== - BOPTools_CArray1OfESInterference& NMTDS_InterfPool::ESInterferences() +BOPTools_CArray1OfESInterference& NMTDS_InterfPool::ESInterferences() { return myESInterferences; } @@ -241,7 +244,7 @@ static //function : VSInterferences //purpose : //=========================================================================== - BOPTools_CArray1OfVSInterference& NMTDS_InterfPool::VSInterferences() +BOPTools_CArray1OfVSInterference& NMTDS_InterfPool::VSInterferences() { return myVSInterferences; } @@ -249,7 +252,7 @@ static //function : EEInterferences //purpose : //=========================================================================== - BOPTools_CArray1OfEEInterference& NMTDS_InterfPool::EEInterferences() +BOPTools_CArray1OfEEInterference& NMTDS_InterfPool::EEInterferences() { return myEEInterferences; } @@ -257,7 +260,7 @@ static //function : VEInterferences //purpose : //=========================================================================== - BOPTools_CArray1OfVEInterference& NMTDS_InterfPool::VEInterferences() +BOPTools_CArray1OfVEInterference& NMTDS_InterfPool::VEInterferences() { return myVEInterferences; } @@ -265,11 +268,29 @@ static //function : VVInterferences //purpose : //=========================================================================== - BOPTools_CArray1OfVVInterference& NMTDS_InterfPool::VVInterferences() +BOPTools_CArray1OfVVInterference& NMTDS_InterfPool::VVInterferences() { return myVVInterferences; } -//////////////////// + +//modified by NIZNHY-PKV Mon Dec 12 09:07:54 2011f +//======================================================================= +//function : Purge +//purpose : +//======================================================================= +void NMTDS_InterfPool::Purge() +{ +#if OCC_VERSION_LARGE > 0x06050200 + myVVInterferences.Purge(); + myVEInterferences.Purge(); + myEEInterferences.Purge(); + myVSInterferences.Purge(); + myESInterferences.Purge(); + mySSInterferences.Purge(); +#endif +} +//modified by NIZNHY-PKV Mon Dec 12 09:07:58 2011t + //======================================================================= //function : TypeToInteger //purpose : diff --git a/src/NMTDS/NMTDS_InterfPool.hxx b/src/NMTDS/NMTDS_InterfPool.hxx index e7e17dcde..cbb6cded6 100644 --- a/src/NMTDS/NMTDS_InterfPool.hxx +++ b/src/NMTDS/NMTDS_InterfPool.hxx @@ -1,191 +1,165 @@ -// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is 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_InterfPool_HeaderFile -#define _NMTDS_InterfPool_HeaderFile - -#ifndef _NMTDS_MapOfPassKeyBoolean_HeaderFile -#include -#endif -#ifndef _NMTDS_ListOfPassKeyBoolean_HeaderFile -#include -#endif -#ifndef _Standard_Integer_HeaderFile -#include -#endif -#ifndef _BOPTools_CArray1OfSSInterference_HeaderFile -#include -#endif -#ifndef _BOPTools_CArray1OfESInterference_HeaderFile -#include -#endif -#ifndef _BOPTools_CArray1OfVSInterference_HeaderFile -#include -#endif -#ifndef _BOPTools_CArray1OfEEInterference_HeaderFile -#include -#endif -#ifndef _BOPTools_CArray1OfVEInterference_HeaderFile -#include -#endif -#ifndef _BOPTools_CArray1OfVVInterference_HeaderFile -#include -#endif -#ifndef _Standard_Boolean_HeaderFile -#include -#endif -#ifndef _NMTDS_InterfType_HeaderFile -#include -#endif -class NMTDS_PassKeyBoolean; -class NMTDS_ListOfPassKeyBoolean; -class BOPTools_CArray1OfSSInterference; -class BOPTools_CArray1OfESInterference; -class BOPTools_CArray1OfVSInterference; -class BOPTools_CArray1OfEEInterference; -class BOPTools_CArray1OfVEInterference; -class BOPTools_CArray1OfVVInterference; - - -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Standard_Macro_HeaderFile -#include -#endif - - -class NMTDS_InterfPool { - -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_InterfPool(); -Standard_EXPORT virtual ~NMTDS_InterfPool(); - - -Standard_EXPORT Standard_Boolean Add(const NMTDS_PassKeyBoolean& aPKB,const NMTDS_InterfType aType) ; - - -Standard_EXPORT Standard_Boolean Add(const Standard_Integer aInd1,const Standard_Integer aInd2,const NMTDS_InterfType aType) ; - - -Standard_EXPORT Standard_Boolean Add(const Standard_Integer aInd1,const Standard_Integer aInd2,const Standard_Boolean bFlag,const NMTDS_InterfType aType) ; - - -Standard_EXPORT Standard_Boolean Contains(const NMTDS_PassKeyBoolean& aPKB) const; - - -Standard_EXPORT Standard_Boolean Contains(const Standard_Integer aInd1,const Standard_Integer aInd2) const; - - -Standard_EXPORT const NMTDS_ListOfPassKeyBoolean& Get() const; - - -Standard_EXPORT const NMTDS_ListOfPassKeyBoolean& Get(const NMTDS_InterfType aType) const; - - -Standard_EXPORT const NMTDS_ListOfPassKeyBoolean& Get(const Standard_Integer aInd) const; - - -Standard_EXPORT const NMTDS_ListOfPassKeyBoolean& Get(const Standard_Integer aInd,const NMTDS_InterfType aType) const; - - -//! Returns the reference to array Of F/F interferences
-Standard_EXPORT BOPTools_CArray1OfSSInterference& SSInterferences() ; - - -//! Returns the reference to array Of E/F interferences
-Standard_EXPORT BOPTools_CArray1OfESInterference& ESInterferences() ; - - -//! Returns the reference to array Of V/F interferences
-Standard_EXPORT BOPTools_CArray1OfVSInterference& VSInterferences() ; - - -//! Returns the reference to arrray Of E/E interferences
-Standard_EXPORT BOPTools_CArray1OfEEInterference& EEInterferences() ; - - -//! Returns the reference to arrray Of V/E interferences
-Standard_EXPORT BOPTools_CArray1OfVEInterference& VEInterferences() ; - - -//! Returns the reference to arrray Of V/V interferences
-Standard_EXPORT BOPTools_CArray1OfVVInterference& VVInterferences() ; - - - - - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // -NMTDS_MapOfPassKeyBoolean myTable[6]; -NMTDS_ListOfPassKeyBoolean myList; -Standard_Integer myMaxInd; -BOPTools_CArray1OfSSInterference mySSInterferences; -BOPTools_CArray1OfESInterference myESInterferences; -BOPTools_CArray1OfVSInterference myVSInterferences; -BOPTools_CArray1OfEEInterference myEEInterferences; -BOPTools_CArray1OfVEInterference myVEInterferences; -BOPTools_CArray1OfVVInterference myVVInterferences; - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - - -}; - - - - - -// other Inline functions and methods (like "C++: function call" methods) -// - - -#endif +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is 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_InterfPool_HeaderFile +#define _NMTDS_InterfPool_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#ifndef _NMTDS_MapOfPairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_ListOfPairBoolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _BOPTools_CArray1OfSSInterference_HeaderFile +#include +#endif +#ifndef _BOPTools_CArray1OfESInterference_HeaderFile +#include +#endif +#ifndef _BOPTools_CArray1OfVSInterference_HeaderFile +#include +#endif +#ifndef _BOPTools_CArray1OfEEInterference_HeaderFile +#include +#endif +#ifndef _BOPTools_CArray1OfVEInterference_HeaderFile +#include +#endif +#ifndef _BOPTools_CArray1OfVVInterference_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _NMTDS_InterfType_HeaderFile +#include +#endif +class NMTDS_PairBoolean; +class NMTDS_ListOfPairBoolean; +class BOPTools_CArray1OfSSInterference; +class BOPTools_CArray1OfESInterference; +class BOPTools_CArray1OfVSInterference; +class BOPTools_CArray1OfEEInterference; +class BOPTools_CArray1OfVEInterference; +class BOPTools_CArray1OfVVInterference; + + + +class NMTDS_InterfPool { +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); + } + + + Standard_EXPORT NMTDS_InterfPool(); +Standard_EXPORT virtual ~NMTDS_InterfPool(); + + Standard_EXPORT Standard_Boolean Add(const NMTDS_PairBoolean& aPKB,const NMTDS_InterfType aType) ; + + Standard_EXPORT Standard_Boolean Add(const Standard_Integer aInd1,const Standard_Integer aInd2,const NMTDS_InterfType aType) ; + + Standard_EXPORT Standard_Boolean Add(const Standard_Integer aInd1,const Standard_Integer aInd2,const Standard_Boolean bFlag,const NMTDS_InterfType aType) ; + + Standard_EXPORT Standard_Boolean Contains(const NMTDS_PairBoolean& aPKB) const; + + Standard_EXPORT Standard_Boolean Contains(const Standard_Integer aInd1,const Standard_Integer aInd2) const; + + Standard_EXPORT const NMTDS_ListOfPairBoolean& Get() const; + + Standard_EXPORT const NMTDS_ListOfPairBoolean& Get(const NMTDS_InterfType aType) const; + + Standard_EXPORT const NMTDS_ListOfPairBoolean& Get(const Standard_Integer aInd) const; + + Standard_EXPORT const NMTDS_ListOfPairBoolean& Get(const Standard_Integer aInd,const NMTDS_InterfType aType) const; + +//! Returns the reference to array Of F/F interferences
+ Standard_EXPORT BOPTools_CArray1OfSSInterference& SSInterferences() ; + +//! Returns the reference to array Of E/F interferences
+ Standard_EXPORT BOPTools_CArray1OfESInterference& ESInterferences() ; + +//! Returns the reference to array Of V/F interferences
+ Standard_EXPORT BOPTools_CArray1OfVSInterference& VSInterferences() ; + +//! Returns the reference to arrray Of E/E interferences
+ Standard_EXPORT BOPTools_CArray1OfEEInterference& EEInterferences() ; + +//! Returns the reference to arrray Of V/E interferences
+ Standard_EXPORT BOPTools_CArray1OfVEInterference& VEInterferences() ; + +//! Returns the reference to arrray Of V/V interferences
+ Standard_EXPORT BOPTools_CArray1OfVVInterference& VVInterferences() ; + + Standard_EXPORT void Purge() ; + + + + + +protected: + + + +NMTDS_MapOfPairBoolean myTable[6]; +NMTDS_ListOfPairBoolean myList; +Standard_Integer myMaxInd; +BOPTools_CArray1OfSSInterference mySSInterferences; +BOPTools_CArray1OfESInterference myESInterferences; +BOPTools_CArray1OfVSInterference myVSInterferences; +BOPTools_CArray1OfEEInterference myEEInterferences; +BOPTools_CArray1OfVEInterference myVEInterferences; +BOPTools_CArray1OfVVInterference myVVInterferences; + + +private: + + + + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_InterfPool.jxx b/src/NMTDS/NMTDS_InterfPool.jxx index e76cdc310..96e12ff0a 100644 --- a/src/NMTDS/NMTDS_InterfPool.jxx +++ b/src/NMTDS/NMTDS_InterfPool.jxx @@ -1,46 +1,45 @@ -// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is 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_PassKeyBoolean_HeaderFile -#include -#endif -#ifndef _NMTDS_ListOfPassKeyBoolean_HeaderFile -#include -#endif -#ifndef _BOPTools_CArray1OfSSInterference_HeaderFile -#include -#endif -#ifndef _BOPTools_CArray1OfESInterference_HeaderFile -#include -#endif -#ifndef _BOPTools_CArray1OfVSInterference_HeaderFile -#include -#endif -#ifndef _BOPTools_CArray1OfEEInterference_HeaderFile -#include -#endif -#ifndef _BOPTools_CArray1OfVEInterference_HeaderFile -#include -#endif -#ifndef _BOPTools_CArray1OfVVInterference_HeaderFile -#include -#endif -#ifndef _NMTDS_InterfPool_HeaderFile -#include -#endif +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is 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_PairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_ListOfPairBoolean_HeaderFile +#include +#endif +#ifndef _BOPTools_CArray1OfSSInterference_HeaderFile +#include +#endif +#ifndef _BOPTools_CArray1OfESInterference_HeaderFile +#include +#endif +#ifndef _BOPTools_CArray1OfVSInterference_HeaderFile +#include +#endif +#ifndef _BOPTools_CArray1OfEEInterference_HeaderFile +#include +#endif +#ifndef _BOPTools_CArray1OfVEInterference_HeaderFile +#include +#endif +#ifndef _BOPTools_CArray1OfVVInterference_HeaderFile +#include +#endif +#ifndef _NMTDS_InterfPool_HeaderFile +#include +#endif diff --git a/src/NMTDS/NMTDS_Iterator.cdl b/src/NMTDS/NMTDS_Iterator.cdl index 513307d71..1a836be17 100755 --- a/src/NMTDS/NMTDS_Iterator.cdl +++ b/src/NMTDS/NMTDS_Iterator.cdl @@ -21,7 +21,7 @@ -- -- File: NMTDS_Iterator.cdl --- Created: Sun May 07 14:58:16 2006 +-- Created: -- Author: Peter KURNEV -- class Iterator from NMTDS @@ -33,8 +33,8 @@ uses ShapeEnum from TopAbs, ShapesDataStructure from NMTDS, PShapesDataStructure from NMTDS, - ListOfPassKeyBoolean from NMTDS, - ListIteratorOfListOfPassKeyBoolean from NMTDS, + ListOfPairBoolean from NMTDS, + ListIteratorOfListOfPairBoolean from NMTDS, PassKeyBoolean from NMTDS --raises @@ -85,10 +85,10 @@ is aMVSD2:out DataMapOfIntegerListOfInteger from TColStd); fields - myDS :PShapesDataStructure from NMTDS is protected; - myLists :ListOfPassKeyBoolean from NMTDS [6] is protected; - myIterator :ListIteratorOfListOfPassKeyBoolean from NMTDS is protected; - myEmptyList:ListOfPassKeyBoolean from NMTDS is protected; + myDS :PShapesDataStructure from NMTDS is protected; + myLists :ListOfPairBoolean from NMTDS [6] is protected; + myIterator :ListIteratorOfListOfPairBoolean from NMTDS is protected; + myEmptyList:ListOfPairBoolean from NMTDS is protected; myLength :Integer from Standard is protected; -- myMVSD :DataMapOfIntegerListOfInteger from TColStd is protected; diff --git a/src/NMTDS/NMTDS_Iterator.cxx b/src/NMTDS/NMTDS_Iterator.cxx index 9bdc79e72..3db662e57 100755 --- a/src/NMTDS/NMTDS_Iterator.cxx +++ b/src/NMTDS/NMTDS_Iterator.cxx @@ -18,12 +18,10 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: NMTDS_Iterator.cxx -// Created: Sun May 07 15:04:41 2006 // Author: Peter KURNEV -// + #include // #include @@ -47,8 +45,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -59,7 +57,7 @@ //function : NMTDS_Iterator //purpose : //======================================================================= - NMTDS_Iterator::NMTDS_Iterator() +NMTDS_Iterator::NMTDS_Iterator() { myDS=NULL; myLength=0; @@ -68,14 +66,14 @@ //function : ~NMTDS_Iterator //purpose : //======================================================================= - NMTDS_Iterator::~NMTDS_Iterator() +NMTDS_Iterator::~NMTDS_Iterator() { } //======================================================================= // function: SetDS // purpose: //======================================================================= - void NMTDS_Iterator::SetDS(const NMTDS_PShapesDataStructure& aDS) +void NMTDS_Iterator::SetDS(const NMTDS_PShapesDataStructure& aDS) { myDS=aDS; } @@ -83,7 +81,7 @@ // function: DS // purpose: //======================================================================= - const NMTDS_ShapesDataStructure& NMTDS_Iterator::DS()const +const NMTDS_ShapesDataStructure& NMTDS_Iterator::DS()const { return *myDS; } @@ -91,7 +89,7 @@ // function: ExpectedLength // purpose: //======================================================================= - Standard_Integer NMTDS_Iterator::ExpectedLength() const +Standard_Integer NMTDS_Iterator::ExpectedLength() const { return myLength; } @@ -99,9 +97,9 @@ // function: BlockLength // purpose: //======================================================================= - Standard_Integer NMTDS_Iterator::BlockLength() const +Standard_Integer NMTDS_Iterator::BlockLength() const { - Standard_Integer aNbIIs; + Standard_Integer aNbIIs, iTresh; Standard_Real aCfPredict=.5; aNbIIs=ExpectedLength(); @@ -109,6 +107,13 @@ if (aNbIIs<=1) { return 1; } + //modified by NIZNHY-PKV Mon Dec 12 08:50:50 2011f + iTresh=1000; + if (aNbIIs>iTresh) { + aNbIIs=iTresh; + return aNbIIs; + } + //modified by NIZNHY-PKV Mon Dec 12 08:50:54 2011t // aNbIIs=(Standard_Integer) (aCfPredict*(Standard_Real)aNbIIs); return aNbIIs; @@ -117,8 +122,8 @@ // function: Initialize // purpose: //======================================================================= - void NMTDS_Iterator::Initialize(const TopAbs_ShapeEnum aType1, - const TopAbs_ShapeEnum aType2) +void NMTDS_Iterator::Initialize(const TopAbs_ShapeEnum aType1, + const TopAbs_ShapeEnum aType2) { Standard_Integer iX; // @@ -136,7 +141,7 @@ // function: More // purpose: //======================================================================= - Standard_Boolean NMTDS_Iterator::More()const +Standard_Boolean NMTDS_Iterator::More()const { return myIterator.More(); } @@ -144,7 +149,7 @@ // function: Next // purpose: //======================================================================= - void NMTDS_Iterator::Next() +void NMTDS_Iterator::Next() { myIterator.Next(); } @@ -152,11 +157,11 @@ // function: Current // purpose: //======================================================================= - void NMTDS_Iterator::Current(Standard_Integer& aIndex1, - Standard_Integer& aIndex2, - Standard_Boolean& aWithSubShape) const +void NMTDS_Iterator::Current(Standard_Integer& aIndex1, + Standard_Integer& aIndex2, + Standard_Boolean& aWithSubShape) const { - const NMTDS_PassKeyBoolean& aPKB=myIterator.Value(); + const NMTDS_PairBoolean& aPKB=myIterator.Value(); aPKB.Ids(aIndex1, aIndex2); aWithSubShape=aPKB.Flag(); } @@ -164,7 +169,7 @@ // function: SDVertices // purpose: //======================================================================= - const TColStd_DataMapOfIntegerListOfInteger& NMTDS_Iterator::SDVertices()const +const TColStd_DataMapOfIntegerListOfInteger& NMTDS_Iterator::SDVertices()const { return myMVSD; } @@ -172,7 +177,7 @@ // function: Prepare // purpose: //======================================================================= - void NMTDS_Iterator::Prepare() +void NMTDS_Iterator::Prepare() { Standard_Integer i; // @@ -191,7 +196,7 @@ // function: Intersect // purpose: //======================================================================= - void NMTDS_Iterator::Intersect() +void NMTDS_Iterator::Intersect() { Standard_Boolean bFlag; Standard_Integer aNb, i, aNbB, aNbR, iFlag; @@ -202,8 +207,8 @@ TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD; TopTools_DataMapOfShapeInteger aMSI; TopAbs_ShapeEnum aTi, aTj; - NMTDS_PassKeyBoolean aPKXB; - NMTDS_MapOfPassKeyBoolean aMPKXB; + NMTDS_PairBoolean aPKXB; + NMTDS_MapOfPairBoolean aMPKXB; NMTDS_IndexedDataMapOfShapeBox aMSB; // NMTDS_BoxBndTreeSelector aSelector; @@ -317,13 +322,10 @@ } } // - //modified by NIZNHY-PKV Mon Sep 27 08:31:04 2010f aNbLV1=aLV1.Extent(); if (aNbLV1) { aMVSD.Bind(i, aLV1); } - //aMVSD.Bind(i, aLV1); - //modified by NIZNHY-PKV Mon Sep 27 08:31:21 2010t } }//for (i=i1; i<=i2; ++i) { }//for (iR=1; iR -#endif -#ifndef _NMTDS_ListOfPassKeyBoolean_HeaderFile -#include -#endif -#ifndef _NMTDS_ListIteratorOfListOfPassKeyBoolean_HeaderFile -#include -#endif -#ifndef _Standard_Integer_HeaderFile -#include -#endif -#ifndef _TColStd_DataMapOfIntegerListOfInteger_HeaderFile -#include -#endif -#ifndef _TopAbs_ShapeEnum_HeaderFile -#include -#endif -#ifndef _Standard_Boolean_HeaderFile -#include -#endif -class NMTDS_ShapesDataStructure; -class TColStd_DataMapOfIntegerListOfInteger; - - -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Standard_Macro_HeaderFile -#include -#endif - - -class NMTDS_Iterator { - -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_Iterator(); -Standard_EXPORT virtual ~NMTDS_Iterator(); - - -Standard_EXPORT void SetDS(const NMTDS_PShapesDataStructure& pDS) ; - - -Standard_EXPORT const NMTDS_ShapesDataStructure& DS() const; - - -Standard_EXPORT void Initialize(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ; - - -Standard_EXPORT Standard_Boolean More() const; - - -Standard_EXPORT void Next() ; - - -Standard_EXPORT void Current(Standard_Integer& aIndex1,Standard_Integer& aIndex2,Standard_Boolean& aWithSubShape) const; - - -Standard_EXPORT virtual void Prepare() ; - - -Standard_EXPORT Standard_Integer ExpectedLength() const; - - -Standard_EXPORT Standard_Integer BlockLength() const; - - -Standard_EXPORT const TColStd_DataMapOfIntegerListOfInteger& SDVertices() const; - - -Standard_EXPORT static void FillMVSD(const TColStd_DataMapOfIntegerListOfInteger& aMVSD1,TColStd_DataMapOfIntegerListOfInteger& aMVSD2) ; - - - - - -protected: - - // Methods PROTECTED - // - - -Standard_EXPORT virtual void Intersect() ; - - - // Fields PROTECTED - // -NMTDS_PShapesDataStructure myDS; -NMTDS_ListOfPassKeyBoolean myLists[6]; -NMTDS_ListIteratorOfListOfPassKeyBoolean myIterator; -NMTDS_ListOfPassKeyBoolean myEmptyList; -Standard_Integer myLength; -TColStd_DataMapOfIntegerListOfInteger myMVSD; - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - - -}; - - - - - -// other Inline functions and methods (like "C++: function call" methods) -// - - -#endif +// 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 + +#ifndef _NMTDS_Iterator_HeaderFile +#define _NMTDS_Iterator_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#ifndef _NMTDS_PShapesDataStructure_HeaderFile +#include +#endif +#ifndef _NMTDS_ListOfPairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_ListIteratorOfListOfPairBoolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _TColStd_DataMapOfIntegerListOfInteger_HeaderFile +#include +#endif +#ifndef _TopAbs_ShapeEnum_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class NMTDS_ShapesDataStructure; +class TColStd_DataMapOfIntegerListOfInteger; + + + +class NMTDS_Iterator { +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); + } + + + Standard_EXPORT NMTDS_Iterator(); +Standard_EXPORT virtual ~NMTDS_Iterator(); + + Standard_EXPORT void SetDS(const NMTDS_PShapesDataStructure& pDS) ; + + Standard_EXPORT const NMTDS_ShapesDataStructure& DS() const; + + Standard_EXPORT void Initialize(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ; + + Standard_EXPORT Standard_Boolean More() const; + + Standard_EXPORT void Next() ; + + Standard_EXPORT void Current(Standard_Integer& aIndex1,Standard_Integer& aIndex2,Standard_Boolean& aWithSubShape) const; + + Standard_EXPORT virtual void Prepare() ; + + Standard_EXPORT Standard_Integer ExpectedLength() const; + + Standard_EXPORT Standard_Integer BlockLength() const; + + Standard_EXPORT const TColStd_DataMapOfIntegerListOfInteger& SDVertices() const; + + Standard_EXPORT static void FillMVSD(const TColStd_DataMapOfIntegerListOfInteger& aMVSD1,TColStd_DataMapOfIntegerListOfInteger& aMVSD2) ; + + +protected: + + + Standard_EXPORT virtual void Intersect() ; + + +NMTDS_PShapesDataStructure myDS; +NMTDS_ListOfPairBoolean myLists[6]; +NMTDS_ListIteratorOfListOfPairBoolean myIterator; +NMTDS_ListOfPairBoolean myEmptyList; +Standard_Integer myLength; +TColStd_DataMapOfIntegerListOfInteger myMVSD; + + +private: + +}; + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_IteratorCheckerSI.cxx b/src/NMTDS/NMTDS_IteratorCheckerSI.cxx index 549199734..51ce1bb80 100644 --- a/src/NMTDS/NMTDS_IteratorCheckerSI.cxx +++ b/src/NMTDS/NMTDS_IteratorCheckerSI.cxx @@ -15,12 +15,10 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: NMTDS_IteratorChecker.cxx -// Created: Tue Feb 6 10:37:59 2007 // Author: Peter KURNEV -// + #include #include @@ -48,8 +46,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -57,7 +55,7 @@ //function : //purpose : //======================================================================= - NMTDS_IteratorCheckerSI::NMTDS_IteratorCheckerSI() +NMTDS_IteratorCheckerSI::NMTDS_IteratorCheckerSI() : NMTDS_Iterator() { @@ -66,14 +64,14 @@ //function : ~ //purpose : //======================================================================= - NMTDS_IteratorCheckerSI::~NMTDS_IteratorCheckerSI() +NMTDS_IteratorCheckerSI::~NMTDS_IteratorCheckerSI() { } //======================================================================= // function: Intersect // purpose: //======================================================================= - void NMTDS_IteratorCheckerSI::Intersect() +void NMTDS_IteratorCheckerSI::Intersect() { Standard_Boolean bFlag; Standard_Integer aNbS, i, aNbA, aNbB, iFlag; @@ -84,10 +82,10 @@ TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD; TopTools_DataMapOfShapeInteger aMSI; TopAbs_ShapeEnum aTi, aTj; - NMTDS_PassKeyBoolean aPKXB; - NMTDS_MapOfPassKeyBoolean aMPKXB; + NMTDS_PairBoolean aPKXB; + NMTDS_MapOfPairBoolean aMPKXB; NMTDS_IndexedDataMapOfShapeBox aMSB; - NMTDS_MapOfPassKeyBoolean aMPA;//myPairsAvoid + NMTDS_MapOfPairBoolean aMPA;//myPairsAvoid // NMTDS_BoxBndTreeSelector aSelector; NMTDS_BoxBndTree aBBTree; diff --git a/src/NMTDS/NMTDS_ListIteratorOfListOfPair.hxx b/src/NMTDS/NMTDS_ListIteratorOfListOfPair.hxx new file mode 100644 index 000000000..cba16cdaa --- /dev/null +++ b/src/NMTDS/NMTDS_ListIteratorOfListOfPair.hxx @@ -0,0 +1,127 @@ +// 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 + +#ifndef _NMTDS_ListIteratorOfListOfPair_HeaderFile +#define _NMTDS_ListIteratorOfListOfPair_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_NMTDS_ListNodeOfListOfPair_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoMoreObject; +class Standard_NoSuchObject; +class NMTDS_ListOfPair; +class NMTDS_Pair; +class NMTDS_ListNodeOfListOfPair; + + + +class NMTDS_ListIteratorOfListOfPair { +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); + } + + + Standard_EXPORT NMTDS_ListIteratorOfListOfPair(); + + Standard_EXPORT NMTDS_ListIteratorOfListOfPair(const NMTDS_ListOfPair& L); + + Standard_EXPORT void Initialize(const NMTDS_ListOfPair& L) ; + + Standard_Boolean More() const; + + Standard_EXPORT void Next() ; + + Standard_EXPORT NMTDS_Pair& Value() const; + + +friend class NMTDS_ListOfPair; + + + +protected: + + + + + +private: + + + +Standard_Address current; +Standard_Address previous; + + +}; + +#define Item NMTDS_Pair +#define Item_hxx +#define TCollection_ListNode NMTDS_ListNodeOfListOfPair +#define TCollection_ListNode_hxx +#define TCollection_ListIterator NMTDS_ListIteratorOfListOfPair +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_NMTDS_ListNodeOfListOfPair +#define TCollection_ListNode_Type_() NMTDS_ListNodeOfListOfPair_Type_() +#define TCollection_List NMTDS_ListOfPair +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_ListIteratorOfListOfPairBoolean.hxx b/src/NMTDS/NMTDS_ListIteratorOfListOfPairBoolean.hxx new file mode 100644 index 000000000..97bc01b72 --- /dev/null +++ b/src/NMTDS/NMTDS_ListIteratorOfListOfPairBoolean.hxx @@ -0,0 +1,127 @@ +// 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 + +#ifndef _NMTDS_ListIteratorOfListOfPairBoolean_HeaderFile +#define _NMTDS_ListIteratorOfListOfPairBoolean_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_NMTDS_ListNodeOfListOfPairBoolean_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoMoreObject; +class Standard_NoSuchObject; +class NMTDS_ListOfPairBoolean; +class NMTDS_PairBoolean; +class NMTDS_ListNodeOfListOfPairBoolean; + + + +class NMTDS_ListIteratorOfListOfPairBoolean { +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); + } + + + Standard_EXPORT NMTDS_ListIteratorOfListOfPairBoolean(); + + Standard_EXPORT NMTDS_ListIteratorOfListOfPairBoolean(const NMTDS_ListOfPairBoolean& L); + + Standard_EXPORT void Initialize(const NMTDS_ListOfPairBoolean& L) ; + + Standard_Boolean More() const; + + Standard_EXPORT void Next() ; + + Standard_EXPORT NMTDS_PairBoolean& Value() const; + + +friend class NMTDS_ListOfPairBoolean; + + + +protected: + + + + + +private: + + + +Standard_Address current; +Standard_Address previous; + + +}; + +#define Item NMTDS_PairBoolean +#define Item_hxx +#define TCollection_ListNode NMTDS_ListNodeOfListOfPairBoolean +#define TCollection_ListNode_hxx +#define TCollection_ListIterator NMTDS_ListIteratorOfListOfPairBoolean +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_NMTDS_ListNodeOfListOfPairBoolean +#define TCollection_ListNode_Type_() NMTDS_ListNodeOfListOfPairBoolean_Type_() +#define TCollection_List NMTDS_ListOfPairBoolean +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_ListIteratorOfListOfPairBoolean_0.cxx b/src/NMTDS/NMTDS_ListIteratorOfListOfPairBoolean_0.cxx new file mode 100644 index 000000000..f9b27daaa --- /dev/null +++ b/src/NMTDS/NMTDS_ListIteratorOfListOfPairBoolean_0.cxx @@ -0,0 +1,52 @@ +// 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 + +#include + +#ifndef _Standard_NoMoreObject_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _NMTDS_ListOfPairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_PairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_ListNodeOfListOfPairBoolean_HeaderFile +#include +#endif + + +#define Item NMTDS_PairBoolean +#define Item_hxx +#define TCollection_ListNode NMTDS_ListNodeOfListOfPairBoolean +#define TCollection_ListNode_hxx +#define TCollection_ListIterator NMTDS_ListIteratorOfListOfPairBoolean +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_NMTDS_ListNodeOfListOfPairBoolean +#define TCollection_ListNode_Type_() NMTDS_ListNodeOfListOfPairBoolean_Type_() +#define TCollection_List NMTDS_ListOfPairBoolean +#define TCollection_List_hxx +#include + diff --git a/src/NMTDS/NMTDS_ListIteratorOfListOfPair_0.cxx b/src/NMTDS/NMTDS_ListIteratorOfListOfPair_0.cxx new file mode 100644 index 000000000..c186b06d9 --- /dev/null +++ b/src/NMTDS/NMTDS_ListIteratorOfListOfPair_0.cxx @@ -0,0 +1,52 @@ +// 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 + +#include + +#ifndef _Standard_NoMoreObject_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _NMTDS_ListOfPair_HeaderFile +#include +#endif +#ifndef _NMTDS_Pair_HeaderFile +#include +#endif +#ifndef _NMTDS_ListNodeOfListOfPair_HeaderFile +#include +#endif + + +#define Item NMTDS_Pair +#define Item_hxx +#define TCollection_ListNode NMTDS_ListNodeOfListOfPair +#define TCollection_ListNode_hxx +#define TCollection_ListIterator NMTDS_ListIteratorOfListOfPair +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_NMTDS_ListNodeOfListOfPair +#define TCollection_ListNode_Type_() NMTDS_ListNodeOfListOfPair_Type_() +#define TCollection_List NMTDS_ListOfPair +#define TCollection_List_hxx +#include + diff --git a/src/NMTDS/NMTDS_ListNodeOfListOfPair.hxx b/src/NMTDS/NMTDS_ListNodeOfListOfPair.hxx new file mode 100644 index 000000000..bd6aaa8df --- /dev/null +++ b/src/NMTDS/NMTDS_ListNodeOfListOfPair.hxx @@ -0,0 +1,105 @@ +// 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 + +#ifndef _NMTDS_ListNodeOfListOfPair_HeaderFile +#define _NMTDS_ListNodeOfListOfPair_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_DefineHandle_HeaderFile +#include +#endif +#ifndef _Handle_NMTDS_ListNodeOfListOfPair_HeaderFile +#include +#endif + +#ifndef _NMTDS_Pair_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class NMTDS_Pair; +class NMTDS_ListOfPair; +class NMTDS_ListIteratorOfListOfPair; + + + +class NMTDS_ListNodeOfListOfPair : public TCollection_MapNode { + +public: + + + NMTDS_ListNodeOfListOfPair(const NMTDS_Pair& I,const TCollection_MapNodePtr& n); + + NMTDS_Pair& Value() const; + + + + + DEFINE_STANDARD_RTTI(NMTDS_ListNodeOfListOfPair) + +protected: + + + + +private: + + +NMTDS_Pair myValue; + + +}; + +#define Item NMTDS_Pair +#define Item_hxx +#define TCollection_ListNode NMTDS_ListNodeOfListOfPair +#define TCollection_ListNode_hxx +#define TCollection_ListIterator NMTDS_ListIteratorOfListOfPair +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_NMTDS_ListNodeOfListOfPair +#define TCollection_ListNode_Type_() NMTDS_ListNodeOfListOfPair_Type_() +#define TCollection_List NMTDS_ListOfPair +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_ListNodeOfListOfPairBoolean.hxx b/src/NMTDS/NMTDS_ListNodeOfListOfPairBoolean.hxx new file mode 100644 index 000000000..2661de064 --- /dev/null +++ b/src/NMTDS/NMTDS_ListNodeOfListOfPairBoolean.hxx @@ -0,0 +1,105 @@ +// 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 + +#ifndef _NMTDS_ListNodeOfListOfPairBoolean_HeaderFile +#define _NMTDS_ListNodeOfListOfPairBoolean_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_DefineHandle_HeaderFile +#include +#endif +#ifndef _Handle_NMTDS_ListNodeOfListOfPairBoolean_HeaderFile +#include +#endif + +#ifndef _NMTDS_PairBoolean_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class NMTDS_PairBoolean; +class NMTDS_ListOfPairBoolean; +class NMTDS_ListIteratorOfListOfPairBoolean; + + + +class NMTDS_ListNodeOfListOfPairBoolean : public TCollection_MapNode { + +public: + + + NMTDS_ListNodeOfListOfPairBoolean(const NMTDS_PairBoolean& I,const TCollection_MapNodePtr& n); + + NMTDS_PairBoolean& Value() const; + + + + + DEFINE_STANDARD_RTTI(NMTDS_ListNodeOfListOfPairBoolean) + +protected: + + + + +private: + + +NMTDS_PairBoolean myValue; + + +}; + +#define Item NMTDS_PairBoolean +#define Item_hxx +#define TCollection_ListNode NMTDS_ListNodeOfListOfPairBoolean +#define TCollection_ListNode_hxx +#define TCollection_ListIterator NMTDS_ListIteratorOfListOfPairBoolean +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_NMTDS_ListNodeOfListOfPairBoolean +#define TCollection_ListNode_Type_() NMTDS_ListNodeOfListOfPairBoolean_Type_() +#define TCollection_List NMTDS_ListOfPairBoolean +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_ListNodeOfListOfPairBoolean_0.cxx b/src/NMTDS/NMTDS_ListNodeOfListOfPairBoolean_0.cxx new file mode 100644 index 000000000..8aef0cdb3 --- /dev/null +++ b/src/NMTDS/NMTDS_ListNodeOfListOfPairBoolean_0.cxx @@ -0,0 +1,66 @@ +// 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 + +#include + +#ifndef _Standard_Type_HeaderFile +#include +#endif + +#ifndef _NMTDS_PairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_ListOfPairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_ListIteratorOfListOfPairBoolean_HeaderFile +#include +#endif + + + + +IMPLEMENT_STANDARD_TYPE(NMTDS_ListNodeOfListOfPairBoolean) +IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() + STANDARD_TYPE(TCollection_MapNode), + STANDARD_TYPE(MMgt_TShared), + STANDARD_TYPE(Standard_Transient), + +IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() +IMPLEMENT_STANDARD_TYPE_END(NMTDS_ListNodeOfListOfPairBoolean) + + +IMPLEMENT_DOWNCAST(NMTDS_ListNodeOfListOfPairBoolean,Standard_Transient) +IMPLEMENT_STANDARD_RTTI(NMTDS_ListNodeOfListOfPairBoolean) + + +#define Item NMTDS_PairBoolean +#define Item_hxx +#define TCollection_ListNode NMTDS_ListNodeOfListOfPairBoolean +#define TCollection_ListNode_hxx +#define TCollection_ListIterator NMTDS_ListIteratorOfListOfPairBoolean +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_NMTDS_ListNodeOfListOfPairBoolean +#define TCollection_ListNode_Type_() NMTDS_ListNodeOfListOfPairBoolean_Type_() +#define TCollection_List NMTDS_ListOfPairBoolean +#define TCollection_List_hxx +#include + diff --git a/src/NMTDS/NMTDS_ListNodeOfListOfPair_0.cxx b/src/NMTDS/NMTDS_ListNodeOfListOfPair_0.cxx new file mode 100644 index 000000000..d35a153db --- /dev/null +++ b/src/NMTDS/NMTDS_ListNodeOfListOfPair_0.cxx @@ -0,0 +1,66 @@ +// 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 + +#include + +#ifndef _Standard_Type_HeaderFile +#include +#endif + +#ifndef _NMTDS_Pair_HeaderFile +#include +#endif +#ifndef _NMTDS_ListOfPair_HeaderFile +#include +#endif +#ifndef _NMTDS_ListIteratorOfListOfPair_HeaderFile +#include +#endif + + + + +IMPLEMENT_STANDARD_TYPE(NMTDS_ListNodeOfListOfPair) +IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() + STANDARD_TYPE(TCollection_MapNode), + STANDARD_TYPE(MMgt_TShared), + STANDARD_TYPE(Standard_Transient), + +IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() +IMPLEMENT_STANDARD_TYPE_END(NMTDS_ListNodeOfListOfPair) + + +IMPLEMENT_DOWNCAST(NMTDS_ListNodeOfListOfPair,Standard_Transient) +IMPLEMENT_STANDARD_RTTI(NMTDS_ListNodeOfListOfPair) + + +#define Item NMTDS_Pair +#define Item_hxx +#define TCollection_ListNode NMTDS_ListNodeOfListOfPair +#define TCollection_ListNode_hxx +#define TCollection_ListIterator NMTDS_ListIteratorOfListOfPair +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_NMTDS_ListNodeOfListOfPair +#define TCollection_ListNode_Type_() NMTDS_ListNodeOfListOfPair_Type_() +#define TCollection_List NMTDS_ListOfPair +#define TCollection_List_hxx +#include + diff --git a/src/NMTDS/NMTDS_ListOfPair.hxx b/src/NMTDS/NMTDS_ListOfPair.hxx new file mode 100644 index 000000000..9da05334d --- /dev/null +++ b/src/NMTDS/NMTDS_ListOfPair.hxx @@ -0,0 +1,165 @@ +// 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 + +#ifndef _NMTDS_ListOfPair_HeaderFile +#define _NMTDS_ListOfPair_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_NMTDS_ListNodeOfListOfPair_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class NMTDS_ListIteratorOfListOfPair; +class NMTDS_Pair; +class NMTDS_ListNodeOfListOfPair; + + + +class NMTDS_ListOfPair { +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); + } + + + Standard_EXPORT NMTDS_ListOfPair(); + + Standard_EXPORT void Assign(const NMTDS_ListOfPair& Other) ; + void operator=(const NMTDS_ListOfPair& Other) +{ + Assign(Other); +} + + Standard_EXPORT Standard_Integer Extent() const; + + Standard_EXPORT void Clear() ; +~NMTDS_ListOfPair() +{ + Clear(); +} + + Standard_Boolean IsEmpty() const; + + Standard_EXPORT void Prepend(const NMTDS_Pair& I) ; + + Standard_EXPORT void Prepend(const NMTDS_Pair& I,NMTDS_ListIteratorOfListOfPair& theIt) ; + + Standard_EXPORT void Prepend(NMTDS_ListOfPair& Other) ; + + Standard_EXPORT void Append(const NMTDS_Pair& I) ; + + Standard_EXPORT void Append(const NMTDS_Pair& I,NMTDS_ListIteratorOfListOfPair& theIt) ; + + Standard_EXPORT void Append(NMTDS_ListOfPair& Other) ; + + Standard_EXPORT NMTDS_Pair& First() const; + + Standard_EXPORT NMTDS_Pair& Last() const; + + Standard_EXPORT void RemoveFirst() ; + + Standard_EXPORT void Remove(NMTDS_ListIteratorOfListOfPair& It) ; + + Standard_EXPORT void InsertBefore(const NMTDS_Pair& I,NMTDS_ListIteratorOfListOfPair& It) ; + + Standard_EXPORT void InsertBefore(NMTDS_ListOfPair& Other,NMTDS_ListIteratorOfListOfPair& It) ; + + Standard_EXPORT void InsertAfter(const NMTDS_Pair& I,NMTDS_ListIteratorOfListOfPair& It) ; + + Standard_EXPORT void InsertAfter(NMTDS_ListOfPair& Other,NMTDS_ListIteratorOfListOfPair& It) ; + + +friend class NMTDS_ListIteratorOfListOfPair; + + + +protected: + + + + + +private: + + + Standard_EXPORT NMTDS_ListOfPair(const NMTDS_ListOfPair& Other); + + +Standard_Address myFirst; +Standard_Address myLast; + + +}; + +#define Item NMTDS_Pair +#define Item_hxx +#define TCollection_ListNode NMTDS_ListNodeOfListOfPair +#define TCollection_ListNode_hxx +#define TCollection_ListIterator NMTDS_ListIteratorOfListOfPair +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_NMTDS_ListNodeOfListOfPair +#define TCollection_ListNode_Type_() NMTDS_ListNodeOfListOfPair_Type_() +#define TCollection_List NMTDS_ListOfPair +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_ListOfPairBoolean.hxx b/src/NMTDS/NMTDS_ListOfPairBoolean.hxx new file mode 100644 index 000000000..7e8d08ad5 --- /dev/null +++ b/src/NMTDS/NMTDS_ListOfPairBoolean.hxx @@ -0,0 +1,165 @@ +// 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 + +#ifndef _NMTDS_ListOfPairBoolean_HeaderFile +#define _NMTDS_ListOfPairBoolean_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#ifndef _Standard_Address_HeaderFile +#include +#endif +#ifndef _Handle_NMTDS_ListNodeOfListOfPairBoolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class NMTDS_ListIteratorOfListOfPairBoolean; +class NMTDS_PairBoolean; +class NMTDS_ListNodeOfListOfPairBoolean; + + + +class NMTDS_ListOfPairBoolean { +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); + } + + + Standard_EXPORT NMTDS_ListOfPairBoolean(); + + Standard_EXPORT void Assign(const NMTDS_ListOfPairBoolean& Other) ; + void operator=(const NMTDS_ListOfPairBoolean& Other) +{ + Assign(Other); +} + + Standard_EXPORT Standard_Integer Extent() const; + + Standard_EXPORT void Clear() ; +~NMTDS_ListOfPairBoolean() +{ + Clear(); +} + + Standard_Boolean IsEmpty() const; + + Standard_EXPORT void Prepend(const NMTDS_PairBoolean& I) ; + + Standard_EXPORT void Prepend(const NMTDS_PairBoolean& I,NMTDS_ListIteratorOfListOfPairBoolean& theIt) ; + + Standard_EXPORT void Prepend(NMTDS_ListOfPairBoolean& Other) ; + + Standard_EXPORT void Append(const NMTDS_PairBoolean& I) ; + + Standard_EXPORT void Append(const NMTDS_PairBoolean& I,NMTDS_ListIteratorOfListOfPairBoolean& theIt) ; + + Standard_EXPORT void Append(NMTDS_ListOfPairBoolean& Other) ; + + Standard_EXPORT NMTDS_PairBoolean& First() const; + + Standard_EXPORT NMTDS_PairBoolean& Last() const; + + Standard_EXPORT void RemoveFirst() ; + + Standard_EXPORT void Remove(NMTDS_ListIteratorOfListOfPairBoolean& It) ; + + Standard_EXPORT void InsertBefore(const NMTDS_PairBoolean& I,NMTDS_ListIteratorOfListOfPairBoolean& It) ; + + Standard_EXPORT void InsertBefore(NMTDS_ListOfPairBoolean& Other,NMTDS_ListIteratorOfListOfPairBoolean& It) ; + + Standard_EXPORT void InsertAfter(const NMTDS_PairBoolean& I,NMTDS_ListIteratorOfListOfPairBoolean& It) ; + + Standard_EXPORT void InsertAfter(NMTDS_ListOfPairBoolean& Other,NMTDS_ListIteratorOfListOfPairBoolean& It) ; + + +friend class NMTDS_ListIteratorOfListOfPairBoolean; + + + +protected: + + + + + +private: + + + Standard_EXPORT NMTDS_ListOfPairBoolean(const NMTDS_ListOfPairBoolean& Other); + + +Standard_Address myFirst; +Standard_Address myLast; + + +}; + +#define Item NMTDS_PairBoolean +#define Item_hxx +#define TCollection_ListNode NMTDS_ListNodeOfListOfPairBoolean +#define TCollection_ListNode_hxx +#define TCollection_ListIterator NMTDS_ListIteratorOfListOfPairBoolean +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_NMTDS_ListNodeOfListOfPairBoolean +#define TCollection_ListNode_Type_() NMTDS_ListNodeOfListOfPairBoolean_Type_() +#define TCollection_List NMTDS_ListOfPairBoolean +#define TCollection_List_hxx + +#include + +#undef Item +#undef Item_hxx +#undef TCollection_ListNode +#undef TCollection_ListNode_hxx +#undef TCollection_ListIterator +#undef TCollection_ListIterator_hxx +#undef Handle_TCollection_ListNode +#undef TCollection_ListNode_Type_ +#undef TCollection_List +#undef TCollection_List_hxx + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_ListOfPairBoolean_0.cxx b/src/NMTDS/NMTDS_ListOfPairBoolean_0.cxx new file mode 100644 index 000000000..40e4ff1c4 --- /dev/null +++ b/src/NMTDS/NMTDS_ListOfPairBoolean_0.cxx @@ -0,0 +1,49 @@ +// 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 + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _NMTDS_ListIteratorOfListOfPairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_PairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_ListNodeOfListOfPairBoolean_HeaderFile +#include +#endif + + +#define Item NMTDS_PairBoolean +#define Item_hxx +#define TCollection_ListNode NMTDS_ListNodeOfListOfPairBoolean +#define TCollection_ListNode_hxx +#define TCollection_ListIterator NMTDS_ListIteratorOfListOfPairBoolean +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_NMTDS_ListNodeOfListOfPairBoolean +#define TCollection_ListNode_Type_() NMTDS_ListNodeOfListOfPairBoolean_Type_() +#define TCollection_List NMTDS_ListOfPairBoolean +#define TCollection_List_hxx +#include + diff --git a/src/NMTDS/NMTDS_ListOfPair_0.cxx b/src/NMTDS/NMTDS_ListOfPair_0.cxx new file mode 100644 index 000000000..ff7491667 --- /dev/null +++ b/src/NMTDS/NMTDS_ListOfPair_0.cxx @@ -0,0 +1,49 @@ +// 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 + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _NMTDS_ListIteratorOfListOfPair_HeaderFile +#include +#endif +#ifndef _NMTDS_Pair_HeaderFile +#include +#endif +#ifndef _NMTDS_ListNodeOfListOfPair_HeaderFile +#include +#endif + + +#define Item NMTDS_Pair +#define Item_hxx +#define TCollection_ListNode NMTDS_ListNodeOfListOfPair +#define TCollection_ListNode_hxx +#define TCollection_ListIterator NMTDS_ListIteratorOfListOfPair +#define TCollection_ListIterator_hxx +#define Handle_TCollection_ListNode Handle_NMTDS_ListNodeOfListOfPair +#define TCollection_ListNode_Type_() NMTDS_ListNodeOfListOfPair_Type_() +#define TCollection_List NMTDS_ListOfPair +#define TCollection_List_hxx +#include + diff --git a/src/NMTDS/NMTDS_MapIteratorOfMapOfPairBoolean.hxx b/src/NMTDS/NMTDS_MapIteratorOfMapOfPairBoolean.hxx new file mode 100644 index 000000000..34d774295 --- /dev/null +++ b/src/NMTDS/NMTDS_MapIteratorOfMapOfPairBoolean.hxx @@ -0,0 +1,96 @@ +// 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 + +#ifndef _NMTDS_MapIteratorOfMapOfPairBoolean_HeaderFile +#define _NMTDS_MapIteratorOfMapOfPairBoolean_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Handle_NMTDS_StdMapNodeOfMapOfPairBoolean_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class NMTDS_PairBoolean; +class NMTDS_PairMapHasher; +class NMTDS_MapOfPairBoolean; +class NMTDS_StdMapNodeOfMapOfPairBoolean; + + + +class NMTDS_MapIteratorOfMapOfPairBoolean : public TCollection_BasicMapIterator { +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); + } + + + Standard_EXPORT NMTDS_MapIteratorOfMapOfPairBoolean(); + + Standard_EXPORT NMTDS_MapIteratorOfMapOfPairBoolean(const NMTDS_MapOfPairBoolean& aMap); + + Standard_EXPORT void Initialize(const NMTDS_MapOfPairBoolean& aMap) ; + + Standard_EXPORT const NMTDS_PairBoolean& Key() const; + + + + + +protected: + + + + + +private: + + + + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_MapIteratorOfMapOfPairBoolean_0.cxx b/src/NMTDS/NMTDS_MapIteratorOfMapOfPairBoolean_0.cxx new file mode 100644 index 000000000..f52475020 --- /dev/null +++ b/src/NMTDS/NMTDS_MapIteratorOfMapOfPairBoolean_0.cxx @@ -0,0 +1,54 @@ +// 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 + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _NMTDS_PairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_PairMapHasher_HeaderFile +#include +#endif +#ifndef _NMTDS_MapOfPairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_StdMapNodeOfMapOfPairBoolean_HeaderFile +#include +#endif + + +#define TheKey NMTDS_PairBoolean +#define TheKey_hxx +#define Hasher NMTDS_PairMapHasher +#define Hasher_hxx +#define TCollection_StdMapNode NMTDS_StdMapNodeOfMapOfPairBoolean +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator NMTDS_MapIteratorOfMapOfPairBoolean +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_NMTDS_StdMapNodeOfMapOfPairBoolean +#define TCollection_StdMapNode_Type_() NMTDS_StdMapNodeOfMapOfPairBoolean_Type_() +#define TCollection_Map NMTDS_MapOfPairBoolean +#define TCollection_Map_hxx +#include + diff --git a/src/NMTDS/NMTDS_MapOfPairBoolean.hxx b/src/NMTDS/NMTDS_MapOfPairBoolean.hxx new file mode 100644 index 000000000..108319ba0 --- /dev/null +++ b/src/NMTDS/NMTDS_MapOfPairBoolean.hxx @@ -0,0 +1,118 @@ +// 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 + +#ifndef _NMTDS_MapOfPairBoolean_HeaderFile +#define _NMTDS_MapOfPairBoolean_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Handle_NMTDS_StdMapNodeOfMapOfPairBoolean_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class NMTDS_PairBoolean; +class NMTDS_PairMapHasher; +class NMTDS_StdMapNodeOfMapOfPairBoolean; +class NMTDS_MapIteratorOfMapOfPairBoolean; + + + +class NMTDS_MapOfPairBoolean : 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); + } + + + Standard_EXPORT NMTDS_MapOfPairBoolean(const Standard_Integer NbBuckets = 1); + + Standard_EXPORT NMTDS_MapOfPairBoolean& Assign(const NMTDS_MapOfPairBoolean& Other) ; + NMTDS_MapOfPairBoolean& operator =(const NMTDS_MapOfPairBoolean& Other) +{ + return Assign(Other); +} + + Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + Standard_EXPORT void Clear() ; +~NMTDS_MapOfPairBoolean() +{ + Clear(); +} + + Standard_EXPORT Standard_Boolean Add(const NMTDS_PairBoolean& aKey) ; + + Standard_EXPORT Standard_Boolean Contains(const NMTDS_PairBoolean& aKey) const; + + Standard_EXPORT Standard_Boolean Remove(const NMTDS_PairBoolean& aKey) ; + + + + + +protected: + + + + + +private: + + + Standard_EXPORT NMTDS_MapOfPairBoolean(const NMTDS_MapOfPairBoolean& Other); + + + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_MapOfPairBoolean_0.cxx b/src/NMTDS/NMTDS_MapOfPairBoolean_0.cxx new file mode 100644 index 000000000..7b21510b5 --- /dev/null +++ b/src/NMTDS/NMTDS_MapOfPairBoolean_0.cxx @@ -0,0 +1,54 @@ +// 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 + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _NMTDS_PairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_PairMapHasher_HeaderFile +#include +#endif +#ifndef _NMTDS_StdMapNodeOfMapOfPairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_MapIteratorOfMapOfPairBoolean_HeaderFile +#include +#endif + + +#define TheKey NMTDS_PairBoolean +#define TheKey_hxx +#define Hasher NMTDS_PairMapHasher +#define Hasher_hxx +#define TCollection_StdMapNode NMTDS_StdMapNodeOfMapOfPairBoolean +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator NMTDS_MapIteratorOfMapOfPairBoolean +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_NMTDS_StdMapNodeOfMapOfPairBoolean +#define TCollection_StdMapNode_Type_() NMTDS_StdMapNodeOfMapOfPairBoolean_Type_() +#define TCollection_Map NMTDS_MapOfPairBoolean +#define TCollection_Map_hxx +#include + diff --git a/src/NMTDS/NMTDS_Pair.cdl b/src/NMTDS/NMTDS_Pair.cdl new file mode 100644 index 000000000..4b5522616 --- /dev/null +++ b/src/NMTDS/NMTDS_Pair.cdl @@ -0,0 +1,66 @@ +-- 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: NMTDS_Pair.cdl +-- Created: +-- Author: Peter KURNEV +-- +class Pair from NMTDS + + ---Purpose: + +--uses +--raises + +is + Create + returns Pair from NMTDS; + ---C++: alias "Standard_EXPORT virtual ~NMTDS_Pair();" + + Create(Other:Pair from NMTDS) + returns Pair from NMTDS; + ---C++: alias "Standard_EXPORT NMTDS_Pair& operator =(const NMTDS_Pair& Other);" + + Clear(me:out); + + SetIds(me:out; + aI1 :Integer from Standard; + aI2 :Integer from Standard); + + Ids(me; + aI1 :out Integer from Standard; + aI2 :out Integer from Standard); + + IsEqual(me; + aOther:Pair from NMTDS) + returns Boolean from Standard; + + HashCode(me; + Upper : Integer from Standard) + returns Integer from Standard; + + +fields + myId1: Integer from Standard is protected; + myId2: Integer from Standard is protected; + +end Pair; diff --git a/src/NMTDS/NMTDS_Pair.cxx b/src/NMTDS/NMTDS_Pair.cxx new file mode 100644 index 000000000..dece0c710 --- /dev/null +++ b/src/NMTDS/NMTDS_Pair.cxx @@ -0,0 +1,149 @@ +// 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: NMTDS_Pair.cxx +// Author: Peter KURNEV + +#include + +#include +#include +#include +#include + +#ifdef WNT +#pragma warning( disable : 4101) +#endif + +static + Standard_Integer NormalizedId(const Standard_Integer aId, + const Standard_Integer aDiv); + +//======================================================================= +//function : +//purpose : +//======================================================================= +NMTDS_Pair::NMTDS_Pair() +{ + Clear(); +} +//======================================================================= +//function : +//purpose : +//======================================================================= +NMTDS_Pair::NMTDS_Pair(const NMTDS_Pair& aOther) +{ + myId1=aOther.myId1; + myId2=aOther.myId2; +} +//======================================================================= +//function :operator = +//purpose : +//======================================================================= + NMTDS_Pair& NMTDS_Pair::operator =(const NMTDS_Pair& aOther) +{ + myId1=aOther.myId1; + myId2=aOther.myId2; + return *this; +} +//======================================================================= +//function :~ +//purpose : +//======================================================================= + NMTDS_Pair::~NMTDS_Pair() +{ +} +//======================================================================= +//function :Clear +//purpose : +//======================================================================= + void NMTDS_Pair::Clear() +{ + myId1=0; + myId2=0; +} +//======================================================================= +//function :SetIds +//purpose : +//======================================================================= + void NMTDS_Pair::SetIds(const Standard_Integer aId1, + const Standard_Integer aId2) +{ + Clear(); + myId1=aId1; + myId2=aId2; + if (aId1>aId2) { + myId1=aId2; + myId2=aId1; + } +} +//======================================================================= +//function :Ids +//purpose : +//======================================================================= + void NMTDS_Pair::Ids(Standard_Integer& aId1, + Standard_Integer& aId2) const +{ + aId1=myId1; + aId2=myId2; +} +//======================================================================= +//function :IsEqual +//purpose : +//======================================================================= + Standard_Boolean NMTDS_Pair::IsEqual(const NMTDS_Pair& aOther) const +{ + + Standard_Boolean bRet; + // + bRet=(myId1==aOther.myId1 && myId2==aOther.myId2);//ZZ + return bRet; +} +//======================================================================= +//function : HashCode +//purpose : +//======================================================================= + Standard_Integer NMTDS_Pair::HashCode(const Standard_Integer aUpper) const +{ + Standard_Integer aSum; + // + aSum=0; + aSum+=NormalizedId(myId1, 2); + aSum+=NormalizedId(myId2, 2); + return ::HashCode(aSum, aUpper); +} +//======================================================================= +// function: NormalizedId +// purpose : +//======================================================================= +Standard_Integer NormalizedId(const Standard_Integer aId, + const Standard_Integer aDiv) +{ + Standard_Integer aMax, aTresh, aIdRet; + // + aIdRet=aId; + aMax=::IntegerLast(); + aTresh=aMax/aDiv; + if (aId>aTresh) { + aIdRet=aId%aTresh; + } + return aIdRet; +} diff --git a/src/NMTDS/NMTDS_Pair.hxx b/src/NMTDS/NMTDS_Pair.hxx new file mode 100644 index 000000000..2b884ec9d --- /dev/null +++ b/src/NMTDS/NMTDS_Pair.hxx @@ -0,0 +1,101 @@ +// 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 + +#ifndef _NMTDS_Pair_HeaderFile +#define _NMTDS_Pair_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif + + + +class NMTDS_Pair { +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); + } + + + Standard_EXPORT NMTDS_Pair(); +Standard_EXPORT virtual ~NMTDS_Pair(); + + Standard_EXPORT NMTDS_Pair(const NMTDS_Pair& Other); +Standard_EXPORT NMTDS_Pair& operator =(const NMTDS_Pair& Other); + + Standard_EXPORT void Clear() ; + + Standard_EXPORT void SetIds(const Standard_Integer aI1,const Standard_Integer aI2) ; + + Standard_EXPORT void Ids(Standard_Integer& aI1,Standard_Integer& aI2) const; + + Standard_EXPORT Standard_Boolean IsEqual(const NMTDS_Pair& aOther) const; + + Standard_EXPORT Standard_Integer HashCode(const Standard_Integer Upper) const; + + + + + +protected: + + + +Standard_Integer myId1; +Standard_Integer myId2; + + +private: + + + + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_Pair.ixx b/src/NMTDS/NMTDS_Pair.ixx new file mode 100644 index 000000000..359d8ae56 --- /dev/null +++ b/src/NMTDS/NMTDS_Pair.ixx @@ -0,0 +1,26 @@ +// 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 + +#include + + + + diff --git a/src/NMTDS/NMTDS_Pair.jxx b/src/NMTDS/NMTDS_Pair.jxx new file mode 100644 index 000000000..f732185d7 --- /dev/null +++ b/src/NMTDS/NMTDS_Pair.jxx @@ -0,0 +1,24 @@ +// 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 + +#ifndef _NMTDS_Pair_HeaderFile +#include +#endif diff --git a/src/NMTDS/NMTDS_PairBoolean.cdl b/src/NMTDS/NMTDS_PairBoolean.cdl new file mode 100644 index 000000000..e20e9e430 --- /dev/null +++ b/src/NMTDS/NMTDS_PairBoolean.cdl @@ -0,0 +1,52 @@ +-- 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: NMTDS_PairBoolean.cdl +-- Created: +-- Author: Peter KURNEV + +class PairBoolean from NMTDS + inherits Pair from NMTDS + + ---Purpose: + +uses + Shape from TopoDS, + ListOfInteger from TColStd + +--raises + +is + Create + returns PairBoolean from NMTDS; + ---C++: alias "Standard_EXPORT virtual ~NMTDS_PairBoolean();" + + SetFlag(me:out; + aFlag: Boolean from Standard); + ---C++: alias " Standard_EXPORT NMTDS_PairBoolean& operator =(const NMTDS_PairBoolean& Other);" + + Flag(me) + returns Boolean from Standard; + +fields + myFlag: Boolean from Standard is protected; + +end PairBoolean; diff --git a/src/NMTDS/NMTDS_PairBoolean.cxx b/src/NMTDS/NMTDS_PairBoolean.cxx new file mode 100644 index 000000000..364694960 --- /dev/null +++ b/src/NMTDS/NMTDS_PairBoolean.cxx @@ -0,0 +1,69 @@ +// 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: NMTDS_PairBoolean.cxx +// Author: Peter KURNEV + +#include + +//======================================================================= +//function : +//purpose : +//======================================================================= + NMTDS_PairBoolean::NMTDS_PairBoolean() +: + myFlag(Standard_False), + NMTDS_Pair() +{ +} +//======================================================================= +//function : ~ +//purpose : +//======================================================================= + NMTDS_PairBoolean::~NMTDS_PairBoolean() +{ +} +//======================================================================= +//function :operator = +//purpose : +//======================================================================= + NMTDS_PairBoolean& NMTDS_PairBoolean::operator =(const NMTDS_PairBoolean& anOther) +{ + myFlag=anOther.myFlag; + NMTDS_Pair::operator =(anOther); + return *this; +} +//======================================================================= +//function :SetFlag +//purpose : +//======================================================================= + void NMTDS_PairBoolean::SetFlag(const Standard_Boolean aFlag) +{ + myFlag=aFlag; +} +//======================================================================= +//function :Flag +//purpose : +//======================================================================= + Standard_Boolean NMTDS_PairBoolean::Flag()const +{ + return myFlag; +} diff --git a/src/NMTDS/NMTDS_PairBoolean.hxx b/src/NMTDS/NMTDS_PairBoolean.hxx new file mode 100644 index 000000000..8bf1a29e1 --- /dev/null +++ b/src/NMTDS/NMTDS_PairBoolean.hxx @@ -0,0 +1,92 @@ +// 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 + +#ifndef _NMTDS_PairBoolean_HeaderFile +#define _NMTDS_PairBoolean_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +#ifndef _NMTDS_Pair_HeaderFile +#include +#endif + + + +class NMTDS_PairBoolean : public NMTDS_Pair { +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); + } + + + Standard_EXPORT NMTDS_PairBoolean(); +Standard_EXPORT virtual ~NMTDS_PairBoolean(); + + Standard_EXPORT void SetFlag(const Standard_Boolean aFlag) ; + Standard_EXPORT NMTDS_PairBoolean& operator =(const NMTDS_PairBoolean& Other); + + Standard_EXPORT Standard_Boolean Flag() const; + + + + + +protected: + + + +Standard_Boolean myFlag; + + +private: + + + + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_PairBoolean.ixx b/src/NMTDS/NMTDS_PairBoolean.ixx new file mode 100644 index 000000000..71fdb731a --- /dev/null +++ b/src/NMTDS/NMTDS_PairBoolean.ixx @@ -0,0 +1,26 @@ +// 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 + +#include + + + + diff --git a/src/NMTDS/NMTDS_PairBoolean.jxx b/src/NMTDS/NMTDS_PairBoolean.jxx new file mode 100644 index 000000000..c45fd0355 --- /dev/null +++ b/src/NMTDS/NMTDS_PairBoolean.jxx @@ -0,0 +1,24 @@ +// 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 + +#ifndef _NMTDS_PairBoolean_HeaderFile +#include +#endif diff --git a/src/NMTDS/NMTDS_PairMapHasher.cdl b/src/NMTDS/NMTDS_PairMapHasher.cdl new file mode 100644 index 000000000..cf4a80485 --- /dev/null +++ b/src/NMTDS/NMTDS_PairMapHasher.cdl @@ -0,0 +1,46 @@ +-- 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: NMTDS_PairMapHasher.cdl +-- Author: Peter KURNEV + +class PairMapHasher from NMTDS + + ---Purpose: + +uses + Pair from NMTDS + +--raises + +is + HashCode(myclass; + aPKey : Pair from NMTDS; + Upper : Integer from Standard) + returns Integer from Standard; + + + IsEqual(myclass; + aPKey1 : Pair from NMTDS; + aPKey2 : Pair from NMTDS) + returns Boolean from Standard; + +end PairMapHasher; diff --git a/src/NMTDS/NMTDS_PairMapHasher.cxx b/src/NMTDS/NMTDS_PairMapHasher.cxx new file mode 100644 index 000000000..46c79902b --- /dev/null +++ b/src/NMTDS/NMTDS_PairMapHasher.cxx @@ -0,0 +1,44 @@ +// 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: NMTDS_PairMapHasher.cxx +// Author: Peter KURNEV + +#include + +//======================================================================= +//function : HashCode +//purpose : +//======================================================================= +Standard_Integer NMTDS_PairMapHasher::HashCode(const NMTDS_Pair& aPK, + const Standard_Integer Upper) +{ + return aPK.HashCode(Upper); +} +//======================================================================= +//function :IsEqual +//purpose : +//======================================================================= +Standard_Boolean NMTDS_PairMapHasher::IsEqual(const NMTDS_Pair& aPK1, + const NMTDS_Pair& aPK2) +{ + return aPK1.IsEqual(aPK2); +} diff --git a/src/NMTDS/NMTDS_PairMapHasher.hxx b/src/NMTDS/NMTDS_PairMapHasher.hxx new file mode 100644 index 000000000..24858888d --- /dev/null +++ b/src/NMTDS/NMTDS_PairMapHasher.hxx @@ -0,0 +1,88 @@ +// 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 + +#ifndef _NMTDS_PairMapHasher_HeaderFile +#define _NMTDS_PairMapHasher_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class NMTDS_Pair; + + + +class NMTDS_PairMapHasher { +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); + } + + + Standard_EXPORT static Standard_Integer HashCode(const NMTDS_Pair& aPKey,const Standard_Integer Upper) ; + + Standard_EXPORT static Standard_Boolean IsEqual(const NMTDS_Pair& aPKey1,const NMTDS_Pair& aPKey2) ; + + + + + +protected: + + + + + +private: + + + + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_PairMapHasher.ixx b/src/NMTDS/NMTDS_PairMapHasher.ixx new file mode 100644 index 000000000..19a1a77a4 --- /dev/null +++ b/src/NMTDS/NMTDS_PairMapHasher.ixx @@ -0,0 +1,26 @@ +// 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 + +#include + + + + diff --git a/src/NMTDS/NMTDS_PairMapHasher.jxx b/src/NMTDS/NMTDS_PairMapHasher.jxx new file mode 100644 index 000000000..d4dfdf593 --- /dev/null +++ b/src/NMTDS/NMTDS_PairMapHasher.jxx @@ -0,0 +1,27 @@ +// 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 + +#ifndef _NMTDS_Pair_HeaderFile +#include +#endif +#ifndef _NMTDS_PairMapHasher_HeaderFile +#include +#endif diff --git a/src/NMTDS/NMTDS_ShapesDataStructure.cdl b/src/NMTDS/NMTDS_ShapesDataStructure.cdl index 5b11882c0..0f2c201f6 100644 --- a/src/NMTDS/NMTDS_ShapesDataStructure.cdl +++ b/src/NMTDS/NMTDS_ShapesDataStructure.cdl @@ -21,7 +21,7 @@ -- -- File: NMTDS_ShapesDataStructure.cdl --- Created: Mon Dec 1 10:17:05 2003 +-- Created: -- Author: Peter KURNEV -- class ShapesDataStructure from NMTDS @@ -34,8 +34,11 @@ uses IndexedMapOfInteger from TColStd, Shape from TopoDS, IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations, - CArray1OfIndexRange from NMTDS, - IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger from NMTDS + CArray1OfIndexRange from NMTDS, + --modified by NIZNHY-PKV Mon Dec 12 08:57:18 2011f + DataMapOfShapeInteger from TopTools + --IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger from NMTDS + --modified by NIZNHY-PKV Mon Dec 12 08:57:22 2011t --raises is @@ -70,8 +73,6 @@ is returns Integer from Standard is redefined; --- Modified to Add new methods Thu Sep 14 14:35:18 2006 --- Contribution of Samtech www.samcef.com BEGIN FillMap (me; aS :Shape from TopoDS; aMSA: out IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations; @@ -81,7 +82,6 @@ is aS :Shape from TopoDS; aMSA:out IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations; aMS :out IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations); --- Contribution of Samtech www.samcef.com END GetAllSuccessors(me; anIndex:Integer from Standard; @@ -93,8 +93,10 @@ is fields myCompositeShape: Shape from TopoDS is protected; - myRanges : CArray1OfIndexRange from NMTDS is protected; - myShapeIndexMap : IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger from NMTDS is protected; - + myRanges : CArray1OfIndexRange from NMTDS is protected; + --modified by NIZNHY-PKV Mon Dec 12 08:58:07 2011f + myShapeIndexMap : DataMapOfShapeInteger from TopTools is protected; + --myShapeIndexMap : IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger from NMTDS is protected; + --modified by NIZNHY-PKV Mon Dec 12 08:58:21 2011t end ShapesDataStructure; diff --git a/src/NMTDS/NMTDS_ShapesDataStructure.cxx b/src/NMTDS/NMTDS_ShapesDataStructure.cxx index 85e5876b5..1fc3741c1 100644 --- a/src/NMTDS/NMTDS_ShapesDataStructure.cxx +++ b/src/NMTDS/NMTDS_ShapesDataStructure.cxx @@ -18,13 +18,10 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// // File: NMTDS_ShapesDataStructure.cxx -// Created: Mon Dec 1 10:21:04 2003 // Author: Peter KURNEV -// -// + #include #include #include @@ -53,7 +50,7 @@ static //function : NMTDS_ShapesDataStructure::NMTDS_ShapesDataStructure //purpose : //=========================================================================== - NMTDS_ShapesDataStructure::NMTDS_ShapesDataStructure() +NMTDS_ShapesDataStructure::NMTDS_ShapesDataStructure() : BooleanOperations_ShapesDataStructure() {} @@ -61,7 +58,7 @@ static //function : SetCompositeShape //purpose : //=========================================================================== - void NMTDS_ShapesDataStructure::SetCompositeShape(const TopoDS_Shape& aS) +void NMTDS_ShapesDataStructure::SetCompositeShape(const TopoDS_Shape& aS) { myCompositeShape=aS; } @@ -69,7 +66,7 @@ static //function : CompositeShape //purpose : //=========================================================================== - const TopoDS_Shape& NMTDS_ShapesDataStructure::CompositeShape()const +const TopoDS_Shape& NMTDS_ShapesDataStructure::CompositeShape()const { return myCompositeShape; } @@ -77,17 +74,15 @@ static //function : Ranges //purpose : //=========================================================================== - const NMTDS_CArray1OfIndexRange& NMTDS_ShapesDataStructure::Ranges()const +const NMTDS_CArray1OfIndexRange& NMTDS_ShapesDataStructure::Ranges()const { return myRanges; } -// Modified to Add new methods Thu Sep 14 14:35:18 2006 -// Contribution of Samtech www.samcef.com BEGIN //=========================================================================== //function : FillMap //purpose : //=========================================================================== - void NMTDS_ShapesDataStructure::FillMap +void NMTDS_ShapesDataStructure::FillMap (const TopoDS_Shape& aS, BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSA, BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMS) const @@ -121,7 +116,7 @@ static //function : FillSubshapes //purpose : //=========================================================================== - void NMTDS_ShapesDataStructure::FillSubshapes +void NMTDS_ShapesDataStructure::FillSubshapes (const TopoDS_Shape& aS, BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSA, BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMS) const @@ -153,12 +148,11 @@ static } } } -// Contribution of Samtech www.samcef.com END //=========================================================================== //function : Init //purpose : //=========================================================================== - void NMTDS_ShapesDataStructure::Init() +void NMTDS_ShapesDataStructure::Init() { Standard_Integer i, j, aNbSx, aNbS, aShift, aNbRanges; Standard_Integer iFirst, iLast; @@ -171,30 +165,21 @@ static for (; anIt.More(); anIt.Next()) { const TopoDS_Shape& aSx=anIt.Value(); BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors aMS; - //modified by NIZNHY-PKV Tue Feb 27 17:05:47 2007f - //FillMap(aSx, aMSA, aMS); - //aLx.Append(aMS); // if (!aMSA.Contains(aSx)) { FillMap(aSx, aMSA, aMS); aLx.Append(aMS); } - //modified by NIZNHY-PKV Tue Feb 27 17:06:03 2007t } aNbS=aMSA.Extent(); // // Fill myRanges - //modified by NIZNHY-PKV Tue Feb 27 17:10:07 2007f i=aLx.Extent(); - //modified by NIZNHY-PKV Tue Feb 27 17:10:10 2007t myRanges.Resize(i); aLit.Initialize(aLx); for (i=1; aLit.More(); aLit.Next(), ++i) { - // Modified Thu Sep 14 14:35:18 2006 - // Contribution of Samtech www.samcef.com BEGIN const BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSx=aLit.Value(); aNbSx=aMSx.Extent(); - // Contribution of Samtech www.samcef.com END if (i==1) { iFirst=1; iLast=aNbSx; @@ -209,34 +194,14 @@ static } // myNumberOfShapesOfTheObject=aNbS; - // Modified Thu Sep 14 14:35:18 2006 - // Contribution of Samtech www.samcef.com BEGIN - //myNumberOfShapesOfTheTool=aNbS; - //myLength=3*aNbS; myNumberOfShapesOfTheTool=0; myLength=2*aNbS; - // Contribution of Samtech www.samcef.com END // // Allocate the whole Table myListOfShapeAndInterferences = (BooleanOperations_PShapeAndInterferences) Standard::Allocate(myLength*sizeof(BooleanOperations_ShapeAndInterferences)); - // Modified Thu Sep 14 14:35:18 2006 - // Contribution of Samtech www.samcef.com BEGIN // // Fill the table - - //aShift=0; - //for (i=0; i<2; ++i) { - // if (i) { - // aShift=aNbS; - // } - // for (j=1; j<=aNbS; ++j) { - // const TopoDS_Shape& aSx=aMSA.FindKey(j); - // const BooleanOperations_AncestorsSeqAndSuccessorsSeq& aASx= - // aMSA.FindFromIndex(j); - // InsertShapeAndAncestorsSuccessors(aSx, aASx, aShift); - // } - //} aShift=0; for (j=1; j<=aNbS; ++j) { @@ -244,24 +209,21 @@ static const BooleanOperations_AncestorsSeqAndSuccessorsSeq& aASx=aMSA.FindFromIndex(j); InsertShapeAndAncestorsSuccessors(aSx, aASx, aShift); } - // Contribution of Samtech www.samcef.com END - // // myShapeIndexMap myShapeIndexMap.Clear(); // + //modified by NIZNHY-PKV Mon Dec 12 09:01:53 2011f aNbRanges=myRanges.Extent(); for (i=1; i<=aNbRanges; ++i){ - BooleanOperations_IndexedDataMapOfShapeInteger aSIM; - // const NMTDS_IndexRange& aR=myRanges(i); iFirst=aR.First(); iLast =aR.Last(); for (j=iFirst; j<=iLast; ++j) { const TopoDS_Shape& aS=Shape(j); - aSIM.Add(aS, j); + myShapeIndexMap.Bind(aS, j); } - myShapeIndexMap.Add(i, aSIM); } + //modified by NIZNHY-PKV Mon Dec 12 09:02:00 2011t // // myRefEdges iLast=myNumberOfShapesOfTheObject+myNumberOfShapesOfTheTool; @@ -280,7 +242,8 @@ static //function : ShapeRangeIndex //purpose : //=========================================================================== - Standard_Integer NMTDS_ShapesDataStructure::ShapeRangeIndex(const Standard_Integer aId)const +Standard_Integer NMTDS_ShapesDataStructure::ShapeRangeIndex + (const Standard_Integer aId)const { Standard_Boolean bFound; Standard_Integer i, aNbR, aIdx, aNbS, aZero=0; @@ -310,7 +273,8 @@ static //function : Rank //purpose : //=========================================================================== - Standard_Integer NMTDS_ShapesDataStructure::Rank(const Standard_Integer aId)const +Standard_Integer NMTDS_ShapesDataStructure::Rank + (const Standard_Integer aId)const { Standard_Boolean bFound; Standard_Integer i, aNbR, aNbS, aZero=0; @@ -335,41 +299,21 @@ static //function : ShapeIndex //purpose : //=========================================================================== - Standard_Integer NMTDS_ShapesDataStructure::ShapeIndex(const TopoDS_Shape& aS, - const Standard_Integer aRank)const +Standard_Integer NMTDS_ShapesDataStructure::ShapeIndex + (const TopoDS_Shape& aS, + const Standard_Integer aRank)const { - Standard_Boolean bFound; - Standard_Integer aIndex=0; - // - bFound=myShapeIndexMap.Contains(aRank); - if (!bFound) { - return aIndex; - } - // Modified Thu Sep 14 14:35:18 2006 - // Contribution of Samtech www.samcef.com BEGIN - // - //const BooleanOperations_IndexedDataMapOfShapeInteger& aSIM= - // myShapeIndexMap.FindFromKey(aRank); - // - //bFound=aSIM.Contains(aS); - //if (!bFound) { - // return aIndex; - //} - // - //aIndex=aSIM.FindFromKey(aS); + Standard_Address pIndex; + Standard_Integer aIndex; // - Standard_Integer i, aNbRanks; + aIndex=0; // - aNbRanks=myShapeIndexMap.Extent(); - for (i=1; i<=aNbRanks; ++i){ - const BooleanOperations_IndexedDataMapOfShapeInteger& aSIM=myShapeIndexMap.FindFromKey(i); - bFound=aSIM.Contains(aS); - if (bFound) { - aIndex=aSIM.FindFromKey(aS); - return aIndex; - } + //modified by NIZNHY-PKV Mon Dec 12 09:02:48 2011f + pIndex=myShapeIndexMap.Find1(aS); + if (pIndex) { + aIndex=*((Standard_Integer*)pIndex); } - // Contribution of Samtech www.samcef.com END + //modified by NIZNHY-PKV Mon Dec 12 09:02:54 2011t return aIndex; } @@ -377,8 +321,9 @@ static //function : ComputeBoxEx //purpose : //======================================================================= - void NMTDS_ShapesDataStructure::ComputeBoxEx (const Standard_Integer aIx, - Bnd_Box& aBoxEx)const +void NMTDS_ShapesDataStructure::ComputeBoxEx + (const Standard_Integer aIx, + Bnd_Box& aBoxEx)const { ComputeBoxExS(aIx, this, aBoxEx); } @@ -386,8 +331,9 @@ static //function : GetAllSuccessors //purpose : //======================================================================= - void NMTDS_ShapesDataStructure::GetAllSuccessors(const Standard_Integer nS, - TColStd_IndexedMapOfInteger& aMA)const +void NMTDS_ShapesDataStructure::GetAllSuccessors + (const Standard_Integer nS, + TColStd_IndexedMapOfInteger& aMA)const { GetAllSuccessorsS(nS, this, aMA); } @@ -424,9 +370,9 @@ void GetAllSuccessorsS(const Standard_Integer nS, // function: ComputeBoxExS // purpose: //======================================================================= - void ComputeBoxExS(const Standard_Integer aIx, - const NMTDS_ShapesDataStructure* pDS, - Bnd_Box& aBoxEx) +void ComputeBoxExS(const Standard_Integer aIx, + const NMTDS_ShapesDataStructure* pDS, + Bnd_Box& aBoxEx) { Standard_Integer i, aNbS, iS; // diff --git a/src/NMTDS/NMTDS_ShapesDataStructure.hxx b/src/NMTDS/NMTDS_ShapesDataStructure.hxx index bcc61031b..f8a1180df 100644 --- a/src/NMTDS/NMTDS_ShapesDataStructure.hxx +++ b/src/NMTDS/NMTDS_ShapesDataStructure.hxx @@ -1,148 +1,124 @@ -// 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 -// - -#ifndef _NMTDS_ShapesDataStructure_HeaderFile -#define _NMTDS_ShapesDataStructure_HeaderFile - -#ifndef _TopoDS_Shape_HeaderFile -#include -#endif -#ifndef _NMTDS_CArray1OfIndexRange_HeaderFile -#include -#endif -#ifndef _NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger_HeaderFile -#include -#endif -#ifndef _BooleanOperations_ShapesDataStructure_HeaderFile -#include -#endif -#ifndef _Standard_Integer_HeaderFile -#include -#endif -class TopoDS_Shape; -class NMTDS_CArray1OfIndexRange; -class BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors; -class TColStd_IndexedMapOfInteger; -class Bnd_Box; - - -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Standard_Macro_HeaderFile -#include -#endif - - -class NMTDS_ShapesDataStructure : public BooleanOperations_ShapesDataStructure { - -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_ShapesDataStructure(); - - -Standard_EXPORT void SetCompositeShape(const TopoDS_Shape& aS) ; - - -Standard_EXPORT void Init() ; - - -Standard_EXPORT const NMTDS_CArray1OfIndexRange& Ranges() const; - - -Standard_EXPORT const TopoDS_Shape& CompositeShape() const; - - -Standard_EXPORT Standard_Integer ShapeRangeIndex(const Standard_Integer aId) const; - - -Standard_EXPORT virtual Standard_Integer Rank(const Standard_Integer anIndex) const; - - -Standard_EXPORT virtual Standard_Integer ShapeIndex(const TopoDS_Shape& aS,const Standard_Integer iRank) const; - - -Standard_EXPORT void FillMap(const TopoDS_Shape& aS,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSA,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMS) const; - - -Standard_EXPORT void FillSubshapes(const TopoDS_Shape& aS,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSA,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMS) const; - - -Standard_EXPORT void GetAllSuccessors(const Standard_Integer anIndex,TColStd_IndexedMapOfInteger& aScrs) const; - - -Standard_EXPORT void ComputeBoxEx(const Standard_Integer anIndex,Bnd_Box& aBox) const; - - - - - -protected: - - // Methods PROTECTED - // - - - // Fields PROTECTED - // -TopoDS_Shape myCompositeShape; -NMTDS_CArray1OfIndexRange myRanges; -NMTDS_IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger myShapeIndexMap; - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - - -}; - - - - - -// other Inline functions and methods (like "C++: function call" methods) -// - - -#endif +// 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 + +#ifndef _NMTDS_ShapesDataStructure_HeaderFile +#define _NMTDS_ShapesDataStructure_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _NMTDS_CArray1OfIndexRange_HeaderFile +#include +#endif +#ifndef _TopTools_DataMapOfShapeInteger_HeaderFile +#include +#endif +#ifndef _BooleanOperations_ShapesDataStructure_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +class TopoDS_Shape; +class NMTDS_CArray1OfIndexRange; +class BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors; +class TColStd_IndexedMapOfInteger; +class Bnd_Box; + + + +class NMTDS_ShapesDataStructure : public BooleanOperations_ShapesDataStructure { +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); + } + + + Standard_EXPORT NMTDS_ShapesDataStructure(); + + Standard_EXPORT void SetCompositeShape(const TopoDS_Shape& aS) ; + + Standard_EXPORT void Init() ; + + Standard_EXPORT const NMTDS_CArray1OfIndexRange& Ranges() const; + + Standard_EXPORT const TopoDS_Shape& CompositeShape() const; + + Standard_EXPORT Standard_Integer ShapeRangeIndex(const Standard_Integer aId) const; + + Standard_EXPORT virtual Standard_Integer Rank(const Standard_Integer anIndex) const; + + Standard_EXPORT virtual Standard_Integer ShapeIndex(const TopoDS_Shape& aS,const Standard_Integer iRank) const; + + Standard_EXPORT void FillMap(const TopoDS_Shape& aS,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSA,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMS) const; + + Standard_EXPORT void FillSubshapes(const TopoDS_Shape& aS,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMSA,BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors& aMS) const; + + Standard_EXPORT void GetAllSuccessors(const Standard_Integer anIndex,TColStd_IndexedMapOfInteger& aScrs) const; + + Standard_EXPORT void ComputeBoxEx(const Standard_Integer anIndex,Bnd_Box& aBox) const; + + + + + +protected: + + + +TopoDS_Shape myCompositeShape; +NMTDS_CArray1OfIndexRange myRanges; +TopTools_DataMapOfShapeInteger myShapeIndexMap; + + +private: + + + + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_StdMapNodeOfMapOfPairBoolean.hxx b/src/NMTDS/NMTDS_StdMapNodeOfMapOfPairBoolean.hxx new file mode 100644 index 000000000..4fa8a6ad3 --- /dev/null +++ b/src/NMTDS/NMTDS_StdMapNodeOfMapOfPairBoolean.hxx @@ -0,0 +1,110 @@ +// 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 + +#ifndef _NMTDS_StdMapNodeOfMapOfPairBoolean_HeaderFile +#define _NMTDS_StdMapNodeOfMapOfPairBoolean_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_DefineHandle_HeaderFile +#include +#endif +#ifndef _Handle_NMTDS_StdMapNodeOfMapOfPairBoolean_HeaderFile +#include +#endif + +#ifndef _NMTDS_PairBoolean_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class NMTDS_PairBoolean; +class NMTDS_PairMapHasher; +class NMTDS_MapOfPairBoolean; +class NMTDS_MapIteratorOfMapOfPairBoolean; + + + +class NMTDS_StdMapNodeOfMapOfPairBoolean : public TCollection_MapNode { + +public: + + + NMTDS_StdMapNodeOfMapOfPairBoolean(const NMTDS_PairBoolean& K,const TCollection_MapNodePtr& n); + + NMTDS_PairBoolean& Key() const; + + + + + DEFINE_STANDARD_RTTI(NMTDS_StdMapNodeOfMapOfPairBoolean) + +protected: + + + + +private: + + +NMTDS_PairBoolean myKey; + + +}; + +#define TheKey NMTDS_PairBoolean +#define TheKey_hxx +#define Hasher NMTDS_PairMapHasher +#define Hasher_hxx +#define TCollection_StdMapNode NMTDS_StdMapNodeOfMapOfPairBoolean +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator NMTDS_MapIteratorOfMapOfPairBoolean +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_NMTDS_StdMapNodeOfMapOfPairBoolean +#define TCollection_StdMapNode_Type_() NMTDS_StdMapNodeOfMapOfPairBoolean_Type_() +#define TCollection_Map NMTDS_MapOfPairBoolean +#define TCollection_Map_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_StdMapNode +#undef TCollection_StdMapNode_hxx +#undef TCollection_MapIterator +#undef TCollection_MapIterator_hxx +#undef Handle_TCollection_StdMapNode +#undef TCollection_StdMapNode_Type_ +#undef TCollection_Map +#undef TCollection_Map_hxx + + +// other Inline functions and methods (like "C++: function call" methods) + + +#endif diff --git a/src/NMTDS/NMTDS_StdMapNodeOfMapOfPairBoolean_0.cxx b/src/NMTDS/NMTDS_StdMapNodeOfMapOfPairBoolean_0.cxx new file mode 100644 index 000000000..4a755b6e8 --- /dev/null +++ b/src/NMTDS/NMTDS_StdMapNodeOfMapOfPairBoolean_0.cxx @@ -0,0 +1,71 @@ +// 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 + +#include + +#ifndef _Standard_Type_HeaderFile +#include +#endif + +#ifndef _NMTDS_PairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_PairMapHasher_HeaderFile +#include +#endif +#ifndef _NMTDS_MapOfPairBoolean_HeaderFile +#include +#endif +#ifndef _NMTDS_MapIteratorOfMapOfPairBoolean_HeaderFile +#include +#endif + + + + +IMPLEMENT_STANDARD_TYPE(NMTDS_StdMapNodeOfMapOfPairBoolean) +IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() + STANDARD_TYPE(TCollection_MapNode), + STANDARD_TYPE(MMgt_TShared), + STANDARD_TYPE(Standard_Transient), + +IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() +IMPLEMENT_STANDARD_TYPE_END(NMTDS_StdMapNodeOfMapOfPairBoolean) + + +IMPLEMENT_DOWNCAST(NMTDS_StdMapNodeOfMapOfPairBoolean,Standard_Transient) +IMPLEMENT_STANDARD_RTTI(NMTDS_StdMapNodeOfMapOfPairBoolean) + + +#define TheKey NMTDS_PairBoolean +#define TheKey_hxx +#define Hasher NMTDS_PairMapHasher +#define Hasher_hxx +#define TCollection_StdMapNode NMTDS_StdMapNodeOfMapOfPairBoolean +#define TCollection_StdMapNode_hxx +#define TCollection_MapIterator NMTDS_MapIteratorOfMapOfPairBoolean +#define TCollection_MapIterator_hxx +#define Handle_TCollection_StdMapNode Handle_NMTDS_StdMapNodeOfMapOfPairBoolean +#define TCollection_StdMapNode_Type_() NMTDS_StdMapNodeOfMapOfPairBoolean_Type_() +#define TCollection_Map NMTDS_MapOfPairBoolean +#define TCollection_Map_hxx +#include + diff --git a/src/NMTTools/NMTTools_PaveFiller.cdl b/src/NMTTools/NMTTools_PaveFiller.cdl index 38df5ddea..f4d8ecf41 100644 --- a/src/NMTTools/NMTTools_PaveFiller.cdl +++ b/src/NMTTools/NMTTools_PaveFiller.cdl @@ -20,7 +20,7 @@ -- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -- -- File: NMTTools_PaveFiller.cdl --- Created: Fri Dec 5 14:35:00 2003 +-- Created: -- Author: Peter KURNEV -- -- @@ -252,7 +252,13 @@ is is protected; UpdateCommonBlocks(me:out) + is protected; + + --modified by NIZNHY-PKV Mon Dec 12 09:12:15 2011f + UpdateCommonBlocks(me:out; + aI:Integer from Standard) is protected; + --modified by NIZNHY-PKV Mon Dec 12 09:12:21 2011t UpdatePaveBlocks(me:out) is protected; @@ -385,11 +391,9 @@ is nF2 :Integer from Standard; aLs :out ListOfPaveBlock from BOPTools); ---modified by NIZNHY-PKV Mon Oct 17 11:43:23 2011f - RealSplitsInFace(me:out; + RealSplitsInFace(me:out; nF1 :Integer from Standard; aLPB :out ListOfPaveBlock from BOPTools); ---modified by NIZNHY-PKV Mon Oct 17 11:43:39 2011t RealSplitsOnEdge(me:out; nE1 :Integer from Standard; diff --git a/src/NMTTools/NMTTools_PaveFiller.cxx b/src/NMTTools/NMTTools_PaveFiller.cxx index 3a4e10700..b3c13fcdc 100644 --- a/src/NMTTools/NMTTools_PaveFiller.cxx +++ b/src/NMTTools/NMTTools_PaveFiller.cxx @@ -266,6 +266,10 @@ myPavePoolNew.Destroy(); myPavePoolNew.Resize (myNbEdges); // + //modified by NIZNHY-PKV Mon Dec 12 09:13:53 2011f + UpdateCommonBlocks(0); + //modified by NIZNHY-PKV Mon Dec 12 09:13:56 2011t + // // 5.EF PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE); PerformEF(); @@ -293,6 +297,9 @@ // MakeAloneVertices(); // + //modified by NIZNHY-PKV Mon Dec 12 09:14:23 2011f + myIP->Purge(); + //modified by NIZNHY-PKV Mon Dec 12 09:14:27 2011t myIsDone=Standard_True; } catch (BOPTColStd_Failure& ) { diff --git a/src/NMTTools/NMTTools_PaveFiller.hxx b/src/NMTTools/NMTTools_PaveFiller.hxx index 30be65121..f7c47a2ae 100644 --- a/src/NMTTools/NMTTools_PaveFiller.hxx +++ b/src/NMTTools/NMTTools_PaveFiller.hxx @@ -18,7 +18,6 @@ // 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 _NMTTools_PaveFiller_HeaderFile #define _NMTTools_PaveFiller_HeaderFile @@ -305,9 +304,11 @@ protected: Standard_EXPORT void EFNewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; Standard_EXPORT void UpdateCommonBlocks() ; - + + Standard_EXPORT void UpdateCommonBlocks (const Standard_Integer aI); + Standard_EXPORT void UpdatePaveBlocks() ; - + Standard_EXPORT Standard_Integer SplitIndex(const BOPTools_PaveBlock& aPB) const; Standard_EXPORT void MakeBlocks() ; @@ -347,11 +348,6 @@ private: }; - - - - // other Inline functions and methods (like "C++: function call" methods) - #endif diff --git a/src/NMTTools/NMTTools_PaveFiller_7.cxx b/src/NMTTools/NMTTools_PaveFiller_7.cxx index 9484646a0..dc98b9ed5 100644 --- a/src/NMTTools/NMTTools_PaveFiller_7.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_7.cxx @@ -21,7 +21,7 @@ // // File: NMTTools_PaveFiller_7.cxx -// Created: Thu Dec 18 15:14:55 2003 +// Created: // Author: Peter KURNEV // // @@ -38,6 +38,8 @@ #include #include +#include + #include #include @@ -82,18 +84,14 @@ #include #include -// Modified Thu Sep 14 14:35:18 2006 -// Contribution of Samtech www.samcef.com BEGIN -// static -// void FuseVertices(const TopoDS_Shape& aCompound, -// TopTools_DataMapOfShapeShape& aDMVV); -// Contribution of Samtech www.samcef.com END +#include + //======================================================================= // function: MakeSplitEdges // purpose: //======================================================================= - void NMTTools_PaveFiller::MakeSplitEdges() +void NMTTools_PaveFiller::MakeSplitEdges() { myIsDone=Standard_False; // @@ -177,11 +175,146 @@ } myIsDone=Standard_True; } +//modified by NIZNHY-PKV Mon Dec 12 09:16:37 2011f +//======================================================================= +// function: UpdateCommonBlocks +// purpose: +//======================================================================= +void NMTTools_PaveFiller::UpdateCommonBlocks(const Standard_Integer) +{ + + Standard_Integer nE, aNbS, nEx, nEMax, j, aNbPoints; + Standard_Real aTolEx, aTolExMax, aTSRMax[2], aTx[2], aTmp; + gp_Pnt aPMax[2]; + TopoDS_Edge aEMax; + BOPTools_ListIteratorOfListOfPaveBlock aItLPB, aItLPBS; + NMTTools_ListIteratorOfListOfCommonBlock aItLCB; + NMTTools_MapOfPaveBlock aMPB; + // + myIsDone=Standard_False; + // + aNbS=myDS->NumberOfShapesOfTheObject(); + for (nE=1; nE<=aNbS; ++nE) { + if (myDS->GetShapeType(nE)!=TopAbs_EDGE){ + continue; + } + // + const TopoDS_Edge& aE=*((TopoDS_Edge*)&myDS->Shape(nE)); + if (BRep_Tool::Degenerated(aE)){ + continue; + } + // + NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE)); + + // 1 + aItLCB.Initialize(aLCB); + for (; aItLCB.More(); aItLCB.Next()) { + NMTTools_CommonBlock& aCB=aItLCB.Value(); + // + BOPTools_PaveBlock aPBMax; + aTolExMax=-1.; + const BOPTools_ListOfPaveBlock &aLPB=aCB.PaveBlocks(); + aItLPB.Initialize(aLPB); + for (; aItLPB.More(); aItLPB.Next()) { + const BOPTools_PaveBlock& aPBx=aItLPB.Value(); + nEx=aPBx.OriginalEdge(); + const TopoDS_Edge& aEx=*((TopoDS_Edge*)&myDS->Shape(nEx)); + aTolEx=BRep_Tool::Tolerance(aEx); + if (aTolEx>aTolExMax) { + aTolExMax=aTolEx; + aEMax=aEx; + aPBMax=aPBx; + } + } + // + // 2 + if (aMPB.Contains(aPBMax)) { + continue; + } + aMPB.Add(aPBMax); + // + nEMax=aPBMax.OriginalEdge(); + const IntTools_ShrunkRange& aISRMax=aPBMax.ShrunkRange(); + const IntTools_Range& aSRMax=aISRMax.ShrunkRange(); + const Bnd_Box& aBoxMax=aISRMax.BndBox(); + aSRMax.Range(aTSRMax[0], aTSRMax[1]); + for (j=0; j<2; ++j) { + BOPTools_Tools::PointOnEdge(aEMax, aTSRMax[j], aPMax[j]); + } + // + // 3 + aItLPB.Initialize(aLPB); + for (; aItLPB.More(); aItLPB.Next()) { + const BOPTools_PaveBlock& aPBx=aItLPB.Value(); + nEx=aPBx.OriginalEdge(); + if (nEx==nEMax) { + continue; + } + // + const TopoDS_Edge& aEx=*((TopoDS_Edge*)&myDS->Shape(nEx)); + GeomAPI_ProjectPointOnCurve& aPPCx=myContext.ProjPC(aEx); + // + for (j=0; j<2; ++j) { + aPPCx.Perform(aPMax[j]); + aNbPoints=aPPCx.NbPoints(); + if (!aNbPoints) { + break; + } + aTx[j]=aPPCx.LowerDistanceParameter(); + } + if (!aNbPoints) { + // correction the range is impossible due to + // a projection problem + continue; + } + // + if (aTx[0]>aTx[1]){ + aTmp=aTx[0]; + aTx[0]=aTx[1]; + aTx[1]=aTmp; + } + // + // 4 Correction + // 4.1 aPBx + { + const IntTools_ShrunkRange& aISRx=aPBx.ShrunkRange(); + IntTools_Range *pSRx=(IntTools_Range *)(&aISRx.ShrunkRange()); + Bnd_Box *pBoxx=(Bnd_Box *)(&aISRx.BndBox()); + // + pSRx->SetFirst(aTx[0]); + pSRx->SetLast(aTx[1]); + *pBoxx=aBoxMax; + } + // + // 4.2 aPBSx + BOPTools_ListOfPaveBlock& aLPBSx=mySplitShapesPool(myDS->RefEdge(nEx)); + aItLPBS.Initialize(aLPBSx); + for (; aItLPBS.More(); aItLPBS.Next()) { + const BOPTools_PaveBlock& aPBSx=aItLPBS.Value(); + if (!aPBSx.IsEqual(aPBx)) { + continue; + } + // + const IntTools_ShrunkRange& aISRx=aPBSx.ShrunkRange(); + IntTools_Range *pSRx=(IntTools_Range *)(&aISRx.ShrunkRange()); + Bnd_Box *pBoxx=(Bnd_Box *)(&aISRx.BndBox()); + // + pSRx->SetFirst(aTx[0]); + pSRx->SetLast(aTx[1]); + *pBoxx=aBoxMax; + } + // + // + }//for (; aItLPB.More(); aItLPB.Next()) { + }//for (; aItLCB.More(); aItLCB.Next()) { + }//for (nE=1; nE<=aNbS; ++nE) { +} +//modified by NIZNHY-PKV Mon Dec 12 09:16:44 2011t //======================================================================= // function: UpdateCommonBlocks // purpose: //======================================================================= - void NMTTools_PaveFiller::UpdateCommonBlocks() +void NMTTools_PaveFiller::UpdateCommonBlocks() { myIsDone=Standard_False; // @@ -206,7 +339,6 @@ for (; aCBIt.More(); aCBIt.Next()) { NMTTools_CommonBlock& aCB=aCBIt.Value(); // - //modified by NIZNHY-PKV Wed Nov 8 15:59:46 2006f // Among all PBs of aCB the first PB will be one // that have max tolerance value { @@ -233,7 +365,6 @@ pLPB->Clear(); *pLPB=aLPBx; } - //modified by NIZNHY-PKV Wed Nov 8 15:59:50 2006t // BOPTools_PaveBlock& aPB=aCB.PaveBlock1(nE); nSp=SplitIndex(aPB); @@ -259,7 +390,8 @@ // function: SplitIndex // purpose: //======================================================================= - Standard_Integer NMTTools_PaveFiller::SplitIndex(const BOPTools_PaveBlock& aPBx)const +Standard_Integer NMTTools_PaveFiller::SplitIndex + (const BOPTools_PaveBlock& aPBx)const { Standard_Integer anOriginalEdge, anEdgeIndex=0; @@ -281,7 +413,7 @@ // function: UpdatePaveBlocks // purpose: //======================================================================= - void NMTTools_PaveFiller::UpdatePaveBlocks() +void NMTTools_PaveFiller::UpdatePaveBlocks() { myIsDone=Standard_False; // @@ -351,15 +483,11 @@ } } } -// Modified -// to treat Alone Vertices between faces -// Thu Sep 14 14:35:18 2006 -// Contribution of Samtech www.samcef.com BEGIN //======================================================================= // function: MakeAloneVertices // purpose: //======================================================================= - void NMTTools_PaveFiller::MakeAloneVertices() +void NMTTools_PaveFiller::MakeAloneVertices() { Standard_Integer i, aNbFFs, nF1, nF2, j, aNbPnts, nFx, aNbV; Standard_Real aTolF1, aTolF2, aTolSum, aTolV; @@ -603,7 +731,8 @@ // function: AloneVertices // purpose: //======================================================================= - const NMTTools_IndexedDataMapOfIndexedMapOfInteger& NMTTools_PaveFiller::AloneVertices()const +const NMTTools_IndexedDataMapOfIndexedMapOfInteger& + NMTTools_PaveFiller::AloneVertices()const { return myAloneVertices; } @@ -611,8 +740,9 @@ // function: FuseVertices // purpose: //======================================================================= - void NMTTools_PaveFiller::FuseVertices(const TopoDS_Shape& aCompound, - TopTools_DataMapOfShapeShape& aDMVV)const +void NMTTools_PaveFiller::FuseVertices + (const TopoDS_Shape& aCompound, + TopTools_DataMapOfShapeShape& aDMVV)const { Standard_Integer i, aNbVV, n1, n2, nX; NMTTools_PaveFiller tPF; @@ -642,4 +772,3 @@ } } } -// Contribution of Samtech www.samcef.com END