Salome HOME
Integration next version of GEOM packages from PKV.
authorskl <skl@opencascade.com>
Wed, 13 Jun 2007 07:24:14 +0000 (07:24 +0000)
committerskl <skl@opencascade.com>
Wed, 13 Jun 2007 07:24:14 +0000 (07:24 +0000)
88 files changed:
src/GEOMAlgo/GEOMAlgo_Builder.cdl
src/GEOMAlgo/GEOMAlgo_Builder.cxx
src/GEOMAlgo/GEOMAlgo_Builder.hxx
src/GEOMAlgo/GEOMAlgo_Builder.jxx
src/GEOMAlgo/GEOMAlgo_Builder_0.cxx
src/GEOMAlgo/GEOMAlgo_Builder_1.cxx
src/GEOMAlgo/GEOMAlgo_Builder_2.cxx
src/GEOMAlgo/GEOMAlgo_Builder_3.cxx
src/GEOMAlgo/GEOMAlgo_Builder_4.cxx
src/GEOMAlgo/GEOMAlgo_Splitter.cxx
src/GEOMAlgo/Makefile.in
src/GEOMImpl/GEOMImpl_BlockDriver.cxx
src/GEOMImpl/Makefile.in
src/Makefile.in
src/NMTDS/Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx [new file with mode: 0644]
src/NMTDS/Makefile.in
src/NMTDS/NMTDS.cdl
src/NMTDS/NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_0.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_0.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger_0.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_InterfPool.cdl [new file with mode: 0644]
src/NMTDS/NMTDS_InterfPool.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_InterfPool.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_InterfPool.ixx [new file with mode: 0644]
src/NMTDS/NMTDS_InterfPool.jxx [new file with mode: 0644]
src/NMTDS/NMTDS_InterfType.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_Iterator.cdl
src/NMTDS/NMTDS_Iterator.cxx
src/NMTDS/NMTDS_Iterator.hxx
src/NMTDS/NMTDS_IteratorCheckerSI.cdl [new file with mode: 0644]
src/NMTDS/NMTDS_IteratorCheckerSI.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_IteratorCheckerSI.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_IteratorCheckerSI.ixx [new file with mode: 0644]
src/NMTDS/NMTDS_IteratorCheckerSI.jxx [new file with mode: 0644]
src/NMTDS/NMTDS_PInterfPool.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_PIterator.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKey.cdl
src/NMTDS/NMTDS_PassKey.cxx
src/NMTDS/NMTDS_PassKey.hxx
src/NMTDS/NMTDS_PassKey.jxx
src/NMTDS/NMTDS_PassKeyBoolean.cdl
src/NMTDS/NMTDS_PassKeyBoolean.cxx
src/NMTDS/NMTDS_PassKeyBoolean.hxx
src/NMTDS/NMTDS_PassKeyMapHasher.cdl
src/NMTDS/NMTDS_PassKeyMapHasher.cxx
src/NMTDS/NMTDS_PassKeyShape.cdl [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShape.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShape.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShape.ixx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShape.jxx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShapeMapHasher.cdl [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShapeMapHasher.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShapeMapHasher.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShapeMapHasher.ixx [new file with mode: 0644]
src/NMTDS/NMTDS_PassKeyShapeMapHasher.jxx [new file with mode: 0644]
src/NMTDS/NMTDS_ShapesDataStructure.cdl
src/NMTDS/NMTDS_ShapesDataStructure.cxx
src/NMTDS/NMTDS_ShapesDataStructure.hxx
src/NMTDS/NMTDS_ShapesDataStructure.jxx
src/NMTDS/NMTDS_Tools.cdl [new file with mode: 0644]
src/NMTDS/NMTDS_Tools.cxx [new file with mode: 0644]
src/NMTDS/NMTDS_Tools.hxx [new file with mode: 0644]
src/NMTDS/NMTDS_Tools.ixx [new file with mode: 0644]
src/NMTDS/NMTDS_Tools.jxx [new file with mode: 0644]
src/NMTTools/Makefile.in
src/NMTTools/NMTTools.cdl
src/NMTTools/NMTTools_CheckerSI.cdl [new file with mode: 0644]
src/NMTTools/NMTTools_CheckerSI.cxx [new file with mode: 0644]
src/NMTTools/NMTTools_CheckerSI.hxx [new file with mode: 0644]
src/NMTTools/NMTTools_CheckerSI.ixx [new file with mode: 0644]
src/NMTTools/NMTTools_CheckerSI.jxx [new file with mode: 0644]
src/NMTTools/NMTTools_CheckerSI_1.cxx [new file with mode: 0755]
src/NMTTools/NMTTools_DEProcessor.cxx
src/NMTTools/NMTTools_PaveFiller.cdl
src/NMTTools/NMTTools_PaveFiller.cxx
src/NMTTools/NMTTools_PaveFiller.hxx
src/NMTTools/NMTTools_PaveFiller.jxx
src/NMTTools/NMTTools_PaveFiller_0.cxx
src/NMTTools/NMTTools_PaveFiller_1.cxx
src/NMTTools/NMTTools_PaveFiller_2.cxx
src/NMTTools/NMTTools_PaveFiller_3.cxx
src/NMTTools/NMTTools_PaveFiller_4.cxx
src/NMTTools/NMTTools_PaveFiller_5.cxx
src/NMTTools/NMTTools_PaveFiller_6.cxx
src/NMTTools/NMTTools_PaveFiller_7.cxx

index 967bc05f99f0483c10280abfcf7957e62b388e3f..a6f4ca4065fd8d81d3d6b1df022fb02ef9627068 100755 (executable)
@@ -37,8 +37,8 @@ uses
     MapOfShape                       from TopTools,
     Image     from BRepAlgo, 
     
-    DSFiller  from NMTTools,
-    PDSFiller from NMTTools
+    PaveFiller from NMTTools, 
+    PPaveFiller from NMTTools 
     
 --raises
 
@@ -54,8 +54,8 @@ is
        is redefined; 
         
     PerformWithFiller(me:out; 
-       theDSF: DSFiller from NMTTools) 
-       ---Purpose:  Performs calculations using prepared DSFiller 
+       theDSF: PaveFiller from NMTTools) 
+       ---Purpose:  Performs calculations using prepared PaveFiller 
        --           object theDSF               
        is virtual;
    
@@ -99,13 +99,12 @@ is
     -- 
     --    protected methods  
     --  
-    -- 
     PerformInternal(me:out; 
-       theDSF: DSFiller from NMTTools) 
+       theDSF: PaveFiller from NMTTools) 
        ---Purpose:  Performs calculations using prepared DSFiller 
        --           object theDSF               
-       is protected; 
-    --
+       is virtual protected;  
+        
     PrepareHistory (me:out) 
        ---Purpose:  Prepare information for history support  
        is redefined protected;  
@@ -234,7 +233,7 @@ is
     -- =====================================================
  
 fields 
-    myDSFiller        : PDSFiller from NMTTools is protected;  
+    myPaveFiller      : PPaveFiller from NMTTools is protected;  
     myShapes          : ListOfShape from TopTools is protected; 
     -- Common usage 
     myNbTypes         : Integer from Standard is protected; 
@@ -248,7 +247,7 @@ fields
     mySameDomainShapes: IndexedDataMapOfShapeShape from TopTools is protected;
     --  solids 
     myDraftSolids     : IndexedDataMapOfShapeShape from TopTools is protected; 
-    myEntryPoint      : Integer from Standard is protected;    
+    myEntryPoint      : Integer from Standard is protected;
     --     
 end Builder;
 
index 284cd7b10b837f5bcbed6a39918053408c1239ec..ebb87589366b35f7173943f151da6ea3bc2f09b3 100755 (executable)
@@ -38,9 +38,8 @@
 
 #include <BOP_CorrectTolerances.hxx>
 
-#include <NMTTools_DSFiller.hxx>
-
 #include <BRepLib.hxx>
+#include <NMTTools_PaveFiller.hxx>
 
 //=======================================================================
 //function : 
@@ -51,7 +50,7 @@
   GEOMAlgo_BuilderShape()
 {
   myNbTypes=9;
-  myDSFiller=NULL;
+  myPaveFiller=NULL;
   myEntryPoint=0; // Entry point through PerformWithFiller ()
 }
 //=======================================================================
@@ -61,9 +60,9 @@
   GEOMAlgo_Builder::~GEOMAlgo_Builder()
 {
   if (myEntryPoint==1) {
-    if (myDSFiller) {
-      delete myDSFiller;
-      myDSFiller=NULL;
+    if (myPaveFiller) {
+      delete myPaveFiller;
+      myPaveFiller=NULL;
     }
   }
 }
     aBB.Add(aCS, aS);
   }
   //
-  if (myDSFiller) {
-    delete myDSFiller;
-    myDSFiller=NULL;
-  }
-  NMTTools_DSFiller* pDSF=new NMTTools_DSFiller;
+  NMTTools_PaveFiller* pPF=new NMTTools_PaveFiller;
   //
-  pDSF->SetCompositeShape(aCS);
-  pDSF->Perform();
+  pPF->SetCompositeShape(aCS);
+  pPF->Perform();
   //
   myEntryPoint=1;
