]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
OCCT dev version porting (6.7.2)
authorvsr <vsr@opencascade.com>
Mon, 9 Jun 2014 08:56:21 +0000 (12:56 +0400)
committervsr <vsr@opencascade.com>
Mon, 9 Jun 2014 08:56:21 +0000 (12:56 +0400)
22 files changed:
src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx
src/GEOMAlgo/GEOMAlgo_AlgoTools.hxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx
src/GEOMAlgo/GEOMAlgo_Gluer.cxx
src/GEOMAlgo/GEOMAlgo_GluerAlgo.cxx
src/GEOMAlgo/GEOMAlgo_GluerAlgo.hxx
src/GEOMAlgo/GEOMAlgo_RemoverWebs.cxx
src/GEOMAlgo/GEOMAlgo_ShapeAlgo.cxx
src/GEOMAlgo/GEOMAlgo_ShapeAlgo.hxx
src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx
src/GEOMAlgo/GEOMAlgo_VertexSolid.cxx
src/GEOMAlgo/GEOMAlgo_WireSolid.cxx
src/GEOMGUI/GEOM_Displayer.cxx
src/OCC2VTK/GEOM_EdgeSource.cxx
src/OCC2VTK/GEOM_EdgeSource.h
src/OCC2VTK/GEOM_FaceSource.cxx
src/OCC2VTK/GEOM_FaceSource.h
src/OCC2VTK/GEOM_ShadingFace.cxx
src/OCC2VTK/GEOM_VertexSource.cxx
src/OCC2VTK/GEOM_VertexSource.h
src/OCC2VTK/GEOM_WireframeFace.cxx
src/OCC2VTK/OCC2VTK_internal.h [new file with mode: 0644]

index 3b550941dcff4080dd8972fe9e99f8c3afa804a0..5adf8979d16469e38b668a639c73267c527e6851 100755 (executable)
@@ -25,6 +25,8 @@
 
 #include <GEOMAlgo_AlgoTools.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <gp_Pnt.hxx>
 #include <gp_Pnt2d.hxx>
 #include <gp_Dir2d.hxx>