-  PerformInternal(*pDSF);
+  PerformInternal(*pPF);
 }
 //=======================================================================
 //function : PerformWithFiller
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_Builder::PerformWithFiller(const NMTTools_DSFiller& theDSF)
+  void GEOMAlgo_Builder::PerformWithFiller(const NMTTools_PaveFiller& theDSF)
 {
   myEntryPoint=0;
   //
 //function : PerformInternal
 //purpose  : 
 //=======================================================================
-  void GEOMAlgo_Builder::PerformInternal(const NMTTools_DSFiller& theDSF)
+  void GEOMAlgo_Builder::PerformInternal(const NMTTools_PaveFiller& pPF)
 {
   myErrorStatus=0;
   //
   Standard_Boolean bIsDone;
   //
-  // 0. myDSFiller
-  myDSFiller=(NMTTools_DSFiller *)&theDSF;
+  // 0. myPaveFiller
+  myPaveFiller=(NMTTools_PaveFiller *)&pPF;
   //
-  bIsDone=myDSFiller->IsDone();
+  bIsDone=myPaveFiller->IsDone();
   if (!bIsDone) {
-    myErrorStatus=2; // DSFiller is failed
+    myErrorStatus=2; // PaveFiller is failed
     return;
   }
   //
 // 
 // 0  - Ok
 // 1  - The object is just initialized
-// 2  - DSFiller is failed
+// 2  - PaveFiller is failed
 // 10 - No shapes to process
 // 30 - SolidBuilder failed
index 2f38d77fbd305be48ea31024ed23a042d91d2cff..930b3edf0a6744bf0b6e3a244a0d870fbf592201 100644 (file)
@@ -20,8 +20,8 @@
 #ifndef _GEOMAlgo_Builder_HeaderFile
 #define _GEOMAlgo_Builder_HeaderFile
 
-#ifndef _NMTTools_PDSFiller_HeaderFile
-#include <NMTTools_PDSFiller.hxx>
+#ifndef _NMTTools_PPaveFiller_HeaderFile
+#include <NMTTools_PPaveFiller.hxx>
 #endif
 #ifndef _TopTools_ListOfShape_HeaderFile
 #include <TopTools_ListOfShape.hxx>
@@ -50,7 +50,7 @@
 #ifndef _TopAbs_ShapeEnum_HeaderFile
 #include <TopAbs_ShapeEnum.hxx>
 #endif
-class NMTTools_DSFiller;
+class NMTTools_PaveFiller;
 class TopoDS_Shape;
 class TopTools_ListOfShape;
 class BRepAlgo_Image;
@@ -90,9 +90,9 @@ Standard_EXPORT virtual ~GEOMAlgo_Builder();
 //!  Performs calculations <br>
 Standard_EXPORT virtual  void Perform() ;
 
-//!  Performs calculations using prepared DSFiller <br>
+//!  Performs calculations using prepared PaveFiller <br>
 //!           object theDSF <br>
-Standard_EXPORT virtual  void PerformWithFiller(const NMTTools_DSFiller& theDSF) ;
+Standard_EXPORT virtual  void PerformWithFiller(const NMTTools_PaveFiller& theDSF) ;
 
 //!  Adds argument theShape of the operation <br>
 Standard_EXPORT virtual  void AddShape(const TopoDS_Shape& theShape) ;
@@ -139,7 +139,7 @@ protected:
 
 //!  Performs calculations using prepared DSFiller <br>
 //!           object theDSF <br>
-Standard_EXPORT   void PerformInternal(const NMTTools_DSFiller& theDSF) ;
+Standard_EXPORT virtual  void PerformInternal(const NMTTools_PaveFiller& theDSF) ;
 
 //!  Prepare information for history support <br>
 Standard_EXPORT virtual  void PrepareHistory() ;
@@ -214,7 +214,7 @@ Standard_EXPORT   void BuildDraftSolid(const TopoDS_Shape& theSolid,TopoDS_Shape
 
  // Fields PROTECTED
  //
-NMTTools_PDSFiller myDSFiller;
+NMTTools_PPaveFiller myPaveFiller;
 TopTools_ListOfShape myShapes;
 Standard_Integer myNbTypes;
 TopTools_MapOfShape myMapFence;
index 1965f5ec776ea60896c8605bc59ebc8a19712fb4..4cc8d4a529bc38c5a5b37354884a8d3bdf2caa0a 100644 (file)
@@ -17,8 +17,8 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 
-#ifndef _NMTTools_DSFiller_HeaderFile
-#include <NMTTools_DSFiller.hxx>
+#ifndef _NMTTools_PaveFiller_HeaderFile
+#include <NMTTools_PaveFiller.hxx>
 #endif
 #ifndef _TopoDS_Shape_HeaderFile
 #include <TopoDS_Shape.hxx>
index 72a8b39dc966833e842bf372aeab5887d29d3658..728c8404def797d881fb0b68fc5a50d4003e0b11 100644 (file)
@@ -20,7 +20,7 @@
 #include <GEOMAlgo_Builder.hxx>
 
 #include <NMTDS_ShapesDataStructure.hxx>
-#include <NMTTools_DSFiller.hxx>
+//#include <NMTTools_DSFiller.hxx>
 #include <NMTTools_PaveFiller.hxx>
 #include <IntTools_Context.hxx>
 #include <TopoDS_Shape.hxx>
index d42da67e28cf9e1a1084ad5879c0d4da9ddfa5ce..b6cdfee665e2799a345b460864bed9a2562417aa 100755 (executable)
@@ -47,7 +47,6 @@
 //
 #include <NMTDS_ShapesDataStructure.hxx>
 //
-#include <NMTTools_DSFiller.hxx>
 #include <NMTTools_PaveFiller.hxx>
 #include <NMTTools_CommonBlockPool.hxx>
 #include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
@@ -78,8 +77,8 @@ static
 {
   myErrorStatus=0;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   //
   Standard_Integer i, aNb, iV;
   //
@@ -94,7 +93,6 @@ static
          myImages.Bind(aV, aVSD);
          //
          mySameDomainShapes.Add(aV, aVSD);
-         //
        }
       }
     }
@@ -108,8 +106,8 @@ static
 {
   myErrorStatus=0;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   const BOPTools_SplitShapesPool& aSSP=pPF->SplitShapesPool();
   NMTTools_CommonBlockPool& aCBP=pPF->ChangeCommonBlockPool();
   IntTools_Context& aCtx=pPF->ChangeContext();
@@ -218,8 +216,8 @@ static
   TopTools_MapOfShape aMS;
   TopTools_MapIteratorOfMapOfShape aItS;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
   aNbS=aDS.NumberOfShapesOfTheObject();
index 068fbc564fb885007b2261ff540e8d4c682ab1d5..92e9e2cc87734acf270ca6e312b812cd4d74cf41 100755 (executable)
@@ -54,7 +54,6 @@
 #include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
 #include <BOPTools_ListOfPaveBlock.hxx>
 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
-#include <BOPTools_InterferencePool.hxx>
 #include <BOPTools_CArray1OfSSInterference.hxx>
 #include <BOPTools_SSInterference.hxx>
 #include <BOPTools_SequenceOfCurves.hxx>
@@ -68,7 +67,6 @@
 #include <BOPTools_CArray1OfESInterference.hxx>
 
 #include <NMTDS_ShapesDataStructure.hxx>
-#include <NMTTools_DSFiller.hxx>
 #include <NMTTools_PaveFiller.hxx>
 #include <NMTTools_ListOfCoupleOfShape.hxx>
 #include <NMTTools_Tools.hxx>
@@ -83,6 +81,7 @@
 #include <GEOMAlgo_Tools3D.hxx>
 #include <GEOMAlgo_WireEdgeSet.hxx>
 #include <GEOMAlgo_BuilderFace.hxx>
+#include <NMTDS_InterfPool.hxx>
 
 static
   void UpdateCandidates(const Standard_Integer ,
@@ -109,9 +108,9 @@ static
 //=======================================================================
   void GEOMAlgo_Builder::FillIn2DParts()
 {
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
-  BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
+  NMTDS_InterfPool* pIP=pPF->IP();
   BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
   NMTTools_CommonBlockPool& aCBP=pPF->ChangeCommonBlockPool();
   //
@@ -193,9 +192,9 @@ static
 //=======================================================================
   void GEOMAlgo_Builder::BuildSplitFaces()
 {
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
-  BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
+  NMTDS_InterfPool* pIP=pPF->IP();
   BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
@@ -388,9 +387,9 @@ static
 //=======================================================================
   void GEOMAlgo_Builder::FillSameDomainFaces()
 {
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
-  BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
+  NMTDS_InterfPool* pIP=pPF->IP();
   BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
@@ -513,7 +512,7 @@ static
   TopTools_ListOfShape aLFx;
   TopTools_ListIteratorOfListOfShape aIt;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
   //
   aNb=aDS.NumberOfShapesOfTheObject();
   for (i=1; i<=aNb; ++i) {
@@ -557,9 +556,9 @@ static
 //=======================================================================
   void GEOMAlgo_Builder::FillInternalVertices()
 {
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
-  BOPTools_InterferencePool* pIP=(BOPTools_InterferencePool*)&myDSFiller->InterfPool();
+  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();
index 220cc453f8b220a36ec80dd9b0efdb8797025a5d..649c603703bc1cbce11a026c28c5b85d98fb8c39 100755 (executable)
@@ -56,7 +56,6 @@
 #include <IntTools_Context.hxx>
 
 #include <NMTDS_ShapesDataStructure.hxx>
-#include <NMTTools_DSFiller.hxx>
 #include <NMTTools_PaveFiller.hxx>
 
 #include <GEOMAlgo_Tools3D.hxx>
@@ -93,8 +92,8 @@ static
 {
   myErrorStatus=0;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS(); 
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
   Standard_Boolean bToReverse;
@@ -186,8 +185,8 @@ static
 {
   myErrorStatus=0;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS(); 
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
   Standard_Boolean bIsIN, bHasImage;
@@ -416,8 +415,8 @@ static
 {
   myErrorStatus=0;
   // 
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
   Standard_Integer i, aNbS, iErr;
@@ -589,8 +588,8 @@ static
 {
   myErrorStatus=0;
   //
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx= pPF->ChangeContext();
   //
   //Standard_Boolean bHasImage;
index 080093803882e72b0853cecfed50d0457a478c4f..8465cebbaf5f6a920a7ae61bca0737cb0d96e31e 100755 (executable)
@@ -35,7 +35,6 @@
 #include <NMTDS_ShapesDataStructure.hxx>
 
 #include <NMTTools_PaveFiller.hxx>
-#include <NMTTools_DSFiller.hxx>
 
 #include <GEOMAlgo_Tools3D.hxx>
 
@@ -49,8 +48,8 @@ static
 //=======================================================================
   const TopTools_ListOfShape& GEOMAlgo_Builder::Generated(const TopoDS_Shape& theS)
 {
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx=pPF->ChangeContext();
   //
   Standard_Boolean bHasImage, bToReverse;
@@ -104,8 +103,8 @@ static
 //=======================================================================
   const TopTools_ListOfShape& GEOMAlgo_Builder::Modified(const TopoDS_Shape& theS)
 {
-  const NMTDS_ShapesDataStructure& aDS=myDSFiller->DS();
-  NMTTools_PaveFiller* pPF=(NMTTools_PaveFiller*)&(myDSFiller->PaveFiller());
+  const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
+  NMTTools_PaveFiller* pPF=myPaveFiller;
   IntTools_Context& aCtx=pPF->ChangeContext();
   //
   Standard_Boolean bHasImage, bToReverse;
index bcbf18afeab0b1a8cec19ac416abddaccb5d4fa7..431719ab15fe5009ae12bd5f65928172e828712e 100755 (executable)
@@ -42,7 +42,6 @@
 
 #include <BOP_CorrectTolerances.hxx>
 
-#include <NMTTools_DSFiller.hxx>
 
 static 
   void TreatCompound(const TopoDS_Shape& aC, 
@@ -320,6 +319,6 @@ void TreatCompound(const TopoDS_Shape& aC1,
 // 
 // 0  - Ok
 // 1  - The object is just initialized
-// 2  - DSFiller is failed
+// 2  - PaveFiller is failed
 // 10 - No shapes to process
 // 30 - SolidBuilder failed
index 447899ee3c0f0cfca3b1ce914a9e9be07f7d1f86..e6294d4fb0e607a4acbab744f7c3c71397139e58 100644 (file)
@@ -238,7 +238,7 @@ EXPORT_IDLS=
 
 CPPFLAGS += $(OCC_INCLUDES) $(KERNEL_CXXFLAGS)
 CXXFLAGS += $(OCC_CXXFLAGS) $(KERNEL_CXXFLAGS)
-LDFLAGS += $(CAS_LDPATH) -lTKBO $(KERNEL_LDFLAGS)
+LDFLAGS += $(CAS_LDPATH) -lTKBO $(KERNEL_LDFLAGS) -lNMTTools
 
 %_moc.cxx: %.h
        $(MOC) $< -o $@
index 9e2d85745ca0a232b91ab60e3eadf496bba7f544..5ecfa98a97408eec2faead201107a46bfdc7af46 100644 (file)
@@ -34,7 +34,8 @@
 #include <GEOM_Function.hxx>
 
 #include <ShHealOper_Sewing.hxx>
-#include <NMTAlgo_Splitter1.hxx>
+//#include <NMTAlgo_Splitter1.hxx>
+#include <GEOMAlgo_Gluer.hxx>
 #include <BlockFix_BlockFixAPI.hxx>
 
 #include "utilities.h"
@@ -470,14 +471,21 @@ Standard_Integer GEOMImpl_BlockDriver::Execute(TFunction_Logbook& log) const
       TopoDS_Shape aCompound = anArgs(1);
 
       // Glue coincident faces and edges (with Partition algorithm).
-      NMTAlgo_Splitter1 PS;
-      PS.AddShape(aCompound);
-      PS.Compute();
-      PS.SetRemoveWebs(Standard_False);
-//      PS.Build(aCompound.ShapeType());
-      PS.Build(TopAbs_SOLID);
-
-      aShape = PS.Shape();
+      //NMTAlgo_Splitter1 PS;
+      //PS.AddShape(aCompound);
+      //PS.Compute();
+      //PS.SetRemoveWebs(Standard_False);
+      //      PS.Build(aCompound.ShapeType());
+      //PS.Build(TopAbs_SOLID);
+      //aShape = PS.Shape();
+
+      GEOMAlgo_Gluer aGluer;
+      aGluer.SetShape(aCompound);
+      aGluer.SetCheckGeometry(Standard_True);
+      aGluer.Perform();
+      aShape = aGluer.Result();
+
+
     } else {
     }
 
index 73061a42cc83045670352794452d857d5ac0d950..168b01cd153df77f26118cac0d5e6c2441a64bf0 100644 (file)
@@ -114,7 +114,7 @@ EXPORT_HEADERS= GEOMImpl_Gen.hxx \
 # additionnal information to compil and link file
 CPPFLAGS += $(OCC_INCLUDES) $(KERNEL_CXXFLAGS) $(BOOST_CPPFLAGS)
 CXXFLAGS += $(OCC_CXXFLAGS) $(KERNEL_CXXFLAGS)
-LDFLAGS  += $(KERNEL_LDFLAGS) $(CAS_LDPATH) -lTKCAF -lTKFillet -lTKOffset -lGEOMbasic -lNMTAlgo -lGEOMAlgo -lShHealOper
+LDFLAGS  += $(KERNEL_LDFLAGS) $(CAS_LDPATH) -lTKCAF -lTKFillet -lTKOffset -lGEOMbasic -lGEOMAlgo -lShHealOper
 
 
 # additional file to be cleaned
index c3f92245f3d608949abad591e035bb230e667f3e..6140bd005c29782ab8a854bae08457d1aa4e50f6 100644 (file)
@@ -34,7 +34,7 @@ VPATH=.:@srcdir@
 
 #SUBDIRS = OBJECT ARCHIMEDE NMTDS NMTTools NMTAlgo GEOMAlgo SKETCHER GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport ShHealOper GEOMImpl GEOM_I GEOMClient DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GroupGUI BlocksGUI GEOM_I_Superv GEOM_SWIG STLExport
 
-SUBDIRS = ARCHIMEDE NMTDS NMTTools NMTAlgo GEOMAlgo SKETCHER GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport ShHealOper GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG STLExport
+SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER GEOM BREPExport BREPImport IGESExport IGESImport STEPExport STEPImport ShHealOper GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG STLExport
 
 ifeq (@WITHIHM@,yes)
   SUBDIRS+= OBJECT DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI MeasureGUI GroupGUI BlocksGUI GEOM_SWIG_WITHIHM
diff --git a/src/NMTDS/Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx b/src/NMTDS/Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx
new file mode 100644 (file)
index 0000000..a48a632
--- /dev/null
@@ -0,0 +1,72 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#define _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+
+#ifndef _Handle_TCollection_MapNode_HeaderFile
+#include <Handle_TCollection_MapNode.hxx>
+#endif
+
+class Standard_Transient;
+class Handle_Standard_Type;
+class Handle(TCollection_MapNode);
+class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger;
+Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger);
+
+class Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) : public Handle(TCollection_MapNode) {
+  public:
+    Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)():Handle(TCollection_MapNode)() {} 
+    Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)(const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& aHandle) : Handle(TCollection_MapNode)(aHandle) 
+     {
+     }
+
+    Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)(const NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) 
+     {
+     }
+
+    Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& operator=(const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& aHandle)
+     {
+      Assign(aHandle.Access());
+      return *this;
+     }
+
+    Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)& operator=(const NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* anItem)
+     {
+      Assign((Standard_Transient *)anItem);
+      return *this;
+     }
+
+    NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger* operator->() const
+     {
+      return (NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger *)ControlAccess();
+     }
+
+//   Standard_EXPORT ~Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)();
+   Standard_EXPORT static const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) DownCast(const Handle(Standard_Transient)& AnObject);
+};
+#endif
index 23f815f854545251331d133cf418e08681ecb11b..c2e15ae1a41b8195a72c8e8b51a09aec517788f7 100644 (file)
@@ -39,6 +39,9 @@ LIB = libNMTDS.la
 
 LIB_SRC = \
        NMTDS_CArray1OfIndexRange_0.cxx \
+       NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_0.cxx \
+       NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_0.cxx \
+       NMTDS_DataMapOfIntegerMapOfInteger_0.cxx \
        NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger_0.cxx \
        NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx \
        NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_0.cxx \
@@ -46,7 +49,9 @@ LIB_SRC = \
        NMTDS_IndexedDataMapOfIntegerShape_0.cxx  \
        NMTDS_IndexedDataMapOfShapeBox_0.cxx \
        NMTDS_IndexRange.cxx \
+       NMTDS_InterfPool.cxx \
        NMTDS_Iterator.cxx \
+       NMTDS_IteratorCheckerSI.cxx \
        NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors_0.cxx  \
        NMTDS_ListIteratorOfListOfPassKey_0.cxx  \
        NMTDS_ListIteratorOfListOfPassKeyBoolean_0.cxx \
@@ -63,9 +68,12 @@ LIB_SRC = \
        NMTDS_PassKeyBoolean.cxx \
        NMTDS_PassKey.cxx \
        NMTDS_PassKeyMapHasher.cxx \
+       NMTDS_PassKeyShape.cxx \
+       NMTDS_PassKeyShapeMapHasher.cxx \
        NMTDS_ShapesDataStructure.cxx \
        NMTDS_StdMapNodeOfMapOfPassKey_0.cxx \
        NMTDS_StdMapNodeOfMapOfPassKeyBoolean_0.cxx \
+       NMTDS_Tools.cxx \
        NMTDS_BoxBndTree.cxx
 
 LIB_CLIENT_IDL = 
@@ -73,6 +81,7 @@ LIB_SERVER_IDL =
 
 # header files 
 EXPORT_HEADERS = \
+       Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx \
        Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \
        Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
        Handle_NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \
@@ -82,6 +91,9 @@ EXPORT_HEADERS = \
        Handle_NMTDS_StdMapNodeOfMapOfPassKeyBoolean.hxx \
        Handle_NMTDS_StdMapNodeOfMapOfPassKey.hxx \
        NMTDS_CArray1OfIndexRange.hxx \
+       NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx \
+       NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx \
+       NMTDS_DataMapOfIntegerMapOfInteger.hxx \
        NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerIndexedDataMapOfShapeInteger.hxx \
        NMTDS_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape.hxx \
        NMTDS_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \
@@ -89,7 +101,10 @@ EXPORT_HEADERS = \
        NMTDS_IndexedDataMapOfIntegerShape.hxx \
        NMTDS_IndexedDataMapOfShapeBox.hxx \
        NMTDS_IndexRange.hxx \
+       NMTDS_InterfPool.hxx \
+       NMTDS_InterfType.hxx \
        NMTDS_Iterator.hxx \
+       NMTDS_IteratorCheckerSI.hxx \
        NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx \
        NMTDS_ListIteratorOfListOfPassKeyBoolean.hxx \
        NMTDS_ListIteratorOfListOfPassKey.hxx \
@@ -104,12 +119,17 @@ EXPORT_HEADERS = \
        NMTDS_MapOfPassKeyBoolean.hxx  \
        NMTDS_MapOfPassKey.hxx \
        NMTDS_PassKeyBoolean.hxx \
+       NMTDS_PInterfPool.hxx \
+       NMTDS_PIterator.hxx \
        NMTDS_PassKey.hxx \
        NMTDS_PassKeyMapHasher.hxx \
+       NMTDS_PassKeyShape.hxx \
+       NMTDS_PassKeyShapeMapHasher.hxx \
        NMTDS_PShapesDataStructure.hxx \
        NMTDS_ShapesDataStructure.hxx \
        NMTDS_StdMapNodeOfMapOfPassKeyBoolean.hxx \
        NMTDS_StdMapNodeOfMapOfPassKey.hxx \
+       NMTDS_Tools.hxx \
        NMTDS_BoxBndTree.hxx
 
 # idl files
index c023fff9e295daf945bc788e22dda679da4a421f..cabb10f4bf016cf7f4af84cc49693984ef297602 100644 (file)
@@ -28,29 +28,49 @@ package NMTDS
        ---Purpose: 
 
 uses   
-    
     TCollection, 
     TColStd,
     Bnd,
     TopoDS, 
     TopAbs, 
     TopTools, 
-    BooleanOperations,
-    BOPTColStd
+    BooleanOperations, 
+    BOPTools,
+    BOPTColStd 
+    
 is  
+    enumeration InterfType is
+       TI_VV,
+       TI_VE,
+       TI_VF,
+       TI_EE,
+       TI_EF,
+       TI_FF,
+       TI_UNKNOWN
+    end InterfType;      
+    --
     class ShapesDataStructure;
     class IndexRange;   
     
     -- Modified to Add new classes Thu Sep 14 14:35:18 2006 
     -- Contribution of Samtech www.samcef.com BEGIN 
     class Iterator; 
+    
     class PassKey; 
     class PassKeyBoolean; 
     class PassKeyMapHasher; 
     -- Contribution of Samtech www.samcef.com END  
-    
+    class PassKeyShape; 
+    class PassKeyShapeMapHasher; 
+    --modified by NIZNHY-PKV Tue Feb  6 10:40:02 2007f 
+    class IteratorCheckerSI; 
+    class Tools; 
+    class InterfPool; 
+    --modified by NIZNHY-PKV Tue Feb  6 10:40:04 2007t 
     pointer PShapesDataStructure to ShapesDataStructure from NMTDS;
-
+    pointer PIterator to Iterator from NMTDS;
+    pointer PInterfPool to InterfPool from NMTDS;
+     
     class CArray1OfIndexRange instantiates 
        CArray1 from BOPTColStd(IndexRange from NMTDS); 
      
@@ -79,7 +99,7 @@ is
                             PassKeyMapHasher from NMTDS);   
     -- Contribution of Samtech www.samcef.com END
 
-
+--modified by NIZNHY-PKV Tue Oct 10 11:19:06 2006f 
     class IndexedDataMapOfShapeBox  
        instantiates IndexedDataMap from TCollection    (Shape from TopoDS,
                                                         Box from Bnd,
@@ -88,6 +108,12 @@ is
        instantiates IndexedDataMap from TCollection    (Integer from Standard,
                                                         Shape from TopoDS,
                                                         MapIntegerHasher from TColStd); 
+                                                         
+    class DataMapOfIntegerMapOfInteger  
+       instantiates DataMap from TCollection           (Integer from Standard, 
+                                                        MapOfInteger from TColStd, 
+                                                        MapIntegerHasher from TColStd); 
 
+--modified by NIZNHY-PKV Tue Oct 10 11:19:08 2006t
  
 end NMTDS;
diff --git a/src/NMTDS/NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx b/src/NMTDS/NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx
new file mode 100644 (file)
index 0000000..5c782f2
--- /dev/null
@@ -0,0 +1,115 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
+#define _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
+
+#ifndef _TCollection_BasicMapIterator_HeaderFile
+#include <TCollection_BasicMapIterator.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+class Standard_NoSuchObject;
+class TColStd_MapOfInteger;
+class TColStd_MapIntegerHasher;
+class NMTDS_DataMapOfIntegerMapOfInteger;
+class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger  : 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); 
+      }
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger();
+
+
+Standard_EXPORT NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger(const NMTDS_DataMapOfIntegerMapOfInteger& aMap);
+
+
+Standard_EXPORT   void Initialize(const NMTDS_DataMapOfIntegerMapOfInteger& aMap) ;
+
+
+Standard_EXPORT  const Standard_Integer& Key() const;
+
+
+Standard_EXPORT  const TColStd_MapOfInteger& Value() const;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_0.cxx b/src/NMTDS/NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_0.cxx
new file mode 100644 (file)
index 0000000..52c8d53
--- /dev/null
@@ -0,0 +1,54 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+
+#ifndef _Standard_NoSuchObject_HeaderFile
+#include <Standard_NoSuchObject.hxx>
+#endif
+#ifndef _TColStd_MapOfInteger_HeaderFile
+#include <TColStd_MapOfInteger.hxx>
+#endif
+#ifndef _TColStd_MapIntegerHasher_HeaderFile
+#include <TColStd_MapIntegerHasher.hxx>
+#endif
+#ifndef _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#endif
+#ifndef _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+
+#define TheKey Standard_Integer
+#define TheKey_hxx <Standard_Integer.hxx>
+#define TheItem TColStd_MapOfInteger
+#define TheItem_hxx <TColStd_MapOfInteger.hxx>
+#define Hasher TColStd_MapIntegerHasher
+#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
+#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
+#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#include <TCollection_DataMapIterator.gxx>
+
diff --git a/src/NMTDS/NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx b/src/NMTDS/NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx
new file mode 100644 (file)
index 0000000..89989c7
--- /dev/null
@@ -0,0 +1,131 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#define _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _TColStd_MapOfInteger_HeaderFile
+#include <TColStd_MapOfInteger.hxx>
+#endif
+#ifndef _TCollection_MapNode_HeaderFile
+#include <TCollection_MapNode.hxx>
+#endif
+#ifndef _TCollection_MapNodePtr_HeaderFile
+#include <TCollection_MapNodePtr.hxx>
+#endif
+class TColStd_MapOfInteger;
+class TColStd_MapIntegerHasher;
+class NMTDS_DataMapOfIntegerMapOfInteger;
+class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger;
+
+
+
+class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger : public TCollection_MapNode {
+
+public:
+ // Methods PUBLIC
+ // 
+
+NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger(const Standard_Integer& K,const TColStd_MapOfInteger& I,const TCollection_MapNodePtr& n);
+
+  Standard_Integer& Key() const;
+
+  TColStd_MapOfInteger& Value() const;
+//Standard_EXPORT ~NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger();
+
+
+
+
+ // Type management
+ //
+ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
+ //Standard_EXPORT Standard_Boolean           IsKind(const Handle(Standard_Type)&) const;
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+Standard_Integer myKey;
+TColStd_MapOfInteger myValue;
+
+
+};
+
+#define TheKey Standard_Integer
+#define TheKey_hxx <Standard_Integer.hxx>
+#define TheItem TColStd_MapOfInteger
+#define TheItem_hxx <TColStd_MapOfInteger.hxx>
+#define Hasher TColStd_MapIntegerHasher
+#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
+#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
+#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+
+#include <TCollection_DataMapNode.lxx>
+
+#undef TheKey
+#undef TheKey_hxx
+#undef TheItem
+#undef TheItem_hxx
+#undef Hasher
+#undef Hasher_hxx
+#undef TCollection_DataMapNode
+#undef TCollection_DataMapNode_hxx
+#undef TCollection_DataMapIterator
+#undef TCollection_DataMapIterator_hxx
+#undef Handle_TCollection_DataMapNode
+#undef TCollection_DataMapNode_Type_
+#undef TCollection_DataMap
+#undef TCollection_DataMap_hxx
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_0.cxx b/src/NMTDS/NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_0.cxx
new file mode 100644 (file)
index 0000000..81d4ca5
--- /dev/null
@@ -0,0 +1,100 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+
+#ifndef _Standard_TypeMismatch_HeaderFile
+#include <Standard_TypeMismatch.hxx>
+#endif
+
+#ifndef _TColStd_MapOfInteger_HeaderFile
+#include <TColStd_MapOfInteger.hxx>
+#endif
+#ifndef _TColStd_MapIntegerHasher_HeaderFile
+#include <TColStd_MapIntegerHasher.hxx>
+#endif
+#ifndef _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#endif
+#ifndef _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+//NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::~NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger() {}
+
+
+Standard_EXPORT Handle_Standard_Type& NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+{
+
+    static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode);
+  static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
+  static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
+
+  static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
+  static Handle_Standard_Type _aType = new Standard_Type("NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger",
+                                                        sizeof(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger),
+                                                        1,
+                                                        (Standard_Address)_Ancestors,
+                                                        (Standard_Address)NULL);
+
+  return _aType;
+}
+
+
+// DownCast method
+//   allow safe downcasting
+//
+const Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)::DownCast(const Handle(Standard_Transient)& AnObject) 
+{
+  Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) _anOtherObject;
+
+  if (!AnObject.IsNull()) {
+     if (AnObject->IsKind(STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger))) {
+       _anOtherObject = Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)((Handle(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger)&)AnObject);
+     }
+  }
+
+  return _anOtherObject ;
+}
+const Handle(Standard_Type)& NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::DynamicType() const 
+{ 
+  return STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) ; 
+}
+//Standard_Boolean NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::IsKind(const Handle(Standard_Type)& AType) const 
+//{ 
+//  return (STANDARD_TYPE(NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger) == AType || TCollection_MapNode::IsKind(AType)); 
+//}
+//Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger::~Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger() {}
+#define TheKey Standard_Integer
+#define TheKey_hxx <Standard_Integer.hxx>
+#define TheItem TColStd_MapOfInteger
+#define TheItem_hxx <TColStd_MapOfInteger.hxx>
+#define Hasher TColStd_MapIntegerHasher
+#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
+#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
+#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#include <TCollection_DataMapNode.gxx>
+
diff --git a/src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger.hxx b/src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger.hxx
new file mode 100644 (file)
index 0000000..2e7c5b4
--- /dev/null
@@ -0,0 +1,154 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
+#define _NMTDS_DataMapOfIntegerMapOfInteger_HeaderFile
+
+#ifndef _TCollection_BasicMap_HeaderFile
+#include <TCollection_BasicMap.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class Standard_DomainError;
+class Standard_NoSuchObject;
+class TColStd_MapOfInteger;
+class TColStd_MapIntegerHasher;
+class NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger;
+class NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_DataMapOfIntegerMapOfInteger  : public TCollection_BasicMap {
+
+public:
+
+    void* operator new(size_t,void* anAddress) 
+      {
+        return anAddress;
+      }
+    void* operator new(size_t size) 
+      { 
+        return Standard::Allocate(size); 
+      }
+    void  operator delete(void *anAddress) 
+      { 
+        if (anAddress) Standard::Free((Standard_Address&)anAddress); 
+      }
+ // Methods PUBLIC
+ // 
+
+
+Standard_EXPORT NMTDS_DataMapOfIntegerMapOfInteger(const Standard_Integer NbBuckets = 1);
+
+
+Standard_EXPORT   NMTDS_DataMapOfIntegerMapOfInteger& Assign(const NMTDS_DataMapOfIntegerMapOfInteger& Other) ;
+  NMTDS_DataMapOfIntegerMapOfInteger& operator =(const NMTDS_DataMapOfIntegerMapOfInteger& Other) 
+{
+  return Assign(Other);
+}
+
+
+
+Standard_EXPORT   void ReSize(const Standard_Integer NbBuckets) ;
+
+
+Standard_EXPORT   void Clear() ;
+~NMTDS_DataMapOfIntegerMapOfInteger()
+{
+  Clear();
+}
+
+
+
+Standard_EXPORT   Standard_Boolean Bind(const Standard_Integer& K,const TColStd_MapOfInteger& I) ;
+
+
+Standard_EXPORT   Standard_Boolean IsBound(const Standard_Integer& K) const;
+
+
+Standard_EXPORT   Standard_Boolean UnBind(const Standard_Integer& K) ;
+
+
+Standard_EXPORT  const TColStd_MapOfInteger& Find(const Standard_Integer& K) const;
+ const TColStd_MapOfInteger& operator()(const Standard_Integer& K) const
+{
+  return Find(K);
+}
+
+
+
+Standard_EXPORT   TColStd_MapOfInteger& ChangeFind(const Standard_Integer& K) ;
+  TColStd_MapOfInteger& operator()(const Standard_Integer& K) 
+{
+  return ChangeFind(K);
+}
+
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+Standard_EXPORT NMTDS_DataMapOfIntegerMapOfInteger(const NMTDS_DataMapOfIntegerMapOfInteger& Other);
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger_0.cxx b/src/NMTDS/NMTDS_DataMapOfIntegerMapOfInteger_0.cxx
new file mode 100644 (file)
index 0000000..ca6e0ff
--- /dev/null
@@ -0,0 +1,57 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+
+#ifndef _Standard_DomainError_HeaderFile
+#include <Standard_DomainError.hxx>
+#endif
+#ifndef _Standard_NoSuchObject_HeaderFile
+#include <Standard_NoSuchObject.hxx>
+#endif
+#ifndef _TColStd_MapOfInteger_HeaderFile
+#include <TColStd_MapOfInteger.hxx>
+#endif
+#ifndef _TColStd_MapIntegerHasher_HeaderFile
+#include <TColStd_MapIntegerHasher.hxx>
+#endif
+#ifndef _NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+#ifndef _NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger_HeaderFile
+#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#endif
+
+#define TheKey Standard_Integer
+#define TheKey_hxx <Standard_Integer.hxx>
+#define TheItem TColStd_MapOfInteger
+#define TheItem_hxx <TColStd_MapOfInteger.hxx>
+#define Hasher TColStd_MapIntegerHasher
+#define Hasher_hxx <TColStd_MapIntegerHasher.hxx>
+#define TCollection_DataMapNode NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_hxx <NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger.hxx>
+#define TCollection_DataMapIterator NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapIterator_hxx <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
+#define Handle_TCollection_DataMapNode Handle_NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger
+#define TCollection_DataMapNode_Type_() NMTDS_DataMapNodeOfDataMapOfIntegerMapOfInteger_Type_()
+#define TCollection_DataMap NMTDS_DataMapOfIntegerMapOfInteger
+#define TCollection_DataMap_hxx <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#include <TCollection_DataMap.gxx>
+
diff --git a/src/NMTDS/NMTDS_InterfPool.cdl b/src/NMTDS/NMTDS_InterfPool.cdl
new file mode 100644 (file)
index 0000000..8b74d08
--- /dev/null
@@ -0,0 +1,151 @@
+-- Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+-- 
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either 
+-- version 2.1 of the License.
+-- 
+-- This library is distributed in the hope that it will be useful 
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of 
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public  
+-- License along with this library; if not, write to the Free Software 
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+--
+-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--   
+-- File:       NMTDS_InterfPool.cdl
+-- Created:    Wed Feb 21 10:10:58 2007
+-- Author:     Peter KURNEV
+--             <pkv@irinox>
+---Copyright:   Matra Datavision 2007
+
+
+class InterfPool from NMTDS 
+
+       ---Purpose: 
+
+uses
+    MapOfPassKeyBoolean  from NMTDS, 
+    ListOfPassKeyBoolean from NMTDS, 
+    PassKeyBoolean       from NMTDS,
+    InterfType           from NMTDS, 
+    --     
+    CArray1OfSSInterference from BOPTools,
+    CArray1OfESInterference from BOPTools,
+    CArray1OfVSInterference from BOPTools, 
+    CArray1OfEEInterference from BOPTools, 
+    CArray1OfVEInterference from BOPTools, 
+    CArray1OfVVInterference from BOPTools
+
+--raises
+
+is 
+    Create 
+       returns InterfPool from NMTDS; 
+    ---C++: alias "Standard_EXPORT virtual ~NMTDS_InterfPool();"  
+
+    Add (me:out;   
+           aPKB : PassKeyBoolean from NMTDS;
+            aType: InterfType from NMTDS) 
+       returns Boolean from Standard; 
+       
+    Add (me:out;   
+           aInd1 : Integer from Standard;
+           aInd2 : Integer from Standard; 
+            aType : InterfType from NMTDS) 
+       returns Boolean from Standard;
+      
+    Add (me:out;   
+           aInd1 : Integer from Standard;
+           aInd2 : Integer from Standard; 
+           bFlag : Boolean from Standard;                   
+            aType : InterfType from NMTDS) 
+       returns Boolean from Standard;
+
+    Contains(me; 
+           aPKB : PassKeyBoolean from NMTDS)
+       returns Boolean from Standard; 
+     
+    Contains(me; 
+           aInd1 : Integer from Standard;
+           aInd2 : Integer from Standard) 
+       returns Boolean from Standard; 
+     
+    Get(me) 
+       returns ListOfPassKeyBoolean from NMTDS; 
+    ---C++: return const &       
+
+    Get(me; 
+           aType : InterfType from NMTDS) 
+       returns ListOfPassKeyBoolean from NMTDS; 
+    ---C++: return const &      
+
+    Get(me; 
+           aInd : Integer from Standard) 
+       returns ListOfPassKeyBoolean from NMTDS; 
+    ---C++: return const & 
+      
+    Get(me; 
+           aInd : Integer from Standard; 
+           aType: InterfType from NMTDS) 
+       returns ListOfPassKeyBoolean from NMTDS; 
+    ---C++: return const &  
+    
+    -- 
+    -- Interferences 
+    -- 
+    SSInterferences (me:out)  
+       returns CArray1OfSSInterference from BOPTools; 
+       ---C++:  return  & 
+       ---Purpose: 
+       --- Returns the reference to array Of F/F interferences 
+       ---
+    ESInterferences (me:out)  
+       returns CArray1OfESInterference from BOPTools; 
+       ---C++:  return  & 
+       ---Purpose: 
+       --- Returns the reference to array Of E/F interferences 
+       ---
+    VSInterferences (me:out)  
+       returns CArray1OfVSInterference from BOPTools; 
+       ---C++:  return  &
+       ---Purpose: 
+       --- Returns the reference to array Of V/F interferences 
+       ---
+    EEInterferences (me:out)  
+       returns CArray1OfEEInterference from BOPTools; 
+       ---C++:  return  &  
+       ---Purpose: 
+       --- Returns the reference to arrray Of E/E interferences 
+       ---
+    VEInterferences (me:out)  
+       returns CArray1OfVEInterference from BOPTools; 
+       ---C++:  return  &              
+       ---Purpose: 
+       --- Returns the reference to arrray Of  V/E interferences 
+       ---
+    VVInterferences (me:out)  
+       returns CArray1OfVVInterference from BOPTools; 
+       ---C++:  return  &              
+       ---Purpose: 
+       --- Returns the reference to arrray Of  V/V interferences 
+       ---
+
+fields 
+    myTable : MapOfPassKeyBoolean from NMTDS [6] is protected; 
+    myList  : ListOfPassKeyBoolean from NMTDS is protected;
+    myMaxInd: Integer from Standard is protected; 
+    -- 
+    mySSInterferences  :  CArray1OfSSInterference from BOPTools is protected;
+    myESInterferences  :  CArray1OfESInterference from BOPTools is protected;
+    myVSInterferences  :  CArray1OfVSInterference from BOPTools is protected;
+    myEEInterferences  :  CArray1OfEEInterference from BOPTools is protected;
+    myVEInterferences  :  CArray1OfVEInterference from BOPTools is protected;
+    myVVInterferences  :  CArray1OfVVInterference from BOPTools is protected;   
+
+end InterfPool;
diff --git a/src/NMTDS/NMTDS_InterfPool.cxx b/src/NMTDS/NMTDS_InterfPool.cxx
new file mode 100644 (file)
index 0000000..95774e9
--- /dev/null
@@ -0,0 +1,281 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:       NMTDS_.InterfPoolcxx
+// Created:    Wed Feb 21 10:35:35 2007
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <NMTDS_InterfPool.ixx>
+#include <NMTDS_PassKeyBoolean.hxx>
+#include <NMTDS_ListOfPassKeyBoolean.hxx>
+#include <NMTDS_MapIteratorOfMapOfPassKeyBoolean.hxx>
+#include <NMTDS_ListIteratorOfListOfPassKeyBoolean.hxx>
+
+static
+  Standard_Integer TypeToInteger(const NMTDS_InterfType aType);
+
+//=======================================================================
+//function : 
+//purpose  : 
+//=======================================================================
+  NMTDS_InterfPool::NMTDS_InterfPool()
+{
+  myMaxInd=6;
+}
+//=======================================================================
+//function : ~
+//purpose  : 
+//=======================================================================
+  NMTDS_InterfPool::~NMTDS_InterfPool()
+{
+}
+//=======================================================================
+//function : Add
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_InterfPool::Add (const NMTDS_PassKeyBoolean& aPKB,
+                                         const NMTDS_InterfType aType)
+{
+  Standard_Boolean bRet;
+  Standard_Integer iType;
+  //
+  bRet=Standard_False;
+  //
+  iType=TypeToInteger(aType);
+  if (iType>-1 && iType<myMaxInd) {
+    bRet=myTable[iType].Add(aPKB);
+  }
+  return bRet;
+}
+//=======================================================================
+//function : Add
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
+                                         const Standard_Integer aInd2,
+                                         const NMTDS_InterfType aType)
+{
+  NMTDS_PassKeyBoolean aPKB;
+  //
+  aPKB.SetIds(aInd1, aInd2);
+  return Add(aPKB, aType);
+}
+//=======================================================================
+//function : Add
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
+                                         const Standard_Integer aInd2,
+                                         const Standard_Boolean bFlag,
+                                         const NMTDS_InterfType aType)
+{
+  NMTDS_PassKeyBoolean aPKB;
+  //
+  aPKB.SetIds(aInd1, aInd2);
+  aPKB.SetFlag(bFlag);
+  return Add(aPKB, aType);
+}
+//=======================================================================
+//function : Contains 
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_InterfPool::Contains(const NMTDS_PassKeyBoolean& aPKB)const
+{
+  Standard_Boolean bRet;
+  Standard_Integer i;
+  //
+  for (i=0; i<myMaxInd; ++i) {
+    bRet=myTable[i].Contains(aPKB);
+    if (bRet) {
+      break;
+    }
+  }
+  return bRet;
+}
+//=======================================================================
+//function : Contains 
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_InterfPool::Contains(const Standard_Integer aInd1,
+                                             const Standard_Integer aInd2)const
+{
+  NMTDS_PassKeyBoolean aPKB;
+  //
+  aPKB.SetIds(aInd1, aInd2);
+  return Contains(aPKB);
+}
+//=======================================================================
+//function :  Get
+//purpose  : 
+//=======================================================================
+  const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get()const
+{
+  Standard_Integer i;
+  NMTDS_ListOfPassKeyBoolean* pL;
+  //
+  pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+  pL->Clear();
+  //
+  for (i=0; i<myMaxInd; ++i) {
+    NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
+    //
+    aIt.Initialize(myTable[i]);
+    for(; aIt.More(); aIt.Next()) {
+      const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
+      pL->Append(aPKB);
+    }
+  }
+  return myList;
+}
+//=======================================================================
+//function :  Get
+//purpose  : 
+//=======================================================================
+  const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const Standard_Integer aInd)const
+{
+  Standard_Integer i, n1, n2;
+  NMTDS_ListOfPassKeyBoolean* pL;
+  //
+  pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+  pL->Clear();
+  //
+  for (i=0; i<myMaxInd; ++i) {
+    NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
+    //
+    aIt.Initialize(myTable[i]);
+    for(; aIt.More(); aIt.Next()) {
+      const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
+      aPKB.Ids(n1, n2);
+      if(n1==aInd || n2==aInd) {
+       pL->Append(aPKB);
+      }
+    }
+  }
+  return myList;
+}
+//=======================================================================
+//function :  Get
+//purpose  : 
+//=======================================================================
+  const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const NMTDS_InterfType aType)const
+{
+  Standard_Integer iType;
+  NMTDS_ListOfPassKeyBoolean* pL;
+  //
+  pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+  pL->Clear();
+  //
+  iType=TypeToInteger(aType);
+  if (iType>-1 && iType<myMaxInd) {
+    NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
+    //
+    aIt.Initialize(myTable[iType]);
+    for(; aIt.More(); aIt.Next()) {
+      const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
+      pL->Append(aPKB);
+    }
+  }
+  return myList;
+}
+//=======================================================================
+//function :  Get
+//purpose  : 
+//=======================================================================
+  const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const Standard_Integer aInd,
+                                                         const NMTDS_InterfType aType)const
+{
+  Standard_Integer n1, n2;
+  NMTDS_ListOfPassKeyBoolean *pL, aLPKB;
+  NMTDS_ListIteratorOfListOfPassKeyBoolean aIt;
+  //
+  aLPKB=Get(aType);
+  //
+  pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+  pL->Clear();
+  //
+  aIt.Initialize (aLPKB);
+  for (; aIt.More(); aIt.Next()) {
+    const NMTDS_PassKeyBoolean& aPKB=aIt.Value();
+    aPKB.Ids(n1, n2);
+    if(n1==aInd || n2==aInd) {
+      pL->Append(aPKB);
+    }
+  }
+  return myList;
+}
+////////////////////
+//===========================================================================
+//function : SSInterferences
+//purpose  : 
+//===========================================================================
+  BOPTools_CArray1OfSSInterference&  NMTDS_InterfPool::SSInterferences()
+{
+  return mySSInterferences;
+}
+//===========================================================================
+//function : ESInterferences
+//purpose  : 
+//===========================================================================
+  BOPTools_CArray1OfESInterference&  NMTDS_InterfPool::ESInterferences()
+{
+  return myESInterferences;
+}
+//===========================================================================
+//function : VSInterferences
+//purpose  : 
+//===========================================================================
+  BOPTools_CArray1OfVSInterference&  NMTDS_InterfPool::VSInterferences()
+{
+  return myVSInterferences;
+}
+//===========================================================================
+//function : EEInterferences
+//purpose  : 
+//===========================================================================
+  BOPTools_CArray1OfEEInterference&  NMTDS_InterfPool::EEInterferences()
+{
+  return myEEInterferences;
+}
+//===========================================================================
+//function : VEInterferences
+//purpose  : 
+//===========================================================================
+  BOPTools_CArray1OfVEInterference&  NMTDS_InterfPool::VEInterferences()
+{
+  return myVEInterferences;
+}
+//===========================================================================
+//function : VVInterferences
+//purpose  : 
+//===========================================================================
+  BOPTools_CArray1OfVVInterference&  NMTDS_InterfPool::VVInterferences()
+{
+  return myVVInterferences;
+}
+////////////////////
+//=======================================================================
+//function : TypeToInteger
+//purpose  : 
+//=======================================================================
+Standard_Integer TypeToInteger(const NMTDS_InterfType aType)
+{
+  return (Standard_Integer)aType;
+}
diff --git a/src/NMTDS/NMTDS_InterfPool.hxx b/src/NMTDS/NMTDS_InterfPool.hxx
new file mode 100644 (file)
index 0000000..f0bfd21
--- /dev/null
@@ -0,0 +1,191 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_InterfPool_HeaderFile
+#define _NMTDS_InterfPool_HeaderFile
+
+#ifndef _NMTDS_MapOfPassKeyBoolean_HeaderFile
+#include <NMTDS_MapOfPassKeyBoolean.hxx>
+#endif
+#ifndef _NMTDS_ListOfPassKeyBoolean_HeaderFile
+#include <NMTDS_ListOfPassKeyBoolean.hxx>
+#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfSSInterference_HeaderFile
+#include <BOPTools_CArray1OfSSInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfESInterference_HeaderFile
+#include <BOPTools_CArray1OfESInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVSInterference_HeaderFile
+#include <BOPTools_CArray1OfVSInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfEEInterference_HeaderFile
+#include <BOPTools_CArray1OfEEInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVEInterference_HeaderFile
+#include <BOPTools_CArray1OfVEInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVVInterference_HeaderFile
+#include <BOPTools_CArray1OfVVInterference.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+#ifndef _NMTDS_InterfType_HeaderFile
+#include <NMTDS_InterfType.hxx>
+#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 <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#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 <br>
+Standard_EXPORT   BOPTools_CArray1OfSSInterference& SSInterferences() ;
+
+
+//! Returns the reference to array Of E/F interferences <br>
+Standard_EXPORT   BOPTools_CArray1OfESInterference& ESInterferences() ;
+
+
+//! Returns the reference to array Of V/F interferences <br>
+Standard_EXPORT   BOPTools_CArray1OfVSInterference& VSInterferences() ;
+
+
+//! Returns the reference to arrray Of E/E interferences <br>
+Standard_EXPORT   BOPTools_CArray1OfEEInterference& EEInterferences() ;
+
+
+//! Returns the reference to arrray Of  V/E interferences <br>
+Standard_EXPORT   BOPTools_CArray1OfVEInterference& VEInterferences() ;
+
+
+//! Returns the reference to arrray Of  V/V interferences <br>
+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
diff --git a/src/NMTDS/NMTDS_InterfPool.ixx b/src/NMTDS/NMTDS_InterfPool.ixx
new file mode 100644 (file)
index 0000000..c608b68
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_InterfPool.jxx>
+
+
+
diff --git a/src/NMTDS/NMTDS_InterfPool.jxx b/src/NMTDS/NMTDS_InterfPool.jxx
new file mode 100644 (file)
index 0000000..f12d529
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_PassKeyBoolean_HeaderFile
+#include <NMTDS_PassKeyBoolean.hxx>
+#endif
+#ifndef _NMTDS_ListOfPassKeyBoolean_HeaderFile
+#include <NMTDS_ListOfPassKeyBoolean.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfSSInterference_HeaderFile
+#include <BOPTools_CArray1OfSSInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfESInterference_HeaderFile
+#include <BOPTools_CArray1OfESInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVSInterference_HeaderFile
+#include <BOPTools_CArray1OfVSInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfEEInterference_HeaderFile
+#include <BOPTools_CArray1OfEEInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVEInterference_HeaderFile
+#include <BOPTools_CArray1OfVEInterference.hxx>
+#endif
+#ifndef _BOPTools_CArray1OfVVInterference_HeaderFile
+#include <BOPTools_CArray1OfVVInterference.hxx>
+#endif
+#ifndef _NMTDS_InterfPool_HeaderFile
+#include <NMTDS_InterfPool.hxx>
+#endif
diff --git a/src/NMTDS/NMTDS_InterfType.hxx b/src/NMTDS/NMTDS_InterfType.hxx
new file mode 100644 (file)
index 0000000..d32f983
--- /dev/null
@@ -0,0 +1,39 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_InterfType_HeaderFile
+#define _NMTDS_InterfType_HeaderFile
+
+
+enum NMTDS_InterfType { 
+ NMTDS_TI_VV,
+NMTDS_TI_VE,
+NMTDS_TI_VF,
+NMTDS_TI_EE,
+NMTDS_TI_EF,
+NMTDS_TI_FF,
+NMTDS_TI_UNKNOWN
+};
+
+
+#ifndef _Standard_PrimitiveTypes_HeaderFile
+#include <Standard_PrimitiveTypes.hxx>
+#endif
+
+#endif
index 05a026a73deee24dd884419b8af042855a47452f..d73a1d5d31a581f20e8e2e01b75355812ebd85e6 100755 (executable)
@@ -24,7 +24,7 @@
 
 
 class Iterator from NMTDS 
-
+     
        ---Purpose: 
 
 uses  
@@ -33,7 +33,9 @@ uses
     ShapesDataStructure  from NMTDS,
     PShapesDataStructure from NMTDS,
     ListOfPassKeyBoolean from NMTDS,
-    ListIteratorOfListOfPassKeyBoolean from NMTDS
+    ListIteratorOfListOfPassKeyBoolean from NMTDS,
+    PassKeyBoolean from NMTDS 
+    
 --raises
 
 is 
@@ -61,18 +63,28 @@ is
                aIndex2:out Integer from Standard;
                aWithSubShape: out Boolean from Standard); 
        
-    Prepare(me:out); 
-     
+    Prepare(me:out) 
+       is virtual; 
+      
+    Intersect(me:out) 
+       is virtual protected; 
+       
     ExpectedLength(me) 
        returns Integer from Standard;  
         
+    BlockLength(me) 
+       returns Integer from Standard;  
+     
     SDVertices(me) 
        returns DataMapOfIntegerListOfInteger from TColStd; 
-    ---C++:return const & 
-
+    ---C++:return const &  
+     
+    FillMVSD(myclass; 
+       aMVSD1:DataMapOfIntegerListOfInteger from TColStd; 
+       aMVSD2:out DataMapOfIntegerListOfInteger from TColStd); 
  
 fields
-    myPDS      :PShapesDataStructure from NMTDS     is protected; 
+    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; 
index d186736c06789c715c33fc4c1bad3a310a2daca2..8e894d6d4121542f1381c4d3e8f183d03f624b3f 100755 (executable)
@@ -1,18 +1,17 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2006 SAMTECH
+// 
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
+// License as published by the Free Software Foundation; either 
 // version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 // Lesser General Public License for more details.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 
 
 #include <NMTDS_Iterator.ixx>
-#include <NMTDS_CArray1OfIndexRange.hxx>
-#include <NMTDS_IndexRange.hxx>
+//
 #include <Bnd_Box.hxx>
-#include <TopoDS_Shape.hxx>
+//
 #include <TColStd_ListOfInteger.hxx>
-#include <TColStd_Array1OfListOfInteger.hxx>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <TColStd_MapOfInteger.hxx>
 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
-#include <NMTDS_PassKeyBoolean.hxx>
-#include <NMTDS_MapOfPassKeyBoolean.hxx>
-#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
-#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
-#include <Bnd_HArray1OfBox.hxx>
-#include <Bnd_BoundSortBox.hxx>
-#include <TColStd_ListOfInteger.hxx>
 #include <TColStd_DataMapOfIntegerInteger.hxx>
-#include <TopTools_DataMapOfShapeInteger.hxx>
 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
-#include <TColStd_DataMapIteratorOfDataMapOfIntegerInteger.hxx>
 #include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
 #include <TColStd_MapOfInteger.hxx>
-
+//
+#include <TopoDS.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Shape.hxx>
+//
+#include <TopTools_DataMapOfShapeInteger.hxx>
+//
 #include <NMTDS_BoxBndTree.hxx>
 #include <NCollection_UBTreeFiller.hxx>
-
-static 
-  void ComputeBoxEx(const Standard_Integer aIx,
-                   NMTDS_ShapesDataStructure* pDS,
-                   Bnd_Box& aBoxEx);
-
-static inline
-  Standard_Boolean IsValidType(const TopAbs_ShapeEnum aT);
-
-static
-  Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
-                                const TopAbs_ShapeEnum aType2);
-
+#include <NMTDS_CArray1OfIndexRange.hxx>
+#include <NMTDS_IndexRange.hxx>
+#include <NMTDS_PassKeyBoolean.hxx>
+#include <NMTDS_MapOfPassKeyBoolean.hxx>
+#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
+#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
+#include <NMTDS_Tools.hxx>
+#include <NMTDS_DataMapOfIntegerMapOfInteger.hxx>
+#include <NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger.hxx>
 
 //=======================================================================
 //function : NMTDS_Iterator
@@ -69,7 +59,7 @@ static
 //=======================================================================
   NMTDS_Iterator::NMTDS_Iterator()
 {
-  myPDS=NULL; 
+  myDS=NULL; 
   myLength=0;
 }
 //=======================================================================
@@ -85,7 +75,7 @@ static
 //=======================================================================
   void NMTDS_Iterator::SetDS(const NMTDS_PShapesDataStructure& aDS)
 {
-  myPDS=aDS;
+  myDS=aDS;
 }
 //=======================================================================
 // function: DS
@@ -93,7 +83,7 @@ static
 //=======================================================================
   const NMTDS_ShapesDataStructure&  NMTDS_Iterator::DS()const
 {
-  return *myPDS;
+  return *myDS;
 }
 //=======================================================================
 // function: ExpectedLength
@@ -104,6 +94,24 @@ static
   return myLength;
 }
 //=======================================================================
+// function: BlockLength
+// purpose: 
+//=======================================================================
+  Standard_Integer NMTDS_Iterator::BlockLength() const
+{
+  Standard_Integer aNbIIs;
+  Standard_Real aCfPredict=.5;
+  
+  aNbIIs=ExpectedLength();
+  
+  if (aNbIIs<=1) {
+    return 1;
+  }
+  //
+  aNbIIs=(Standard_Integer) (aCfPredict*(Standard_Real)aNbIIs);
+  return aNbIIs;
+}
+//=======================================================================
 // function: Initialize
 // purpose: 
 //=======================================================================
@@ -112,7 +120,7 @@ static
 {
   Standard_Integer iX;
   //
-  iX=TypeToInteger(aType1, aType2);
+  iX=NMTDS_Tools::TypeToInteger(aType1, aType2);
   if (iX>=0) {
     myIterator.Initialize(myLists[iX]);
     myLength=myLists[iX].Extent();
@@ -158,52 +166,62 @@ static
 {
   return myMVSD;
 }
-
 //=======================================================================
 // function: Prepare
 // purpose: 
 //=======================================================================
   void NMTDS_Iterator::Prepare()
+{
+  Standard_Integer i;
+  //
+  myLength=0;
+  for (i=0; i<6; ++i) {
+    myLists[i].Clear();
+  }
+  myMVSD.Clear();
+  //
+  if (myDS==NULL){
+    return;
+  }
+  Intersect();
+}
+//=======================================================================
+// function: Intersect
+// purpose: 
+//=======================================================================
+  void NMTDS_Iterator::Intersect()
 {
   Standard_Boolean bFlag;
-  Standard_Integer aNb, i, aNbB, aNbR;
+  Standard_Integer aNb, i, aNbB, aNbR, iFlag;
   Standard_Integer i1, i2, aNbSD, iX, j, iDS, jB, iR, k, aNbLV;
   TColStd_ListIteratorOfListOfInteger aIt;
   TColStd_DataMapOfIntegerInteger aMII;
-  TColStd_MapOfInteger aMFence;
+  //modified by NIZNHY-PKV Mon Jan 22 15:08:00 2007f
+  //TColStd_MapOfInteger aMFence;
+  TColStd_DataMapOfIntegerListOfInteger aMVSD;
+  TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
+  //modified by NIZNHY-PKV Mon Jan 22 10:21:50 2007t
   TopTools_DataMapOfShapeInteger aMSI;
   TopAbs_ShapeEnum aTi, aTj;
   NMTDS_PassKeyBoolean aPKXB; 
   NMTDS_MapOfPassKeyBoolean aMPKXB;
   NMTDS_IndexedDataMapOfShapeBox aMSB;
-  Handle(Bnd_HArray1OfBox) aHAB;
-  Bnd_BoundSortBox aBSB;
   //
   NMTDS_BoxBndTreeSelector aSelector;
   NMTDS_BoxBndTree aBBTree;
   NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
   //
-  if (myPDS==NULL){
-    return;
-  }
-  //
-  myLength=0;
-  for (i=0; i<6; ++i) {
-    myLists[i].Clear();
-  }
-  myMVSD.Clear();
-  //
-  const NMTDS_CArray1OfIndexRange& aRanges=myPDS->Ranges();
+  const NMTDS_CArray1OfIndexRange& aRanges=myDS->Ranges();
   aNbR=aRanges.Extent();
   //
-  aNb=myPDS->NumberOfShapesOfTheObject();
+  aNb=myDS->NumberOfShapesOfTheObject();
   for (i=1; i<=aNb; ++i) {
-    const TopoDS_Shape& aS=myPDS->Shape(i);
+    const TopoDS_Shape& aS=myDS->Shape(i);
     aTi=aS.ShapeType();
-    if (IsValidType(aTi)) {
+    if (NMTDS_Tools::HasBRep(aTi)) {
       Bnd_Box aBoxEx;
       //
-      ComputeBoxEx(i, myPDS, aBoxEx);
+      myDS->ComputeBoxEx(i, aBoxEx);
       aMSI.Bind(aS, i);
       aMSB.Add(aS, aBoxEx);
     }
@@ -228,9 +246,9 @@ static
     i1=aR.First();
     i2=aR.Last();
     for (i=i1; i<=i2; ++i) {
-      const TopoDS_Shape& aSi=myPDS->Shape(i);
+      const TopoDS_Shape& aSi=myDS->Shape(i);
       aTi=aSi.ShapeType();
-      if (!IsValidType(aTi)){
+      if (!NMTDS_Tools::HasBRep(aTi)){
        continue;
       }
       const Bnd_Box& aBoxEx=aMSB.FindFromKey(aSi);
@@ -257,25 +275,24 @@ static
        }
        //
        aPKXB.SetIds(i, j);
+       //
        if (aMPKXB.Add(aPKXB)) {
          bFlag=Standard_False;// Bounding boxes are intersected
-         const Bnd_Box& aBoxi=myPDS->GetBoundingBox(i);
-         const Bnd_Box& aBoxj=myPDS->GetBoundingBox(j);
+         const Bnd_Box& aBoxi=myDS->GetBoundingBox(i);
+         const Bnd_Box& aBoxj=myDS->GetBoundingBox(j);
          if (aBoxi.IsOut(aBoxj)) {
            bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
          }
-         const TopoDS_Shape& aSj=myPDS->Shape(j);
+         const TopoDS_Shape& aSj=myDS->Shape(j);
          aTj=aSj.ShapeType();
-         iX=TypeToInteger(aTi, aTj);
-         
+         iX=NMTDS_Tools::TypeToInteger(aTi, aTj);
+         //bFlag=(iStatus==2);
          aPKXB.SetFlag(bFlag);
          myLists[iX].Append(aPKXB);
          //
          // VSD prepare
          if (iX==5) { //VV
-           if (aMFence.Add(j)) {
-             aLV.Append(j);
-           }
+           aLV.Append(j);
          }
        }// if (aMPKXB.Add(aPKXB)) {
       }// for (; aIt.More(); aIt.Next()) {
@@ -283,112 +300,154 @@ static
       // VSD treatment
       aNbLV=aLV.Extent();
       if (aNbLV) {
-       myMVSD.Bind(i, aLV);
+       TColStd_ListOfInteger aLV1;
+       //
+       const TopoDS_Vertex& aVi=TopoDS::Vertex(aSi);
+       aIt.Initialize(aLV);
+       for (; aIt.More(); aIt.Next()) {
+         j=aIt.Value();  
+         const TopoDS_Shape&  aSj=myDS->Shape(j);
+         const TopoDS_Vertex& aVj=TopoDS::Vertex(aSj);
+         iFlag=NMTDS_Tools::ComputeVV(aVi, aVj);
+         if (!iFlag) {
+           aLV1.Append(j);
+         }
+         else {
+           aPKXB.SetIds(i, j);
+           aMPKXB.Remove(aPKXB);
+         }
+       }
+       aMVSD.Bind(i, aLV1);
       }
     }//for (i=i1; i<=i2; ++i) {
   }//for (iR=1; iR<aNbR; ++iR) {
-}
-
-//=======================================================================
-// function: IsValidType
-// purpose: 
-//=======================================================================
-Standard_Boolean IsValidType(const TopAbs_ShapeEnum aTi)
-{
-  return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE);
-}
-//=======================================================================
-// function: ComputeBoxEx
-// purpose: 
-//=======================================================================
-  void ComputeBoxEx(const Standard_Integer aIx,
-                   NMTDS_ShapesDataStructure* pDS,
-                   Bnd_Box& aBoxEx)
-{
-  Standard_Integer i, aNbS, iS;
   //
-  const Bnd_Box& aBox=pDS->GetBoundingBox(aIx);
-  aBoxEx.Add(aBox);
   //
-  aNbS=pDS->NumberOfSuccessors(aIx);
-  for (i=1; i<=aNbS; ++i) {
-    Bnd_Box aBoxS;
-    iS=pDS->GetSuccessor(aIx, i);
-    ComputeBoxEx(iS, pDS, aBoxS);
-    aBoxEx.Add(aBoxS);
-  }
+  // Chains
+  //=================
+  myMVSD.Clear();
+  NMTDS_Iterator::FillMVSD(aMVSD, myMVSD);
 }
-
 //=======================================================================
-// function: TypeToInteger
-// purpose
+//function : FillMVSD
+//purpose  
 //=======================================================================
-Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType1,
-                              const TopAbs_ShapeEnum aType2)
+  void NMTDS_Iterator::FillMVSD(const TColStd_DataMapOfIntegerListOfInteger& aMVSD,
+                               TColStd_DataMapOfIntegerListOfInteger& bMVSD)
 {
-  Standard_Integer iRet, iT1, iT2, iX;
-  //
-  iRet=-1;
-  iT1=(Standard_Integer)aType1;
-  iT2=(Standard_Integer)aType2;
+  Standard_Boolean bFound;
+  Standard_Integer aNbVSD, iCnt, i, j, k;
+  TColStd_ListOfInteger aLV;
+  TColStd_ListIteratorOfListOfInteger aIt;
+  TColStd_MapOfInteger aMF;
+  TColStd_MapIteratorOfMapOfInteger aItMI;
+  TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
+  NMTDS_DataMapOfIntegerMapOfInteger aDMIMI;
+  NMTDS_DataMapIteratorOfDataMapOfIntegerMapOfInteger aIti, aItj;
   //
-  iX=iT2*10+iT1;
-  switch (iX) {
-    case 77:
-      iRet=5; // VV
-      break;
-    case 76:
-    case 67:
-      iRet=4; // VE
-      break;
-    case 74:
-    case 47:
-      iRet=2; // VF
-      break;
-    case 66:
-      iRet=3; // EE
-      break;
-    case 64:
-    case 46:
-      iRet=1; // EF
-      break;
-    case 44:
-      iRet=0; // FF
-      break;
-    default:
-      break;
+  aNbVSD=aMVSD.Extent();
+  if (!aNbVSD) {
+    return;
   }
-  return iRet; 
-}
-
-/*
-//
-  // check
-  TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
-  TColStd_DataMapIteratorOfDataMapOfIntegerInteger aIt2;
   //
-  printf(" \n");
-  printf(" aMVLV.Extent()=%d\n", aMVLV.Extent());
-  aIt1.Initialize(aMVLV);
-  for (; aIt1.More(); aIt1.Next()) {
-    i=aIt1.Key();
-    printf(" i=%d (", i);
-    const TColStd_ListOfInteger& aLV=aIt1.Value();
-    aIt.Initialize(aLV);
+  aItVSD.Initialize(aMVSD);
+  for (; aItVSD.More(); aItVSD.Next()) {
+    TColStd_MapOfInteger aMI;
+    //
+    i=aItVSD.Key();
+    aMI.Add(i);
+    const TColStd_ListOfInteger& aLVSD=aItVSD.Value();
+    aIt.Initialize(aLVSD);
     for (; aIt.More(); aIt.Next()) {
       j=aIt.Value();
-      printf(" %d", j);
+      aMI.Add(j);
     }
-    printf(")\n");
+    aDMIMI.Bind(i, aMI);
   }
-  //
-  printf(" \n");
-  printf(" aMVV.Extent()=%d\n", aMVV.Extent());
-  aIt2.Initialize(aMVV);
-  for (; aIt2.More(); aIt2.Next()) {
-    i=aIt2.Key();
-    j=aIt2.Value();
-    printf(" (%d, %d)\n", i, j);
+  // i
+  aIti.Initialize(aDMIMI);
+  for (; aIti.More(); aIti.Next()) {
+    i=aIti.Key();
+    if (aMF.Contains(i)) {
+      continue;
+    }
+    aMF.Add(i);
+    //
+    //TColStd_MapOfInteger& aMIi=aDMIMI.ChangeFind(i);
+    TColStd_MapOfInteger *pMIi=(TColStd_MapOfInteger *)&aIti.Value();
+    TColStd_MapOfInteger& aMIi=*pMIi;
+    //  j
+    while (1) {
+      iCnt=0;
+      aItj.Initialize(aDMIMI);
+      for (; aItj.More(); aItj.Next()) {
+       j=aItj.Key();
+       if (aMF.Contains(j)) {
+         continue;
+       }
+       //
+       //TColStd_MapOfInteger& aMIj=aDMIMI.ChangeFind(j);
+       TColStd_MapOfInteger *pMj=(TColStd_MapOfInteger *)&aItj.Value();
+       TColStd_MapOfInteger& aMIj=*pMj;
+       //
+       aItMI.Initialize(aMIj);
+       for (; aItMI.More(); aItMI.Next()) {
+         k=aItMI.Key();
+         bFound=aMIi.Contains(k);
+         if (bFound) {
+           break;
+         }
+       }
+       if (!bFound) {
+         continue;
+       }
+       //
+       aItMI.Initialize(aMIj);
+       for (; aItMI.More(); aItMI.Next()) {
+         k=aItMI.Key();
+         aMIi.Add(k);
+       }
+       //
+       if (aMF.Add(j)) {
+         ++iCnt;
+       }
+      } //for (; aItj.More(); aItj.Next()) {
+      if (!iCnt) {
+       break;
+      }
+    } // while (1) {
+    //
+    aLV.Clear();
+    aItMI.Initialize(aMIi);
+    for (; aItMI.More(); aItMI.Next()) {
+      k=aItMI.Key();
+       if (k!=i) {
+         aLV.Append(k);
+       }
+    }
+    bMVSD.Bind(i, aLV);
+  }// for (; aIti.More(); aIti.Next()) {
+}
+
+  /*  
+  {
+    // check
+    TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItX;
+    //
+    printf(" \n");
+    printf(" myMVSD.Extent()=%d\n", myMVSD.Extent());
+    aItX.Initialize(myMVSD);
+    for (; aItX.More(); aItX.Next()) {
+      i=aItX.Key();
+      printf(" i=%d (", i);
+      const TColStd_ListOfInteger& aLV=aItX.Value();
+      aIt.Initialize(aLV);
+      for (; aIt.More(); aIt.Next()) {
+       j=aIt.Value();
+       printf(" %d", j);
+      }
+      printf(")\n");
+    }
   }
-  printf("\n");
 */
+
index d2d260ccd0a6790cc709352571ed71792fb557e3..25ae15ec0fd2313c313483daa05dd622bd77f0b1 100644 (file)
@@ -95,15 +95,21 @@ Standard_EXPORT   void Next() ;
 Standard_EXPORT   void Current(Standard_Integer& aIndex1,Standard_Integer& aIndex2,Standard_Boolean& aWithSubShape) const;
 
 
-Standard_EXPORT   void Prepare() ;
+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) ;
+
+
 
 
 
@@ -113,9 +119,12 @@ protected:
  // 
 
 
+Standard_EXPORT virtual  void Intersect() ;
+
+
  // Fields PROTECTED
  //
-NMTDS_PShapesDataStructure myPDS;
+NMTDS_PShapesDataStructure myDS;
 NMTDS_ListOfPassKeyBoolean myLists[6];
 NMTDS_ListIteratorOfListOfPassKeyBoolean myIterator;
 NMTDS_ListOfPassKeyBoolean myEmptyList;
diff --git a/src/NMTDS/NMTDS_IteratorCheckerSI.cdl b/src/NMTDS/NMTDS_IteratorCheckerSI.cdl
new file mode 100644 (file)
index 0000000..c7f7650
--- /dev/null
@@ -0,0 +1,41 @@
+-- Copyright (C) 2007 SAMTECH
+-- 
+-- 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_IteratorCheckerSI.cdl
+-- Created:    Tue Feb  6 10:18:27 2007
+-- Author:     Peter KURNEV
+
+
+class IteratorCheckerSI from NMTDS  
+    inherits Iterator from NMTDS
+
+       ---Purpose: 
+
+--uses 
+--raises
+
+is 
+    Create   
+       returns IteratorCheckerSI from NMTDS;
+    ---C++: alias "Standard_EXPORT virtual ~NMTDS_IteratorCheckerSI();" 
+     
+    Intersect(me:out) 
+       is redefined protected;  
+--fields
+end IteratorCheckerSI;
diff --git a/src/NMTDS/NMTDS_IteratorCheckerSI.cxx b/src/NMTDS/NMTDS_IteratorCheckerSI.cxx
new file mode 100644 (file)
index 0000000..da2290b
--- /dev/null
@@ -0,0 +1,225 @@
+// Copyright (C) 2007 SAMTECH
+// 
+// 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_IteratorChecker.cxx
+// Created:    Tue Feb  6 10:37:59 2007
+// Author:     Peter KURNEV
+
+
+#include <NMTDS_IteratorCheckerSI.ixx>
+
+#include <TopAbs_ShapeEnum.hxx>
+#include <gp_Pnt.hxx>
+#include <Bnd_Box.hxx>
+//
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS.hxx>
+#include <BRep_Tool.hxx>
+//
+#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_DataMapOfIntegerInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_MapOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
+#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
+//
+#include <TopTools_DataMapOfShapeInteger.hxx>
+//
+#include <NCollection_UBTreeFiller.hxx>
+#include <NMTDS_BoxBndTree.hxx>
+#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_CArray1OfIndexRange.hxx>
+#include <NMTDS_IndexRange.hxx>
+#include <NMTDS_PassKeyBoolean.hxx>
+#include <NMTDS_MapOfPassKeyBoolean.hxx>
+#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
+#include <NMTDS_Tools.hxx>
+
+//=======================================================================
+//function : 
+//purpose  : 
+//=======================================================================
+  NMTDS_IteratorCheckerSI::NMTDS_IteratorCheckerSI()
+:
+  NMTDS_Iterator()
+{
+}
+//=======================================================================
+//function : ~
+//purpose  : 
+//=======================================================================
+  NMTDS_IteratorCheckerSI::~NMTDS_IteratorCheckerSI()
+{
+}
+//=======================================================================
+// function: Intersect
+// purpose: 
+//=======================================================================
+  void NMTDS_IteratorCheckerSI::Intersect()
+{
+  Standard_Boolean bFlag;
+  Standard_Integer aNbS, i, aNbA, aNbB, iFlag;
+  Standard_Integer aNbSD, iX, j, iDS, jB, k, aNbLV;
+  TColStd_ListIteratorOfListOfInteger aIt;
+  TColStd_DataMapOfIntegerInteger aMII;
+  TColStd_DataMapOfIntegerListOfInteger aMVSD;
+  TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD;
+  TopTools_DataMapOfShapeInteger aMSI;
+  TopAbs_ShapeEnum aTi, aTj;
+  NMTDS_PassKeyBoolean aPKXB; 
+  NMTDS_MapOfPassKeyBoolean aMPKXB;
+  NMTDS_IndexedDataMapOfShapeBox aMSB;
+  NMTDS_MapOfPassKeyBoolean aMPA;//myPairsAvoid
+  //
+  NMTDS_BoxBndTreeSelector aSelector;
+  NMTDS_BoxBndTree aBBTree;
+  NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
+  //
+  aNbS=myDS->NumberOfShapesOfTheObject();
+  //
+  // myPairsAvoid, aMSI, aMSB
+  for (i=1; i<=aNbS; ++i) {
+    const TopoDS_Shape& aSi=myDS->Shape(i);
+    aTi=aSi.ShapeType();
+    if (NMTDS_Tools::HasBRep(aTi)) {
+      if (aTi!=TopAbs_VERTEX) {
+       TColStd_IndexedMapOfInteger aMA;
+       //
+       myDS->GetAllSuccessors(i, aMA);
+       //
+       aNbA=aMA.Extent();
+       for (j=1; j<=aNbA; ++j) {
+         iX=aMA(j);
+         aPKXB.Clear();
+         aPKXB.SetIds(i, iX);
+         aMPA.Add(aPKXB);
+       }
+      }
+      else {
+       aPKXB.Clear();
+       aPKXB.SetIds(i, i);
+       aMPA.Add(aPKXB);
+      }
+      //
+      Bnd_Box aBoxEx;
+      //
+      myDS->ComputeBoxEx(i, aBoxEx);
+      aMSI.Bind(aSi, i);
+      aMSB.Add(aSi, aBoxEx);
+    }
+  }
+  // 
+  // aMII
+  aNbB=aMSB.Extent();
+  for (i=1; i<=aNbB; ++i) {
+    const TopoDS_Shape& aS=aMSB.FindKey(i);
+    const Bnd_Box& aBoxEx=aMSB(i);
+    //
+    aTreeFiller.Add(i, aBoxEx);
+    //
+    iDS=aMSI.Find(aS);
+    aMII.Bind(i, iDS);
+  }
+  //
+  aTreeFiller.Fill();
+  //
+  for (i=1; i<=aNbS; ++i) {
+    const TopoDS_Shape& aSi=myDS->Shape(i);
+    aTi=aSi.ShapeType();
+    if (!NMTDS_Tools::HasBRep(aTi)){
+      continue;
+    }
+    const Bnd_Box& aBoxEx=aMSB.FindFromKey(aSi);
+    aSelector.Clear();
+    aSelector.SetBox(aBoxEx);
+    //
+    aNbSD=aBBTree.Select(aSelector);
+    if (!aNbSD){
+      continue;
+    }
+    //
+    const TColStd_ListOfInteger& aLI=aSelector.Indices();
+    //
+    k=0;
+    TColStd_ListOfInteger aLV;
+    //
+    aIt.Initialize(aLI);
+    for (; aIt.More(); aIt.Next()) {
+      jB=aIt.Value();  // box index in MII
+      j=aMII.Find(jB); // DS index
+      //
+      aPKXB.SetIds(i, j);
+      if (aMPA.Contains(aPKXB)) {
+       continue;
+      }
+      //
+      if (aMPKXB.Add(aPKXB)) {
+       bFlag=Standard_False;// Bounding boxes are intersected
+       const Bnd_Box& aBoxi=myDS->GetBoundingBox(i);
+       const Bnd_Box& aBoxj=myDS->GetBoundingBox(j);
+       if (aBoxi.IsOut(aBoxj)) {
+         bFlag=!bFlag; //Bounding boxes of Sub-shapes are intersected
+       }
+       const TopoDS_Shape& aSj=myDS->Shape(j);
+       aTj=aSj.ShapeType();
+       iX=NMTDS_Tools::TypeToInteger(aTi, aTj);
+       //bFlag=(iStatus==2);
+       aPKXB.SetFlag(bFlag);
+       myLists[iX].Append(aPKXB);
+       //
+       // VSD prepare
+       if (iX==5) { //VV
+         aLV.Append(j);
+       }
+      }// if (aMPKXB.Add(aPKXB)) {
+    }// for (; aIt.More(); aIt.Next()) {
+    //
+    // VSD treatment
+    aNbLV=aLV.Extent();
+    if (aNbLV) {
+      TColStd_ListOfInteger aLV1;
+      //
+      const TopoDS_Vertex& aVi=TopoDS::Vertex(aSi);
+      aIt.Initialize(aLV);
+      for (; aIt.More(); aIt.Next()) {
+       j=aIt.Value();  
+       const TopoDS_Shape&  aSj=myDS->Shape(j);
+       const TopoDS_Vertex& aVj=TopoDS::Vertex(aSj);
+       iFlag=NMTDS_Tools::ComputeVV(aVi, aVj);
+       if (!iFlag) {
+         aLV1.Append(j);
+       }
+       else {
+         aPKXB.SetIds(i, j);
+         aMPKXB.Remove(aPKXB);
+       }
+      }        
+      aMVSD.Bind(i, aLV1);
+    }
+  }//for (i=1; i<=aNbS; ++i) {
+  //
+  //
+  // 2. Chains
+  //=================
+  myMVSD.Clear();
+  NMTDS_Iterator::FillMVSD(aMVSD, myMVSD);
+}
+
diff --git a/src/NMTDS/NMTDS_IteratorCheckerSI.hxx b/src/NMTDS/NMTDS_IteratorCheckerSI.hxx
new file mode 100644 (file)
index 0000000..f11a9c1
--- /dev/null
@@ -0,0 +1,96 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_IteratorCheckerSI_HeaderFile
+#define _NMTDS_IteratorCheckerSI_HeaderFile
+
+#ifndef _NMTDS_Iterator_HeaderFile
+#include <NMTDS_Iterator.hxx>
+#endif
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_IteratorCheckerSI  : public 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_IteratorCheckerSI();
+Standard_EXPORT virtual ~NMTDS_IteratorCheckerSI();
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+Standard_EXPORT virtual  void Intersect() ;
+
+
+ // Fields PROTECTED
+ //
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_IteratorCheckerSI.ixx b/src/NMTDS/NMTDS_IteratorCheckerSI.ixx
new file mode 100644 (file)
index 0000000..6346ab5
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_IteratorCheckerSI.jxx>
+
+
+
diff --git a/src/NMTDS/NMTDS_IteratorCheckerSI.jxx b/src/NMTDS/NMTDS_IteratorCheckerSI.jxx
new file mode 100644 (file)
index 0000000..dc6afc1
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_IteratorCheckerSI_HeaderFile
+#include <NMTDS_IteratorCheckerSI.hxx>
+#endif
diff --git a/src/NMTDS/NMTDS_PInterfPool.hxx b/src/NMTDS/NMTDS_PInterfPool.hxx
new file mode 100644 (file)
index 0000000..7084ba3
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_PInterfPool_HeaderFile
+#define _NMTDS_PInterfPool_HeaderFile
+
+class NMTDS_InterfPool;
+
+typedef NMTDS_InterfPool* NMTDS_PInterfPool;
+
+#endif
diff --git a/src/NMTDS/NMTDS_PIterator.hxx b/src/NMTDS/NMTDS_PIterator.hxx
new file mode 100644 (file)
index 0000000..8cefa5b
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_PIterator_HeaderFile
+#define _NMTDS_PIterator_HeaderFile
+
+class NMTDS_Iterator;
+
+typedef NMTDS_Iterator* NMTDS_PIterator;
+
+#endif
index e9a637a46217fac124944f857df57f1d385d8f90..905a8d62af018cfee7fede43578abf4b2d29bbb0 100755 (executable)
@@ -1,4 +1,5 @@
--- Copyright (C) 2006 SAMTECH 
+-- Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 -- 
 -- This library is free software; you can redistribute it and/or
 -- modify it under the terms of the GNU Lesser General Public
 -- License along with this library; if not, write to the Free Software 
 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 --
--- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 -- 
 -- File:       NMTDS_PassKey.cdl
--- Created:    
+-- Created:    Mon Nov 20 12:16:13 2006
 -- Author:     Peter KURNEV
 --             <pkv@irinox>
 
+
 class PassKey from NMTDS 
 
        ---Purpose: 
 
 uses
     Shape from TopoDS, 
-    ListOfInteger from TColStd   
-        
+    IndexedMapOfInteger from TColStd, 
+    ListOfInteger from TColStd
+
 --raises
 
 is 
     Create  
        returns PassKey from NMTDS; 
-     
-    Assign(me:out;  
-           Other : PassKey from NMTDS) 
-       returns PassKey from NMTDS; 
-    ---C++: alias operator =
-    ---C++: return & 
---    
+    ---C++: alias "Standard_EXPORT virtual ~NMTDS_PassKey();" 
+
+    Create(Other:PassKey from NMTDS) 
+       returns PassKey from NMTDS;
+   ---C++: alias "Standard_EXPORT NMTDS_PassKey& operator =(const NMTDS_PassKey& Other);" 
+
+    Clear(me:out);
+    
     SetIds(me:out; 
-           aI1 :Integer from Standard;    
+           aI1  :Integer from Standard); 
+            
+    SetIds(me:out; 
+           aI1 :Integer from Standard; 
            aI2 :Integer from Standard);  
             
-    NbMax(me) 
-       returns Integer  from Standard; 
-        
-    Clear(me:out); 
+    SetIds(me:out; 
+           aI1 :Integer from Standard;    
+           aI2 :Integer from Standard;    
+           aI3 :Integer from Standard);  
+
+    SetIds(me:out; 
+           aI1 :Integer from Standard;    
+           aI2 :Integer from Standard;    
+           aI3 :Integer from Standard;    
+           aI4 :Integer from Standard); 
      
-    Compute(me:out); 
+    SetIds(me:out;  
+           aLS  :ListOfInteger from TColStd);   
+
+    NbIds(me) 
+       returns Integer  from Standard; 
      
     IsEqual(me; 
            aOther:PassKey from NMTDS) 
        returns Boolean from Standard;                       
-
-    Key(me) 
-       returns Address from Standard;  
         
     HashCode(me; 
            Upper : Integer  from Standard)  
        returns Integer from Standard;           
      
+    Id(me; 
+           aIndex: Integer  from Standard)  
+       returns  Integer from Standard;
+       
     Ids(me; 
            aI1 :out Integer from Standard;    
            aI2 :out Integer from Standard);
-     
-    Dump(me); 
 
+    Dump(me; 
+       aHex:Integer from Standard=0);  
+     
+       
 fields 
     myNbIds: Integer from Standard is protected;  
-    myNbMax: Integer from Standard is protected; 
-    mySum  : Integer from Standard is protected;   
-    myIds  : Integer from Standard [2] is protected; 
+    mySum  : Integer from Standard is protected;  
+    myMap  : IndexedMapOfInteger from TColStd is protected; 
 
 end PassKey;
index 910400cd6309b5c3aa8bd6ce99890b3380208fb2..2d2d52ea0a5386292a7eefe810383791173d3eed 100755 (executable)
@@ -1,4 +1,5 @@
-// Copyright (C) 2006 SAMTECH
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 // 
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-// File:       NMTDS_PassKey.cxx
-// Created:    
+//
+// File:       NMTDS_Algo.cxx
+// Created:    Sat Dec 04 12:39:47 2004
 // Author:     Peter KURNEV
-//             <pkv@irinox>
+//             <peter@PREFEX>
 
 
 #include <NMTDS_PassKey.ixx>
 #include <stdio.h>
 #include <string.h>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
 
 #ifdef WNT
 #pragma warning( disable : 4101) 
 #endif
 
-static 
-  void SortShell(const int n, int* a); 
 static
   Standard_Integer NormalizedId(const Standard_Integer aId,
                                const Standard_Integer aDiv);
@@ -44,129 +45,197 @@ static
 //=======================================================================
   NMTDS_PassKey::NMTDS_PassKey()
 {
-  Clear();
+ Clear(); 
+}
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKey::NMTDS_PassKey(const NMTDS_PassKey& aOther)
+{
+  myNbIds=aOther.myNbIds;
+  mySum=aOther.mySum;
+  myMap=aOther.myMap;
 }
 //=======================================================================
-//function :Assign
+//function :operator =
 //purpose  : 
 //=======================================================================
-  NMTDS_PassKey& NMTDS_PassKey::Assign(const NMTDS_PassKey& anOther)
+  NMTDS_PassKey& NMTDS_PassKey::operator =(const NMTDS_PassKey& aOther)
 {
-  myNbIds=anOther.myNbIds;
-  myNbMax=anOther.myNbMax;
-  mySum=anOther.mySum;
-  memcpy(myIds, anOther.myIds, sizeof(myIds));
+  myNbIds=aOther.myNbIds;
+  mySum=aOther.mySum;
+  myMap=aOther.myMap;
   return *this;
 }
 //=======================================================================
+//function :~
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKey::~NMTDS_PassKey()
+{
+}
+//=======================================================================
 //function :Clear
 //purpose  : 
 //=======================================================================
   void NMTDS_PassKey::Clear()
 {
-  Standard_Integer i;
-  //
   myNbIds=0;
-  myNbMax=2;
   mySum=0;
-  for (i=0; i<myNbMax; ++i) {
-    myIds[i]=0;
-  }
+  myMap.Clear();
+}
+//=======================================================================
+//function :SetIds
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKey::SetIds(const Standard_Integer aId1)
+                              
+{
+  Clear();
+  myNbIds=1;
+  myMap.Add(aId1);
+  mySum=NormalizedId(aId1, myNbIds);
+}
+//=======================================================================
+//function :SetIds
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
+                            const Standard_Integer aId2)
+{
+  TColStd_ListOfInteger aLI;
+  //
+  aLI.Append(aId1);
+  aLI.Append(aId2);
+  SetIds(aLI);
 }
 //=======================================================================
 //function :SetIds
 //purpose  : 
 //=======================================================================
-  void NMTDS_PassKey::SetIds(const Standard_Integer anId1,
-                            const Standard_Integer anId2)
+  void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
+                            const Standard_Integer aId2,
+                            const Standard_Integer aId3)
 {
-  Standard_Integer aIdN1, aIdN2;
+  TColStd_ListOfInteger aLI;
   //
-  myNbIds=2;
-  aIdN1=NormalizedId(anId1, myNbIds);
-  aIdN2=NormalizedId(anId2, myNbIds);
-  mySum=aIdN1+aIdN2;
+  aLI.Append(aId1);
+  aLI.Append(aId2);
+  aLI.Append(aId3);
+  SetIds(aLI);
+}
+//=======================================================================
+//function :SetIds
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKey::SetIds(const Standard_Integer aId1,
+                            const Standard_Integer aId2,
+                            const Standard_Integer aId3,
+                            const Standard_Integer aId4)
+{ 
+  TColStd_ListOfInteger aLI;
   //
-  if (anId1<anId2) {
-    myIds[myNbMax-2]=anId1;
-    myIds[myNbMax-1]=anId2;
-    return;
-  }
-  myIds[myNbMax-2]=anId2;
-  myIds[myNbMax-1]=anId1;
+  aLI.Append(aId1);
+  aLI.Append(aId2);
+  aLI.Append(aId3);
+  aLI.Append(aId4);
+  SetIds(aLI);
 }
 //=======================================================================
-//function :Ids
+//function :SetIds
 //purpose  : 
 //=======================================================================
-  void NMTDS_PassKey::Ids(Standard_Integer& aId1,
-                         Standard_Integer& aId2)const
+  void NMTDS_PassKey::SetIds(const TColStd_ListOfInteger& aLI)
 {
-  aId1=myIds[0];
-  aId2=myIds[1];
+  Standard_Integer i, aId, aIdN;
+  TColStd_ListIteratorOfListOfInteger aIt;
+  //
+  Clear();
+  aIt.Initialize(aLI);
+  for (; aIt.More(); aIt.Next()) {
+    aId=aIt.Value();
+    myMap.Add(aId);
+  }
+  myNbIds=myMap.Extent();
+  for(i=1; i<=myNbIds; ++i) {
+    aId=myMap(i);
+    aIdN=NormalizedId(aId, myNbIds);
+    mySum+=aIdN;
+  }
 }
+
 //=======================================================================
-//function :NbMax
+//function :NbIds
 //purpose  : 
 //=======================================================================
-  Standard_Integer NMTDS_PassKey::NbMax()const
+  Standard_Integer NMTDS_PassKey::NbIds()const
 {
-  return myNbMax;
+  return myNbIds;
 }
 //=======================================================================
-//function :Compute
+//function :Id
 //purpose  : 
 //=======================================================================
-  void NMTDS_PassKey::Compute()
+  Standard_Integer NMTDS_PassKey::Id(const Standard_Integer aIndex) const
 {
-  SortShell(myNbIds, myIds+myNbMax-myNbIds);
+  if (aIndex<1 || aIndex>myNbIds) {
+    return -1;
+  }
+  return myMap(aIndex);
 }
 //=======================================================================
-//function :IsEqual
+//function :Ids
 //purpose  : 
 //=======================================================================
-  Standard_Boolean NMTDS_PassKey::IsEqual(const NMTDS_PassKey& anOther) const
+  void NMTDS_PassKey::Ids(Standard_Integer& aId1,
+                         Standard_Integer& aId2) const
 {
-  Standard_Integer iIsEqual;
-  Standard_Boolean bIsEqual;
-  //
-  iIsEqual=memcmp(myIds, anOther.myIds, sizeof(myIds));
-  bIsEqual=Standard_False;
-  if (!iIsEqual) {
-    bIsEqual=!bIsEqual;
+  aId1=0;
+  aId2=0;
+  if (myNbIds>1) {
+    aId1=myMap(1);
+    aId2=myMap(2);
   }
-  return bIsEqual;
 }
 //=======================================================================
-//function :Key
+//function :IsEqual
 //purpose  : 
 //=======================================================================
-  Standard_Address NMTDS_PassKey::Key()const
+  Standard_Boolean NMTDS_PassKey::IsEqual(const NMTDS_PassKey& aOther) const
 {
-  return (Standard_Address)myIds;
+  Standard_Boolean bRet;
+  Standard_Integer i, aId;
+  //
+  bRet=Standard_False;
+  //
+  if (myNbIds!=aOther.myNbIds) {
+    return bRet;
+  }
+  for (i=1; i<=myNbIds; ++i) {
+    aId=myMap(i);
+    if (!aOther.myMap.Contains(aId)) {
+      return bRet;
+    }
+  }
+  return !bRet;
 }
 //=======================================================================
 //function : HashCode
 //purpose  : 
 //=======================================================================
-  Standard_Integer NMTDS_PassKey::HashCode(const Standard_Integer Upper) const
+  Standard_Integer NMTDS_PassKey::HashCode(const Standard_Integer aUpper) const
 {
-  return ::HashCode(mySum, Upper);
+  return ::HashCode(mySum, aUpper);
 }
 //=======================================================================
 //function : Dump
 //purpose  : 
 //=======================================================================
-  void NMTDS_PassKey::Dump()const
+  void NMTDS_PassKey::Dump(const Standard_Integer )const
 {
-  Standard_Integer i;
-  //
-  printf(" PassKey: {");
-  for (i=0; i<myNbMax; ++i) {
-    printf(" %d", myIds[i]);
-  }
-  printf(" }");
 }
+
 //=======================================================================
 // function: NormalizedId
 // purpose : 
@@ -184,33 +253,109 @@ Standard_Integer NormalizedId(const Standard_Integer aId,
   }
   return aIdRet;
 }