@@ -195,7 +197,12 @@ Standard_Integer GEOMAlgo_AlgoTools::BuildPCurveForEdgeOnFace
   (const TopoDS_Edge& aEold,
    const TopoDS_Edge& aEnew,
    const TopoDS_Face& aF,
-   const Handle(BOPInt_Context)& aCtx)
+#if OCC_VERSION_LARGE > 0x06070100
+   const Handle(IntTools_Context)& aCtx
+#else
+   const Handle(BOPInt_Context)& aCtx
+#endif
+   )
 {
   Standard_Boolean bIsClosed, bUClosed, bHasOld;
   Standard_Integer iRet, aNbPoints;
@@ -426,7 +433,12 @@ void GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE,
 Standard_Boolean GEOMAlgo_AlgoTools::IsSplitToReverse
   (const TopoDS_Edge& aEF1,
    const TopoDS_Edge& aEF2,
-   const Handle(BOPInt_Context)& aContext)
+#if OCC_VERSION_LARGE > 0x06070100
+   const Handle(IntTools_Context)& aContext
+#else
+   const Handle(BOPInt_Context)& aContext
+#endif
+   )
 {
   Standard_Boolean aFlag;
   Standard_Real aT1, aT2, aScPr, a, b;
@@ -471,7 +483,12 @@ Standard_Boolean GEOMAlgo_AlgoTools::ProjectPointOnShape
   (const gp_Pnt& aP1,
    const TopoDS_Shape& aS,
    gp_Pnt& aP2,
-   const Handle(BOPInt_Context)& aCtx)
+#if OCC_VERSION_LARGE > 0x06070100
+   const Handle(IntTools_Context)& aCtx
+#else
+   const Handle(BOPInt_Context)& aCtx
+#endif
+   )
 {
   Standard_Boolean bIsDone = Standard_False;
   Standard_Real aT2;
@@ -618,7 +635,12 @@ Standard_Integer GEOMAlgo_AlgoTools::FindSDShapes
    const TopTools_ListOfShape& aLE,
    const Standard_Real aTol,
    TopTools_ListOfShape& aLESD,
-   const Handle(BOPInt_Context)& aCtx)
+#if OCC_VERSION_LARGE > 0x06070100
+   const Handle(IntTools_Context)& aCtx
+#else
+   const Handle(BOPInt_Context)& aCtx
+#endif
+   )
 {
   Standard_Boolean bIsDone;
   Standard_Real aTol2, aD2;
@@ -657,7 +679,12 @@ Standard_Integer GEOMAlgo_AlgoTools::FindSDShapes
   (const TopTools_ListOfShape& aLE,
    const Standard_Real aTol,
    TopTools_IndexedDataMapOfShapeListOfShape& aMEE,
-   const Handle(BOPInt_Context)& aCtx)
+#if OCC_VERSION_LARGE > 0x06070100
+   const Handle(IntTools_Context)& aCtx
+#else
+   const Handle(BOPInt_Context)& aCtx
+#endif
+   )
 {
   Standard_Integer aNbE, aNbEProcessed, aNbESD, iErr;
   TopTools_ListOfShape aLESD;
@@ -725,7 +752,12 @@ Standard_Integer GEOMAlgo_AlgoTools::FindSDShapes
 Standard_Integer GEOMAlgo_AlgoTools::RefineSDShapes
   (GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMPKLE,
    const Standard_Real aTol,
-   const Handle(BOPInt_Context)& aCtx)
+#if OCC_VERSION_LARGE > 0x06070100
+   const Handle(IntTools_Context)& aCtx
+#else
+   const Handle(BOPInt_Context)& aCtx
+#endif
+   )
 {
   Standard_Integer i, aNbE, iErr, j, aNbEE, aNbToAdd;
   TopTools_IndexedDataMapOfShapeListOfShape aMEE, aMSDE, aMEToAdd;
index 0ba458c4598cf2c9360d8140314199bae72f4c84..7fba7d88c7ca6963df33181ffb203ef3880c48b0 100755 (executable)
 #ifndef _GEOMAlgo_AlgoTools_HeaderFile
 #define _GEOMAlgo_AlgoTools_HeaderFile
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <Standard.hxx>
 #include <Standard_Macro.hxx>
 #include <Standard_Boolean.hxx>
+#if OCC_VERSION_LARGE > 0x06070100
+#include <Handle_IntTools_Context.hxx>
+#include <IntTools_Context.hxx>
+#else
 #include <Handle_BOPInt_Context.hxx>
+#include <BOPInt_Context.hxx>
+#endif
 #include <Standard_Integer.hxx>
 
 #include <gp_Pnt.hxx>
@@ -43,8 +51,6 @@
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Edge.hxx>
 
-#include <BOPInt_Context.hxx>
-
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 #include <TopTools_ListOfShape.hxx>
@@ -88,20 +94,34 @@ class GEOMAlgo_AlgoTools  {
     static  Standard_Integer RefineSDShapes
       (GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMSD,
        const Standard_Real aTol,
-       const Handle(BOPInt_Context)& aCtx) ;
+#if OCC_VERSION_LARGE > 0x06070100
+       const Handle(IntTools_Context)& aCtx
+#else
+       const Handle(BOPInt_Context)& aCtx
+#endif
+       ) ;
 
   Standard_EXPORT
     static  Standard_Integer FindSDShapes(const TopTools_ListOfShape& aLE,
                                          const Standard_Real aTol,
                                          TopTools_IndexedDataMapOfShapeListOfShape& aMEE,
-                                         const Handle(BOPInt_Context)& aCtx) ;
-
+#if OCC_VERSION_LARGE > 0x06070100
+                                         const Handle(IntTools_Context)& aCtx
+#else
+                                         const Handle(BOPInt_Context)& aCtx
+#endif
+                                         ) ;
   Standard_EXPORT
     static  Standard_Integer FindSDShapes(const TopoDS_Shape& aE1,
                                          const TopTools_ListOfShape& aLE,
                                          const Standard_Real aTol,
                                          TopTools_ListOfShape& aLESD,
-                                         const Handle(BOPInt_Context)& aCtx) ;
+#if OCC_VERSION_LARGE > 0x06070100
+                                         const Handle(IntTools_Context)& aCtx
+#else
+                                         const Handle(BOPInt_Context)& aCtx
+#endif
+                                         ) ;
 
   Standard_EXPORT
     static  void PointOnShape(const TopoDS_Shape& aS,
@@ -128,7 +148,12 @@ class GEOMAlgo_AlgoTools  {
     static  Standard_Boolean ProjectPointOnShape(const gp_Pnt& aP1,
                                                 const TopoDS_Shape& aS,
                                                 gp_Pnt& aP2,
-                                                const Handle(BOPInt_Context)& aCtx) ;
+#if OCC_VERSION_LARGE > 0x06070100
+                                                const Handle(IntTools_Context)& aCtx
+#else
+                                                const Handle(BOPInt_Context)& aCtx
+#endif
+                                                ) ;
 
   Standard_EXPORT
     static void CorrectTolerances(const TopoDS_Shape& aShape,
@@ -146,7 +171,12 @@ class GEOMAlgo_AlgoTools  {
   Standard_EXPORT
     static Standard_Boolean IsSplitToReverse1 (const TopoDS_Edge& aEF1,
                                               const TopoDS_Edge& aEF2,
-                                              const Handle(BOPInt_Context)& aContext);
+#if OCC_VERSION_LARGE > 0x06070100
+                                              const Handle(IntTools_Context)& aCtx
+#else
+                                              const Handle(BOPInt_Context)& aCtx
+#endif
+                                              ) ;
   Standard_EXPORT
     static void RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE,
                                          const TopoDS_Face& aF,
@@ -163,22 +193,42 @@ class GEOMAlgo_AlgoTools  {
   Standard_EXPORT
     static Standard_Boolean IsSplitToReverse(const TopoDS_Edge& theSplit,
                                             const TopoDS_Edge& theEdge,
-                                            const Handle(BOPInt_Context)& theContext);
+#if OCC_VERSION_LARGE > 0x06070100
+                                            const Handle(IntTools_Context)& theCtx
+#else
+                                            const Handle(BOPInt_Context)& theCtx
+#endif
+                                            ) ;
   
   Standard_EXPORT
     static Standard_Boolean IsSplitToReverse  (const TopoDS_Face& theFSp,
                                               const TopoDS_Face& theFSr,
-                                              const Handle(BOPInt_Context)& theContext);
+#if OCC_VERSION_LARGE > 0x06070100
+                                              const Handle(IntTools_Context)& theCtx
+#else
+                                              const Handle(BOPInt_Context)& theCtx
+#endif
+                                              ) ;
   
   Standard_EXPORT
     static Standard_Boolean IsSplitToReverse  (const TopoDS_Shape& theSp,
                                               const TopoDS_Shape& theSr,
-                                              const Handle(BOPInt_Context)& theCtx);
+#if OCC_VERSION_LARGE > 0x06070100
+                                              const Handle(IntTools_Context)& theCtx
+#else
+                                              const Handle(BOPInt_Context)& theCtx
+#endif
+                                              ) ;
   Standard_EXPORT
     static Standard_Integer BuildPCurveForEdgeOnFace  (const TopoDS_Edge& aEold,
                                                       const TopoDS_Edge& aEnew,
                                                       const TopoDS_Face& aF,
-                                                      const Handle(BOPInt_Context)& aCtx);
+#if OCC_VERSION_LARGE > 0x06070100
+                                                      const Handle(IntTools_Context)& aCtx
+#else
+                                                      const Handle(BOPInt_Context)& aCtx
+#endif
+                                                      ) ;
 
 //
   Standard_EXPORT