+/*
+//=========
 //=======================================================================
-// function: SortShell
-// purpose : 
+//function : Contains
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_PassKey::Contains(const Standard_Integer aId) const
+{
+  return myMap.Contains(aId);
+}
+//=======================================================================
+//function :Contains
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_PassKey::Contains(const NMTDS_PassKey& aOther) const
+{
+  Standard_Boolean bRet;
+  Standard_Integer i, aId;
+  //
+  bRet=Standard_False;
+  //
+  if (myNbIds<aOther.myNbIds) {
+    return bRet;
+  }
+  for (i=1; i<=aOther.myNbIds; ++i) {
+    aId=aOther.myMap(i);
+    if (!myMap.Contains(aId)) {
+      return bRet;
+    }
+  }
+  return !bRet;
+}
+//=======================================================================
+//function :Intersected
+//purpose  : 
 //=======================================================================
-void SortShell(const int n, int* a) 
+  Standard_Boolean NMTDS_PassKey::Intersected(const NMTDS_PassKey& aOther) const
 {
-  int  x, nd, i, j, l, d=1;
+  Standard_Boolean bRet;
+  Standard_Integer i, aId;
   //
-  while(d<=n) {
-    d*=2;
+  bRet=Standard_False;
+  //
+  for (i=1; i<=myNbIds; ++i) {
+    aId=myMap(i);
+    if (aOther.Contains(aId)) {
+      return !bRet;
+    }
+  }
+  return bRet;
+}
+//=======================================================================
+//function : Add
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKey::Add(const Standard_Integer aId)
+{
+  TColStd_ListOfInteger aLI;
+  aLI.Append(aId);
+  //
+  Add(aLI);
+}
+//=======================================================================
+//function : Add
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKey::Add(const NMTDS_PassKey& aOther) 
+{
+  Standard_Integer i, aId;
+  TColStd_ListOfInteger aLS;
+  //
+  for(i=1; i<=myNbIds; ++i) {
+    aId=myMap(i);
+    aLS.Append(aId);
+  }
+  for(i=1; i<=aOther.myNbIds; ++i) {
+    aId=aOther.myMap(i);
+    aLS.Append(aId);
+  }
+  //
+  Add(aLS);
+}
+//=======================================================================
+//function : Add
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKey::Add(const TColStd_ListOfInteger& aLI)
+{
+  Standard_Integer i, aId;
+  TColStd_ListOfInteger aLS;
+  TColStd_ListIteratorOfListOfInteger aIt;
+  //
+  for(i=1; i<=myNbIds; ++i) {
+    aId=myMap(i);
+    aLS.Append(aId);
+  }
+  aIt.Initialize(aLI);
+  for (; aIt.More(); aIt.Next()) {
+    aId=aIt.Value();
+    aLS.Append(aId);
   }
   //
-  while (d) {
-    d=(d-1)/2;
-    //
-    nd=n-d;
-    for (i=0; i<nd; ++i) {
-      j=i;
-    m30:;
-      l=j+d;
-      if (a[l] < a[j]){
-       x=a[j];
-       a[j]=a[l];
-       a[l]=x;
-       j-=d;
-       if (j > -1) goto m30;
-      }//if (a[l] < a[j]){
-    }//for (i=0; i<nd; ++i) 
-  }//while (1)
+  SetIds(aLS);
 }
+//=========
+*/
index 65ac7bb2b80764723ae41a6d652c05535d6d12d3..379b72f79d2e5de73b5703f17114c22ecdcbbc66 100644 (file)
 #ifndef _Standard_Integer_HeaderFile
 #include <Standard_Integer.hxx>
 #endif
+#ifndef _TColStd_IndexedMapOfInteger_HeaderFile
+#include <TColStd_IndexedMapOfInteger.hxx>
+#endif
 #ifndef _Standard_Boolean_HeaderFile
 #include <Standard_Boolean.hxx>
 #endif
-#ifndef _Standard_Address_HeaderFile
-#include <Standard_Address.hxx>
-#endif
+class TColStd_ListOfInteger;
 
 
 #ifndef _Standard_HeaderFile
@@ -60,41 +61,47 @@ public:
 
 
 Standard_EXPORT NMTDS_PassKey();
+Standard_EXPORT virtual ~NMTDS_PassKey();
+
 
+Standard_EXPORT NMTDS_PassKey(const NMTDS_PassKey& Other);
+Standard_EXPORT NMTDS_PassKey& operator =(const NMTDS_PassKey& Other);
+
+
+Standard_EXPORT   void Clear() ;
 
-Standard_EXPORT   NMTDS_PassKey& Assign(const NMTDS_PassKey& Other) ;
-  NMTDS_PassKey& operator =(const NMTDS_PassKey& Other) 
-{
-  return Assign(Other);
-}
 
+Standard_EXPORT   void SetIds(const Standard_Integer aI1) ;
 
 
 Standard_EXPORT   void SetIds(const Standard_Integer aI1,const Standard_Integer aI2) ;
 
 
-Standard_EXPORT   Standard_Integer NbMax() const;
+Standard_EXPORT   void SetIds(const Standard_Integer aI1,const Standard_Integer aI2,const Standard_Integer aI3) ;
 
 
-Standard_EXPORT   void Clear() ;
+Standard_EXPORT   void SetIds(const Standard_Integer aI1,const Standard_Integer aI2,const Standard_Integer aI3,const Standard_Integer aI4) ;
 
 
-Standard_EXPORT   void Compute() ;
+Standard_EXPORT   void SetIds(const TColStd_ListOfInteger& aLS) ;
 
 
-Standard_EXPORT   Standard_Boolean IsEqual(const NMTDS_PassKey& aOther) const;
+Standard_EXPORT   Standard_Integer NbIds() const;
 
 
-Standard_EXPORT   Standard_Address Key() const;
+Standard_EXPORT   Standard_Boolean IsEqual(const NMTDS_PassKey& aOther) const;
 
 
 Standard_EXPORT   Standard_Integer HashCode(const Standard_Integer Upper) const;
 
 
+Standard_EXPORT   Standard_Integer Id(const Standard_Integer aIndex) const;
+
+
 Standard_EXPORT   void Ids(Standard_Integer& aI1,Standard_Integer& aI2) const;
 
 
-Standard_EXPORT   void Dump() const;
+Standard_EXPORT   void Dump(const Standard_Integer aHex = 0) const;
 
 
 
@@ -109,9 +116,8 @@ protected:
  // Fields PROTECTED
  //
 Standard_Integer myNbIds;
-Standard_Integer myNbMax;
 Standard_Integer mySum;
-Standard_Integer myIds[2];
+TColStd_IndexedMapOfInteger myMap;
 
 
 private: 
index 02ef906d33255b21132320b4eb74620fbd454e62..ba0d04dd17ed07bdbc4dc1403387efb9e7e78a85 100644 (file)
@@ -17,6 +17,9 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 
+#ifndef _TColStd_ListOfInteger_HeaderFile
+#include <TColStd_ListOfInteger.hxx>
+#endif
 #ifndef _NMTDS_PassKey_HeaderFile
 #include <NMTDS_PassKey.hxx>
 #endif
index 2ad7871a0e4c00b0d536f274d4f4633ac279468b..c34a3244a6b5d46627ec0c191175bcae2ce7db7d 100755 (executable)
@@ -36,21 +36,16 @@ uses
 is 
     Create  
        returns PassKeyBoolean from NMTDS; 
-     
-    Assign(me:out;  
-           Other : PassKeyBoolean from NMTDS) 
-       returns PassKeyBoolean from NMTDS; 
-    ---C++: alias operator =
-    ---C++: return & 
---     
+    ---C++: alias "Standard_EXPORT virtual ~NMTDS_PassKeyBoolean();" 
+    
     SetFlag(me:out; 
            aFlag: Boolean from Standard); 
-        
+    ---C++: alias " Standard_EXPORT NMTDS_PassKeyBoolean& operator =(const NMTDS_PassKeyBoolean& Other);" 
+    
     Flag(me)  
        returns Boolean from Standard;      
 
 fields 
     myFlag: Boolean from Standard is protected;  
 
 end PassKeyBoolean;
index 11f90ee799a4730be0f1db17d6abdfc553adb251..059751fe2e180ebe2e29f2e6f81209cf5d4a7032 100755 (executable)
@@ -25,7 +25,7 @@
 #include <NMTDS_PassKeyBoolean.ixx>
 
 //=======================================================================
-//function : NMTDS_PassKeyBoolean
+//function : 
 //purpose  : 
 //=======================================================================
   NMTDS_PassKeyBoolean::NMTDS_PassKeyBoolean()
 {
 }
 //=======================================================================
-//function :Assign
+//function : ~
 //purpose  : 
 //=======================================================================
-  NMTDS_PassKeyBoolean& NMTDS_PassKeyBoolean::Assign(const NMTDS_PassKeyBoolean& anOther)
+  NMTDS_PassKeyBoolean::~NMTDS_PassKeyBoolean()
+{
+}
+//=======================================================================
+//function :operator =
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKeyBoolean& NMTDS_PassKeyBoolean::operator =(const NMTDS_PassKeyBoolean& anOther)
 {
   myFlag=anOther.myFlag;
-  NMTDS_PassKey::Assign(anOther);
+  NMTDS_PassKey::operator =(anOther);
   return *this;
 }
 //=======================================================================
index 0ac2e06b628f78bcdce0c0bc0300b046bdf59c49..604cfa30b368c4c1216748e83afcb38c1ac1eebf 100644 (file)
@@ -57,17 +57,11 @@ public:
 
 
 Standard_EXPORT NMTDS_PassKeyBoolean();
-
-
-Standard_EXPORT   NMTDS_PassKeyBoolean& Assign(const NMTDS_PassKeyBoolean& Other) ;
-  NMTDS_PassKeyBoolean& operator =(const NMTDS_PassKeyBoolean& Other) 
-{
-  return Assign(Other);
-}
-
+Standard_EXPORT virtual ~NMTDS_PassKeyBoolean();
 
 
 Standard_EXPORT   void SetFlag(const Standard_Boolean aFlag) ;
+ Standard_EXPORT NMTDS_PassKeyBoolean& operator =(const NMTDS_PassKeyBoolean& Other);
 
 
 Standard_EXPORT   Standard_Boolean Flag() const;
index ae537d7873bfe80de5be02e5faf41cda152fad05..de75ce8f9de1a32bd78fe3cf1f5cc07a9e56a78d 100755 (executable)
@@ -1,4 +1,5 @@
--- Copyright (C) 2006 SAMTECH 
+-- Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 -- 
 -- This library is free software; you can redistribute it and/or
 -- modify it under the terms of the GNU Lesser General Public
@@ -14,8 +15,8 @@
 -- License along with this library; if not, write to the Free Software 
 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 --
--- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
--- 
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
 -- File:       NMTDS_PassKeyMapHasher.cdl
 -- Created:    
 -- Author:     Peter KURNEV
index 09e4ad0476214c1b831171818a912ceb853b30a2..ac7910947f683d906b4c3a45e42e33bb8164999b 100755 (executable)
@@ -1,4 +1,5 @@
-// Copyright (C) 2006 SAMTECH
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 // 
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //function : HashCode
 //purpose  : 
 //=======================================================================
-  Standard_Integer NMTDS_PassKeyMapHasher::HashCode(const NMTDS_PassKey& aPKey,
+  Standard_Integer NMTDS_PassKeyMapHasher::HashCode(const NMTDS_PassKey& aPK,
                                                    const Standard_Integer Upper)
 {
-  return aPKey.HashCode(Upper);
+  return aPK.HashCode(Upper);
 }
 //=======================================================================
 //function :IsEqual
 //purpose  : 
 //=======================================================================
-  Standard_Boolean NMTDS_PassKeyMapHasher::IsEqual(const NMTDS_PassKey& aPKey1,
-                                                  const NMTDS_PassKey& aPKey2)
+  Standard_Boolean NMTDS_PassKeyMapHasher::IsEqual(const NMTDS_PassKey& aPK1,
+                                                  const NMTDS_PassKey& aPK2)
 {
-  return aPKey1.IsEqual(aPKey2);
+  return aPK1.IsEqual(aPK2);
 }
diff --git a/src/NMTDS/NMTDS_PassKeyShape.cdl b/src/NMTDS/NMTDS_PassKeyShape.cdl
new file mode 100644 (file)
index 0000000..0812265
--- /dev/null
@@ -0,0 +1,95 @@
+-- Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+-- 
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either 
+-- version 2.1 of the License.
+-- 
+-- This library is distributed in the hope that it will be useful 
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of 
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public  
+-- License along with this library; if not, write to the Free Software 
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+--
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File:       NMTDS_PassKeyShape.cdl
+-- Created:    
+-- Author:     Peter KURNEV
+--             <pkv@irinox>
+
+
+class PassKeyShape from NMTDS 
+   
+       ---Purpose: 
+
+uses
+    Shape from TopoDS, 
+    ListOfShape from TopTools,   
+    IndexedMapOfShape from TopTools 
+     
+--raises
+
+is 
+    Create  
+       returns PassKeyShape from NMTDS; 
+     ---C++: alias "Standard_EXPORT virtual ~NMTDS_PassKeyShape();" 
+     
+    Create(Other:PassKeyShape from NMTDS) 
+       returns PassKeyShape from NMTDS;
+     
+    Assign(me:out;  
+           Other : PassKeyShape from NMTDS) 
+       returns PassKeyShape from NMTDS; 
+    ---C++: alias operator =
+    ---C++: return &  
+     
+    SetShapes(me:out; 
+           aS  :Shape from TopoDS); 
+           
+    SetShapes(me:out; 
+           aS1  :Shape from TopoDS; 
+           aS2  :Shape from TopoDS); 
+     
+    SetShapes(me:out; 
+           aS1  :Shape from TopoDS; 
+           aS2  :Shape from TopoDS; 
+           aS3  :Shape from TopoDS); 
+    SetShapes(me:out;  
+           aS1  :Shape from TopoDS; 
+           aS2  :Shape from TopoDS; 
+           aS3  :Shape from TopoDS;
+           aS4  :Shape from TopoDS);
+    SetShapes(me:out;  
+           aLS  :ListOfShape from TopTools); 
+        
+    Clear(me:out); 
+     
+
+    NbIds(me) 
+       returns Integer  from Standard; 
+     
+    IsEqual(me; 
+           aOther:PassKeyShape from NMTDS) 
+       returns Boolean from Standard;                       
+        
+    HashCode(me; 
+           Upper : Integer  from Standard)  
+       returns Integer from Standard;           
+     
+    Dump(me; 
+       aHex:Integer from Standard=0);  
+       
+fields 
+    myNbIds:Integer from Standard is protected;    
+    mySum  :Integer from Standard is protected;    
+    myUpper:Integer from Standard is protected;    
+    myMap  :IndexedMapOfShape from TopTools is protected;        
+
+end PassKeyShape;
diff --git a/src/NMTDS/NMTDS_PassKeyShape.cxx b/src/NMTDS/NMTDS_PassKeyShape.cxx
new file mode 100644 (file)
index 0000000..c4af3a4
--- /dev/null
@@ -0,0 +1,227 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:       NMTDS_PassKeyShape.cxx
+// Created:    
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <NMTDS_PassKeyShape.ixx>
+
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+
+
+static 
+  Standard_Integer NormalizedId(const Standard_Integer aId,
+                               const Standard_Integer aDiv);
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKeyShape::NMTDS_PassKeyShape()
+{
+  myUpper=432123;
+}
+//=======================================================================
+//function :
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKeyShape::NMTDS_PassKeyShape(const NMTDS_PassKeyShape& aOther)
+{
+  myUpper=432123;
+  myNbIds=aOther.myNbIds;
+  mySum=aOther.mySum;
+  myMap=aOther.myMap;
+}
+//=======================================================================
+//function :~
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKeyShape::~NMTDS_PassKeyShape()
+{
+}
+//=======================================================================
+//function :Assign
+//purpose  : 
+//=======================================================================
+  NMTDS_PassKeyShape& NMTDS_PassKeyShape::Assign(const NMTDS_PassKeyShape& aOther)
+{
+  myUpper=432123;
+  myNbIds=aOther.myNbIds;
+  mySum=aOther.mySum;
+  myMap=aOther.myMap;
+  return *this;
+}
+//=======================================================================
+//function :Clear
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::Clear()
+{
+  myNbIds=0;
+  mySum=0;
+  myMap.Clear();
+}
+//=======================================================================
+//function :SetShapes
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1)
+                              
+{
+  Standard_Integer aHC;
+  //
+  Clear();
+  myNbIds=1;
+  myMap.Add(aS1);
+  aHC=aS1.HashCode(myUpper);
+  mySum=NormalizedId(aHC, myNbIds);
+}
+//=======================================================================
+//function :SetShapes
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
+                                       const TopoDS_Shape& aS2)
+{
+  TopTools_ListOfShape aLS;
+  //
+  aLS.Append(aS1);
+  aLS.Append(aS2);
+  SetShapes(aLS);
+}
+//=======================================================================
+//function :SetShapes
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
+                                       const TopoDS_Shape& aS2,
+                                       const TopoDS_Shape& aS3)
+{
+  TopTools_ListOfShape aLS;
+  //
+  aLS.Append(aS1);
+  aLS.Append(aS2);
+  aLS.Append(aS3);
+  SetShapes(aLS);
+}
+//=======================================================================
+//function :SetShapes
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::SetShapes(const TopoDS_Shape& aS1,
+                                       const TopoDS_Shape& aS2,
+                                       const TopoDS_Shape& aS3,
+                                       const TopoDS_Shape& aS4)
+{
+  TopTools_ListOfShape aLS;
+  //
+  aLS.Append(aS1);
+  aLS.Append(aS2);
+  aLS.Append(aS3);
+  aLS.Append(aS4);
+  SetShapes(aLS);
+}
+//=======================================================================
+//function :SetShapes
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::SetShapes(const TopTools_ListOfShape& aLS)
+{
+  Standard_Integer i, aId, aIdN;
+  TopTools_ListIteratorOfListOfShape aIt;
+  //
+  Clear();
+  aIt.Initialize(aLS);
+  for (; aIt.More(); aIt.Next()) {
+    const TopoDS_Shape& aS=aIt.Value();
+    myMap.Add(aS);
+  }
+  myNbIds=myMap.Extent();
+  for(i=1; i<=myNbIds; ++i) {
+    const TopoDS_Shape& aS=myMap(i);
+    aId=aS.HashCode(myUpper);
+    aIdN=NormalizedId(aId, myNbIds);
+    mySum+=aIdN;
+  }
+}
+//=======================================================================
+//function :NbIds
+//purpose  : 
+//=======================================================================
+  Standard_Integer NMTDS_PassKeyShape::NbIds()const
+{
+  return myNbIds;
+}
+//=======================================================================
+//function :IsEqual
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_PassKeyShape::IsEqual(const NMTDS_PassKeyShape& aOther) const
+{
+  Standard_Boolean bRet;
+  Standard_Integer i;
+  //
+  bRet=Standard_False;
+  //
+  if (myNbIds!=aOther.myNbIds) {
+    return bRet;
+  }
+  for (i=1; i<=myNbIds; ++i) {
+    const TopoDS_Shape& aS=myMap(i);
+    if (!aOther.myMap.Contains(aS)) {
+      return bRet;
+    }
+  }
+  return !bRet;
+}
+//=======================================================================
+//function : HashCode
+//purpose  : 
+//=======================================================================
+  Standard_Integer NMTDS_PassKeyShape::HashCode(const Standard_Integer aUpper) const
+{
+  return ::HashCode(mySum, aUpper);
+}
+//=======================================================================
+//function : Dump
+//purpose  : 
+//=======================================================================
+  void NMTDS_PassKeyShape::Dump(const Standard_Integer)const
+{
+}
+//=======================================================================
+// 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_PassKeyShape.hxx b/src/NMTDS/NMTDS_PassKeyShape.hxx
new file mode 100644 (file)
index 0000000..81eaa80
--- /dev/null
@@ -0,0 +1,146 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_PassKeyShape_HeaderFile
+#define _NMTDS_PassKeyShape_HeaderFile
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _TopTools_IndexedMapOfShape_HeaderFile
+#include <TopTools_IndexedMapOfShape.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class TopoDS_Shape;
+class TopTools_ListOfShape;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_PassKeyShape  {
+
+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_PassKeyShape();
+Standard_EXPORT virtual ~NMTDS_PassKeyShape();
+
+
+Standard_EXPORT NMTDS_PassKeyShape(const NMTDS_PassKeyShape& Other);
+
+
+Standard_EXPORT   NMTDS_PassKeyShape& Assign(const NMTDS_PassKeyShape& Other) ;
+  NMTDS_PassKeyShape& operator =(const NMTDS_PassKeyShape& Other) 
+{
+  return Assign(Other);
+}
+
+
+
+Standard_EXPORT   void SetShapes(const TopoDS_Shape& aS) ;
+
+
+Standard_EXPORT   void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2) ;
+
+
+Standard_EXPORT   void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3) ;
+
+
+Standard_EXPORT   void SetShapes(const TopoDS_Shape& aS1,const TopoDS_Shape& aS2,const TopoDS_Shape& aS3,const TopoDS_Shape& aS4) ;
+
+
+Standard_EXPORT   void SetShapes(const TopTools_ListOfShape& aLS) ;
+
+
+Standard_EXPORT   void Clear() ;
+
+
+Standard_EXPORT   Standard_Integer NbIds() const;
+
+
+Standard_EXPORT   Standard_Boolean IsEqual(const NMTDS_PassKeyShape& aOther) const;
+
+
+Standard_EXPORT   Standard_Integer HashCode(const Standard_Integer Upper) const;
+
+
+Standard_EXPORT   void Dump(const Standard_Integer aHex = 0) const;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+Standard_Integer myNbIds;
+Standard_Integer mySum;
+Standard_Integer myUpper;
+TopTools_IndexedMapOfShape myMap;
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_PassKeyShape.ixx b/src/NMTDS/NMTDS_PassKeyShape.ixx
new file mode 100644 (file)
index 0000000..90c37bd
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_PassKeyShape.jxx>
+
+
+
diff --git a/src/NMTDS/NMTDS_PassKeyShape.jxx b/src/NMTDS/NMTDS_PassKeyShape.jxx
new file mode 100644 (file)
index 0000000..9d79955
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _TopTools_ListOfShape_HeaderFile
+#include <TopTools_ListOfShape.hxx>
+#endif
+#ifndef _NMTDS_PassKeyShape_HeaderFile
+#include <NMTDS_PassKeyShape.hxx>
+#endif
diff --git a/src/NMTDS/NMTDS_PassKeyShapeMapHasher.cdl b/src/NMTDS/NMTDS_PassKeyShapeMapHasher.cdl
new file mode 100644 (file)
index 0000000..77c0667
--- /dev/null
@@ -0,0 +1,47 @@
+-- Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+-- 
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either 
+-- version 2.1 of the License.
+-- 
+-- This library is distributed in the hope that it will be useful 
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of 
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public  
+-- License along with this library; if not, write to the Free Software 
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+--
+-- See http:--www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--
+-- File:       NMTDS_PassKeyMapHasher.cdl
+-- Created:    
+-- Author:     Peter KURNEV
+--             <pkv@irinox>
+
+
+class PassKeyShapeMapHasher from NMTDS 
+
+       ---Purpose: 
+
+uses 
+    PassKeyShape from NMTDS 
+
+--raises
+
+is 
+    HashCode(myclass;  
+           aPKey : PassKeyShape from NMTDS;  
+           Upper : Integer from Standard)  
+       returns Integer from Standard;
+       
+       
+    IsEqual(myclass;  
+           aPKey1 : PassKeyShape from NMTDS;  
+           aPKey2 : PassKeyShape from NMTDS)  
+       returns Boolean from Standard;
+
+end PassKeyShapeMapHasher;
diff --git a/src/NMTDS/NMTDS_PassKeyShapeMapHasher.cxx b/src/NMTDS/NMTDS_PassKeyShapeMapHasher.cxx
new file mode 100644 (file)
index 0000000..e637e33
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:       NMTDS_PassKeyMapHasher.cxx
+// Created:    
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <NMTDS_PassKeyShapeMapHasher.ixx>
+
+//=======================================================================
+//function : HashCode
+//purpose  : 
+//=======================================================================
+  Standard_Integer NMTDS_PassKeyShapeMapHasher::HashCode(const NMTDS_PassKeyShape& aPK,
+                                                        const Standard_Integer Upper)
+{
+  return aPK.HashCode(Upper);
+}
+//=======================================================================
+//function :IsEqual
+//purpose  : 
+//=======================================================================
+  Standard_Boolean NMTDS_PassKeyShapeMapHasher::IsEqual(const NMTDS_PassKeyShape& aPK1,
+                                                       const NMTDS_PassKeyShape& aPK2)
+{
+  return aPK1.IsEqual(aPK2);
+}
diff --git a/src/NMTDS/NMTDS_PassKeyShapeMapHasher.hxx b/src/NMTDS/NMTDS_PassKeyShapeMapHasher.hxx
new file mode 100644 (file)
index 0000000..e484367
--- /dev/null
@@ -0,0 +1,99 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_PassKeyShapeMapHasher_HeaderFile
+#define _NMTDS_PassKeyShapeMapHasher_HeaderFile
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class NMTDS_PassKeyShape;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_PassKeyShapeMapHasher  {
+
+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 static  Standard_Integer HashCode(const NMTDS_PassKeyShape& aPKey,const Standard_Integer Upper) ;
+
+
+Standard_EXPORT static  Standard_Boolean IsEqual(const NMTDS_PassKeyShape& aPKey1,const NMTDS_PassKeyShape& aPKey2) ;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_PassKeyShapeMapHasher.ixx b/src/NMTDS/NMTDS_PassKeyShapeMapHasher.ixx
new file mode 100644 (file)
index 0000000..c7148fd
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_PassKeyShapeMapHasher.jxx>
+
+
+
diff --git a/src/NMTDS/NMTDS_PassKeyShapeMapHasher.jxx b/src/NMTDS/NMTDS_PassKeyShapeMapHasher.jxx
new file mode 100644 (file)
index 0000000..f0e81fc
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_PassKeyShape_HeaderFile
+#include <NMTDS_PassKeyShape.hxx>
+#endif
+#ifndef _NMTDS_PassKeyShapeMapHasher_HeaderFile
+#include <NMTDS_PassKeyShapeMapHasher.hxx>
+#endif
index 1922b4861f8e3a0d21c7e6ee7d2cfadc99911b7f..5a2f93f72ce08f2eb8f8d62f9f15f0a8a699e754 100644 (file)
@@ -27,8 +27,10 @@ class ShapesDataStructure from NMTDS
 
        ---Purpose: 
 
-uses
-    Shape from TopoDS,  
+uses  
+    Box from Bnd,
+    IndexedMapOfInteger from TColStd,
+    Shape from TopoDS, 
     IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations,
     CArray1OfIndexRange from NMTDS, 
     IndexedDataMapOfIntegerIndexedDataMapOfShapeInteger from NMTDS
@@ -79,6 +81,14 @@ is
            aMS :out IndexedDataMapOfShapeAncestorsSuccessors from BooleanOperations); 
 -- Contribution of Samtech www.samcef.com END 
 
+    GetAllSuccessors(me; 
+       anIndex:Integer from Standard; 
+       aScrs  :out IndexedMapOfInteger from TColStd);   
+
+    ComputeBoxEx(me; 
+       anIndex:Integer from Standard; 
+       aBox:out Box from Bnd);   
+
 fields
     myCompositeShape:  Shape from TopoDS is protected; 
     myRanges        :  CArray1OfIndexRange from NMTDS is protected; 
index c7355995b5c7ac561d89b35293cebb3c156af3d7..a9a0e7370c65e3b5b0201ec41e137b1cab3cd2b6 100644 (file)
 
 
 #include <NMTDS_ShapesDataStructure.ixx>
-
-#include <TColStd_MapOfInteger.hxx>
-
 #include <TopoDS_Iterator.hxx>
 #include <TopoDS_Shape.hxx>
-
-#include <BooleanOperations_ShapeAndInterferences.hxx>
 #include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
-#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
-
 #include <NMTDS_ListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx>
 #include <NMTDS_ListIteratorOfListOfIndexedDataMapOfShapeAncestorsSuccessors.hxx>
+#include <BooleanOperations_ShapeAndInterferences.hxx>
 #include <NMTDS_IndexRange.hxx>
+//
+#include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
+#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+#include <TColStd_MapOfInteger.hxx>
+#include <NMTDS_Tools.hxx>
+
+
+static
+  void ComputeBoxExS(const Standard_Integer aIx,
+                    const NMTDS_ShapesDataStructure* pDS,
+                    Bnd_Box& aBoxEx);
+static
+  void GetAllSuccessorsS(const Standard_Integer nS,
+                        const NMTDS_ShapesDataStructure* myDS,
+                        TColStd_IndexedMapOfInteger& aMA);
 
 //===========================================================================
 //function : NMTDS_ShapesDataStructure::NMTDS_ShapesDataStructure
     }
     //modified by NIZNHY-PKV Tue Feb 27 17:06:03 2007t
   }
-  //
   aNbS=aMSA.Extent(); 
   //
   // Fill myRanges
   // Contribution of Samtech www.samcef.com BEGIN
   //
   // Fill the table
+    
   //aShift=0;
   //for (i=0; i<2; ++i) {
   //  if (i) {
   //    InsertShapeAndAncestorsSuccessors(aSx, aASx, aShift);
   //  }
   //}
-
+  
   aShift=0;
   for (j=1; j<=aNbS; ++j) {
     const TopoDS_Shape& aSx=aMSA.FindKey(j);
   // Contribution of Samtech www.samcef.com END
   return aIndex;
 }
+
+//=======================================================================
+//function : ComputeBoxEx
+//purpose  : 
+//=======================================================================
+  void NMTDS_ShapesDataStructure::ComputeBoxEx (const Standard_Integer aIx,
+                                               Bnd_Box& aBoxEx)const
+{
+  ComputeBoxExS(aIx, this, aBoxEx);
+}
+//=======================================================================
+//function : GetAllSuccessors
+//purpose  : 
+//=======================================================================
+  void NMTDS_ShapesDataStructure::GetAllSuccessors(const Standard_Integer nS,
+                                                  TColStd_IndexedMapOfInteger& aMA)const
+{
+  GetAllSuccessorsS(nS, this, aMA);
+}
+//=======================================================================
+//function : GetAllSuccessorsS
+//purpose  : 
+//=======================================================================
+void GetAllSuccessorsS(const Standard_Integer nS,
+                      const NMTDS_ShapesDataStructure* myDS,
+                      TColStd_IndexedMapOfInteger& aMA)
+{
+  TopAbs_ShapeEnum aT;
+  Standard_Integer i, nSx, aNbSuccessors, *pSuccessors;
+  Standard_Address xSuccessors;
+  //
+  const TopoDS_Shape& aS=myDS->Shape(nS);
+  aT=aS.ShapeType();
+  if(NMTDS_Tools::HasBRep(aT)) {
+    aMA.Add(nS);
+    //
+    if (aT==TopAbs_VERTEX) {
+      return;
+    }
+  }
+  //
+  myDS->GetSuccessors(nS, xSuccessors, aNbSuccessors);
+  pSuccessors=(Standard_Integer*)xSuccessors;
+  for (i=0; i<aNbSuccessors; ++i) {
+    nSx=pSuccessors[i];
+    GetAllSuccessorsS(nSx, myDS, aMA);
+  }
+}
+//=======================================================================
+// function: ComputeBoxExS
+// purpose: 
+//=======================================================================
+  void ComputeBoxExS(const Standard_Integer aIx,
+                    const NMTDS_ShapesDataStructure* pDS,
+                    Bnd_Box& aBoxEx)
+{
+  Standard_Integer i, aNbS, iS;
+  //
+  const Bnd_Box& aBox=pDS->GetBoundingBox(aIx);
+  aBoxEx.Add(aBox);
+  //
+  aNbS=pDS->NumberOfSuccessors(aIx);
+  for (i=1; i<=aNbS; ++i) {
+    Bnd_Box aBoxS;
+    iS=pDS->GetSuccessor(aIx, i);
+    ComputeBoxExS(iS, pDS, aBoxS);
+    aBoxEx.Add(aBoxS);
+  }
+}
index b3e8065f806efda98797b152fa085bf75db8bbde..9d149f5a716193fbbe630634b059634643430b47 100644 (file)
@@ -38,6 +38,8 @@
 class TopoDS_Shape;
 class NMTDS_CArray1OfIndexRange;
 class BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors;
+class TColStd_IndexedMapOfInteger;
+class Bnd_Box;
 
 
 #ifndef _Standard_HeaderFile
@@ -98,6 +100,12 @@ Standard_EXPORT   void FillMap(const TopoDS_Shape& aS,BooleanOperations_IndexedD
 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;
+
+
 
 
 
index 5ae9a8554dc5459dd0c73c8b7ddb2e56c2bd763b..41897c6155a228076677b1cea8c684a07c6ee55b 100644 (file)
 #ifndef _BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors_HeaderFile
 #include <BooleanOperations_IndexedDataMapOfShapeAncestorsSuccessors.hxx>
 #endif
+#ifndef _TColStd_IndexedMapOfInteger_HeaderFile
+#include <TColStd_IndexedMapOfInteger.hxx>
+#endif
+#ifndef _Bnd_Box_HeaderFile
+#include <Bnd_Box.hxx>
+#endif
 #ifndef _NMTDS_ShapesDataStructure_HeaderFile
 #include <NMTDS_ShapesDataStructure.hxx>
 #endif
diff --git a/src/NMTDS/NMTDS_Tools.cdl b/src/NMTDS/NMTDS_Tools.cdl
new file mode 100644 (file)
index 0000000..1465d4d
--- /dev/null
@@ -0,0 +1,64 @@
+-- Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+-- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+-- 
+-- This library is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU Lesser General Public
+-- License as published by the Free Software Foundation; either 
+-- version 2.1 of the License.
+-- 
+-- This library is distributed in the hope that it will be useful 
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of 
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+-- Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public  
+-- License along with this library; if not, write to the Free Software 
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+--
+-- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+--  
+-- File:       NMTDS_Tools.cdl
+-- Created:    Tue Feb 20 14:56:14 2007
+-- Author:     Peter KURNEV
+--             <pkv@irinox>
+---Copyright:   Matra Datavision 2007
+
+
+class Tools from NMTDS 
+
+       ---Purpose: 
+
+uses
+    ShapeEnum from TopAbs, 
+    Vertex    from TopoDS,
+    Shape     from TopoDS,
+    IndexedDataMapOfShapeShape from TopTools 
+    
+--raises
+
+is 
+    TypeToInteger(myclass; 
+           aT1: ShapeEnum from TopAbs; 
+           aT2: ShapeEnum from TopAbs) 
+       returns Integer from Standard; 
+        
+    HasBRep(myclass; 
+           aT: ShapeEnum from TopAbs) 
+       returns Boolean from Standard;  
+        
+    ComputeVV(myclass;  
+           aV1:Vertex from TopoDS;  
+           aV2:Vertex from TopoDS) 
+       returns Integer from Standard;  
+
+    CopyShape(myclass; 
+           aS:Shape from TopoDS;  
+           aSC:out Shape from TopoDS);  
+
+    CopyShape(myclass; 
+           aS:Shape from TopoDS;  
+           aSC  :out Shape from TopoDS; 
+           aMSS :out IndexedDataMapOfShapeShape from TopTools);
+--fields
+
+end Tools;
diff --git a/src/NMTDS/NMTDS_Tools.cxx b/src/NMTDS/NMTDS_Tools.cxx
new file mode 100644 (file)
index 0000000..8944fe5
--- /dev/null
@@ -0,0 +1,173 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File:       NMTDS_Tools.cxx
+// Created:    Tue Feb 20 14:57:28 2007
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <NMTDS_Tools.ixx>
+#include <TopoDS_Vertex.hxx>
+#include <gp_Pnt.hxx>
+#include <BRep_Tool.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopTools_IndexedDataMapOfShapeShape.hxx>
+#include <TopAbs_ShapeEnum.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <BRep_Builder.hxx>
+
+void CopySource(const TopoDS_Shape& aS, 
+               TopTools_IndexedDataMapOfShapeShape& aMapSS, 
+               TopoDS_Shape& aSC);
+
+//=======================================================================
+//function : CopyShape
+//purpose  : 
+//=======================================================================
+  void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS, 
+                             TopoDS_Shape& aSC)
+{
+  TopTools_IndexedDataMapOfShapeShape aMapSS;
+  //
+  CopySource(aS, aMapSS, aSC);
+}
+//=======================================================================
+//function : CopyShape
+//purpose  : 
+//=======================================================================
+  void NMTDS_Tools::CopyShape(const TopoDS_Shape& aS, 
+                             TopoDS_Shape& aSC,
+                             TopTools_IndexedDataMapOfShapeShape& aMapSS)
+{
+  CopySource(aS, aMapSS, aSC);
+}
+//=======================================================================
+//function : CopySource
+//purpose  : 
+//=======================================================================
+void CopySource(const TopoDS_Shape& aS, 
+               TopTools_IndexedDataMapOfShapeShape& aMapSS, 
+               TopoDS_Shape& aSC)
+{
+  Standard_Boolean bFree;
+  TopAbs_ShapeEnum aT;
+  TopoDS_Iterator aIt;
+  BRep_Builder BB;
+  //
+  aT=aS.ShapeType();
+  //
+  if (aMapSS.Contains(aS)) {
+    aSC=aMapSS.ChangeFromKey(aS);
+    aSC.Orientation(aS.Orientation());
+    return;
+  }
+  else {
+    aSC=aS.EmptyCopied();
+    aMapSS.Add(aS, aSC);
+  }
+  //
+  bFree=aSC.Free();
+  aSC.Free(Standard_True);
+  aIt.Initialize(aS);
+  for (; aIt.More();  aIt.Next()) {
+    TopoDS_Shape aSCx;
+    //
+    const TopoDS_Shape& aSx=aIt.Value();
+    //
+    CopySource (aSx, aMapSS, aSCx);  
+    //
+    aSCx.Orientation(aSx.Orientation());
+    BB.Add(aSC, aSCx);
+  }
+  aSC.Free(bFree);
+}
+//=======================================================================
+// function: ComputeVV
+// purpose: 
+//=======================================================================
+  Standard_Integer NMTDS_Tools::ComputeVV(const TopoDS_Vertex& aV1, 
+                                         const TopoDS_Vertex& aV2)
+{
+  Standard_Real aTolV1, aTolV2, aTolSum, aTolSum2, aD2;
+  gp_Pnt aP1, aP2;
+  //
+  aTolV1=BRep_Tool::Tolerance(aV1);
+  aTolV2=BRep_Tool::Tolerance(aV2);
+  aTolSum=aTolV1+aTolV2;
+  aTolSum2=aTolSum*aTolSum;
+  //
+  aP1=BRep_Tool::Pnt(aV1);
+  aP2=BRep_Tool::Pnt(aV2);
+  //
+  aD2=aP1.SquareDistance(aP2);
+  if (aD2>aTolSum2) {
+    return -1;
+  }
+  return 0;
+}
+//=======================================================================
+// function: HasBRep
+// purpose: 
+//=======================================================================
+  Standard_Boolean NMTDS_Tools::HasBRep(const TopAbs_ShapeEnum aTi)
+{
+  return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE);
+}
+//=======================================================================
+//function : TypeToInteger
+//purpose  : 
+//=======================================================================
+  Standard_Integer NMTDS_Tools::TypeToInteger(const TopAbs_ShapeEnum aType1,
+                                           const TopAbs_ShapeEnum aType2)
+{
+  Standard_Integer iRet, iT1, iT2, iX;
+  //
+  iRet=-1;
+  iT1=(Standard_Integer)aType1;
+  iT2=(Standard_Integer)aType2;
+  //
+  iX=iT2*10+iT1;
+  switch (iX) {
+    case 77:
+      iRet=5; // VV
+      break;
+    case 76:
+    case 67:
+      iRet=4; // VE
+      break;
+    case 74:
+    case 47:
+      iRet=2; // VF
+      break;
+    case 66:
+      iRet=3; // EE
+      break;
+    case 64:
+    case 46:
+      iRet=1; // EF
+      break;
+    case 44:
+      iRet=0; // FF
+      break;
+    default:
+      break;
+  }
+  return iRet; 
+}
diff --git a/src/NMTDS/NMTDS_Tools.hxx b/src/NMTDS/NMTDS_Tools.hxx
new file mode 100644 (file)
index 0000000..c7eb8fd
--- /dev/null
@@ -0,0 +1,113 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTDS_Tools_HeaderFile
+#define _NMTDS_Tools_HeaderFile
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _TopAbs_ShapeEnum_HeaderFile
+#include <TopAbs_ShapeEnum.hxx>
+#endif
+#ifndef _Standard_Boolean_HeaderFile
+#include <Standard_Boolean.hxx>
+#endif
+class TopoDS_Vertex;
+class TopoDS_Shape;
+class TopTools_IndexedDataMapOfShapeShape;
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTDS_Tools  {
+
+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 static  Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aT1,const TopAbs_ShapeEnum aT2) ;
+
+
+Standard_EXPORT static  Standard_Boolean HasBRep(const TopAbs_ShapeEnum aT) ;
+
+
+Standard_EXPORT static  Standard_Integer ComputeVV(const TopoDS_Vertex& aV1,const TopoDS_Vertex& aV2) ;
+
+
+Standard_EXPORT static  void CopyShape(const TopoDS_Shape& aS,TopoDS_Shape& aSC) ;
+
+
+Standard_EXPORT static  void CopyShape(const TopoDS_Shape& aS,TopoDS_Shape& aSC,TopTools_IndexedDataMapOfShapeShape& aMSS) ;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+ // Fields PROTECTED
+ //
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTDS/NMTDS_Tools.ixx b/src/NMTDS/NMTDS_Tools.ixx
new file mode 100644 (file)
index 0000000..8e5877b
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTDS_Tools.jxx>
+
+
+
diff --git a/src/NMTDS/NMTDS_Tools.jxx b/src/NMTDS/NMTDS_Tools.jxx
new file mode 100644 (file)
index 0000000..4359a18
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _TopoDS_Vertex_HeaderFile
+#include <TopoDS_Vertex.hxx>
+#endif
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _TopTools_IndexedDataMapOfShapeShape_HeaderFile
+#include <TopTools_IndexedDataMapOfShapeShape.hxx>
+#endif
+#ifndef _NMTDS_Tools_HeaderFile
+#include <NMTDS_Tools.hxx>
+#endif
index 0e8cd2abdfb8d4709d6473937aa3e5ede7ab6136..63c77356a4e562a95c34a2e28298573b553dba50 100644 (file)
@@ -37,12 +37,13 @@ VPATH=.:@srcdir@
 # Libraries targets
 LIB = libNMTTools.la
 LIB_SRC = \
+       NMTTools_CheckerSI.cxx \
+       NMTTools_CheckerSI_1.cxx \
        NMTTools_CommonBlockAPI.cxx \
        NMTTools_CommonBlock.cxx \
        NMTTools_CommonBlockPool_0.cxx \
        NMTTools_CoupleOfShape.cxx \
        NMTTools_DEProcessor.cxx \
-       NMTTools_DSFiller.cxx \
        NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger_0.cxx \
        NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape_0.cxx \
        NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock_0.cxx \
@@ -67,7 +68,6 @@ LIB_SRC = \
        NMTTools_PaveFiller_8.cxx \
        NMTTools_PaveFiller_9.cxx \
        NMTTools_PaveFiller.cxx \
-       NMTTools_PCurveMaker.cxx \
        NMTTools_Tools.cxx \
        NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock_0.cxx \
        NMTTools_DataMapNodeOfDataMapOfIntegerListOfPaveBlock_0.cxx \
@@ -90,12 +90,12 @@ EXPORT_HEADERS = \
        Handle_NMTTools_ListNodeOfListOfCommonBlock.hxx \
        Handle_NMTTools_ListNodeOfListOfCoupleOfShape.hxx \
        NMTDS_Iterator.hxx \
+       NMTTools_CheckerSI.hxx \
        NMTTools_CommonBlockAPI.hxx \
        NMTTools_CommonBlock.hxx \
        NMTTools_CommonBlockPool.hxx \
        NMTTools_CoupleOfShape.hxx \
        NMTTools_DEProcessor.hxx \
-       NMTTools_DSFiller.hxx \
        NMTTools_IndexedDataMapNodeOfIndexedDataMapOfIndexedMapOfInteger.hxx \
        NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapeIndexedMapOfShape.hxx \
        NMTTools_IndexedDataMapNodeOfIndexedDataMapOfShapePaveBlock.hxx \
@@ -110,8 +110,6 @@ EXPORT_HEADERS = \
        NMTTools_ListOfCommonBlock.hxx \
        NMTTools_ListOfCoupleOfShape.hxx \
        NMTTools_PaveFiller.hxx \
-       NMTTools_PCurveMaker.hxx \
-       NMTTools_PDSFiller.hxx \
        NMTTools_PPaveFiller.hxx \
        NMTTools_Tools.hxx \
        Handle_NMTTools_DataMapNodeOfDataMapOfIntegerListOfPaveBlock.hxx \
index 6342a3082816a076090775dab1e62d9764d917cb..14ce83e18de44cb5602624cf88063d0d2bde7593 100644 (file)
@@ -44,18 +44,21 @@ uses
     NMTDS
 
 is 
-    class IteratorOfCoupleOfShape; 
-    class DSFiller; 
+    --class IteratorOfCoupleOfShape; 
+    --class DSFiller; 
     class PaveFiller; 
     class Tools; 
     class CommonBlock; 
     class CommonBlockAPI; 
-    class PCurveMaker; 
+    --class PCurveMaker; 
     class DEProcessor; 
-    class CoupleOfShape; 
-        
+    class CoupleOfShape;  
+    --modified by NIZNHY-PKV Mon Feb 19 11:39:24 2007f
+    class CheckerSI;
+    --modified by NIZNHY-PKV Mon Feb 19 11:39:27 2007t 
+
     pointer PPaveFiller to PaveFiller from NMTTools;
-    pointer PDSFiller   to DSFiller   from NMTTools;
+    --pointer PDSFiller   to DSFiller   from NMTTools;
 
     class ListOfCommonBlock  instantiates  
        List from TCollection(CommonBlock from NMTTools); 
diff --git a/src/NMTTools/NMTTools_CheckerSI.cdl b/src/NMTTools/NMTTools_CheckerSI.cdl
new file mode 100644 (file)
index 0000000..50518ec
--- /dev/null
@@ -0,0 +1,64 @@
+-- Copyright (C) 2006 SAMTECH 
+-- 
+-- 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:       NMTTools_CheckerSI.cdl
+-- Created:    Mon Feb 19 11:23:55 2007
+-- Author:     Peter KURNEV
+
+
+class CheckerSI from NMTTools 
+       inherits PaveFiller from NMTTools 
+       ---Purpose: 
+
+uses 
+    ShapeEnum  from  TopAbs
+
+--raises
+
+is
+    Create 
+       returns CheckerSI from NMTTools;  
+    ---C++: alias "Standard_EXPORT virtual ~NMTTools_CheckerSI();" 
+     
+    Perform (me:out) 
+       is redefined; 
+        
+    Init  (me:out) 
+       is redefined protected;
+    Clear (me:out) 
+       is redefined protected;
+    PreparePaveBlocks (me:out;   
+           nE:Integer from Standard) 
+       is redefined protected;                 
+
+    PreparePaveBlocks (me:out; 
+           aType1: ShapeEnum  from  TopAbs; 
+           aType2: ShapeEnum  from  TopAbs) 
+       is redefined protected; 
+    
+    StopStatus(me) 
+       returns Integer from Standard;   
+
+
+fields
+    myStopStatus: Integer from Standard is protected; 
+     
+end CheckerSI;
diff --git a/src/NMTTools/NMTTools_CheckerSI.cxx b/src/NMTTools/NMTTools_CheckerSI.cxx
new file mode 100644 (file)
index 0000000..f315879
--- /dev/null
@@ -0,0 +1,177 @@
+// Copyright (C) 2006 SAMTECH
+// 
+// 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:       NMTTools_CheckerSI.cxx
+// Created:    Mon Feb 19 11:32:08 2007
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <NMTTools_CheckerSI.ixx>
+
+#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_IteratorCheckerSI.hxx>
+#include <NMTDS_InterfPool.hxx>
+#include <NMTTools_DEProcessor.hxx>
+
+//=======================================================================
+//function : 
+//purpose  : 
+//=======================================================================
+  NMTTools_CheckerSI::NMTTools_CheckerSI()
+:
+  NMTTools_PaveFiller()
+{
+  myStopStatus=0;
+}
+//=======================================================================
+//function : ~
+//purpose  : 
+//=======================================================================
+  NMTTools_CheckerSI::~NMTTools_CheckerSI()
+{
+}
+//=======================================================================
+//function : Clear
+//purpose  : 
+//=======================================================================
+  void NMTTools_CheckerSI::Clear()
+{
+  NMTTools_PaveFiller::Clear();
+}
+//=======================================================================
+//function : StopStatus
+//purpose  : 
+//=======================================================================
+  Standard_Integer NMTTools_CheckerSI::StopStatus()const
+{
+  return myStopStatus;
+}
+//=======================================================================
+//function : Init
+//purpose  : 
+//=======================================================================
+  void NMTTools_CheckerSI::Init()
+{
+  myIsDone=Standard_False;
+  if (myCompositeShape.IsNull()) {
+    return;
+  }
+  //
+  Clear();
+  // 1.
+  myDS=new NMTDS_ShapesDataStructure;
+  myDS->SetCompositeShape(myCompositeShape);
+  myDS->Init();
+  //
+  // 2.
+  myDSIt=new NMTDS_IteratorCheckerSI;
+  myDSIt->SetDS(myDS);
+  myDSIt->Prepare();
+  //
+  // 4.
+  myNbSources=myDS->NumberOfShapesOfTheObject()+
+              myDS->NumberOfShapesOfTheTool();
+  myNbEdges=myDS->NbEdges();
+  // 5
+  myIP=new NMTDS_InterfPool;
+}
+//=======================================================================
+//function : Perform
+//purpose  : 
+//=======================================================================
+  void NMTTools_CheckerSI::Perform()
+{
+  myIsDone=Standard_False;
+  myStopStatus=0;
+  //
+  Init();
+  //1.VV
+  //
+  PerformVV();
+  //
+  // 2.VE
+  myPavePool.Resize (myNbEdges);
+
+  PrepareEdges();
+  //
+  PerformVE();
+  //
+  // 3.VF
+  PerformVF();
+  //
+  // 4.EE
+  myCommonBlockPool.Resize (myNbEdges);
+  mySplitShapesPool.Resize (myNbEdges);
+  myPavePoolNew    .Resize (myNbEdges);
+  //
+  PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
+  if (myStopStatus) {
+    return;
+  }
+  PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
+  if (myStopStatus) {
+    return;
+  }
+  //
+  PerformEE();
+  //
+  RefinePavePool ();
+  if (myStopStatus) {
+    return;
+  }
+  //
+  myPavePoolNew.Destroy();
+  myPavePoolNew.Resize (myNbEdges);
+  //
+  // 5.EF
+  PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
+  if (myStopStatus) {
+    return;
+  }
+  //
+  PerformEF();
+  //
+  RefinePavePool();
+  if (myStopStatus) {
+    return;
+  }
+  //
+  myPavePoolNew.Destroy();
+  //
+  MakeSplitEdges();
+  //
+  UpdateCommonBlocks();
+  //
+  // 6. FF
+  PerformFF ();
+  //
+  MakeBlocks();
+  //
+  MakePCurves();
+  //
+  // 7. Postprocessing 
+  UpdatePaveBlocks();
+  //
+  NMTTools_DEProcessor aDEP(*this);
+  aDEP.Do();
+  //
+  MakeAloneVertices();
+  //
+  myIsDone=Standard_True;
+}
diff --git a/src/NMTTools/NMTTools_CheckerSI.hxx b/src/NMTTools/NMTTools_CheckerSI.hxx
new file mode 100644 (file)
index 0000000..4aacb49
--- /dev/null
@@ -0,0 +1,118 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTTools_CheckerSI_HeaderFile
+#define _NMTTools_CheckerSI_HeaderFile
+
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
+#ifndef _NMTTools_PaveFiller_HeaderFile
+#include <NMTTools_PaveFiller.hxx>
+#endif
+#ifndef _TopAbs_ShapeEnum_HeaderFile
+#include <TopAbs_ShapeEnum.hxx>
+#endif
+
+
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
+
+class NMTTools_CheckerSI  : public NMTTools_PaveFiller {
+
+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 NMTTools_CheckerSI();
+Standard_EXPORT virtual ~NMTTools_CheckerSI();
+
+
+Standard_EXPORT virtual  void Perform() ;
+
+
+Standard_EXPORT   Standard_Integer StopStatus() const;
+
+
+
+
+
+protected:
+
+ // Methods PROTECTED
+ // 
+
+
+Standard_EXPORT virtual  void Init() ;
+
+
+Standard_EXPORT virtual  void Clear() ;
+
+
+Standard_EXPORT virtual  void PreparePaveBlocks(const Standard_Integer nE) ;
+
+
+Standard_EXPORT virtual  void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ;
+
+
+ // Fields PROTECTED
+ //
+Standard_Integer myStopStatus;
+
+
+private: 
+
+ // Methods PRIVATE
+ // 
+
+
+ // Fields PRIVATE
+ //
+
+
+};
+
+
+
+
+
+// other Inline functions and methods (like "C++: function call" methods)
+//
+
+
+#endif
diff --git a/src/NMTTools/NMTTools_CheckerSI.ixx b/src/NMTTools/NMTTools_CheckerSI.ixx
new file mode 100644 (file)
index 0000000..5d3e020
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#include <NMTTools_CheckerSI.jxx>
+
+
+
diff --git a/src/NMTTools/NMTTools_CheckerSI.jxx b/src/NMTTools/NMTTools_CheckerSI.jxx
new file mode 100644 (file)
index 0000000..68bdc30
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+#ifndef _NMTTools_CheckerSI_HeaderFile
+#include <NMTTools_CheckerSI.hxx>
+#endif
diff --git a/src/NMTTools/NMTTools_CheckerSI_1.cxx b/src/NMTTools/NMTTools_CheckerSI_1.cxx
new file mode 100755 (executable)
index 0000000..36ab867
--- /dev/null
@@ -0,0 +1,160 @@
+// Copyright (C) 2006 SAMTECH
+// 
+// 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:       NMTTools_CheckerSI.cxx
+// Created:    Mon Feb 19 11:32:08 2007
+// Author:     Peter KURNEV
+//             <pkv@irinox>
+
+
+#include <NMTTools_CheckerSI.ixx>
+#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_IteratorCheckerSI.hxx>
+
+#include <NMTDS_InterfPool.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <BOPTools_ListOfPaveBlock.hxx>
+#include <TopoDS.hxx>
+#include <BRep_Tool.hxx>
+#include <BOPTools_PaveSet.hxx>
+#include <BOPTools_PaveBlockIterator.hxx>
+#include <BOPTools_PaveBlock.hxx>
+#include <IntTools_Range.hxx>
+#include <BOPTools_Pave.hxx>
+#include <IntTools_ShrunkRange.hxx>
+#include <BOPTColStd_Failure.hxx>
+#include <BOPTColStd_Dump.hxx>
+#include <Geom_Curve.hxx>
+#include <gp_Pnt.hxx>
+
+
+
+static
+  Standard_Boolean IsValid(const TopoDS_Edge& aE,
+                          const TopoDS_Vertex& aV,
+                          const Standard_Real aTV1,
+                          const Standard_Real aTV2);
+
+//=======================================================================
+// function: PreparePaveBlocks
+// purpose: 
+//=======================================================================
+  void NMTTools_CheckerSI::PreparePaveBlocks(const TopAbs_ShapeEnum aType1, 
+                                            const TopAbs_ShapeEnum aType2)
+{
+  NMTTools_PaveFiller::PreparePaveBlocks(aType1, aType2);
+}
+//=======================================================================
+// function: PreparePaveBlocks
+// purpose: 
+//=======================================================================
+  void NMTTools_CheckerSI::PreparePaveBlocks(const Standard_Integer nE)
+{
+  myIsDone=Standard_False;
+  //
+  char buf[32]={"SR"};
+  Standard_Boolean bIsValid;
+  Standard_Integer nV1, nV2, iErr;
+  Standard_Real aT1, aT2;
+  TopoDS_Edge aE;
+  TopoDS_Vertex aV1, aV2;
+  //
+  BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
+  // Edge 
+  aE=TopoDS::Edge(myDS->Shape(nE));
+  if (BRep_Tool::Degenerated(aE)) {
+    myIsDone=Standard_True;
+    return;
+  }
+  //
+  BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
+  
+  BOPTools_PaveBlockIterator aPBIt(nE, aPS);
+  for (; aPBIt.More(); aPBIt.Next()) {
+    BOPTools_PaveBlock& aPB=aPBIt.Value();
+    const IntTools_Range& aRange=aPB.Range();
+    //
+    const BOPTools_Pave& aPave1=aPB.Pave1();
+    nV1=aPave1.Index();
+    aV1=TopoDS::Vertex(myDS->Shape(nV1));
+    aT1=aPave1.Param();
+    //
+    const BOPTools_Pave& aPave2=aPB.Pave2();
+    nV2=aPave2.Index();
+    aV2=TopoDS::Vertex(myDS->Shape(nV2)); 
+    aT2=aPave2.Param();
+    //
+    bIsValid=Standard_True;
+    if (nV1==nV2) {
+      bIsValid=IsValid(aE, aV1, aT1, aT2);
+      if (!bIsValid) {
+       //printf(" pb SR: nV    nE: %d  nV1:( %d %15.10lf ) nV2:( %d %15.10lf )\n", nE, nV1, aT1, nV2, aT2);
+       myStopStatus=1;
+      }
+    }
+    //
+    IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
+    iErr=aSR.ErrorStatus();
+    if (!aSR.IsDone()) {
+      //printf(" pb SR: Done  nE: %d  nV1:( %d %15.10lf ) nV2:( %d %15.10lf )\n", nE, nV1, aT1, nV2, aT2);
+      aSR.SetShrunkRange(aRange);
+      //throw BOPTColStd_Failure(buf) ;
+    }
+    else if (iErr!=6) {
+      CorrectShrunkRanges (0, aPave1, aSR);
+      CorrectShrunkRanges (1, aPave2, aSR);
+    }
+    aPB.SetShrunkRange(aSR);
+    aLPB.Append(aPB);
+  } //for (; aPBIt.More(); aPBIt.Next()) 
+  myIsDone=Standard_True;
+}
+
+//=======================================================================
+//function : IsValid
+//purpose  : 
+//=======================================================================
+Standard_Boolean IsValid(const TopoDS_Edge& aE,
+                        const TopoDS_Vertex& aV,
+                        const Standard_Real aTV1,
+                        const Standard_Real aTV2)
+{
+  Standard_Boolean bRet;
+  Standard_Integer i, aNbP, aNbP1;
+  Standard_Real aTolV2, aTC1, aTC2, dT, aTC, aD2;
+  Handle(Geom_Curve) aC;
+  gp_Pnt aPV, aPC;
+  //
+  bRet=Standard_False;
+  aTolV2=BRep_Tool::Tolerance(aV);
+  aTolV2=aTolV2*aTolV2;
+  aPV=BRep_Tool::Pnt(aV);
+  aC=BRep_Tool::Curve(aE, aTC1, aTC2);
+  aNbP=7;
+  aNbP1=aNbP-1;
+  dT=(aTV2-aTV1)/aNbP1;
+  //
+  for (i=1; i<aNbP-1 && !bRet ; ++i) {
+    aTC=aTV1+dT*i;
+    aC->D0(aTC, aPC);
+    aD2=aPV.SquareDistance(aPC);
+    bRet=aD2>aTolV2;
+  }
+  return bRet;
+}
index 9c5f860f5fca955c6cf1ba8dc0f371ed0fbe8e5a..0933b0104516cb8ef58776ecc00a8dba94345d70 100644 (file)
@@ -74,7 +74,7 @@
 #include <BOPTools_PavePool.hxx>
 #include <BOPTools_PaveSet.hxx>
 #include <BOPTools_Tools3D.hxx>
-#include <BOPTools_InterferencePool.hxx>
+
 #include <BOPTools_CArray1OfSSInterference.hxx>
 #include <BOPTools_SplitShapesPool.hxx>
 
@@ -90,7 +90,7 @@
 #include <ElCLib.hxx>
 #include <gp_Lin2d.hxx>
 
-
+#include <NMTDS_InterfPool.hxx>
 
 //=======================================================================
 // function: NMTTools_DEProcessor::NMTTools_DEProcessor
   void NMTTools_DEProcessor::DoPaves()
 {
 
-  Standard_Integer i, aNbE, nED, nVD, nFD, aNbLPB;
+  Standard_Integer i, aNbE, nED, nVD, aNbLPB, nFD;
   //
   nFD=0;
   aNbE=myDEMap.Extent();
     TColStd_ListIteratorOfListOfInteger anIt(nLF);
     for (; anIt.More(); anIt.Next()) {
       nFD=anIt.Value();
-      //
+      
       BOPTools_ListOfPaveBlock aLPB;
       FindPaveBlocks(nED, nVD, nFD, aLPB);
-      //modified by NIZNHY-PKV Fri Mar 23 10:35:27 2007f
-      //
+      // xxf
       aNbLPB=aLPB.Extent();
       if (!aNbLPB) {
        continue;
       }
-      //modified by NIZNHY-PKV Fri Mar 23 10:35:33 2007t
+      //xxt
       FillPaveSet (nED, nVD, nFD, aLPB);
     }
     // 
   BOPTools_ListIteratorOfListOfPaveBlock anIt;
   Standard_Integer i, aNb, nF2, nV;
   //
-  BOPTools_CArray1OfSSInterference& aFFs=(myFiller->InterfPool())->SSInterferences();
+  //BOPTools_CArray1OfSSInterference& aFFs=(myFiller->InterfPool())->SSInterferences();
+  BOPTools_CArray1OfSSInterference& aFFs=(myFiller->IP())->SSInterferences();
   //
   aNb=aFFs.Extent();
   for (i=1; i<=aNb; ++i) {
index 3cee74a1a95e9f2609fe5abc39b36c3567e89d44..19340bc8c10860baadcac84c2234737503a0ac05 100644 (file)
@@ -28,19 +28,18 @@ class PaveFiller from NMTTools
        ---Purpose: 
 
 uses   
-    -- Modified to add new definitions Thu Sep 14 14:35:18 2006 
-    -- Contribution of Samtech www.samcef.com BEGIN   
-    ListOfInteger from TColStd, 
-    -- Contribution of Samtech www.samcef.com END 
     DataMapOfIntegerInteger from TColStd,
     Pnt from gp,
     ShapeEnum  from  TopAbs, 
     Vertex     from  TopoDS, 
     Face       from  TopoDS,  
+    Shape      from TopoDS, 
     -- Modified to add new definitions Thu Sep 14 14:35:18 2006 
     -- Contribution of Samtech www.samcef.com BEGIN 
     Edge       from  TopoDS, 
-    ListOfShape from TopTools, 
+    ListOfShape from TopTools,  
+    DataMapOfShapeShape from TopTools,
+    ListOfInteger from TColStd,  
     -- Contribution of Samtech www.samcef.com END 
     
     Context     from IntTools, 
@@ -48,8 +47,8 @@ uses
     
     IndexedDataMapOfShapeInteger from BooleanOperations, 
     
-    InterferencePool  from BOPTools,
-    PInterferencePool from BOPTools, 
+    --InterferencePool  from BOPTools,
+    --PInterferencePool from BOPTools, 
     PavePool          from BOPTools, 
     PaveBlock         from BOPTools,
     ListOfPaveBlock   from BOPTools,
@@ -66,48 +65,77 @@ uses
     CommonBlockPool         from NMTTools, 
     CommonBlock             from NMTTools, 
     ListOfCommonBlock       from NMTTools, 
-    -- Modified to add new definitions Thu Sep 14 14:35:18 2006 
-    -- Contribution of Samtech www.samcef.com BEGIN
-    IndexedDataMapOfIndexedMapOfInteger from NMTTools,  
-    -- Contribution of Samtech www.samcef.com END
+   
     ShapesDataStructure  from NMTDS,  
+
     -- Modified to add new definitions Thu Sep 14 14:35:18 2006 
     -- Contribution of Samtech www.samcef.com BEGIN
     PShapesDataStructure from NMTDS, 
-    Iterator             from NMTDS 
+    Iterator             from NMTDS, 
+    IndexedDataMapOfIndexedMapOfInteger from NMTTools,  
     -- Contribution of Samtech www.samcef.com END
+     
+    PIterator from NMTDS, 
+    PInterfPool from NMTDS
 
 --raises
 
 is 
     Create 
-       returns PaveFiller from NMTTools; 
+       returns PaveFiller from NMTTools;  
+    ---C++: alias "Standard_EXPORT virtual ~NMTTools_PaveFiller();"
       
-    Create(aIP:InterferencePool from BOPTools)
-       returns PaveFiller from NMTTools; 
+   -- Create(aIP:InterferencePool from BOPTools)
+    -- returns PaveFiller from NMTTools; 
      
-    Destroy (me: in out) 
-       is  virtual;    
-    ---C++: alias "Standard_EXPORT virtual ~NMTTools_PaveFiller(){Destroy();}"
+   -- Destroy (me: in out) 
+       --is  virtual;    
+    --  -C++: alias "Standard_EXPORT virtual ~NMTTools_PaveFiller(){Destroy();}"
     -- 
     --  Selectors/Modifiers
-    SetInterferencePool(me:out; 
-           aIP:InterferencePool from BOPTools);
-    
-    InterfPool(me:out) 
-       returns PInterferencePool from BOPTools; 
+    --SetInterferencePool(me:out; 
+    --     aIP:PInterferencePool from BOPTools);
+     
+    SetCompositeShape (me:out;  
+           aS:  Shape from TopoDS);  
+     
+    CompositeShape(me) 
+       returns  Shape from TopoDS; 
+       ---C++:  return  const&  
+       
+    --InterfPool(me:out) 
+       --returns PInterferencePool from BOPTools; 
+
+    --SetDS(me:out; 
+       --    aDS:PShapesDataStructure from NMTDS);  
+            
+    DS(me:out) 
+       returns PShapesDataStructure from NMTDS;  
+     
+    --SetDSIt(me:out; 
+       --      aIt:PIterator from NMTDS); 
+        
+    DSIt(me:out) 
+       returns PIterator from NMTDS; 
+     
+    IP(me:out)  
+       returns PInterfPool from NMTDS; 
     --  
     --  Perform the algo  
     -- Modified to add new method Thu Sep 14 14:35:18 2006 
     -- Contribution of Samtech www.samcef.com BEGIN      
-    Init       (me:out); 
+    Init       (me:out) 
+       is virtual  protected; 
     -- Contribution of Samtech www.samcef.com END
         
+    Clear   (me:out) 
+       is virtual  protected;
+
     Perform    (me:out) 
        is virtual;   
         
     PerformVV  (me:out) 
-       is virtual ;  
+       is virtual protected;  
      
     PerformVE  (me:out) 
        is virtual protected; 
@@ -142,28 +170,25 @@ is
            anE:Integer from Standard) 
        is virtual protected;             
                       
-    PerformNewVertices  (me:out) 
-       is virtual ;  
+    --PerformNewVertices  (me:out) 
+       --is virtual;  
      
     PrepareEdges  (me:out) 
        is virtual protected;  
      
-    SortTypes      (me;   
-           anInd1:in out Integer from Standard; 
-            anInd2:in out Integer from Standard) 
-       is protected; 
+    --SortTypes      (me;   
+    --     anInd1:in out Integer from Standard; 
+    --        anInd2:in out Integer from Standard) 
+    -- is protected; 
      
-    ExpectedPoolLength(me) 
-       returns  Integer from Standard 
-       is protected;  
+    --ExpectedPoolLength(me) 
+    -- returns  Integer from Standard 
+       --is protected;  
     --
     -- Query section 
     IsDone(me) 
        returns  Boolean from Standard; 
 
-    DS(me:out) 
-       returns PShapesDataStructure from NMTDS;  
-        
     Context(me) 
         returns Context from IntTools; 
        ---C++:return const &   
@@ -200,7 +225,7 @@ is
                    nV:  Integer  from  Standard) 
        returns Integer from Standard; 
 