index 223fb7a978c3a43442be0a40999e299136bc5a3a..c255e35b7c0d915db5a0c4530d145ff0bac66121 100644 (file)
@@ -28,6 +28,7 @@
 #include <GEOMAlgo_FinderShapeOn2.hxx>
 #include <math.h>
 
+#include <Basics_OCCTVersion.hxx>
 
 #include <Precision.hxx>
 #include <TColStd_Array1OfInteger.hxx>
 #include <TColStd_ListIteratorOfListOfInteger.hxx>
 #include <HatchGen_Domain.hxx>
 #include <Geom2dHatch_Hatcher.hxx>
+#if OCC_VERSION_LARGE > 0x06070100
+#include <IntTools_Context.hxx>
+#else
 #include <BOPInt_Context.hxx>
+#endif
 #include <BRepTools.hxx>
 #include <IntTools_Tools.hxx>
 
index 11fe9e20f74d2b8926e07c4c5d49092c5164098c..7740b1e9bcddcefca8ee505f58600a1f774c54ef 100755 (executable)
@@ -27,6 +27,7 @@
 //
 #include <GEOMAlgo_Gluer.hxx>
 
+#include <Basics_OCCTVersion.hxx>
 
 #include <NCollection_UBTreeFiller.hxx>
 
 #include <BRepBndLib.hxx>
 //
 #include <IntTools_Tools.hxx>
+#if OCC_VERSION_LARGE > 0x06070100
+#include <IntTools_Context.hxx>
+#else
 #include <BOPInt_Context.hxx>
+#endif
 #include <BOPTools_AlgoTools.hxx>
 #include <BOPTools_AlgoTools3D.hxx>
 #include <BOPTools_AlgoTools2D.hxx>
index 259c3ed6c98db35c4213f1efd4566a862e0c8b87..257b9b6c9c5e000ae7b53eae135308a06072905d 100644 (file)
 //              <peter@PREFEX>
 //
 #include <GEOMAlgo_GluerAlgo.hxx>
+#if OCC_VERSION_LARGE > 0x06070100
+#include <IntTools_Context.hxx>
+#else
 #include <BOPInt_Context.hxx>
+#endif
 
 
 //=======================================================================
@@ -97,7 +101,11 @@ Standard_Boolean GEOMAlgo_GluerAlgo::CheckGeometry() const
 //function : SetContext
 //purpose  :
 //=======================================================================
+#if OCC_VERSION_LARGE > 0x06070100
+void GEOMAlgo_GluerAlgo::SetContext(const Handle(IntTools_Context)& theContext)
+#else
 void GEOMAlgo_GluerAlgo::SetContext(const Handle(BOPInt_Context)& theContext)
+#endif
 {
   myContext=theContext;
 }
@@ -105,7 +113,11 @@ void GEOMAlgo_GluerAlgo::SetContext(const Handle(BOPInt_Context)& theContext)
 //function : Context
 //purpose  :
 //=======================================================================
+#if OCC_VERSION_LARGE > 0x06070100
+const Handle(IntTools_Context)& GEOMAlgo_GluerAlgo::Context()
+#else
 const Handle(BOPInt_Context)& GEOMAlgo_GluerAlgo::Context()
+#endif
 {
   return myContext;
 }
@@ -141,6 +153,10 @@ void GEOMAlgo_GluerAlgo::Clear()
 void GEOMAlgo_GluerAlgo::Perform()
 {
   if (myContext.IsNull()) {
+#if OCC_VERSION_LARGE > 0x06070100
+    myContext=new IntTools_Context;
+#else
     myContext=new BOPInt_Context;
+#endif
   }
 }
index 0c7eb50c9bfd611b56ec09eaa6394a1a34bb48ed..a1258516bfa273fbbb881c7139a5b44857b4998b 100644 (file)
 #ifndef _GEOMAlgo_GluerAlgo_HeaderFile
 #define _GEOMAlgo_GluerAlgo_HeaderFile
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <Standard_Macro.hxx>
 #include <TopoDS_Shape.hxx>
 #include <Standard_Real.hxx>
 #include <Standard_Boolean.hxx>
 
+#if OCC_VERSION_LARGE > 0x06070100
+#include <IntTools_Context.hxx>
+#else
 #include <BOPInt_Context.hxx>
+#endif
 #include <TopTools_DataMapOfShapeListOfShape.hxx>
 #include <TopTools_DataMapOfShapeShape.hxx>
 
@@ -74,10 +80,18 @@ public:
     virtual  void Clear() ;
 
   Standard_EXPORT
+#if OCC_VERSION_LARGE > 0x06070100
+    void SetContext(const Handle(IntTools_Context)&) ;
+#else
     void SetContext(const Handle(BOPInt_Context)&) ;
+#endif
 
   Standard_EXPORT
+#if OCC_VERSION_LARGE > 0x06070100
+    const Handle(IntTools_Context)& Context() ;
+#else
     const Handle(BOPInt_Context)& Context() ;
+#endif
 
   Standard_EXPORT
     const TopTools_DataMapOfShapeListOfShape& Images() const;
@@ -89,7 +103,11 @@ protected:
   TopoDS_Shape myArgument;
   Standard_Real myTolerance;
   Standard_Boolean myCheckGeometry;
+#if OCC_VERSION_LARGE > 0x06070100
+  Handle(IntTools_Context) myContext;
+#else
   Handle(BOPInt_Context) myContext;
+#endif
   TopTools_DataMapOfShapeListOfShape myImages;
   TopTools_DataMapOfShapeShape myOrigins;
 
index 94f14ff859ba73c72c786209e6427c78d4fe54ce..744017a71d25306fe3b69726d4801c8cb0d7fd7f 100644 (file)
@@ -26,6 +26,8 @@
 #include <GEOMAlgo_RemoverWebs.hxx>
 #include <GEOMAlgo_ShapeAlgo.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <TopoDS_Iterator.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Solid.hxx>
 
 #include <BRepClass3d_SolidClassifier.hxx>
 
+#if OCC_VERSION_LARGE > 0x06070100
+#include <IntTools_Context.hxx>
+#else
 #include <BOPInt_Context.hxx>
+#endif
 
 #include <BOPAlgo_BuilderSolid.hxx>
 
@@ -102,7 +108,11 @@ void GEOMAlgo_RemoverWebs::Perform()
   if (!myContext.IsNull()) {
     myContext.Nullify();
   }
+#if OCC_VERSION_LARGE > 0x06070100
+  myContext=new IntTools_Context;
+#else
   myContext=new BOPInt_Context;
+#endif
   //
   BuildSolid();
   //
@@ -247,9 +257,11 @@ void GEOMAlgo_RemoverWebs::AddInternalShapes(const BOPCol_ListOfShape& aLSR,
   TopoDS_Solid aSd;
   BRep_Builder aBB;
   BOPCol_ListIteratorOfListOfShape aItLS;
-  Handle(BOPInt_Context) aCtx;
-  //
-  aCtx=new BOPInt_Context;
+#if OCC_VERSION_LARGE > 0x06070100
+  Handle(IntTools_Context) aCtx=new IntTools_Context;
+#else
+  Handle(BOPInt_Context) aCtx=new BOPInt_Context;
+#endif
   //
   aNbSI=aMSI.Extent();
   for (i=1; i<=aNbSI; ++i) {
index 13c0c464e8b44c5c992011d0cd566a85424a20d8..bc52f37bfcd3051f1e07c7c691bf15f393d0a175 100644 (file)
 //              <pkv@irinox>
 //
 #include <GEOMAlgo_ShapeAlgo.hxx>
+#if OCC_VERSION_LARGE > 0x06070100
+#include <IntTools_Context.hxx>
+#else
 #include <BOPInt_Context.hxx>
+#endif
 
 //=======================================================================
 //function : GEOMAlgo_ShapeAlgo
@@ -50,7 +54,11 @@ GEOMAlgo_ShapeAlgo::~GEOMAlgo_ShapeAlgo()
 //function : SetContext
 //purpose  :
 //=======================================================================
+#if OCC_VERSION_LARGE > 0x06070100
+void GEOMAlgo_ShapeAlgo::SetContext(const Handle(IntTools_Context)& theContext)
+#else
 void GEOMAlgo_ShapeAlgo::SetContext(const Handle(BOPInt_Context)& theContext)
+#endif
 {
   myContext=theContext;
 }
@@ -58,7 +66,11 @@ void GEOMAlgo_ShapeAlgo::SetContext(const Handle(BOPInt_Context)& theContext)
 //function : Context
 //purpose  :
 //=======================================================================
+#if OCC_VERSION_LARGE > 0x06070100
+const Handle(IntTools_Context)& GEOMAlgo_ShapeAlgo::Context()const
+#else
 const Handle(BOPInt_Context)& GEOMAlgo_ShapeAlgo::Context()const
+#endif
 {
   return myContext;
 }
@@ -109,6 +121,10 @@ const TopoDS_Shape& GEOMAlgo_ShapeAlgo::Result()const
 void GEOMAlgo_ShapeAlgo::Perform()
 {
   if (myContext.IsNull()) {
+#if OCC_VERSION_LARGE > 0x06070100
+    myContext=new IntTools_Context;
+#else
     myContext=new BOPInt_Context;
+#endif
   }
 }
index a8cef9a6344a77959dc89c5c2f7660ed87d03457..8144af710c2e22356f7638b0a6cb65b6233670af 100644 (file)
 #ifndef _GEOMAlgo_ShapeAlgo_HeaderFile
 #define _GEOMAlgo_ShapeAlgo_HeaderFile
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <Standard.hxx>
 #include <Standard_Macro.hxx>
 #include <TopoDS_Shape.hxx>
 #include <Standard_Real.hxx>
+#if OCC_VERSION_LARGE > 0x06070100
+#include <Handle_IntTools_Context.hxx>
+#else
 #include <Handle_BOPInt_Context.hxx>
+#endif
 #include <GEOMAlgo_Algo.hxx>
 
 //=======================================================================
@@ -45,11 +51,19 @@ class GEOMAlgo_ShapeAlgo  : public GEOMAlgo_Algo
 
   //! Sets cashed geometrical tools <br>
   Standard_EXPORT
+#if OCC_VERSION_LARGE > 0x06070100
+    void SetContext(const Handle(IntTools_Context)& theContext) ;
+#else
     void SetContext(const Handle(BOPInt_Context)& theContext) ;
+#endif
 
   //! Returns cashed geometrical tools <br>
   Standard_EXPORT
+#if OCC_VERSION_LARGE > 0x06070100
+    const Handle_IntTools_Context& Context() const;
+#else
     const Handle_BOPInt_Context& Context() const;
+#endif
 
   Standard_EXPORT
     void SetShape(const TopoDS_Shape& aS) ;
@@ -80,6 +94,10 @@ protected:
   TopoDS_Shape myShape;
   Standard_Real myTolerance;
   TopoDS_Shape myResult;
+#if OCC_VERSION_LARGE > 0x06070100
+  Handle_IntTools_Context myContext;
+#else
   Handle_BOPInt_Context myContext;
+#endif
 };
 #endif
index 454f70fdd3b5f35519da48e2b5e0638ebfc84286..47499114c95e0f96fbab454e4d7a354cf9289dd4 100644 (file)
@@ -27,6 +27,8 @@
 //
 #include <GEOMAlgo_ShellSolid.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <Standard_Failure.hxx>
 
 #include <gp_Pnt2d.hxx>
 
 #include <BOPCol_DataMapOfShapeListOfShape.hxx>
 #include <BOPCol_ListOfShape.hxx>
+#if OCC_VERSION_LARGE > 0x06070100
+#include <IntTools_Context.hxx>
+#else
 #include <BOPInt_Context.hxx>
+#endif
 #include <BOPDS_DS.hxx>
 #include <BOPAlgo_Builder.hxx>
 
@@ -231,7 +237,11 @@ void GEOMAlgo_ShellSolid::Perform()
       return;
     }
     //