-    IsSuccesstorsComputed (me;  
+    IsSuccessorsComputed (me;  
            iF1:Integer from  Standard; 
            iF2:Integer from  Standard) 
        returns  Boolean from Standard 
@@ -500,18 +525,17 @@ is
                 aLSE :out ListOfShape   from TopTools); 
     -- Contribution of Samtech www.samcef.com END 
 
+    FuseVertices(me; 
+       aC:Shape from TopoDS; 
+       aDMVV:  out  DataMapOfShapeShape from TopTools);  
+     
 fields 
-    myIntrPool         :  PInterferencePool from BOPTools      is protected; 
+    --myIntrPool         :  PInterferencePool from BOPTools            is protected; 
     myDS               :  PShapesDataStructure from NMTDS      is protected;   
     myIsDone           :  Boolean from Standard                 is protected; 
     myNbSources        :  Integer from Standard                 is protected;  
     myNbEdges          :  Integer from Standard                is protected;  
 
-    -- Modified to add new field Thu Sep 14 14:35:18 2006 
-    -- Contribution of Samtech www.samcef.com BEGIN     
-    myDSIt             :  Iterator from NMTDS is protected; 
-    -- Contribution of Samtech www.samcef.com END 
-     
     myPavePool         :  PavePool from BOPTools                is protected;     
     myPavePoolNew      :  PavePool from BOPTools                is protected;  
     myCommonBlockPool  :  CommonBlockPool from NMTTools         is protected;  
@@ -520,7 +544,10 @@ fields
     myContext          :  Context from IntTools                 is protected; 
     mySectionAttribute :  SSIntersectionAttribute from BOPTools is protected; 
     myAloneVertices    :  IndexedDataMapOfIndexedMapOfInteger from NMTTools is protected;   
-    --
-    myVSD              :  DataMapOfIntegerInteger from TColStd is protected;
-    --
+    --modified by NIZNHY-PKV Wed Oct 11 11:06:50 2006f
+    myVSD              :  DataMapOfIntegerInteger from TColStd is protected; 
+    myDSIt             :  PIterator from NMTDS is protected;  
+    myCompositeShape   :  Shape from TopoDS is protected;
+    myIP               :  PInterfPool from NMTDS is protected;     
+    --modified by NIZNHY-PKV Wed Oct 11 11:06:55 2006t 
 end PaveFiller;
index 9c76d8910d5521a1ec049e919fec55635afa35f3..236a077dcc04ffb74213b12b852a20c02c23f412 100644 (file)
 #include <BOPTColStd_Failure.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
 #include <NMTTools_DEProcessor.hxx>
+#include <NMTDS_Iterator.hxx>
+#include <NMTDS_InterfPool.hxx>
 
-//
 //=======================================================================
 // function: NMTTools_PaveFiller::NMTTools_PaveFiller
 // purpose: 
 //=======================================================================
   NMTTools_PaveFiller::NMTTools_PaveFiller()
 {
-  myIntrPool=NULL;
   myDS=NULL;
+  myDSIt=NULL;
   myIsDone=Standard_False;
   myNbSources=0;
   myNbEdges=0;
+  myIP=NULL;
 }
 //=======================================================================
-// function:NMTTools_PaveFiller::NMTTools_PaveFiller
+// function: ~
 // purpose: 
 //=======================================================================
-  NMTTools_PaveFiller::NMTTools_PaveFiller(const BOPTools_InterferencePool& aIP)
+  NMTTools_PaveFiller::~NMTTools_PaveFiller()
 {
-  SetInterferencePool(aIP);
+  Clear();
 }
 //=======================================================================
-// function: Destroy
+// function: Clear
 // purpose: 
 //=======================================================================
-  void NMTTools_PaveFiller::Destroy()
+  void NMTTools_PaveFiller::Clear()
 {
+  if (myDSIt) {
+    delete myDSIt;
+  } 
+  if (myDS) {
+    delete myDS;
+  }
+  myDSIt=NULL;
+  myDS=NULL;
+  
+  if (myIP) {
+    delete myIP;
+  }
+  myIP=NULL;
 }
 //=======================================================================
-// function: SetInterferencePool
+// function: SetCompositeShape
 // purpose: 
 //=======================================================================
-  void NMTTools_PaveFiller::SetInterferencePool(const BOPTools_InterferencePool& aIP)
+  void NMTTools_PaveFiller::SetCompositeShape(const TopoDS_Shape& aS)
 {
-  myIsDone=Standard_False;
-  //
-  myIntrPool=(BOPTools_InterferencePool*)&aIP;
-  myDS=(NMTDS_ShapesDataStructure*)myIntrPool->DS();
-  myNbSources=myDS->NumberOfShapesOfTheObject()+myDS->NumberOfShapesOfTheTool();
-  myNbEdges=myDS->NbEdges();
+  myCompositeShape=aS;
 }
 //=======================================================================
-// function:  InterfPool
+// function: CompositeShape
 // purpose: 
 //=======================================================================
-  BOPTools_PInterferencePool NMTTools_PaveFiller::InterfPool()
+  const TopoDS_Shape& NMTTools_PaveFiller::CompositeShape()const
 {
-  return myIntrPool;
+  return myCompositeShape;
 }
 //=======================================================================
-// function:IsDone
+// function:  DS
 // purpose: 
 //=======================================================================
-  Standard_Boolean NMTTools_PaveFiller::IsDone() const
+  NMTDS_PShapesDataStructure NMTTools_PaveFiller::DS()
 {
-  return myIsDone;
+  return myDS;
 }
 //=======================================================================
-// function:  DS
+// function: DSIt
 // purpose: 
 //=======================================================================
-  NMTDS_PShapesDataStructure NMTTools_PaveFiller::DS()
+  NMTDS_PIterator NMTTools_PaveFiller::DSIt()
 {
-  return myDS;
+  return myDSIt;
+}
+//=======================================================================
+// function:  IP
+// purpose: 
+//=======================================================================
+  NMTDS_PInterfPool NMTTools_PaveFiller::IP()
+{
+  return myIP;
+}
+//=======================================================================
+// function:IsDone
+// purpose: 
+//=======================================================================
+  Standard_Boolean NMTTools_PaveFiller::IsDone() const
+{
+  return myIsDone;
 }
 //=======================================================================
 // function: Context
 {
   return mySplitShapesPool;
 }
-
 //=======================================================================
 // function:  ChangeSplitShapesPool
 // purpose: 
 //=======================================================================
   void NMTTools_PaveFiller::Init()
 {
-  myDSIt.SetDS(myDS);
-  // Modified Thu Sep 14 14:35:18 2006 
-  // Contribution of Samtech www.samcef.com BEGIN
-  myDSIt.Prepare();
-  // Contribution of Samtech www.samcef.com END 
+  myIsDone=Standard_False;
+  if (myCompositeShape.IsNull()) {
+    return;
+  }
+  //
+  Clear();
+  // 1.
+  myDS=new NMTDS_ShapesDataStructure;
+  myDS->SetCompositeShape(myCompositeShape);
+  myDS->Init();
+  //
+  // 2.
+  myDSIt=new NMTDS_Iterator;
+  myDSIt->SetDS(myDS);
+  myDSIt->Prepare();
+  //
+  // 3.
+  myNbSources=myDS->NumberOfShapesOfTheObject()+
+              myDS->NumberOfShapesOfTheTool();
+  myNbEdges=myDS->NbEdges();
+  //
+  // 4
+  myIP=new NMTDS_InterfPool;
 }
 
 //=======================================================================
 {
   myIsDone=Standard_False;
   //
+  //----------------
   try {
     // 0.
     // Modified Thu Sep 14 14:35:18 2006 
     //1.VV
     //
     PerformVV();
-    PerformNewVertices();
     //
     // 2.VE
     myPavePool.Resize (myNbEdges);
     //
     // 5.EF
     PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
-
     PerformEF();
     //
     RefinePavePool();
index ab479896eadc3f6bb9333ee7df0a48b2822e1273..2d6492a3f72ff818809f93445920e5b3c2f33d27 100644 (file)
@@ -20,9 +20,6 @@
 #ifndef _NMTTools_PaveFiller_HeaderFile
 #define _NMTTools_PaveFiller_HeaderFile
 
-#ifndef _BOPTools_PInterferencePool_HeaderFile
-#include <BOPTools_PInterferencePool.hxx>
-#endif
 #ifndef _NMTDS_PShapesDataStructure_HeaderFile
 #include <NMTDS_PShapesDataStructure.hxx>
 #endif
@@ -32,9 +29,6 @@
 #ifndef _Standard_Integer_HeaderFile
 #include <Standard_Integer.hxx>
 #endif
-#ifndef _NMTDS_Iterator_HeaderFile
-#include <NMTDS_Iterator.hxx>
-#endif
 #ifndef _BOPTools_PavePool_HeaderFile
 #include <BOPTools_PavePool.hxx>
 #endif
 #ifndef _TColStd_DataMapOfIntegerInteger_HeaderFile
 #include <TColStd_DataMapOfIntegerInteger.hxx>
 #endif
+#ifndef _NMTDS_PIterator_HeaderFile
+#include <NMTDS_PIterator.hxx>
+#endif
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
+#endif
+#ifndef _NMTDS_PInterfPool_HeaderFile
+#include <NMTDS_PInterfPool.hxx>
+#endif
 #ifndef _TopAbs_ShapeEnum_HeaderFile
 #include <TopAbs_ShapeEnum.hxx>
 #endif
 #ifndef _Standard_Real_HeaderFile
 #include <Standard_Real.hxx>
 #endif
-class BOPTools_InterferencePool;
+class TopoDS_Shape;
 class BOPTools_Pave;
 class IntTools_ShrunkRange;
 class IntTools_Context;
@@ -86,6 +89,7 @@ class gp_Pnt;
 class NMTTools_IndexedDataMapOfIndexedMapOfInteger;
 class TopTools_ListOfShape;
 class TopoDS_Edge;
+class TopTools_DataMapOfShapeShape;
 
 
 #ifndef _Standard_HeaderFile
@@ -117,39 +121,30 @@ public:
 
 
 Standard_EXPORT NMTTools_PaveFiller();
+Standard_EXPORT virtual ~NMTTools_PaveFiller();
 
 
-Standard_EXPORT NMTTools_PaveFiller(const BOPTools_InterferencePool& aIP);
+Standard_EXPORT   void SetCompositeShape(const TopoDS_Shape& aS) ;
 
 
-Standard_EXPORT virtual  void Destroy() ;
-Standard_EXPORT virtual ~NMTTools_PaveFiller(){Destroy();}
+Standard_EXPORT  const TopoDS_Shape& CompositeShape() const;
 
 
-Standard_EXPORT   void SetInterferencePool(const BOPTools_InterferencePool& aIP) ;
+Standard_EXPORT   NMTDS_PShapesDataStructure DS() ;
 
 
-Standard_EXPORT   BOPTools_PInterferencePool InterfPool() ;
+Standard_EXPORT   NMTDS_PIterator DSIt() ;
 
 
-Standard_EXPORT   void Init() ;
+Standard_EXPORT   NMTDS_PInterfPool IP() ;
 
 
 Standard_EXPORT virtual  void Perform() ;
 
 
-Standard_EXPORT virtual  void PerformVV() ;
-
-
-Standard_EXPORT virtual  void PerformNewVertices() ;
-
-
 Standard_EXPORT   Standard_Boolean IsDone() const;
 
 
-Standard_EXPORT   NMTDS_PShapesDataStructure DS() ;
-
-
 Standard_EXPORT  const IntTools_Context& Context() const;
 
 
@@ -285,6 +280,9 @@ Standard_EXPORT   Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlo
 Standard_EXPORT   void SharedEdges(const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLNE,TopTools_ListOfShape& aLSE) ;
 
 
+Standard_EXPORT   void FuseVertices(const TopoDS_Shape& aC,TopTools_DataMapOfShapeShape& aDMVV) const;
+
+
 
 
 
@@ -294,6 +292,15 @@ protected:
  // 
 
 
+Standard_EXPORT virtual  void Init() ;
+
+
+Standard_EXPORT virtual  void Clear() ;
+
+
+Standard_EXPORT virtual  void PerformVV() ;
+
+
 Standard_EXPORT virtual  void PerformVE() ;
 
 
@@ -324,13 +331,7 @@ Standard_EXPORT virtual  void PreparePaveBlocks(const Standard_Integer anE) ;
 Standard_EXPORT virtual  void PrepareEdges() ;
 
 
-Standard_EXPORT   void SortTypes(Standard_Integer& anInd1,Standard_Integer& anInd2) const;
-
-
-Standard_EXPORT   Standard_Integer ExpectedPoolLength() const;
-
-
-Standard_EXPORT   Standard_Boolean IsSuccesstorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const;
+Standard_EXPORT   Standard_Boolean IsSuccessorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const;
 
 
 Standard_EXPORT   Standard_Boolean IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) const;
@@ -392,12 +393,10 @@ Standard_EXPORT   void MakeAloneVertices() ;
 
  // Fields PROTECTED
  //
-BOPTools_PInterferencePool myIntrPool;
 NMTDS_PShapesDataStructure myDS;
 Standard_Boolean myIsDone;
 Standard_Integer myNbSources;
 Standard_Integer myNbEdges;
-NMTDS_Iterator myDSIt;
 BOPTools_PavePool myPavePool;
 BOPTools_PavePool myPavePoolNew;
 NMTTools_CommonBlockPool myCommonBlockPool;
@@ -406,6 +405,9 @@ IntTools_Context myContext;
 BOPTools_SSIntersectionAttribute mySectionAttribute;
 NMTTools_IndexedDataMapOfIndexedMapOfInteger myAloneVertices;
 TColStd_DataMapOfIntegerInteger myVSD;
+NMTDS_PIterator myDSIt;
+TopoDS_Shape myCompositeShape;
+NMTDS_PInterfPool myIP;
 
 
 private: 
index 0e63c963e9a887f232637aadd31255d811433980..1c7e98a59ac4ee6869c377404e9bcc2cee9b7cf0 100644 (file)
@@ -17,8 +17,8 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 
-#ifndef _BOPTools_InterferencePool_HeaderFile
-#include <BOPTools_InterferencePool.hxx>
+#ifndef _TopoDS_Shape_HeaderFile
+#include <TopoDS_Shape.hxx>
 #endif
 #ifndef _BOPTools_Pave_HeaderFile
 #include <BOPTools_Pave.hxx>
@@ -89,6 +89,9 @@
 #ifndef _TopoDS_Edge_HeaderFile
 #include <TopoDS_Edge.hxx>
 #endif
+#ifndef _TopTools_DataMapOfShapeShape_HeaderFile
+#include <TopTools_DataMapOfShapeShape.hxx>
+#endif
 #ifndef _NMTTools_PaveFiller_HeaderFile
 #include <NMTTools_PaveFiller.hxx>
 #endif
index e64607d3e8d06880a03ab2e469d38f0fc55da724..6a355d3df5941f0bf7b39139b0f722df8ff41435 100644 (file)
@@ -1,65 +1,70 @@
 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// 
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
+// License as published by the Free Software Foundation; either 
 // version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 // Lesser General Public License for more details.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
-// File:       NMTTools_PaveFiller_1.cxx
-// Created:    Mon Dec  8 11:47:55 2003
+// File:       NMTTools_PaveFiller_0.cxx
+// Created:    Mon Dec  8 11:45:51 2003
 // Author:     Peter KURNEV
 //             <pkv@irinox>
 
+
 #include <NMTTools_PaveFiller.ixx>
 
+#include <TColStd_IndexedMapOfInteger.hxx>
 #include <TopAbs_ShapeEnum.hxx>
-#include <BOPTools_ListOfCoupleOfInteger.hxx>
+
+#include <NMTDS_InterfPool.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
-#include <BooleanOperations_OnceExplorer.hxx>
+#include <NMTDS_Iterator.hxx>
 
 //=======================================================================
-//function : SortTypes
-//purpose  
+// function:IsSuccesstorsComputed
+// purpose
 //=======================================================================
-  void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
-                                     Standard_Integer& theWith)const 
-{ 
-  Standard_Boolean aReverseFlag=Standard_True;
-
-  TopAbs_ShapeEnum aType1= myDS->GetShapeType(theWhat),
-                   aType2= myDS->GetShapeType(theWith);
-  
-  if (aType1==aType2)
-    return;
-  
-  if (aType1==TopAbs_EDGE && aType2==TopAbs_FACE){
-    aReverseFlag=Standard_False;
+  Standard_Boolean NMTTools_PaveFiller::IsSuccessorsComputed(const Standard_Integer aN1,
+                                                            const Standard_Integer aN2)const
+{
+  Standard_Boolean bComputed;
+  Standard_Integer i, nSuc, n1, n2, ntmp, aNbS;
+  TopAbs_ShapeEnum aType;
+  TColStd_IndexedMapOfInteger aMSuc;
+  //
+  n1=aN1;
+  n2=aN2;
+  aType=myDS->GetShapeType(aN1);
+  if (aType!=TopAbs_VERTEX) {
+    ntmp=n1;
+    n1=n2;
+    n2=ntmp;
   }
-
-  if (aType1==TopAbs_VERTEX && 
-      (aType2==TopAbs_FACE || aType2==TopAbs_EDGE)) {
-    aReverseFlag=Standard_False;
+  //
+  myDS->GetAllSuccessors(n2, aMSuc);
+  aNbS=aMSuc.Extent();
+  for (i=1; i<=aNbS; ++i) {
+    nSuc=aMSuc(i);
+    bComputed=myIP->Contains(n1, nSuc); 
+    if (bComputed) {
+      break;
+    }
   }
-  
-  Standard_Integer aWhat, aWith;
-  aWhat=(aReverseFlag) ? theWith : theWhat;
-  aWith=(aReverseFlag) ? theWhat : theWith;
-  
-  theWhat=aWhat;
-  theWith=aWith;
+  return bComputed;
 }
+/*
 //=======================================================================
 // function:  ExpectedPoolLength
 // purpose: 
@@ -72,7 +77,7 @@
   // Contribution of Samtech www.samcef.com BEGIN
   //const BOPTools_ListOfCoupleOfInteger& aLC=myDSIt.ListOfCouple();
   //aNbIIs=aLC.Extent();
-  aNbIIs=myDSIt.ExpectedLength();
+  aNbIIs=myDSIt->ExpectedLength();
   // Contribution of Samtech www.samcef.com END
   //
   if (aNbIIs==1) {
   
   return aNbIIs;
 }
+*/
+/*
 //=======================================================================
-// function:IsSuccesstorsComputed
-// purpose
+//function : SortTypes
+//purpose  
 //=======================================================================
-  Standard_Boolean NMTTools_PaveFiller::IsSuccesstorsComputed(const Standard_Integer aN1,
-                                                             const Standard_Integer aN2)const
-{
-  Standard_Integer nSuc, n1, n2;
-
-  BooleanOperations_OnceExplorer aExp(*myDS);
-  TopAbs_ShapeEnum aType=myDS->GetShapeType(aN1);
-
-  n1=aN1;
-  n2=aN2;
-
-  if (aType!=TopAbs_VERTEX) {
-    Standard_Integer ntmp=n1;
-    n1=n2;
-    n2=ntmp;
+  void NMTTools_PaveFiller::SortTypes(Standard_Integer& theWhat,
+                                     Standard_Integer& theWith)const 
+{ 
+  Standard_Integer aWhat, aWith;
+  Standard_Boolean aReverseFlag;
+  TopAbs_ShapeEnum aType1, aType2;
+  //
+  aType1= myDS->GetShapeType(theWhat),
+  aType2= myDS->GetShapeType(theWith);
+  //
+  if (aType1==aType2) {
+    return;
   }
-
-  aType=myDS->GetShapeType(n2);
-  if (aType==TopAbs_EDGE) {
-    aExp.Init(n2, TopAbs_VERTEX);
-    for (; aExp.More(); aExp.Next()) {
-      nSuc=aExp.Current();
-      if (myIntrPool->IsComputed(n1, nSuc)) {
-       return Standard_True;
-      }
-    }
-  return Standard_False;
+  //
+  aReverseFlag=Standard_True;
+  if (aType1==TopAbs_EDGE && aType2==TopAbs_FACE) {
+    aReverseFlag=Standard_False;
   }
-
-  else if (aType==TopAbs_FACE) {
-    aExp.Init(n2, TopAbs_VERTEX);
-    for (; aExp.More(); aExp.Next()) {
-      nSuc=aExp.Current();
-      if (myIntrPool->IsComputed(n1, nSuc)) {
-       return Standard_True;
-      }
-    }
-
-    aExp.Init(n2, TopAbs_EDGE);
-    for (; aExp.More(); aExp.Next()) {
-      nSuc=aExp.Current();
-      if (myIntrPool->IsComputed(n1, nSuc)) {
-       return Standard_True;
-      }
-    }
-    return Standard_False;
+  if (aType1==TopAbs_VERTEX && 
+      (aType2==TopAbs_FACE || aType2==TopAbs_EDGE)) {
+    aReverseFlag=Standard_False;
   }
-
-  return Standard_False;
+  //
+  aWhat=(aReverseFlag) ? theWith : theWhat;
+  aWith=(aReverseFlag) ? theWhat : theWith;
+  //
+  theWhat=aWhat;
+  theWith=aWith;
 }
+*/
index 086e395f62558fe2439f360edf19111e6cadd809..d4cca964a85ebc0394ca9af5e4aa3e80aff7d60d 100644 (file)
 // Created:    Mon Dec  8 11:47:55 2003
 // Author:     Peter KURNEV
 //             <pkv@irinox>
+
 #include <NMTTools_PaveFiller.ixx>
 
 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
 #include <TColStd_ListOfInteger.hxx>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
-  
+
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Vertex.hxx>
 #include <TopTools_ListOfShape.hxx>
 
 #include <IntTools_Tools.hxx>
+#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
 #include <BOPTools_VVInterference.hxx>
 #include <BOPTools_CArray1OfVVInterference.hxx>
-#include <BOPTools_VVInterference.hxx>
-#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
 
+#include <NMTDS_Iterator.hxx>
+#include <NMTDS_InterfPool.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
+
 #include <NMTTools_Tools.hxx>
 
 //=======================================================================
 {
   myIsDone=Standard_False;
   //
-  Standard_Integer anIndexIn, aWhat, aWith, aNbVVs, aBlockLength, aNbVSD; 
-  Standard_Integer nVnew;
+  Standard_Integer aNbVVs, aBL, aNbVSD, nVnew, i, j, n1, n2;
   TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
-  TColStd_ListIteratorOfListOfInteger aIt;
+  TColStd_ListIteratorOfListOfInteger aItX, aItY;
+  TColStd_ListOfInteger aLIX;
   TopTools_ListOfShape aLV;
   TopoDS_Vertex aVnew;
-  TopoDS_Shape aS;
   //
   myVSD.Clear();
   //
-  BOPTools_CArray1OfVVInterference& aVVs=myIntrPool->VVInterferences();
-  //
-  // BlockLength correction
-  aNbVVs=ExpectedPoolLength();
-  aBlockLength=aVVs.BlockLength();
-  if (aNbVVs > aBlockLength) {
-    aVVs.SetBlockLength(aNbVVs);
-  }
-  //
-  const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt.SDVertices();
+  const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt->SDVertices();
   aNbVSD=aMVSD.Extent();
   if (!aNbVSD) {
     return;
   }
   //
+  BOPTools_CArray1OfVVInterference& aVVs=myIP->VVInterferences();
+  //
+  // BlockLength correction
+  myDSIt->Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
+  aNbVVs=myDSIt->BlockLength();
+  aBL=aVVs.BlockLength();
+  if (aNbVVs > aBL) {
+    aVVs.SetBlockLength(aNbVVs);
+  }
+  //
   aIt1.Initialize(aMVSD);
   for (; aIt1.More(); aIt1.Next()) {
     aLV.Clear();
     //
-    aWhat=aIt1.Key();
+    n1=aIt1.Key();
     const TColStd_ListOfInteger& aLIV=aIt1.Value();
     //
     // new vertex
-    aIt.Initialize(aLIV);
-    for (; aIt.More(); aIt.Next()) {
-      aWith=aIt.Value();
-      aS=myDS->Shape(aWith);
-      aLV.Append(aS);
+    const TopoDS_Shape& aS1=myDS->Shape(n1);
+    aLV.Append(aS1);
+    aItX.Initialize(aLIV);
+    for (; aItX.More(); aItX.Next()) {
+      n2=aItX.Value();
+      const TopoDS_Shape& aS2=myDS->Shape(n2);
+      aLV.Append(aS2);
     }
-    aS=myDS->Shape(aWhat);
-    aLV.Append(aS);
     //
     NMTTools_Tools::MakeNewVertex(aLV, aVnew);
     //
     nVnew=myDS->NumberOfInsertedShapes();
     myDS->SetState (nVnew, BooleanOperations_ON);
     //
+    // myVSD, aLIX
+    aLIX.Clear();
+    aLIX.Append(n1);
+    myVSD.Bind(n1, nVnew);
+    //
+    aItX.Initialize(aLIV);
+    for (; aItX.More(); aItX.Next()) {
+      n2=aItX.Value();
+      aLIX.Append(n2);
+      myVSD.Bind(n2, nVnew);
+    }
+    //
     // interferences
-    aIt.Initialize(aLIV);
-    for (; aIt.More(); aIt.Next()) {
-      aWith=aIt.Value();
-      BOPTools_VVInterference aVV(aWhat, aWith);
-      aVV.SetNewShape(nVnew);
-      anIndexIn=aVVs.Append(aVV);
-      myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexVertex, anIndexIn);
-      //
-      // to find SD-Vertices
-      myVSD.Bind(aWith, nVnew);
+    aItX.Initialize(aLIX);
+    for (i=0; aItX.More(); aItX.Next(), ++i) {
+      aItY.Initialize(aLIX);
+      for (j=0; aItY.More(); aItY.Next(), ++j) {
+       if (j>i) {
+         n1=aItX.Value();
+         n2=aItY.Value();
+         myIP->Add(n1, n2, Standard_True, NMTDS_TI_VV);
+         //
+         BOPTools_VVInterference aVV(n1, n2);
+         aVV.SetNewShape(nVnew);
+         aVVs.Append(aVV);    
+       }
+      }
     }
-     myVSD.Bind(aWhat, nVnew);
   }//for (; aIt1.More(); aIt1.Next()) {
   myIsDone=Standard_True;
 }
 //=======================================================================
-// function: PerformNewVertices
-// purpose: 
-//=======================================================================
-  void NMTTools_PaveFiller::PerformNewVertices() 
-{
-}
-//=======================================================================
 // function: FindSDVertex
 // purpose: 
 //=======================================================================
   }
   return nVSD;
 }
+/*
+//=======================================================================
+// function: PerformNewVertices
+// purpose: 
+//=======================================================================
+  void NMTTools_PaveFiller::PerformNewVertices() 
+{
+}
+*/
index 8febb88c27ef7462923e935df9f2e2ccb307d637..4c3c9ed33f0360fed3ab019a5ac993936a4c3f01 100644 (file)
@@ -1,18 +1,18 @@
 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// 
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
+// License as published by the Free Software Foundation; either 
 // version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 // Lesser General Public License for more details.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #include <BOPTools_VEInterference.hxx>
 
 #include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
-
+#include <NMTDS_Iterator.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_InterfPool.hxx>
 //
 // Modified  Thu Sep 14 14:35:18 2006 
 // Contribution of Samtech www.samcef.com BEGIN
 #include <BOPTools_IndexedMapOfCoupleOfInteger.hxx>
 #include <BOPTools_CoupleOfInteger.hxx>
 #include <BooleanOperations_OnceExplorer.hxx>
-//
+
 
 static
   Standard_Boolean Contains(const TopoDS_Edge& aE,
                            const TopoDS_Vertex& aV);
 // Contribution of Samtech www.samcef.com END
+
+//=======================================================================
+// function: PerformVE
+// purpose: 
+//=======================================================================
+  void NMTTools_PaveFiller::PerformVE() 
+{
+  myIsDone=Standard_False;
+  //
+  Standard_Boolean bJustAdd;
+  Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVEs, aBlockLength, iSDV, nV1;
+  Standard_Real aT;
+  TopoDS_Vertex aV1;
+  TopoDS_Edge aE2;
+  BOPTools_IndexedMapOfCoupleOfInteger aSnareMap;
+  BOPTools_CoupleOfInteger aCouple;
+  //
+  BOPTools_CArray1OfVEInterference& aVEs=myIP->VEInterferences();
+  //
+  myDSIt->Initialize (TopAbs_VERTEX, TopAbs_EDGE);
+  //
+  // BlockLength correction
+  aNbVEs=myDSIt->BlockLength();
+  aBlockLength=aVEs.BlockLength();
+  if (aNbVEs > aBlockLength) {
+    aVEs.SetBlockLength(aNbVEs);
+  }
+  //
+  for (; myDSIt->More(); myDSIt->Next()) {
+    myDSIt->Current(n1, n2, bJustAdd);
+    if (!IsSuccessorsComputed(n1, n2)) {
+      anIndexIn=0;
+      aWhat=n1; // Vertex
+      aWith=n2; // Edge
+      if (myDS->GetShapeType(n1)==TopAbs_EDGE) {
+       aWhat=n2;
+       aWith=n1;
+      }
+      //
+      if(bJustAdd) {
+       //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
+       continue;
+      }
+      // Edge
+      aE2=TopoDS::Edge(myDS->Shape(aWith));
+      if (BRep_Tool::Degenerated(aE2)){
+       continue;
+      }
+      // Vertex
+      nV1=aWhat;
+      aV1=TopoDS::Vertex(myDS->Shape(aWhat));
+      //
+      iSDV=FindSDVertex(aWhat);
+      if (iSDV) {
+       nV1=iSDV;
+       aV1=TopoDS::Vertex(myDS->Shape(nV1));
+       // Modified to find same domain vertex Thu Sep 14 14:35:18 2006 
+       // Contribution of Samtech www.samcef.com BEGIN
+       Standard_Integer nVE, iSDVE, iRet;
+       //
+       BooleanOperations_OnceExplorer aExp(*myDS);
+       iRet=0;
+       aExp.Init(aWith, TopAbs_VERTEX);
+       for (; aExp.More(); aExp.Next()) {
+         nVE=aExp.Current();
+         iSDVE=FindSDVertex(nVE);
+         if (iSDVE==iSDV) {
+           iRet=1;
+           break;
+         }
+       }
+       if (iRet) {
+         continue;
+       }
+      }
+      else {
+       if (Contains(aE2, aV1)) {
+         continue;
+       }
+       // Contribution of Samtech www.samcef.com END
+      }
+      //
+      aFlag=myContext.ComputeVE (aV1, aE2, aT);
+      //
+      if (!aFlag) {
+       // Add Interference to the Pool
+       BOPTools_VEInterference anInterf (aWhat, aWith, aT);
+       anIndexIn=aVEs.Append(anInterf);
+       //
+       // Add Pave to the Edge's myPavePool
+       aCouple.SetCouple(nV1, aWith);
+       if (!aSnareMap.Contains(aCouple)){
+         aSnareMap.Add(aCouple);
+         //
+         BOPTools_Pave aPave(nV1, aT, BooleanOperations_VertexEdge);
+         aPave.SetInterference(anIndexIn);
+         BOPTools_PaveSet& aPaveSet= myPavePool(myDS->RefEdge(aWith));
+         aPaveSet.Append(aPave);
+       }
+       //
+       // State for the Vertex in DS;
+       myDS->SetState (aWhat, BooleanOperations_ON);
+       // Insert Vertex in Interference Object
+       BOPTools_VEInterference& aVE=aVEs(anIndexIn);
+       aVE.SetNewShape(aWhat);
+       // qqf
+       {
+         myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VE);
+       }         
+       // qqt
+      }
+      //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
+    }
+  }
+  myIsDone=Standard_True;
+}
 //=======================================================================
 // function: PrepareEdges
 // purpose: 
@@ -106,116 +223,7 @@ static
     }
   }
 }