+#if OCC_VERSION_LARGE > 0x06070100
+    Handle(IntTools_Context) aCtx=myDSFiller->Context();
+#else
     Handle(BOPInt_Context) aCtx=myDSFiller->Context();
+#endif
     const BOPDS_IndexRange& aRange=pDS->Range(iRank);
     aRange.Indices(iBeg, iEnd);
     const TopoDS_Solid& aSolid=(!iRank) ? *((TopoDS_Solid*)&aTool) : *((TopoDS_Solid*)&aObj);
index b7a6d925176377dd69a64cd2e4e0b9b7fed919ea..982e21921f602a39a10d68c1fa57ae6af7f5b6de 100644 (file)
@@ -27,6 +27,8 @@
 //
 #include <GEOMAlgo_VertexSolid.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <gp_Pnt.hxx>
 
 #include <TopAbs_ShapeEnum.hxx>
 #include <BRepClass3d_SolidClassifier.hxx>
 //
 #include <BOPCol_ListOfShape.hxx>
+#if OCC_VERSION_LARGE > 0x06070100
+#include <IntTools_Context.hxx>
+#else
 #include <BOPInt_Context.hxx>
+#endif
 //
 #include <BOPDS_DS.hxx>
 #include <BOPDS_IndexRange.hxx>
@@ -142,7 +148,11 @@ void GEOMAlgo_VertexSolid::BuildResult()
   const TopoDS_Shape& aTool=aLS.Last();
   const TopoDS_Solid& aSolid=(myRank==0) ? TopoDS::Solid(aTool) : TopoDS::Solid(aObj);
   //
+#if OCC_VERSION_LARGE > 0x06070100
+  Handle(IntTools_Context) aCtx=myDSFiller->Context();
+#else
   Handle(BOPInt_Context) aCtx=myDSFiller->Context();
+#endif
   BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid);
   //
   aNbRanges=aDS.NbRanges();
index 43de570dec68fc512971d8e8548a6c6bf0969260..958d4270f954a94d5dbfd347d9c200caed2e77e3 100644 (file)
@@ -27,6 +27,8 @@
 //
 #include <GEOMAlgo_WireSolid.hxx>
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <Standard_Failure.hxx>
 
 #include <TopAbs_ShapeEnum.hxx>
 #include <BOPDS_ListOfPaveBlock.hxx>
 #include <BOPDS_PaveBlock.hxx>
 #include <TopoDS_Solid.hxx>
+#if OCC_VERSION_LARGE > 0x06070100
+#include <IntTools_Context.hxx>
+#else
 #include <BOPInt_Context.hxx>
+#endif
 #include <BRepClass3d_SolidClassifier.hxx>
 #include <BRep_Tool.hxx>
 #include <BOPTools_AlgoTools.hxx>
@@ -144,7 +150,11 @@ void GEOMAlgo_WireSolid::BuildResult()
   const TopoDS_Solid& aSolid=(iRank==0) ?  *((TopoDS_Solid*)&aTool) :
     *((TopoDS_Solid*)&aObj);
   //
+#if OCC_VERSION_LARGE > 0x06070100
+  Handle(IntTools_Context) aCtx=myDSFiller->Context();
+#else
   Handle(BOPInt_Context) aCtx=myDSFiller->Context();
+#endif
   //BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid);
   //
   const BOPDS_IndexRange& aRange=pDS->Range(iRank);
index 0a10553e150f3268d612457dd33c14faa3bf806d..4cd41a6eb7edd04bc70b20ea242aa7a27f5c1c28 100644 (file)
@@ -172,16 +172,28 @@ namespace
       const uchar* aImageBytes = anImage.bits();
       
       for ( int aLine = anImage.height() - 1; aLine >= 0; --aLine ) {
-       Image_ColorBGRA* aPixmapBytes = aPixmap->EditData<Image_ColorBGRA>().ChangeRow(aLine);
-       
+#if OCC_VERSION_LARGE > 0x06070100
        // convert pixels from ARGB to renderer-compatible RGBA
        for ( int aByte = 0; aByte < anImage.width(); ++aByte ) {
+         Image_ColorBGRA& aPixmapBytes = aPixmap->ChangeValue<Image_ColorBGRA>(aLine, aByte);
+       
+         aPixmapBytes.b() = (Standard_Byte) *aImageBytes++;
+         aPixmapBytes.g() = (Standard_Byte) *aImageBytes++;
+         aPixmapBytes.r() = (Standard_Byte) *aImageBytes++;
+         aPixmapBytes.a() = (Standard_Byte) *aImageBytes++;
+       }
+#else
+       Image_ColorBGRA* aPixmapBytes = aPixmap->EditData<Image_ColorBGRA>().ChangeRow(aLine);
+       
+        // convert pixels from ARGB to renderer-compatible RGBA
+        for ( int aByte = 0; aByte < anImage.width(); ++aByte ) {
          aPixmapBytes->b() = (Standard_Byte) *aImageBytes++;
          aPixmapBytes->g() = (Standard_Byte) *aImageBytes++;
          aPixmapBytes->r() = (Standard_Byte) *aImageBytes++;
          aPixmapBytes->a() = (Standard_Byte) *aImageBytes++;
          aPixmapBytes++;
-       }
+        }
+#endif
       }
     }
     return aPixmap;
index 2ff7b91c7c4cf5f757f75673024076625c81c4cd..0a3a41a0d68dd7049a3cd39d25f4f904ea95fb84 100755 (executable)
@@ -18,6 +18,7 @@
 //
 
 #include "GEOM_EdgeSource.h" 
+#include "OCC2VTK_internal.h"
  
 #include <vtkObjectFactory.h> 
 
@@ -42,20 +43,32 @@ vtkStandardNewMacro(GEOM_EdgeSource);
 GEOM_EdgeSource::GEOM_EdgeSource() :
   myIsVector(false)
 { 
+  myData = new EdgeSourceInternal;
   this->SetNumberOfInputPorts(0);
 } 
  
 GEOM_EdgeSource::~GEOM_EdgeSource() 