-//=======================================================================
-// function: PerformVE
-// purpose: 
-//=======================================================================
-  void NMTTools_PaveFiller::PerformVE() 
-{
-  myIsDone=Standard_False;
-  //
-  Standard_Boolean bJustAddInterference;
-  Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVEs, aBlockLength, iSDV, nV1;
-  Standard_Real aT;
-  TopoDS_Vertex aV1;
-  TopoDS_Edge aE2;
-  BOPTools_IndexedMapOfCoupleOfInteger aSnareMap;
-  BOPTools_CoupleOfInteger aCouple;
-  //
-  BOPTools_CArray1OfVEInterference& aVEs=myIntrPool->VEInterferences();
-  //
-  myDSIt.Initialize (TopAbs_VERTEX, TopAbs_EDGE);
-  //
-  // BlockLength correction
-  aNbVEs=ExpectedPoolLength();
-  aBlockLength=aVEs.BlockLength();
-  if (aNbVEs > aBlockLength) {
-    aVEs.SetBlockLength(aNbVEs);
-  }
-  //
-  for (; myDSIt.More(); myDSIt.Next()) {
-    myDSIt.Current(n1, n2, bJustAddInterference);
-    //
-    if (! myIntrPool->IsComputed(n1, n2)) {
-      if (! IsSuccesstorsComputed(n1, n2)) {
-       anIndexIn=0;
-       aWhat=n1; // Vertex
-       aWith=n2; // Edge
-       SortTypes(aWhat, aWith);
-       //
-       if(bJustAddInterference) {
-        myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
-        continue;
-       }
-       // Edge
-       aE2=TopoDS::Edge(myDS->Shape(aWith));
-       if (BRep_Tool::Degenerated(aE2)){
-         continue;
-       }
-       // Vertex
-       nV1=aWhat;
-       aV1=TopoDS::Vertex(myDS->Shape(aWhat));
-       //
-       iSDV=FindSDVertex(aWhat);
-       if (iSDV) {
-         nV1=iSDV;
-         aV1=TopoDS::Vertex(myDS->Shape(nV1));
-         // Modified to find same domain vertex Thu Sep 14 14:35:18 2006 
-         // Contribution of Samtech www.samcef.com BEGIN
-         Standard_Integer nVE, iSDVE, iRet;
-         //
-         BooleanOperations_OnceExplorer aExp(*myDS);
-         iRet=0;
-         aExp.Init(aWith, TopAbs_VERTEX);
-         for (; aExp.More(); aExp.Next()) {
-           nVE=aExp.Current();
-           iSDVE=FindSDVertex(nVE);
-           if (iSDVE==iSDV) {
-             iRet=1;
-             break;
-           }
-         }
-         if (iRet) {
-           continue;
-         }
-       }
-       else {
-         if (Contains(aE2, aV1)) {
-           continue;
-         }
-         // Contribution of Samtech www.samcef.com END
-       }
-       //
-       aFlag=myContext.ComputeVE (aV1, aE2, aT);
-       //
-       if (!aFlag) {
-         // Add Interference to the Pool
-         BOPTools_VEInterference anInterf (aWhat, aWith, aT);
-         anIndexIn=aVEs.Append(anInterf);
-         //
-         // Add Pave to the Edge's myPavePool
-         aCouple.SetCouple(nV1, aWith);
-         if (!aSnareMap.Contains(aCouple)){
-           aSnareMap.Add(aCouple);
-           //
-           BOPTools_Pave aPave(nV1, aT, BooleanOperations_VertexEdge);
-           aPave.SetInterference(anIndexIn);
-           BOPTools_PaveSet& aPaveSet= myPavePool(myDS->RefEdge(aWith));
-           aPaveSet.Append(aPave);
-         }
-         //
-         // State for the Vertex in DS;
-         myDS->SetState (aWhat, BooleanOperations_ON);
-         // Insert Vertex in Interference Object
-         BOPTools_VEInterference& aVE=aVEs(anIndexIn);
-         aVE.SetNewShape(aWhat);
-       }
-       myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexEdge, anIndexIn);
-      }
-    }
-  }
-  myIsDone=Standard_True;
-}
+
 // Modified  Thu Sep 14 14:35:18 2006 
 // Contribution of Samtech www.samcef.com BEGIN
 //=======================================================================
index 7869f87d03432b566e38c77e2b68173b91c04658..ca458c3292f7e8918ef25abad89ede80a32b0f91 100644 (file)
@@ -1,18 +1,18 @@
 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// 
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
+// License as published by the Free Software Foundation; either 
 // version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 // Lesser General Public License for more details.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #include <TopoDS_Vertex.hxx>
 #include <TopoDS_Face.hxx>
 
+#include <TopExp_Explorer.hxx>
+
 #include <BOPTools_VSInterference.hxx>
 #include <BOPTools_CArray1OfVSInterference.hxx>
 
+#include <NMTDS_Iterator.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
-#include <TopExp_Explorer.hxx>
+#include <NMTDS_InterfPool.hxx>
+
 
 // Modified  Thu Sep 14 14:35:18 2006 
 // Contribution of Samtech www.samcef.com BEGIN
@@ -50,71 +54,76 @@ static
 {
   myIsDone=Standard_False;
   //
-  Standard_Boolean aJustAddInterference;
+  Standard_Boolean aJustAdd;
   Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVSs, aBlockLength, iSDV;
   Standard_Real aU, aV;
   TopoDS_Vertex aV1;
   TopoDS_Face aF2;
   //
-  BOPTools_CArray1OfVSInterference& aVSs=myIntrPool->VSInterferences();
+  BOPTools_CArray1OfVSInterference& aVSs=myIP->VSInterferences();
   //
   // V/E Interferences 
-  myDSIt.Initialize(TopAbs_VERTEX, TopAbs_FACE);
+  myDSIt->Initialize(TopAbs_VERTEX, TopAbs_FACE);
   //
   // BlockLength correction
-  aNbVSs=ExpectedPoolLength();
+  aNbVSs=myDSIt->BlockLength();
   aBlockLength=aVSs.BlockLength();
   if (aNbVSs > aBlockLength) {
     aVSs.SetBlockLength(aNbVSs);
   }
   //
-  for (; myDSIt.More(); myDSIt.Next()) {
-    myDSIt.Current(n1, n2, aJustAddInterference);
-    //
-    if (! myIntrPool->IsComputed(n1, n2)) {
-      if (! IsSuccesstorsComputed(n1, n2)) {
-       anIndexIn=0;
-       aWhat=n1; // Vertex
-       aWith=n2; // Face
-       SortTypes(aWhat, aWith);
-       //
-       iSDV=FindSDVertex(aWhat);
-       //
-       if(aJustAddInterference) {
-         myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
-         continue;
-       }
-       //
-       aV1=TopoDS::Vertex(myDS->Shape(aWhat));
-       if (iSDV) {
-         aV1=TopoDS::Vertex(myDS->Shape(iSDV));
-       }
+  for (; myDSIt->More(); myDSIt->Next()) {
+    myDSIt->Current(n1, n2, aJustAdd);
+    if (! IsSuccessorsComputed(n1, n2)) {
+      anIndexIn=0;
+      aWhat=n1; // Vertex
+      aWith=n2; // Face
+      if (myDS->GetShapeType(n1)==TopAbs_FACE) {
+       aWhat=n2;
+       aWith=n1;
+      }
+      //
+      iSDV=FindSDVertex(aWhat);
        //
-       aF2=TopoDS::Face(myDS->Shape(aWith));
+      if(aJustAdd) {
+       //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
+       continue;
+      }
+      //
+      aV1=TopoDS::Vertex(myDS->Shape(aWhat));
+      if (iSDV) {
+       aV1=TopoDS::Vertex(myDS->Shape(iSDV));
+      }
        //
-       // Modified  Thu Sep 14 14:35:18 2006 
-       // Contribution of Samtech www.samcef.com BEGIN
-       if (Contains(aF2, aV1)) {
-         continue;
-       }
-       // Contribution of Samtech www.samcef.com END
+      aF2=TopoDS::Face(myDS->Shape(aWith));
+      //
+      // Modified  Thu Sep 14 14:35:18 2006 
+      // Contribution of Samtech www.samcef.com BEGIN
+      if (Contains(aF2, aV1)) {
+       continue;
+      }
+      // Contribution of Samtech www.samcef.com END
+      //
+      aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
+      //
+      if (!aFlag) {
        //
-       aFlag=myContext.ComputeVS (aV1, aF2, aU, aV);
+       // Add Interference to the Pool
+       BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
+       anIndexIn=aVSs.Append(anInterf);
        //
-       if (!aFlag) {
-         //
-         // Add Interference to the Pool
-         BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
-         anIndexIn=aVSs.Append(anInterf);
-         //
-         // SetState for Vertex in DS;
-         myDS->SetState (aWhat, BooleanOperations_ON);
-         // Insert Vertex in Interference Object
-         BOPTools_VSInterference& aVS=aVSs(anIndexIn);
-         aVS.SetNewShape(aWhat);
+       // SetState for Vertex in DS;
+       myDS->SetState (aWhat, BooleanOperations_ON);
+       // Insert Vertex in Interference Object
+       BOPTools_VSInterference& aVS=aVSs(anIndexIn);
+       aVS.SetNewShape(aWhat);
+       // qqf
+       {
+         myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VF);
        }
-       myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
+       // qqt
       }
+      //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
     }
   }
   myIsDone=Standard_True;
index 3a9a1c5c9187b19370b1e59e163c7e43ccf73526..dc2bf3e7558189c6ab9b6c977174aebf410d563c 100644 (file)
 #include <stdio.h>
 #include <Precision.hxx>
 
+#include <gp_XYZ.hxx>
+#include <gp_Pnt.hxx>
+#include <Bnd_Box.hxx>
+
 #include <TColStd_MapOfInteger.hxx>
 #include <TColStd_IndexedMapOfInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
 
 #include <TopoDS.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Compound.hxx>
 
 #include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
+#include <TopTools_DataMapOfShapeListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_DataMapOfShapeShape.hxx>
 
 #include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
+#include <BRepBndLib.hxx>
 
-#include <Bnd_Box.hxx>
+#include <BOPTColStd_Dump.hxx>
+#include <BOPTColStd_Failure.hxx>
 
 #include <IntTools_ShrunkRange.hxx>
 #include <IntTools_Range.hxx>
 #include <BOPTools_ListIteratorOfListOfPave.hxx>
 #include <BOPTools_SequenceOfPaveBlock.hxx>
 
-#include <BOPTColStd_Dump.hxx>
-#include <BOPTColStd_Failure.hxx>
-
 #include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
 #include <BooleanOperations_IndexedDataMapOfShapeInteger.hxx>
 #include <BooleanOperations_KindOfInterference.hxx>
 
+#include <NMTDS_Iterator.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
+#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
+#include <NMTDS_BoxBndTree.hxx>
+#include <NCollection_UBTreeFiller.hxx>
+#include <NMTDS_InterfPool.hxx>
 
 #include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
 #include <NMTTools_ListOfCommonBlock.hxx>
 #include <BOPTools_VSInterference.hxx>
 // Contribution of Samtech www.samcef.com END
 //
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <Bnd_HArray1OfBox.hxx>
-#include <Bnd_BoundSortBox.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
-#include <TopTools_DataMapOfShapeListOfShape.hxx>
-#include <NMTDS_IndexedDataMapOfIntegerShape.hxx>
-#include <NMTDS_IndexedDataMapOfShapeBox.hxx>
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_DataMapOfShapeShape.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <gp_XYZ.hxx>
-#include <gp_Pnt.hxx>
-#include <BRep_Builder.hxx>
-#include <BRep_Tool.hxx>
-#include <TColStd_MapOfInteger.hxx>
 //
-#include <NMTDS_BoxBndTree.hxx>
-#include <NCollection_UBTreeFiller.hxx>
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
 
 
 static
@@ -165,31 +158,30 @@ static
   BooleanOperations_IndexedDataMapOfShapeInteger aMapVI;
   BOPTools_IDMapOfPaveBlockIMapOfPaveBlock aMapCB;
   //
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
+  //
+  myDSIt->Initialize(TopAbs_EDGE, TopAbs_EDGE);
   //
   // BlockLength correction
-  aNbVEs=ExpectedPoolLength();
+  aNbVEs=myDSIt->BlockLength();
   aBlockLength=aEEs.BlockLength();
   if (aNbVEs > aBlockLength) {
     aEEs.SetBlockLength(aNbVEs);
   }
   //
-  myDSIt.Initialize(TopAbs_EDGE, TopAbs_EDGE);
-  //
-  for (; myDSIt.More(); myDSIt.Next()) {
-    myDSIt.Current(n1, n2, bJustAdd);
+  for (; myDSIt->More(); myDSIt->Next()) {
+    myDSIt->Current(n1, n2, bJustAdd);
     anIndexIn = 0;
     //
-    if (myIntrPool->IsComputed(n1, n2)) {
-      continue;
-    }
+    //if (myIntrPool->IsComputed(n1, n2)) {
+    //  continue;
+    //}
     //
     nE1=n1; 
     nE2=n2; 
-    SortTypes(nE1, nE2);
     //
     if(bJustAdd) {
-      myIntrPool->AddInterference (nE1, nE2, BooleanOperations_EdgeEdge, anIndexIn);
+      //myIntrPool->AddInterference (nE1, nE2, BooleanOperations_EdgeEdge, anIndexIn);
       continue;
     }
     //
@@ -296,7 +288,7 @@ static
                bIsOnPave2=IsOnPave(aT2, aR2, aTol);
                //
                if(bIsOnPave1 || bIsOnPave2) {
-                 myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
+                 //myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
                  continue;
                }
                //
@@ -306,7 +298,12 @@ static
                BOPTools_EEInterference anInterf (aWhat, aWith, aCPart);
                //
                anIndexIn=aEEs.Append(anInterf);
-               myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
+               //myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
+               // qqf
+               {
+                 myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
+               }
+               // qqt
                //
                // Collect
                aMapVI.Add(aNewVertex, anIndexIn);
@@ -321,7 +318,7 @@ static
                aCoinsideFlag=IsBlocksCoinside(aPB1, aPB2);
                //
                if (aNbComPrt2>1 || !aCoinsideFlag) {
-                 myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
+                 //myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn);
                  break;
                }
                //
@@ -349,6 +346,11 @@ static
                  aMapPB.Add(aPB2); 
                  aMapCB.Add(aPB2, aMapPB);
                }
+               // qqf
+               {
+                 myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
+               }
+               // qqt
              }
                break;
            default:
@@ -396,7 +398,7 @@ static
   TColStd_MapOfInteger aMFence;
   BOPTools_Pave aPave;
   //
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
   //
   aNb=aMapVI.Extent();
   if (!aNb) { // no new vertices, no new problems 
@@ -575,10 +577,7 @@ void TreatNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aMap
     //...
     aNbIP=aMIPC.Extent();
     if (!aNbIP) {
-      //modified by NIZNHY-PKV Tue Jan  9 14:26:09 2007f
       aMIPC.Add(i);
-      //continue;
-      //modified by NIZNHY-PKV Tue Jan  9 14:26:12 2007t
     }
     //
     aIt1.Initialize(aMIPC);
@@ -698,7 +697,7 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
   BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;      
   BOPTools_Pave aPave;
   //
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
   //
   // one new vertex case is treated in usual way
   //
@@ -770,58 +769,43 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
 {
   myIsDone=Standard_False;
   //
-  Standard_Boolean Ok1, Ok2, Ok3;
-  Ok1= (aType1==TopAbs_VERTEX) &&  (aType2==TopAbs_EDGE) ;
-  Ok2= (aType1==TopAbs_EDGE)   &&  (aType2==TopAbs_EDGE) ;
-  Ok3= (aType1==TopAbs_EDGE)   &&  (aType2==TopAbs_FACE) ;
-  if (!Ok1 && !Ok2 && !Ok3) {
-    // error: Type mismatch
+  Standard_Boolean bOk1, bOk2, bOk3, bFlag;
+  Standard_Integer i, aNb, nE[2], n1, n2, aNbSplits;
+  TColStd_MapOfInteger aMap;
+  
+  bOk1= (aType1==TopAbs_VERTEX) &&  (aType2==TopAbs_EDGE) ;
+  bOk2= (aType1==TopAbs_EDGE)   &&  (aType2==TopAbs_EDGE) ;
+  bOk3= (aType1==TopAbs_EDGE)   &&  (aType2==TopAbs_FACE) ;
+  if (!bOk1 && !bOk2 && !bOk3) {// error: Type mismatch
     return;
   }
   //
-  Standard_Boolean aFlag = Standard_False;
-  Standard_Integer n1, n2, nE1, nE2, aNbSplits;
-  TColStd_MapOfInteger aMap;
-  //
-  myDSIt.Initialize(aType1, aType2);
+  aNb=bOk2 ? 2 : 1;
   //
-  for (; myDSIt.More(); myDSIt.Next()) {
-    myDSIt.Current(n1, n2, aFlag);
-    nE1=n1; 
-    nE2=n2; 
-    SortTypes(nE1, nE2);
+  myDSIt->Initialize(aType1, aType2);
+  for (; myDSIt->More(); myDSIt->Next()) {
+    myDSIt->Current(n1, n2, bFlag);
     //
-    if (aType1==TopAbs_EDGE) {
-      BOPTools_ListOfPaveBlock& aLPB1=mySplitShapesPool(myDS->RefEdge(nE1));
-      aNbSplits=aLPB1.Extent();
-      if (!aNbSplits) {
-       if (!aMap.Contains(nE1)) { 
-         aMap.Add(nE1);
-         PreparePaveBlocks(nE1);
-         //
-         if (!myIsDone) {
-           return;
-         }
-       }
-      }
+    nE[0]=n1; 
+    nE[1]=n2; 
+    if (myDS->GetShapeType(n1)!=TopAbs_EDGE) {
+      nE[0]=n2; 
+      nE[1]=n1;
     }
     //
-    if (aType2==TopAbs_EDGE) {
-      BOPTools_ListOfPaveBlock& aLPB2=mySplitShapesPool(myDS->RefEdge(nE2));
-      aNbSplits=aLPB2.Extent();
+    for (i=0; i<aNb; ++i) {
+      BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE[i]));
+      aNbSplits=aLPB.Extent();
       if (!aNbSplits) {
-       if (!aMap.Contains(nE2)) { 
-         aMap.Add(nE2);
-         PreparePaveBlocks(nE2);
-         //
+       if (aMap.Add(nE[i])) { 
+         PreparePaveBlocks(nE[i]);
          if (!myIsDone) {
            return;
          }
        }
       }
-    }// if (aType2==TopAbs_EDGE)
+    }
   }// for (; myDSIt.More(); myDSIt.Next()) 
-
   myIsDone=Standard_True;
 }
 //=======================================================================
@@ -831,65 +815,60 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
   void NMTTools_PaveFiller::PreparePaveBlocks(const Standard_Integer nE)
 {
   myIsDone=Standard_False;
-  
-  Standard_Integer nV1, nV2;
-
+  //
+  char buf[512];
+  Standard_Integer nV1, nV2, iErr;
   TopoDS_Edge aE;
   TopoDS_Vertex aV1, aV2;
-    
-  // SplitShapesPool
+  //
   BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
   // Edge 
   aE=TopoDS::Edge(myDS->Shape(nE));
+  if (BRep_Tool::Degenerated(aE)) {
+    myIsDone=Standard_True;
+    return;
+  }
   //
-  if (!BRep_Tool::Degenerated(aE)){
+  BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
+  
+  BOPTools_PaveBlockIterator aPBIt(nE, aPS);
+  for (; aPBIt.More(); aPBIt.Next()) {
+    BOPTools_PaveBlock& aPB=aPBIt.Value();
+    const IntTools_Range& aRange=aPB.Range();
     //
-    BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
-    
-    BOPTools_PaveBlockIterator aPBIt(nE, aPS);
-    for (; aPBIt.More(); aPBIt.Next()) {
-      BOPTools_PaveBlock& aPB=aPBIt.Value();
-      
-      const IntTools_Range& aRange=aPB.Range();
-      
-      const BOPTools_Pave& aPave1=aPB.Pave1();
-      nV1=aPave1.Index();
-      aV1=TopoDS::Vertex(myDS->GetShape(nV1));
-      
-      const BOPTools_Pave& aPave2=aPB.Pave2();
-      nV2=aPave2.Index();
-      aV2=TopoDS::Vertex(myDS->GetShape(nV2));
-      //
-      // ShrunkRange
-      IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
-      //
-      Standard_Integer anErrorStatus;
-      anErrorStatus=aSR.ErrorStatus();
-
-      char buf[512];
-      if (!aSR.IsDone()) {
-       sprintf (buf, "Can not obtain ShrunkRange for Edge %d\n", nE);
-       BOPTColStd_Dump::PrintMessage(buf);
-       sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
-       throw 
-         BOPTColStd_Failure(buf) ;
-      }
-      //
-      if (anErrorStatus==6) {
-       sprintf(buf,
-               "Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
-       BOPTColStd_Dump::PrintMessage(buf);
-      }
-      else {
-       // Check left paves and correct ShrunkRange if it is necessary
-       CorrectShrunkRanges (0, aPave1, aSR);
-       CorrectShrunkRanges (1, aPave2, aSR);
-      }
-      //
-      aPB.SetShrunkRange(aSR);
-      aLPB.Append(aPB);
-    } //for (; aPBIt1.More(); aPBIt1.Next()) 
-  }
+    const BOPTools_Pave& aPave1=aPB.Pave1();
+    nV1=aPave1.Index();
+    aV1=TopoDS::Vertex(myDS->GetShape(nV1));
+    //
+    const BOPTools_Pave& aPave2=aPB.Pave2();
+    nV2=aPave2.Index();
+    aV2=TopoDS::Vertex(myDS->GetShape(nV2));
+    //
+    // ShrunkRange
+    IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
+    iErr=aSR.ErrorStatus();
+    if (!aSR.IsDone()) {
+      sprintf (buf, "Can not obtain ShrunkRange for Edge %d\n", nE);
+      BOPTColStd_Dump::PrintMessage(buf);
+      sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
+      throw 
+       BOPTColStd_Failure(buf) ;
+    }
+    //
+    if (iErr==6) {
+      sprintf(buf,
+             "Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
+      BOPTColStd_Dump::PrintMessage(buf);
+    }
+    else {
+      // Check left paves and correct ShrunkRange if it is necessary
+      CorrectShrunkRanges (0, aPave1, aSR);
+      CorrectShrunkRanges (1, aPave2, aSR);
+    }
+    //
+    aPB.SetShrunkRange(aSR);
+    aLPB.Append(aPB);
+  } //for (; aPBIt.More(); aPBIt.Next()) 
   myIsDone=Standard_True;
 }
 //=======================================================================
@@ -915,7 +894,7 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
     return;
   }
 
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
   const BOPTools_EEInterference& aEE=aEEs(anIndexInterf);
   const IntTools_CommonPrt& aCP=aEE.CommonPrt();
   const TopoDS_Edge& aE1=aCP.Edge1();
@@ -945,8 +924,10 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV,
       tNV=tV+aCoeff*(tNV-tV);
       aNewRange.SetFirst(tNV);
       aNewRange.SetLast (aSR.Last());
-
-      if(aNewRange.First() > aNewRange.Last()) {
+      //modified by NIZNHY-PKV Tue Jan 23 14:07:55 2007f
+      //if(aNewRange.First() > aNewRange.Last()) {
+      if(aNewRange.First() < aNewRange.Last()) {
+      //modified by NIZNHY-PKV Tue Jan 23 14:08:02 2007t
        aShrunkRange.SetShrunkRange(aNewRange);
       }
     }
@@ -1370,8 +1351,8 @@ void ProcessBlock(const BOPTools_PaveBlock& aPB,
   TColStd_ListOfInteger aLFI;
   TColStd_ListIteratorOfListOfInteger aItLFI;
   //
-  BOPTools_CArray1OfVSInterference& aVSs=myIntrPool->VSInterferences();
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
+  BOPTools_CArray1OfVSInterference& aVSs=myIP->VSInterferences();
+  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
   //
   aNbS=myDS->NumberOfShapesOfTheObject();
   for (i=1; i<=aNbS; ++i) {
@@ -1427,213 +1408,3 @@ void ProcessBlock(const BOPTools_PaveBlock& aPB,
   }
 } 
 // Contribution of Samtech www.samcef.com END
-/*
-//=======================================================================
-// function:EENewVertices
-// purpose: 
-//=======================================================================
-  void NMTTools_PaveFiller::EENewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI) 
-{
-  Standard_Integer aNb, i, j, aNewShape, aNbEdges, aNbIEE, aNbVV, aNbSimple;
-  Standard_Integer aWhat, aWith, i1, i2, nE1, nE2, nE, nV, aFlag;
-  Standard_Real aT;
-  TopoDS_Compound aCompound;
-  BRep_Builder aBB;
-  NMTTools_IndexedDataMapOfIndexedMapOfInteger aMNVE, aMNVIEE;
-  BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;      
-  BOPTools_Pave aPave;
-  TopoDS_Vertex aNewVertex;
-  TopTools_IndexedMapOfShape aMNVComplex, aMNVSimple;
-  //
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
-  //
-  aNb=aMapVI.Extent();
-  //
-  if (!aNb) { // no new vertices, no new problems 
-    return;
-  }
-  //
-  // 0. 
-  if (aNb==1) {
-    aNewVertex=TopoDS::Vertex(aMapVI.FindKey(1));
-    EENewVertices(aNewVertex, aMapVI);
-    return;
-  }
-  //
-  // 1. Make compound from new vertices
-  aBB.MakeCompound(aCompound);
-  for (i=1; i<=aNb; ++i) {
-    const TopoDS_Shape& aV=aMapVI.FindKey(i);
-    aBB.Add(aCompound, aV);
-  }
-  //
-  // 2. VV intersection between these vertices 
-  //       using the auxiliary Filler
-  NMTDS_ShapesDataStructure tDS;
-  //
-  tDS.SetCompositeShape(aCompound);
-  tDS.Init();
-  //
-  BOPTools_InterferencePool tInterfPool(tDS);
-  NMTTools_PaveFiller tPaveFiller(tInterfPool);
-  //
-  tPaveFiller.Init();
-  //
-  tPaveFiller.PerformVV();
-  tPaveFiller.PerformNewVertices();
-  //
-  const BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterfs();
-  //
-  // 3. Separate Comlex and Simple new vertices
-  aNbVV=aVVInterfs.Extent();
-  for (i=1; i<=aNbVV; ++i) {
-    const BOPTools_VVInterference& aVV=aVVInterfs(i);
-    aVV.Indices(aWhat, aWith);
-    const TopoDS_Shape& aV1=tDS.Shape(aWhat);
-    const TopoDS_Shape& aV2=tDS.Shape(aWith);
-    aMNVComplex.Add(aV1);
-    aMNVComplex.Add(aV2);
-  }
-  //
-  for (i=1; i<=aNb; ++i) {
-    const TopoDS_Shape& aV=aMapVI.FindKey(i);
-    if (!aMNVComplex.Contains(aV)) {
-      aMNVSimple.Add(aV);
-    }
-  }
-  //
-  // 4. Treat Simple new Vertices
-  aNbSimple=aMNVSimple.Extent();
-  for (i=1; i<=aNbSimple; ++i) {
-    const TopoDS_Vertex& aV=TopoDS::Vertex(aMNVSimple(i));
-    EENewVertices(aV, aMapVI);
-  }
-  //
-  // 3. Fill Maps : NewVertex-edges (aMNVE) 
-  //                NewVertex-interferences (aMNVIEE)
-  for (i=1; i<=aNbVV; ++i) {
-    const BOPTools_VVInterference& aVV=aVVInterfs(i);
-    aNewShape=aVV.NewShape();
-    if (!aNewShape) {
-      continue;
-    }
-    //
-    if (!aMNVE.Contains(aNewShape)) {
-      TColStd_IndexedMapOfInteger aMx;
-      aMNVE.Add(aNewShape, aMx);
-    }
-    if (!aMNVIEE.Contains(aNewShape)) {
-      TColStd_IndexedMapOfInteger aMx;
-      aMNVIEE.Add(aNewShape, aMx);
-    }
-    //
-    TColStd_IndexedMapOfInteger& aME=aMNVE.ChangeFromKey(aNewShape);
-    TColStd_IndexedMapOfInteger& aMIEE=aMNVIEE.ChangeFromKey(aNewShape);
-    //
-    aVV.Indices(aWhat, aWith);
-    //aWhat
-    const TopoDS_Shape& aV1=tDS.Shape(aWhat);
-    i1=aMapVI.FindFromKey(aV1);
-    const BOPTools_EEInterference& aEE1=aEEs(i1);
-    aEE1.Indices(nE1, nE2);
-    aME.Add(nE1);
-    aME.Add(nE2);
-    aMIEE.Add(i1);
-    //aWith
-    const TopoDS_Shape& aV2=tDS.Shape(aWith);
-    i2=aMapVI.FindFromKey(aV2);
-    const BOPTools_EEInterference& aEE2=aEEs(i2);
-    aEE2.Indices(nE1, nE2);
-    aME.Add(nE1);
-    aME.Add(nE2);
-    aMIEE.Add(i2);
-    //
-    //printf(" VV: (%d, %d) -> %d\n", aWhat, aWith, aNewShape);
-  }
-  //
-  // 4. Process new vertices
-  aNb=aMNVE.Extent();
-  for (i=1; i<=aNb; ++i) { // xx
-    //
-    //  new Vertex
-    nV=aMNVE.FindKey(i);
-    aNewVertex=TopoDS::Vertex(tDS.Shape(nV));
-    //
-    // Insert New Vertex in DS;
-    myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
-    aNewShape=myDS->NumberOfInsertedShapes();
-    myDS->SetState (aNewShape, BooleanOperations_ON);
-    //
-    // Update index of NewShape in EE interferences
-    const TColStd_IndexedMapOfInteger& aMIEE=aMNVIEE.FindFromKey(nV);//(i);
-    aNbIEE=aMIEE.Extent();
-    for (j=1; j<=aNbIEE; ++j) {
-      i1=aMIEE(j);
-      BOPTools_EEInterference& aEE1=aEEs(i1);
-      aEE1.SetNewShape(aNewShape);
-    }
-    // 
-    // Update Paves on edges
-    const TColStd_IndexedMapOfInteger& aME=aMNVE(i);
-    aNbEdges=aME.Extent();
-    for (j=1; j<=aNbEdges; ++j) {
-      nE=aME(j);
-      const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));//mpv
-      //
-      aFlag=myContext.ComputeVE (aNewVertex, aE, aT);
-      //
-      if (!aFlag) {
-       aPave.SetInterference(-1);
-       aPave.SetType (BooleanOperations_EdgeEdge);
-       aPave.SetIndex(aNewShape);
-       aPave.SetParam(aT);
-       //
-       BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE));
-       aPaveSet.Append(aPave);
-      }
-    }
-  }// for (i=1; i<=aNb; ++i) {// xx
-}
-//=======================================================================
-// function:EENewVertices
-// purpose: 
-//=======================================================================
-  void NMTTools_PaveFiller::EENewVertices (const TopoDS_Vertex& aNewVertex,
-                                          const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI) 
-{
-  Standard_Integer  i, aNewShape, nE1, nE2;
-  Standard_Real  aT1, aT2;
-  BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;      
-  BOPTools_Pave aPave;
-  //
-  BOPTools_CArray1OfEEInterference& aEEs=myIntrPool->EEInterferences();
-  //
-  // one new vertex case is treated in usual way
-  //
-  // Insert New Vertex in DS;
-  myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
-  aNewShape=myDS->NumberOfInsertedShapes();
-  myDS->SetState (aNewShape, BooleanOperations_ON);
-  // Insert New Vertex in EE Interference
-  i=aMapVI.FindFromKey(aNewVertex);
-  BOPTools_EEInterference& aEEInterf= aEEs(i);
-  aEEInterf.SetNewShape(aNewShape);
-  // Extact interference info
-  aEEInterf.Indices(nE1, nE2);
-  const IntTools_CommonPrt& aCPart=aEEInterf.CommonPrt();
-  VertexParameters(aCPart, aT1, aT2);
-  //
-  // Add Paves to the myPavePoolNew
-  aPave.SetInterference(i);
-  aPave.SetType (BooleanOperations_EdgeEdge);
-  aPave.SetIndex(aNewShape);
-  // Pave for edge nE1
-  aPave.SetParam(aT1);
-  BOPTools_PaveSet& aPaveSet1=myPavePoolNew(myDS->RefEdge(nE1));
-  aPaveSet1.Append(aPave);
-  // Pave for edge nE2
-  aPave.SetParam(aT2);
-  BOPTools_PaveSet& aPaveSet2=myPavePoolNew(myDS->RefEdge(nE2));
-  aPaveSet2.Append(aPave);
-}
-*/
index 0c6dbab260a9233240bde2cb2dfdcff5980a92a0..01ec5e0bb346676c244a86f119f49fba88549ffc 100644 (file)
@@ -40,6 +40,8 @@
 #include <TopoDS_Vertex.hxx>
 #include <TopoDS_Compound.hxx>
 
+#include <TopExp.hxx>
+
 #include <TopTools_IndexedMapOfShape.hxx>
 
 #include <IntTools_ShrunkRange.hxx>
@@ -63,7 +65,7 @@
 #include <BOPTools_ListOfPaveBlock.hxx>
 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
 #include <BOPTools_ESInterference.hxx>
-#include <BOPTools_InterferencePool.hxx>
+
 #include <BOPTools_CArray1OfVVInterference.hxx>
 #include <BOPTools_CArray1OfESInterference.hxx>
 #include <BOPTools_VVInterference.hxx>
 #include <BOPTools_IMapOfPaveBlock.hxx>
 
 #include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_Iterator.hxx>
+#include <NMTDS_InterfPool.hxx>
 
 #include <NMTTools_ListOfCommonBlock.hxx>
 #include <NMTTools_CommonBlockAPI.hxx>
 #include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
 #include <NMTTools_CommonBlockAPI.hxx>
 #include <NMTTools_ListOfCommonBlock.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TopExp.hxx>
+
 
 static
   void VertexParameter(const IntTools_CommonPrt& aCPart,
@@ -105,28 +108,32 @@ static
   BOPTools_IDMapOfPaveBlockIMapOfInteger aMapCB;
   BOPTools_IMapOfPaveBlock aIMPBx;
   //
-  BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
+  BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
   //
-  myDSIt.Initialize(TopAbs_EDGE, TopAbs_FACE);
+  myDSIt->Initialize(TopAbs_EDGE, TopAbs_FACE);
   //
   // BlockLength correction
-  aNbEFs=ExpectedPoolLength();
+  aNbEFs=myDSIt->BlockLength();
   aBlockLength=aEFs.BlockLength();
   if (aNbEFs > aBlockLength) {
     aEFs.SetBlockLength(aNbEFs);
   }
   //
-  for (; myDSIt.More(); myDSIt.Next()) {
-    myDSIt.Current(n1, n2, bJustAdd);
+  for (; myDSIt->More(); myDSIt->Next()) {
+    myDSIt->Current(n1, n2, bJustAdd);
     anIndexIn = 0;
     //
-    if (myIntrPool->IsComputed(n1, n2)) {
-      continue;
-    }
+    //if (myIntrPool->IsComputed(n1, n2)) {
+    //  continue;
+    //}
     //
     nE=n1; 
-    nF=n2; 
-    SortTypes(nE, nF);
+    nF=n2;
+    if (myDS->GetShapeType(n2)==TopAbs_EDGE) {
+      nE=n2; 
+      nF=n1;
+    }
+    //SortTypes(nE, nF);
     //
     // all Common Blocks for face nF
     //XXX
@@ -135,7 +142,7 @@ static
     NMTTools_CommonBlockAPI aCBAPIF(aLCBF);
     //XXX
     if(bJustAdd) {
-      myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
+      //myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
       continue;
     }
     // Edge
@@ -246,10 +253,15 @@ static
                  //
                  aMapVI.Add(aNewVertex, anIndexIn);
                  aIMPBx.Add(aPB);
+                 // qqf
+                 {
+                   myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
+                 }
+                 // qqt
                  //
                }// if (!nVF)
              }// if (!bIsOnPave1 && !bIsOnPave2) 
-             myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
+             //myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
            }// case TopAbs_VERTEX:
              break;
            //
@@ -258,7 +270,7 @@ static
              //
              aCoinsideFlag=BOPTools_Tools::IsBlockInOnFace(aPB, aF, myContext);
              if (!aCoinsideFlag) {
-               myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
+               //myIntrPool->AddInterference (nE, nF, BooleanOperations_EdgeSurface, anIndexIn);
                break;
              }
              //
@@ -272,9 +284,12 @@ static
                aMapF.Add(nF);
                aMapCB.Add(aPB, aMapF);
              }
-             //modified by NIZNHY-PKV Fri Jan 23 14:13:08 2004 f
              aIMPBx.Add(aPB);
-             //modified by NIZNHY-PKV Fri Jan 23 14:13:10 2004 t
+             // qqf
+             {
+               myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
+             }
+             // qqt
            }// case TopAbs_EDGE:
              break;
 
@@ -370,7 +385,7 @@ static
   void NMTTools_PaveFiller::EFNewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI) 
 {
   Standard_Integer i, j, aNb, aNewShape, aFlag, iX, aNbVV, aNbSimple;
-  Standard_Integer aWhat, aWith, nE, nF, nV, aNbIEF, aNbEdges;
+  Standard_Integer aWhat, aWith, nE, nF, nV, aNbIEF, aNbEdges, iTmp;
   Standard_Real aT;
   TopoDS_Compound aCompound;
   TopoDS_Vertex aNewVertex;
@@ -380,7 +395,7 @@ static
   BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
   TopTools_IndexedMapOfShape aMNVComplex, aMNVSimple;
   //
-  BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
+  BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
   //
   aNb=aMapVI.Extent();
   //
@@ -404,20 +419,19 @@ static
   //
   // 2. VV intersection between these vertices 
   //       using the auxiliary Filler
-  NMTDS_ShapesDataStructure tDS;
-  //
-  tDS.SetCompositeShape(aCompound);
-  tDS.Init();
-  //
-  BOPTools_InterferencePool tInterfPool(tDS);
-  NMTTools_PaveFiller tPaveFiller(tInterfPool);
+  NMTTools_PaveFiller tPF;
   //
-  tPaveFiller.Init();
+  tPF.SetCompositeShape(aCompound);
   //
-  tPaveFiller.PerformVV();
-  tPaveFiller.PerformNewVertices();
+  tPF.Init();
+  tPF.PerformVV();
+  //tPF.PerformNewVertices(); qq
   //
-  const BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterfs();
+  NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
+  //const BOPTools_InterferencePool& tInterfPool=*(tPF.InterfPool());
+  NMTDS_InterfPool& tInterfPool=*(tPF.IP());
+  //const BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterfs();
+  BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterferences();
   //
   // 3. Separate Comlex and Simple new vertices
   aNbVV=aVVInterfs.Extent();
@@ -472,7 +486,12 @@ static
     iX=aMapVI.FindFromKey(aV1);
     const BOPTools_ESInterference& aEF1=aEFs(iX);
     aEF1.Indices(nE, nF);
-    SortTypes(nE, nF);
+    //SortTypes(nE, nF);
+    if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
+      iTmp=nE;
+      nE=nF;
+      nF=iTmp;
+    }
     aME.Add(nE);
     aMIEF.Add(iX);
     //aWith
@@ -480,7 +499,12 @@ static
     iX=aMapVI.FindFromKey(aV2);
     const BOPTools_ESInterference& aEF2=aEFs(iX);
     aEF2.Indices(nE, nF);
-    SortTypes(nE, nF);
+    //SortTypes(nE, nF);
+    if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
+      iTmp=nE;
+      nE=nF;
+      nF=iTmp;
+    }
     aME.Add(nE);
     aMIEF.Add(iX);
   }
@@ -539,7 +563,7 @@ static
   BOPTools_Pave aPave;
   BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
   //
-  BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
+  BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
   //
   // Insert New Vertex in DS;
   myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
@@ -551,7 +575,10 @@ static
   aEFInterf.SetNewShape(aNewShape);
   // Extract interference info
   aEFInterf.Indices(nE, nF);
-  SortTypes(nE, nF);
+  //SortTypes(nE, nF);
+  if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
+    nE=nF;
+  }
   const IntTools_CommonPrt& aCPart=aEFInterf.CommonPrt();
   VertexParameter(aCPart, aT);
   //
index f15df64dce7ca940144525c888a70d87ef340c70..1d88deac45f65f8d3e1e426741b6f565270b63ba 100644 (file)
 
 #include <TColStd_IndexedMapOfInteger.hxx>
 #include <TColStd_MapOfInteger.hxx>
+#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
 
-#include <Geom2d_Curve.hxx>
 #include <Geom_TrimmedCurve.hxx>
-
+#include <Geom2d_TrimmedCurve.hxx>
+#include <Geom2d_Curve.hxx>
 #include <GeomAdaptor_Curve.hxx>
+
 #include <BndLib_Add3dCurve.hxx>
 
 #include <TopoDS_Face.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Compound.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Edge.hxx>
 
 #include <TopExp.hxx>
 
+#include <BRepLib.hxx>
 #include <BRep_Builder.hxx>
 #include <BRep_Tool.hxx>
 #include <BRepBndLib.hxx>
 
 #include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
 
 #include <BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger.hxx>
 #include <BOPTColStd_IndexedDataMapOfIntegerInteger.hxx>
 #include <IntTools_SequenceOfCurves.hxx>
 #include <IntTools_FaceFace.hxx>
 #include <IntTools_Tools.hxx>
+#include <IntTools_ShrunkRange.hxx>
 
 #include <BOPTools_CArray1OfSSInterference.hxx>
-#include <BOPTools_ListIteratorOfListOfInterference.hxx>
-#include <BOPTools_CArray1OfInterferenceLine.hxx>
-#include <BOPTools_InterferenceLine.hxx>
-#include <BOPTools_ListOfInterference.hxx>
-#include <BOPTools_Interference.hxx>
-#include <BOPTools_InterferencePool.hxx>
+//#include <BOPTools_ListIteratorOfListOfInterference.hxx>
+//#include <BOPTools_CArray1OfInterferenceLine.hxx>
+//#include <BOPTools_InterferenceLine.hxx>
+//#include <BOPTools_ListOfInterference.hxx>
+//#include <BOPTools_Interference.hxx>
+
 #include <BOPTools_SSInterference.hxx>
 #include <BOPTools_ListOfPaveBlock.hxx>
 #include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
 #include <BOPTools_PaveBlockIterator.hxx>
 #include <BOPTools_Tools2D.hxx>
 
+#include <NMTDS_Iterator.hxx>
 #include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_InterfPool.hxx>
+
+#include <NMTTools_Tools.hxx>
 #include <NMTTools_IndexedDataMapOfShapePaveBlock.hxx>
 #include <NMTTools_CommonBlockAPI.hxx>
-#include <Geom2d_Curve.hxx>
-#include <NMTTools_Tools.hxx>
-#include <BRepLib.hxx>
-#include <Geom2d_TrimmedCurve.hxx>
-//
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TColStd_ListOfInteger.hxx>
-////
 #include <NMTTools_DataMapOfIntegerListOfPaveBlock.hxx>
 #include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
+
 #include <NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock.hxx>
-#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
-#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
-#include <TColStd_ListOfInteger.hxx>
-#include <TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <NMTTools_MapOfPaveBlock.hxx>
-//
-#include <IntTools_ShrunkRange.hxx>
-
-static 
-  Standard_Boolean IsPairFound(const Standard_Integer nF1,
-                              const Standard_Integer nF2,
-                              BOPTools_InterferencePool* myIntrPool,
-                              BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
-                              BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith);
-
-static
-  void FMapWhat(const Standard_Integer nF,
-               BOPTools_InterferencePool* myIntrPool,
-               TColStd_IndexedMapOfInteger& aMapWhat);
-static
-  void FMapWith(const Standard_Integer nF,
-               BOPTools_InterferencePool* myIntrPool,
-               TColStd_IndexedMapOfInteger& aMapWith);
-static
-  Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
-                          const TColStd_IndexedMapOfInteger& aMapWith);
 
 // Modified  Thu Sep 14 14:35:18 2006 
 // Contribution of Samtech www.samcef.com BEGIN
@@ -137,9 +113,11 @@ static
                    TopTools_ListOfShape& aLS);
 // Contribution of Samtech www.samcef.com END
 
+//modified by NIZNHY-PKV Mon Dec  4 12:56:04 2006f
 static
   Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, 
                               IntTools_Context& aCtx);
+//modified by NIZNHY-PKV Mon Dec  4 12:56:08 2006t
 
 //=======================================================================
 // function: PerformFF
@@ -149,7 +127,7 @@ static
 {
   myIsDone=Standard_False;
   //
-  Standard_Boolean bIsFound, bJustAdd, bIsComputed;
+  Standard_Boolean bJustAdd;//, bIsComputed, bIsFound;
   Standard_Integer n1, n2, anIndexIn, nF1, nF2, aBlockLength, aNbFFs;
   Standard_Boolean bToApproxC3d, bToApproxC2dOnS1, bToApproxC2dOnS2, bIsDone;
   Standard_Integer aNbCurves, aNbPoints;
@@ -159,25 +137,25 @@ static
   IntTools_SequenceOfCurves aCvs;
   BooleanOperations_KindOfInterference aTypeFF=BooleanOperations_SurfaceSurface;
   //
-  BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
   //
   //  F/F Interferences  [BooleanOperations_SurfaceSurface]
-  myDSIt.Initialize(TopAbs_FACE, TopAbs_FACE);
+  myDSIt->Initialize(TopAbs_FACE, TopAbs_FACE);
   //
   // BlockLength correction
-  aNbFFs=ExpectedPoolLength();
+  aNbFFs=myDSIt->BlockLength();
   aBlockLength=aFFs.BlockLength();
   if (aNbFFs > aBlockLength) {
     aFFs.SetBlockLength(aNbFFs);
   }
   //
-  for (; myDSIt.More(); myDSIt.Next()) {
-    myDSIt.Current(n1, n2, bJustAdd);
+  for (; myDSIt->More(); myDSIt->Next()) {
+    myDSIt->Current(n1, n2, bJustAdd);
     //
-    bIsComputed=myIntrPool->IsComputed(n1, n2);
-    if (bIsComputed) {
-      continue;
-    }
+    //bIsComputed=myIntrPool->IsComputed(n1, n2);
+    //if (bIsComputed) {
+    //  continue;
+    //}
     //
     nF1 = n2;
     nF2 = n1;
@@ -189,8 +167,8 @@ static
     aPnts.Clear();
     aCvs.Clear();
     //
+    /*
     bIsFound=IsPairFound(nF1, nF2, myIntrPool, aMapWhat, aMapWith);
-    //
     if (bJustAdd) {
       if (!bIsFound) {
        myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
@@ -202,6 +180,7 @@ static
       }
       continue;
     }
+    */
     //
     const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));//mpv
     const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));//mpv
@@ -222,7 +201,9 @@ static
     //
     bIsDone=aFF.IsDone();
     //
+
     if (!bIsDone) {
+      /*
       if (!bIsFound) {
        myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
       }
@@ -231,6 +212,7 @@ static
        anIndexIn=aFFs.Append(anInterf);
        myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
       }
+      */
       continue;
     }
     //
@@ -251,14 +233,14 @@ static
     if (!aNbCurves && !aNbPoints) {
       BOPTools_SSInterference anInterf (nF1, nF2, 1.e-07, 1.e-07, aCvs, aPnts);
       anIndexIn=aFFs.Append(anInterf);
-      myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
+      //myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
       continue;
     }
     //
     {
       BOPTools_SSInterference anInterf (nF1, nF2, aTolR3D, aTolR2D, aCvsX, aPntsX);
       anIndexIn=aFFs.Append(anInterf);
-      myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
+      //myIntrPool->AddInterference (nF1, nF2, aTypeFF, anIndexIn);
     }
     //
   }// for (; myDSIt.More(); myDSIt.Next()) 
@@ -278,7 +260,7 @@ static
   Standard_Boolean bIsExistingPaveBlock, bIsValidIn2D, bIsCoincided;
   // Contribution of Samtech www.samcef.com END
   //
-  Standard_Boolean bIsMicroEdge;
+  Standard_Boolean bIsMicroEdge, bHasES;
   Standard_Integer i, aNbFFs, nF1, nF2, aBid=0;
   Standard_Integer nV1, nV2, j, aNbCurves;
   Standard_Real aTolR3D, aTol2D, aT1, aT2, aTolPPC=Precision::PConfusion();
@@ -286,7 +268,7 @@ static
   BooleanOperations_IndexedDataMapOfShapeInteger aMapEI;
   BOPTools_ListIteratorOfListOfPaveBlock anIt;  
   //
-  BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
   //
   aNbFFs=aFFs.Extent();
   //
@@ -375,11 +357,9 @@ static
   //
   // 1. Produce Section Edges from intersection curves
   //    between each pair of faces
-  //
   aNbFFs=aFFs.Extent();
   //
   for (i=1; i<=aNbFFs; ++i) {
-    
     BOPTools_SSInterference& aFFi=aFFs(i);
     // 
     // Faces
@@ -456,6 +436,7 @@ static
     }
     //
     //  Pave Blocks on Curves
+    bHasES=Standard_False;
     for (j=1; j<=aNbCurves; ++j) {
       BOPTools_Curve& aBC=aSCvs(j);
       const IntTools_Curve& aIC= aBC.Curve();
@@ -472,13 +453,12 @@ static
        nV2=aPBNew.Pave2().Index();
        aT1=aPBNew.Pave1().Param();
        aT2=aPBNew.Pave2().Param();
-       // ???
+       // 
        if((nV1==nV2) && (Abs(aT2 - aT1) < aTolPPC)) {
-         continue;// mkk ft
+         continue;// mkk ft ???
        }
        //
        // 1
-       
        bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLPB, aTolR3D);
        if (bIsExistingPaveBlock) {
          continue;
@@ -517,17 +497,13 @@ static
        //
        BOPTools_Tools::MakeSectEdge (aIC, aV1, aT1, aV2, aT2, aES);
        //
-       // use_01 f
-       //
        NMTTools_Tools::UpdateEdge (aES, aTolR3D);
        bIsMicroEdge=IsMicroEdge(aES, myContext);
        if (bIsMicroEdge) {
          continue;
        }
        //
-       //use_01 t
-       //
-       // SKL/PartC5 f
+       
        {
          Handle(Geom2d_Curve) aC2D1, aC2D2;
          //
@@ -536,14 +512,19 @@ static
          //
          NMTTools_Tools::MakePCurve(aES, aF1, aC2D1);
          NMTTools_Tools::MakePCurve(aES, aF2, aC2D2);
-         //SKL/PartC5 t 
        }
        //
        aMEPB.Add(aES, aPBNew);
        aMapEI.Add(aES, i);
-      }
-      
+       //
+       bHasES=Standard_True;
+      }// for (; aPBIter.More(); aPBIter.Next())
     } // end of for (j=1; j<=aNbCurves; ++j)
+    // qqf
+    if (bHasES) {
+      myIP->Add(nF1, nF2, Standard_True, NMTDS_TI_FF);
+    }
+    // qqt
   }// for (i=1; i<=aNbFFs; ++i)
   //=============================================================
   //
@@ -572,18 +553,14 @@ static
   //
   //
   // 2. Intersect SE using auxiliary Filler
-  NMTDS_ShapesDataStructure tDS;
-  //
-  tDS.SetCompositeShape(aCompound);
-  tDS.Init();
+  NMTTools_PaveFiller tPF;
   //
-  BOPTools_InterferencePool tIP(tDS);
-  NMTTools_PaveFiller tPF(tIP);
+  tPF.SetCompositeShape(aCompound);
   //
   // 2.1.VV
   tPF.Init();
   tPF.PerformVV();
-  tPF.PerformNewVertices();
+  //tPF.PerformNewVertices(); qq
   //
   // 2.2.VE
   tPF.myPavePool.Resize (tPF.myNbEdges);
@@ -617,6 +594,7 @@ static
   BOPTools_ListIteratorOfListOfPaveBlock aIt;
   BOPTColStd_IndexedDataMapOfIntegerInteger aMNewOld;
   //
+  const NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
   const BOPTools_SplitShapesPool& aSSP=tPF.mySplitShapesPool;
   const NMTTools_CommonBlockPool& aCBP=tPF.myCommonBlockPool;
   //
@@ -743,11 +721,9 @@ static
        aF2FWD=aF2;
        aF2FWD.Orientation(TopAbs_FORWARD);
        //
-       // SKL/PartC5 f
        NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1);
        NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2);
        NMTTools_Tools::UpdateEdge (aEx, aTolEx);
-       //SKL/PartC5 t
       } //if (aCBAPI.IsCommonBlock(aPB))
       //
       // new SE
@@ -816,13 +792,13 @@ static
 {
   Standard_Integer i, aNb,  nF1, nF2, nE;
   Standard_Integer aNbCB, aNbF, nSp, nF;
+  TopAbs_ShapeEnum aType;
   TopoDS_Face aF1FWD, aF2FWD;
   TColStd_ListIteratorOfListOfInteger aItF;
   BOPTools_ListIteratorOfListOfPaveBlock anIt;
   NMTTools_ListIteratorOfListOfCommonBlock aItCB;
-  TopAbs_ShapeEnum aType;
   //
-  BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
   //
   aNb=aFFs.Extent();
   for (i=1; i<=aNb; i++) {
@@ -849,7 +825,7 @@ static
       BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF1FWD);
       BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF2FWD);
     }
-  }
+  } 
   //
   //modified by NIZNHY-PKV Fri Mar 23 10:35:02 2007f
   // Check common blocks between edges and faces
@@ -1212,122 +1188,8 @@ static
   }
 }
 /////////////
-//=======================================================================
-// function: IsPairFound
-// purpose: 
-//=======================================================================
-Standard_Boolean IsPairFound(const Standard_Integer nF1,
-                            const Standard_Integer nF2,
-                            BOPTools_InterferencePool* myIntrPool,
-                            BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
-                            BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith)
-{
-  Standard_Boolean bIsFound;
-  //
-  if (!aMapWhat.Contains(nF1)) {
-    TColStd_IndexedMapOfInteger aMWhat;
-    FMapWhat(nF1, myIntrPool, aMWhat);
-    aMapWhat.Add(nF1, aMWhat);
-  }
-  //
-  if (!aMapWith.Contains(nF2)) {
-    TColStd_IndexedMapOfInteger aMWith;
-    FMapWith(nF2, myIntrPool, aMWith);
-    aMapWith.Add(nF2, aMWith);
-  }
-  //
-  const TColStd_IndexedMapOfInteger& aMWht=aMapWhat.FindFromKey(nF1);
-  const TColStd_IndexedMapOfInteger& aMWit=aMapWith.FindFromKey(nF2);
-  //
-  bIsFound=IsFound(aMWht, aMWit);
-  //
-  return bIsFound;
-}
-//=======================================================================
-// function: FMapWhat
-// purpose: 
-//=======================================================================
-void FMapWhat(const Standard_Integer nF,
-             BOPTools_InterferencePool* myIntrPool,
-             TColStd_IndexedMapOfInteger& aMapWhat)
-                   
-{
-  Standard_Integer nE, nV;
-  
 
-  BooleanOperations_ShapesDataStructure* myDS=myIntrPool->DS();
-  BooleanOperations_OnceExplorer aExp(*myDS);
-  //
-  //  What
-  aMapWhat.Add(nF);
-  aExp.Init(nF, TopAbs_VERTEX);
-  for (; aExp.More(); aExp.Next()) {
-    nV=aExp.Current();
-    aMapWhat.Add(nV);
-  }
-  //
-  aExp.Init(nF, TopAbs_EDGE);
-  for (; aExp.More(); aExp.Next()) {
-    nE=aExp.Current();
-    aMapWhat.Add(nE);
-  }
-}
-//=======================================================================
-// function: FMapWith
-// purpose: 
-//=======================================================================
-void FMapWith(const Standard_Integer nF,
-             BOPTools_InterferencePool* myIntrPool,
-             TColStd_IndexedMapOfInteger& aMapWith)
-{
-  TColStd_IndexedMapOfInteger aMapWhat;
-  
-  FMapWhat(nF, myIntrPool, aMapWhat);
-  //
-  // With
-  Standard_Integer i, aNb, anIndex, aWhat, aWith;
-  BOPTools_ListIteratorOfListOfInterference anIt;
-  
-  const BOPTools_CArray1OfInterferenceLine& anArrIL= myIntrPool->InterferenceTable();
 
-  aNb=aMapWhat.Extent();
-  for (i=1; i<=aNb; i++) {
-    aWhat=aMapWhat(i);
-    
-    const BOPTools_InterferenceLine& aWithLine=anArrIL(aWhat);
-  
-    const BOPTools_ListOfInterference& aLI=aWithLine.List();
-    anIt.Initialize(aLI);
-    for (; anIt.More(); anIt.Next()) {
-      const BOPTools_Interference& anIntf=anIt.Value();
-      anIndex=anIntf.Index();
-      if (anIndex) {
-       aWith=anIntf.With();
-       aMapWith.Add(aWith);
-      }
-    }
-  }
-}
-//=======================================================================
-// function: IsFound
-// purpose: 
-//=======================================================================
-Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
-                        const TColStd_IndexedMapOfInteger& aMapWith)
-{
-  Standard_Boolean bFlag=Standard_False;
-  Standard_Integer i, aNb, aWhat;
-
-  aNb=aMapWhat.Extent();
-  for (i=1; i<=aNb; i++) {
-    aWhat=aMapWhat(i);
-    if (aMapWith.Contains(aWhat)) {
-      return !bFlag;
-    }
-  }
-  return bFlag;
-}
 // Modified  Thu Sep 14 14:35:18 2006 
 // Contribution of Samtech www.samcef.com BEGIN
 //=======================================================================
@@ -1476,7 +1338,7 @@ void SharedEdges1(const TopoDS_Face& aF1,
 //
 // Contribution of Samtech www.samcef.com END
 
-// use_01 f
+//modified by NIZNHY-PKV Mon Dec  4 12:30:38 2006f use_01
 //=======================================================================
 //function : IsMicroEdge
 //purpose  : 
@@ -1515,4 +1377,139 @@ Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
   //
   return bRet;
 }
-// use_01 t
+//modified by NIZNHY-PKV Mon Dec  4 12:55:50 2006t
+/*
+static 
+  Standard_Boolean IsPairFound(const Standard_Integer nF1,
+                              const Standard_Integer nF2,
+                              BOPTools_InterferencePool* myIntrPool,
+                              BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
+                              BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith);
+
+static
+  void FMapWhat(const Standard_Integer nF,
+               BOPTools_InterferencePool* myIntrPool,
+               TColStd_IndexedMapOfInteger& aMapWhat);
+static
+  void FMapWith(const Standard_Integer nF,
+               BOPTools_InterferencePool* myIntrPool,
+               TColStd_IndexedMapOfInteger& aMapWith);
+static
+  Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
+                          const TColStd_IndexedMapOfInteger& aMapWith);
+
+//=======================================================================
+// function: IsPairFound
+// purpose: 
+//=======================================================================
+Standard_Boolean IsPairFound(const Standard_Integer nF1,
+                            const Standard_Integer nF2,
+                            BOPTools_InterferencePool* myIntrPool,
+                            BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWhat,
+                            BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger& aMapWith)
+{
+  Standard_Boolean bIsFound;
+  //
+  if (!aMapWhat.Contains(nF1)) {
+    TColStd_IndexedMapOfInteger aMWhat;
+    FMapWhat(nF1, myIntrPool, aMWhat);
+    aMapWhat.Add(nF1, aMWhat);
+  }
+  //
+  if (!aMapWith.Contains(nF2)) {
+    TColStd_IndexedMapOfInteger aMWith;
+    FMapWith(nF2, myIntrPool, aMWith);
+    aMapWith.Add(nF2, aMWith);
+  }
+  //
+  const TColStd_IndexedMapOfInteger& aMWht=aMapWhat.FindFromKey(nF1);
+  const TColStd_IndexedMapOfInteger& aMWit=aMapWith.FindFromKey(nF2);
+  //
+  bIsFound=IsFound(aMWht, aMWit);
+  //
+  return bIsFound;
+}
+//=======================================================================
+// function: FMapWhat
+// purpose: 
+//=======================================================================
+void FMapWhat(const Standard_Integer nF,
+             BOPTools_InterferencePool* myIntrPool,
+             TColStd_IndexedMapOfInteger& aMapWhat)
+                   
+{
+  Standard_Integer nE, nV;
+  //
+  BooleanOperations_ShapesDataStructure* myDS=myIntrPool->DS();
+  BooleanOperations_OnceExplorer aExp(*myDS);
+  //
+  //  What
+  aMapWhat.Add(nF);
+  aExp.Init(nF, TopAbs_VERTEX);
+  for (; aExp.More(); aExp.Next()) {
+    nV=aExp.Current();
+    aMapWhat.Add(nV);
+  }
+  //
+  aExp.Init(nF, TopAbs_EDGE);
+  for (; aExp.More(); aExp.Next()) {
+    nE=aExp.Current();
+    aMapWhat.Add(nE);
+  }
+}
+//=======================================================================
+// function: FMapWith
+// purpose: 
+//=======================================================================
+void FMapWith(const Standard_Integer nF,
+             BOPTools_InterferencePool* myIntrPool,
+             TColStd_IndexedMapOfInteger& aMapWith)
+{
+  TColStd_IndexedMapOfInteger aMapWhat;
+  
+  FMapWhat(nF, myIntrPool, aMapWhat);
+  //
+  // With
+  Standard_Integer i, aNb, anIndex, aWhat, aWith;
+  BOPTools_ListIteratorOfListOfInterference anIt;
+  
+  const BOPTools_CArray1OfInterferenceLine& anArrIL= myIntrPool->InterferenceTable();
+
+  aNb=aMapWhat.Extent();
+  for (i=1; i<=aNb; i++) {
+    aWhat=aMapWhat(i);
+    
+    const BOPTools_InterferenceLine& aWithLine=anArrIL(aWhat);
+  
+    const BOPTools_ListOfInterference& aLI=aWithLine.List();
+    anIt.Initialize(aLI);
+    for (; anIt.More(); anIt.Next()) {
+      const BOPTools_Interference& anIntf=anIt.Value();
+      anIndex=anIntf.Index();
+      if (anIndex) {
+       aWith=anIntf.With();
+       aMapWith.Add(aWith);
+      }
+    }
+  }
+}
+//=======================================================================
+// function: IsFound
+// purpose: 
+//=======================================================================
+Standard_Boolean IsFound(const TColStd_IndexedMapOfInteger& aMapWhat,
+                        const TColStd_IndexedMapOfInteger& aMapWith)
+{
+  Standard_Boolean bFlag=Standard_False;
+  Standard_Integer i, aNb, aWhat;
+
+  aNb=aMapWhat.Extent();
+  for (i=1; i<=aNb; i++) {
+    aWhat=aMapWhat(i);
+    if (aMapWith.Contains(aWhat)) {
+      return !bFlag;
+    }
+  }
+  return bFlag;
+}
+*/
index 30b69f3f02f5c69724f686f7048697776e7d7133..ef23a7e29b74b506cb1f636e75789390bf98ea37 100644 (file)
 
 #include <NMTTools_PaveFiller.ixx>
 
+#include <Bnd_HArray1OfBox.hxx>
+#include <Bnd_BoundSortBox.hxx>
+#include <Bnd_Box.hxx>
+#include <BRepBndLib.hxx>
+
+#include <TColStd_MapOfInteger.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <TopTools_DataMapOfShapeListOfInteger.hxx>
+#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
+
+#include <TopAbs_Orientation.hxx>
+
 #include <TopoDS_Vertex.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Compound.hxx>
 
-#include <NMTDS_ShapesDataStructure.hxx>
-#include <TopAbs_Orientation.hxx>
-#include <BOPTools_ListOfPaveBlock.hxx>
-#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
-#include <BOPTools_PaveBlock.hxx>
-#include <BOPTools_Pave.hxx>
-#include <BOPTools_Tools.hxx>
-#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfIntegerShape.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeInteger.hxx>
+#include <TopTools_DataMapOfShapeInteger.hxx>
+#include <TopTools_DataMapOfShapeShape.hxx>
+#include <TopTools_DataMapOfShapeListOfInteger.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfInteger.hxx>
+#include <TopTools_DataMapOfIntegerShape.hxx>
+
+#include <BRep_Builder.hxx>
 #include <BRep_Tool.hxx>
-#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
-#include <BOPTools_SSInterference.hxx>
-#include <BOPTools_CArray1OfSSInterference.hxx>
+
 #include <TopExp_Explorer.hxx>
-#include <TopoDS_Shape.hxx>
 #include <TopExp.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-
 //
 #include <IntTools_SequenceOfPntOn2Faces.hxx>
 #include <IntTools_PntOnFace.hxx>
 #include <IntTools_PntOn2Faces.hxx>
-#include <BOPTools_Tools.hxx>
-#include <TopTools_DataMapOfShapeListOfInteger.hxx>
-#include <TColStd_ListOfInteger.hxx>
-#include <TopoDS_Compound.hxx>
-#include <BRep_Builder.hxx>
+
+#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+
+#include <BOPTools_SSInterference.hxx>
+#include <BOPTools_CArray1OfSSInterference.hxx>
 #include <BOPTools_CArray1OfVVInterference.hxx>
 #include <BOPTools_VVInterference.hxx>
-#include <TopTools_DataMapOfShapeShape.hxx>
-#include <TopTools_DataMapOfShapeListOfInteger.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfInteger.hxx>
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <TopTools_DataMapOfIntegerShape.hxx>
-#include <Bnd_HArray1OfBox.hxx>
-#include <Bnd_BoundSortBox.hxx>
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfIntegerShape.hxx>
-#include <TopTools_DataMapOfShapeInteger.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeInteger.hxx>
-#include <TopTools_DataMapOfShapeInteger.hxx>
-#include <BooleanOperations_AncestorsSeqAndSuccessorsSeq.hxx>
+#include <BOPTools_Tools.hxx>
+#include <BOPTools_ListOfPaveBlock.hxx>
+#include <BOPTools_ListIteratorOfListOfPaveBlock.hxx>
+#include <BOPTools_PaveBlock.hxx>
+#include <BOPTools_Pave.hxx>
+#include <BOPTools_Tools.hxx>
 
+#include <NMTDS_Iterator.hxx>
+#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_InterfPool.hxx>
+
+#include <NMTTools_ListIteratorOfListOfCommonBlock.hxx>
 // Modified  Thu Sep 14 14:35:18 2006 
 // Contribution of Samtech www.samcef.com BEGIN
 static 
@@ -286,7 +293,7 @@ static
   BOPTools_Pave aPave1, aPave2;
   BOPTools_PaveBlock aPB;
   //
-  BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
   //
   aNbFFs=aFFs.Extent();
   for (i=1; i<=aNbFFs; ++i) {
@@ -371,7 +378,7 @@ static
   //
   myAloneVertices.Clear();
   //
-  BOPTools_CArray1OfSSInterference& aFFs=myIntrPool->SSInterferences();
+  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
   //
   // 1. Collect alone vertices from FFs
   aNbV=0;
@@ -545,6 +552,50 @@ static
       }
     }
   }
+  // qqf
+  {
+    Standard_Integer aNbF, aNbAV, nF, k;
+    NMTTools_IndexedDataMapOfIndexedMapOfInteger aMAVF;
+    //
+    aNbF=myAloneVertices.Extent();
+    if (aNbF<2) {
+      return;
+    }
+    //
+    // 1. fill map Alone Vertex/Face ->  aMAVF
+    for (i=1; i<=aNbF; ++i) {
+      nF=myAloneVertices.FindKey(i);
+      const TColStd_IndexedMapOfInteger& aMAV=myAloneVertices(i);
+      aNbAV=aMAV.Extent();
+      for(j=1; j<=aNbAV; ++j) {
+       nV=aMAV(j);
+       if (aMAVF.Contains(nV)) {
+         TColStd_IndexedMapOfInteger& aMF=aMAVF.ChangeFromKey(nV);
+         aMF.Add(nF);
+       }
+       else{
+         TColStd_IndexedMapOfInteger aMF;
+         aMF.Add(nF);
+         aMAVF.Add(nV, aMF);
+       }
+      }
+    }
+    //
+    // 2 Obtain pairs of faces
+    aNbAV=aMAVF.Extent();
+    for (i=1; i<=aNbAV; ++i) {
+      const TColStd_IndexedMapOfInteger& aMF=aMAVF(i);
+      aNbF=aMF.Extent();
+      for(j=1; j<aNbF; ++j) {
+       nF1=aMF(j);
+       for(k=j+1; k<=aNbF; ++k) {
+         nF2=aMF(k);
+         myIP->Add(nF1, nF2, Standard_True, NMTDS_TI_FF);
+       }
+      }
+    }
+  }
+  // qqt
 }
 //=======================================================================
 // function: AloneVertices
@@ -558,24 +609,22 @@ static
 // function: FuseVertices
 // purpose: 
 //=======================================================================
-void FuseVertices(const TopoDS_Shape& aCompound,
-                 TopTools_DataMapOfShapeShape& aDMVV)
+  void NMTTools_PaveFiller::FuseVertices(const TopoDS_Shape& aCompound,
+                                        TopTools_DataMapOfShapeShape& aDMVV)const
 {
   Standard_Integer i, aNbVV, n1, n2, nX;
-  NMTDS_ShapesDataStructure tDS;
-  //
-  tDS.SetCompositeShape(aCompound);
-  tDS.Init();
+  NMTTools_PaveFiller tPF;
   //
-  BOPTools_InterferencePool tInterfPool(tDS);
-  NMTTools_PaveFiller tPaveFiller(tInterfPool);
+  tPF.SetCompositeShape(aCompound);
   //
-  tPaveFiller.Init();
+  tPF.Init();
   //
-  tPaveFiller.PerformVV();
-  tPaveFiller.PerformNewVertices();
+  tPF.PerformVV();
+  //tPF.PerformNewVertices(); //qq
   //
-  const BOPTools_CArray1OfVVInterference& aVVt=tInterfPool.VVInterfs();
+  NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
+  NMTDS_InterfPool& tInterfPool=*(tPF.IP()); 
+  BOPTools_CArray1OfVVInterference& aVVt=tInterfPool.VVInterferences();
   //
   aNbVV=aVVt.Extent();
   for (i=1; i<=aNbVV; ++i) {