-{ 
+{
+  delete myData;
 } 
 
 void GEOM_EdgeSource::AddEdge (const TopoDS_Edge& theEdge,
                                bool theIsVector)
 {
-  myEdgeSet.Add(theEdge);
+  myData->myEdgeSet.Add(theEdge);
   myIsVector = theIsVector;
 }
 
+void GEOM_EdgeSource::Clear()
+{
+  myData->myEdgeSet.Clear();
+}
+
+bool GEOM_EdgeSource::IsEmpty()
+{
+  return myData->myEdgeSet.IsEmpty();
+}
+
 int GEOM_EdgeSource::RequestData(vtkInformation *vtkNotUsed(request),
                                  vtkInformationVector **vtkNotUsed(inputVector),
                                  vtkInformationVector *outputVector)
@@ -69,7 +82,7 @@ int GEOM_EdgeSource::RequestData(vtkInformation *vtkNotUsed(request),
   aPolyData->SetPoints(aPts);
   aPts->Delete();
 
-  TEdgeSet::Iterator anIter (myEdgeSet);
+  TEdgeSet::Iterator anIter (myData->myEdgeSet);
   for (; anIter.More(); anIter.Next()) {
     TopoDS_Edge anEdge = anIter.Value();
     if ( !myIsVector )
index 5dd753c2135de70cc7960395012eaff176ba45b4..da64b0a5223111b692417666d218474da4ba0565 100755 (executable)
 #include "OCC2VTK.h" 
  
 #include <TopoDS_Edge.hxx> 
-#include <NCollection_Set.hxx> 
-typedef NCollection_Set<TopoDS_Edge> TEdgeSet; 
  
 #include <vtkPoints.h> 
 #include <vtkPolyDataAlgorithm.h> 
 
 class vtkPolyData;
+class EdgeSourceInternal;
 
 class OCC2VTK_EXPORT GEOM_EdgeSource: public vtkPolyDataAlgorithm 
 { 
 public: 
-  vtkTypeMacro(GEOM_EdgeSource,vtkPolyDataAlgorithm); 
+  vtkTypeMacro(GEOM_EdgeSource, vtkPolyDataAlgorithm); 
+
   static GEOM_EdgeSource* New(); 
  
   void AddEdge (const TopoDS_Edge& theEdge,
                 bool theIsVector = false);
-  void Clear(){ myEdgeSet.Clear();}
+  void Clear();
   
+  bool IsEmpty();
+
   void SetVectorMode(bool);
 
   bool GetVectorMode();
@@ -51,17 +52,14 @@ public:
                vtkPolyData* thePolyData, 
                vtkPoints* thePts,
                bool theIsVector = false); 
-
-  bool IsEmpty(){return myEdgeSet.IsEmpty();}
-
  
 protected: 
-  TEdgeSet myEdgeSet;
+  EdgeSourceInternal* myData;
   // The <myIsVector> flag is common for all edges, because the shape,
   // representing a vector, can have only one edge.
   bool myIsVector, myIsVectorMode;
  
-  virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+  virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
  
   GEOM_EdgeSource(); 
   ~GEOM_EdgeSource(); 
@@ -72,5 +70,4 @@ private:
   void operator=(const GEOM_EdgeSource&); 
 }; 
  
 #endif //GEOM_EDGESOURCE_H 
index 7067a728255018e05cf8cd4beb6fbe2a9461d87e..41c4bf54727ff05a441dbbcfd23bc281d6cfce2e 100755 (executable)
@@ -18,6 +18,7 @@
 //
 
 #include "GEOM_FaceSource.h" 
+#include "OCC2VTK_internal.h"
  
 #include <vtkObjectFactory.h> 
 
  
 GEOM_FaceSource::GEOM_FaceSource() 
 { 
+  myData = new FaceSourceInternal;
   this->SetNumberOfInputPorts(0);
-} 
+}
  
 GEOM_FaceSource::~GEOM_FaceSource() 
 { 
-} 
+  delete myData;
+}
  
 void  
 GEOM_FaceSource:: 
 AddFace(const TopoDS_Face& theFace) 
 { 
-  myFaceSet.Add(theFace); 
+  myData->myFaceSet.Add(theFace); 
+} 
+
+void
+GEOM_FaceSource:: 
+Clear()
+{
+  myData->myFaceSet.Clear();
 } 
+
+bool
+GEOM_FaceSource:: 
+IsEmpty()
+{
+  return myData->myFaceSet.IsEmpty();
+}
  
 void 
 GEOM_FaceSource::
index cdbbf623b613c95f524e59780d8a00dc49d85e72..8a824f8e0529ef733205e131507934fa3b3ee3d3 100755 (executable)
 
 #include <gp_Pnt.hxx>
 #include <TopoDS_Face.hxx> 
-#include <NCollection_Set.hxx> 
-typedef NCollection_Set<TopoDS_Face> TFaceSet; 
  
 #include <vtkPoints.h> 
 #include <vtkPolyDataAlgorithm.h> 
 
 class vtkPolyData;
+class FaceSourceInternal;
 
 class OCC2VTK_EXPORT GEOM_FaceSource: public vtkPolyDataAlgorithm 
 { 
@@ -39,11 +37,11 @@ public:
   vtkTypeMacro(GEOM_FaceSource,vtkPolyDataAlgorithm); 
  
   void AddFace(const TopoDS_Face& theFace); 
-  void Clear(){ myFaceSet.Clear();} 
-  bool IsEmpty(){return myFaceSet.IsEmpty();}
+  void Clear();
+  bool IsEmpty();
  
 protected: 
-  TFaceSet myFaceSet; 
+  FaceSourceInternal* myData;
  
   static 
   void MoveTo(gp_Pnt thePnt, 
index 9b56761ee6d4b06a86f1ecb66b4877a1e1ada4ca..a802cbce3cb65a181b786f73c445757a1d114221 100755 (executable)
@@ -18,6 +18,7 @@
 //
 
 #include "GEOM_ShadingFace.h" 
+#include "OCC2VTK_internal.h"
  
 #include <vtkObjectFactory.h> 
  
@@ -57,7 +58,7 @@ int GEOM_ShadingFace::RequestData(vtkInformation *vtkNotUsed(request),
   aPolyData->SetPoints(aPts);
   aPts->Delete();
 
-  TFaceSet::Iterator anIter(myFaceSet);
+  TFaceSet::Iterator anIter(myData->myFaceSet);
   for(; anIter.More(); anIter.Next()){
     const TopoDS_Face& aFace = anIter.Value();
     OCC2VTK(aFace,aPolyData,aPts);
index e313ff8657dd10df763bb18a3a6e750fe9bff641..9df081137a5ca257cf2a36f08df6a8f4c9df6277 100755 (executable)
@@ -18,6 +18,7 @@
 //
 
 #include "GEOM_VertexSource.h" 
+#include "OCC2VTK_internal.h"
  
 #include <vtkObjectFactory.h> 
 
 vtkStandardNewMacro(GEOM_VertexSource);
  
 GEOM_VertexSource::GEOM_VertexSource() 
-{ 
+{
+  myData = new VertexSourceInternal;
   this->SetNumberOfInputPorts(0);
-} 
+}
  
 GEOM_VertexSource::~GEOM_VertexSource() 
-{ 
-} 
+{
+  delete myData;
+}
  
 void  
 GEOM_VertexSource:: 
 AddVertex(const TopoDS_Vertex& theVertex) 
-{ 
-  myVertexSet.Add(theVertex); 
-} 
+{
+  myData->myVertexSet.Add(theVertex); 
+}
+
+void
+GEOM_VertexSource:: 
+Clear()
+{
+  myData->myVertexSet.Clear();
+}
  
 int GEOM_VertexSource::RequestData(vtkInformation *vtkNotUsed(request),
                                    vtkInformationVector **vtkNotUsed(inputVector),
@@ -62,7 +72,7 @@ int GEOM_VertexSource::RequestData(vtkInformation *vtkNotUsed(request),
   aPolyData->SetPoints(aPts);
   aPts->Delete();
 
-  TVertexSet::Iterator anIter(myVertexSet);
+  TVertexSet::Iterator anIter(myData->myVertexSet);
   for(; anIter.More(); anIter.Next()){
     const TopoDS_Vertex& aVertex = anIter.Value();
     OCC2VTK(aVertex,aPolyData,aPts);
index 56122d26b11c9b66c1b2696c7bee92c6729fc83a..d3e64c1c827ed00174a4c642d7faf0e195e670e5 100755 (executable)
 #include "OCC2VTK.h" 
  
 #include <TopoDS_Vertex.hxx> 
-#include <NCollection_Set.hxx> 
-typedef NCollection_Set<TopoDS_Vertex> TVertexSet; 
  
 #include <vtkPoints.h> 
 #include <vtkPolyDataAlgorithm.h> 
 
 class vtkPolyData;
+class VertexSourceInternal;
 
 class OCC2VTK_EXPORT GEOM_VertexSource: public vtkPolyDataAlgorithm
 { 
@@ -39,7 +37,7 @@ public:
   static GEOM_VertexSource* New(); 
  
   void AddVertex(const TopoDS_Vertex& theVertex); 
-  void Clear(){ myVertexSet.Clear();} 
+  void Clear();
  
   static  
   void OCC2VTK(const TopoDS_Vertex& theVertex,  
@@ -47,7 +45,7 @@ public:
                vtkPoints* thePts); 
  
 protected: 
-  TVertexSet myVertexSet; 
+  VertexSourceInternal* myData;
  
   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
  
index 8c94300f5247a473796c8eb6423c1f40b851bb16..cf91f71e6948930db091e61c7ae7a49b62de2504 100755 (executable)
@@ -18,6 +18,7 @@
 //
 
 #include "GEOM_WireframeFace.h"
+#include "OCC2VTK_internal.h"
 
 #include <GEOMUtils_Hatcher.hxx>
  
@@ -63,7 +64,7 @@ int GEOM_WireframeFace::RequestData(vtkInformation *vtkNotUsed(request),
   aPolyData->SetPoints(aPts);
   aPts->Delete();
 
-  TFaceSet::Iterator anIter(myFaceSet);
+  TFaceSet::Iterator anIter(myData->myFaceSet);
   for(; anIter.More(); anIter.Next()){
     const TopoDS_Face& aFace = anIter.Value();
     OCC2VTK(aFace,aPolyData,aPts,NbIso,Discret);
diff --git a/src/OCC2VTK/OCC2VTK_internal.h b/src/OCC2VTK/OCC2VTK_internal.h
new file mode 100644 (file)
index 0000000..32e2869
--- /dev/null
@@ -0,0 +1,228 @@
+#ifndef OCC2VTK_INTERNAL_H
+#define OCC2VTK_INTERNAL_H
+
+#include <NCollection_BaseCollection.hxx>
+#include <NCollection_BaseList.hxx>
+#include <NCollection_TListNode.hxx>
+#include <NCollection_TListIterator.hxx>
+
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Edge.hxx> 
+#include <TopoDS_Face.hxx> 
+
+template <class TheItemType> class GEOM_Set
+  : public NCollection_BaseCollection<TheItemType>,
+    public NCollection_BaseList
+{
+public:
+  typedef NCollection_TListNode<TheItemType> SetNode;
+  typedef NCollection_TListIterator<TheItemType> Iterator;
+
+public:
+  //! Constructor
+  GEOM_Set(const Handle(NCollection_BaseAllocator)& theAllocator=0L) :
+    NCollection_BaseCollection<TheItemType>(theAllocator),
+    NCollection_BaseList() {}
+
+  //! Copy constructor
+  GEOM_Set (const GEOM_Set& theOther) :
+    NCollection_BaseCollection<TheItemType>(theOther.myAllocator),
+    NCollection_BaseList()
+  { *this = theOther; }
+
+  //! Size - Number of items
+  virtual Standard_Integer Size (void) const
+  { return Extent(); }
+
+  //! Replace this list by the items of theOther collection
+  virtual void Assign (const NCollection_BaseCollection<TheItemType>& theOther)
+  {
+    if (this == &theOther) 
+      return;
+    Clear();
+    TYPENAME NCollection_BaseCollection<TheItemType>::Iterator& anIter = 
+      theOther.CreateIterator();
+    for (; anIter.More(); anIter.Next())
+    {
+      SetNode* pNew = new (this->myAllocator) SetNode(anIter.Value());
+      PAppend (pNew);
+    }
+  }
+
+  //! Replace this list by the items of theOther Set
+  GEOM_Set& operator= (const GEOM_Set& theOther)
+  { 
+    if (this == &theOther) 
+      return *this;
+    Clear ();
+    SetNode * pCur = (SetNode *) theOther.PFirst();
+    while (pCur)
+    {
+      SetNode* pNew = new (this->myAllocator) SetNode(pCur->Value());
+      PAppend (pNew);
+      pCur = (SetNode *) pCur->Next();
+    }
+    return *this;
+  }
+
+  //! Clear this set
+  void Clear (void)
+  { PClear (SetNode::delNode, this->myAllocator); }
+
+  //! Add item
+  Standard_Boolean Add (const TheItemType& theItem)
+  { 
+    Iterator anIter(*this);
+    while (anIter.More())
+    {
+      if (anIter.Value() == theItem)
+        return Standard_False;
+      anIter.Next();
+    }
+    SetNode * pNew = new (this->myAllocator) SetNode(theItem);
+    PPrepend (pNew);
+    return Standard_True;
+  }
+
+  //! Remove item
+  Standard_Boolean Remove (const TheItemType& theItem)
+  {
+    Iterator anIter(*this);
+    while (anIter.More())
+    {
+      if (anIter.Value() == theItem)
+      {
+        PRemove (anIter, SetNode::delNode, this->myAllocator);
+        return Standard_True;
+      }
+      anIter.Next();
+    }
+    return Standard_False;
+  }
+
+  //! Remove - wrapper against 'hiding' warnings
+  void Remove (Iterator& theIter) 
+  { NCollection_BaseList::PRemove (theIter,
+                                   SetNode::delNode,
+                                   this->myAllocator); }
+
+  //! Contains - item inclusion query
+  Standard_Boolean Contains (const TheItemType& theItem) const
+  {
+    Iterator anIter(*this);
+    for (; anIter.More(); anIter.Next())
+      if (anIter.Value() == theItem)
+        return Standard_True;
+    return Standard_False;
+  }
+
+  //! IsASubset
+  Standard_Boolean IsASubset (const GEOM_Set& theOther)
+  { 
+    if (this == &theOther) 
+      return Standard_True;
+    Iterator anIter(theOther);
+    for (; anIter.More(); anIter.Next())
+      if (!Contains(anIter.Value()))
+        return Standard_False;
+    return Standard_True;
+  }
+
+  //! IsAProperSubset
+  Standard_Boolean IsAProperSubset (const GEOM_Set& theOther)
+  {
+    if (myLength <= theOther.Extent())
+      return Standard_False;
+    Iterator anIter(theOther);
+    for (; anIter.More(); anIter.Next())
+      if (!Contains(anIter.Value()))
+        return Standard_False;
+    return Standard_True;
+  }
+
+  //! Union
+  void Union (const GEOM_Set& theOther)
+  { 
+    if (this == &theOther) 
+      return;
+    Iterator anIter(theOther);
+    Iterator aMyIter;
+    Standard_Integer i, iLength=myLength;
+    for (; anIter.More(); anIter.Next())
+    {
+      Standard_Boolean isIn=Standard_False;
+      const TheItemType& theItem = anIter.Value();
+      for (aMyIter.Init(*this), i=1; 
+           i<=iLength;
+           aMyIter.Next(), i++)
+        if (theItem == aMyIter.Value())
+          isIn = Standard_True;
+      if (!isIn)
+      {
+        SetNode * pNew = new (this->myAllocator) SetNode(theItem);
+        PAppend (pNew);
+      }
+    }
+  }
+
+  //! Intersection
+  void Intersection (const GEOM_Set& theOther)
+  { 
+    if (this == &theOther) 
+      return;
+    Iterator anIter(*this);
+    while (anIter.More())
+      if (theOther.Contains(anIter.Value()))
+        anIter.Next();
+      else
+        NCollection_BaseList::PRemove (anIter, SetNode::delNode, this->myAllocator);
+  }
+
+  //! Difference (Subtraction)
+  void Difference (const GEOM_Set& theOther)
+  { 
+    if (this == &theOther) 
+      return;
+    Iterator anIter(*this);
+    while (anIter.More())
+      if (theOther.Contains(anIter.Value()))
+        NCollection_BaseList::PRemove (anIter, SetNode::delNode, this->myAllocator);
+      else
+        anIter.Next();
+  }
+
+  //! Destructor - clears the List
+  ~GEOM_Set (void)
+  { Clear(); }
+
+private:
+  //! Creates Iterator for use on BaseCollection
+  virtual TYPENAME NCollection_BaseCollection<TheItemType>::Iterator& 
+    CreateIterator(void) const
+  { return *(new (this->IterAllocator()) Iterator(*this)); }
+
+};
+
+typedef GEOM_Set<TopoDS_Vertex> TVertexSet; 
+typedef GEOM_Set<TopoDS_Edge> TEdgeSet; 
+typedef GEOM_Set<TopoDS_Face> TFaceSet; 
+
+class VertexSourceInternal
+{
+public:
+  TVertexSet myVertexSet;
+};
+
+class EdgeSourceInternal
+{
+public:
+  TEdgeSet myEdgeSet;
+};
+
+class FaceSourceInternal
+{
+public:
+  TFaceSet myFaceSet;
+};
+
+#endif // OCC2VTK_INTERNAL_H