]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
OCCT dev version porting (6.7.2)
authorskv <skv@opencascade.com>
Wed, 9 Jul 2014 13:32:02 +0000 (17:32 +0400)
committerskv <skv@opencascade.com>
Wed, 9 Jul 2014 13:32:02 +0000 (17:32 +0400)
14 files changed:
src/AdvancedGUI/AdvancedGUI_DividedCylinderDlg.cxx
src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx
src/BasicGUI/BasicGUI_ArcDlg.cxx
src/BasicGUI/BasicGUI_CircleDlg.cxx
src/GenerationGUI/GenerationGUI_PipeDlg.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 [deleted file]

index 682433f1e8a73d69c762034837b12f4f246c3ee1..4b1a9f28883bda08195d58d26165ead657fe715e 100644 (file)
@@ -35,7 +35,6 @@
 #include <TopoDS_Shape.hxx>
 #include <TopoDS.hxx>
 #include <TopExp.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 
 #include <GEOMImpl_Types.hxx>
index 46be04e60f79626ecca3ac2b67ea4064e13326bd..151af634847d6ff77adad792919e81e4a0027b68 100644 (file)
@@ -33,7 +33,6 @@
 #include <TopoDS.hxx>
 #include <TopoDS_Iterator.hxx>
 #include <TopExp.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 
 #include <GEOMImpl_Types.hxx>
index 4f0d910deaceac8eef7ea3e4529fcd119a740b9b..fff94014cf7e256ba83ced29a16787bf5d389aed 100644 (file)
@@ -35,7 +35,6 @@
 #include <SalomeApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 
-#include <TColStd_IndexedMapOfInteger.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Edge.hxx>
index bd5781fdcf981c61ed71181fb6ed03ab0943f68d..54cbb52befa64d148272a3aa1b549956dd59d07e 100644 (file)
@@ -36,7 +36,6 @@
 #include <SalomeApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 
-#include <TColStd_IndexedMapOfInteger.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Edge.hxx>
index edcbec331bdabc0c7ba8e7ed7ba295a3b5d98fb0..8e264045e925c4f0c7acf0503ec0d9b126d2dc60 100644 (file)
@@ -38,7 +38,6 @@
 #include <TopoDS_Shape.hxx>
 #include <TopoDS.hxx>
 #include <TopExp.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <TColStd_IndexedMapOfInteger.hxx>
 #include <TColStd_MapOfInteger.hxx>
index 0a3a41a0d68dd7049a3cd39d25f4f904ea95fb84..2ff7b91c7c4cf5f757f75673024076625c81c4cd 100755 (executable)
@@ -18,7 +18,6 @@
 //
 
 #include "GEOM_EdgeSource.h" 
-#include "OCC2VTK_internal.h"
  
 #include <vtkObjectFactory.h> 
 
@@ -43,32 +42,20 @@ 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)
 {
-  myData->myEdgeSet.Add(theEdge);
+  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)
@@ -82,7 +69,7 @@ int GEOM_EdgeSource::RequestData(vtkInformation *vtkNotUsed(request),
   aPolyData->SetPoints(aPts);
   aPts->Delete();
 
-  TEdgeSet::Iterator anIter (myData->myEdgeSet);
+  TEdgeSet::Iterator anIter (myEdgeSet);
   for (; anIter.More(); anIter.Next()) {
     TopoDS_Edge anEdge = anIter.Value();
     if ( !myIsVector )
index da64b0a5223111b692417666d218474da4ba0565..0c2dbb67a926dcba1fe4f9cf68dd82b28c08126e 100755 (executable)
 #include "OCC2VTK.h" 
  
 #include <TopoDS_Edge.hxx> 
+#include <TopTools_ShapeMapHasher.hxx>
+#include <NCollection_Map.hxx> 
+typedef NCollection_Map<TopoDS_Edge, TopTools_ShapeMapHasher> 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();
+  void Clear(){ myEdgeSet.Clear();}
   
-  bool IsEmpty();
-
   void SetVectorMode(bool);
 
   bool GetVectorMode();
@@ -52,14 +52,17 @@ public:
                vtkPolyData* thePolyData, 
                vtkPoints* thePts,
                bool theIsVector = false); 
+
+  bool IsEmpty(){return myEdgeSet.IsEmpty();}
+
  
 protected: 
-  EdgeSourceInternal* myData;
+  TEdgeSet myEdgeSet;
   // 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(); 
@@ -70,4 +73,5 @@ private:
   void operator=(const GEOM_EdgeSource&); 
 }; 
  
 #endif //GEOM_EDGESOURCE_H 
index 41c4bf54727ff05a441dbbcfd23bc281d6cfce2e..7067a728255018e05cf8cd4beb6fbe2a9461d87e 100755 (executable)
@@ -18,7 +18,6 @@
 //
 
 #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) 
 { 
-  myData->myFaceSet.Add(theFace); 
-} 
-
-void
-GEOM_FaceSource:: 
-Clear()
-{
-  myData->myFaceSet.Clear();
+  myFaceSet.Add(theFace); 
 } 
-
-bool
-GEOM_FaceSource:: 
-IsEmpty()
-{
-  return myData->myFaceSet.IsEmpty();
-}
  
 void 
 GEOM_FaceSource::
index 8a824f8e0529ef733205e131507934fa3b3ee3d3..4627f7a48c4eacb4ac01e4fb804523d6eb107369 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+#include <TopTools_ShapeMapHasher.hxx>// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 
 #include <gp_Pnt.hxx>
 #include <TopoDS_Face.hxx> 
+#include <TopTools_ShapeMapHasher.hxx>
+#include <NCollection_Map.hxx> 
+typedef NCollection_Map<TopoDS_Face, TopTools_ShapeMapHasher> TFaceSet; 
  
 #include <vtkPoints.h> 
 #include <vtkPolyDataAlgorithm.h> 
 
 class vtkPolyData;
-class FaceSourceInternal;
 
 class OCC2VTK_EXPORT GEOM_FaceSource: public vtkPolyDataAlgorithm 
 { 
@@ -37,11 +40,11 @@ public:
   vtkTypeMacro(GEOM_FaceSource,vtkPolyDataAlgorithm); 
  
   void AddFace(const TopoDS_Face& theFace); 
-  void Clear();
-  bool IsEmpty();
+  void Clear(){ myFaceSet.Clear();} 
+  bool IsEmpty(){return myFaceSet.IsEmpty();}
  
 protected: 
-  FaceSourceInternal* myData;
+  TFaceSet myFaceSet; 
  
   static 
   void MoveTo(gp_Pnt thePnt, 
index a802cbce3cb65a181b786f73c445757a1d114221..9b56761ee6d4b06a86f1ecb66b4877a1e1ada4ca 100755 (executable)
@@ -18,7 +18,6 @@
 //
 
 #include "GEOM_ShadingFace.h" 
-#include "OCC2VTK_internal.h"
  
 #include <vtkObjectFactory.h> 
  
@@ -58,7 +57,7 @@ int GEOM_ShadingFace::RequestData(vtkInformation *vtkNotUsed(request),
   aPolyData->SetPoints(aPts);
   aPts->Delete();
 
-  TFaceSet::Iterator anIter(myData->myFaceSet);
+  TFaceSet::Iterator anIter(myFaceSet);
   for(; anIter.More(); anIter.Next()){
     const TopoDS_Face& aFace = anIter.Value();
     OCC2VTK(aFace,aPolyData,aPts);
index 9df081137a5ca257cf2a36f08df6a8f4c9df6277..e313ff8657dd10df763bb18a3a6e750fe9bff641 100755 (executable)
@@ -18,7 +18,6 @@
 //
 
 #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) 
-{
-  myData->myVertexSet.Add(theVertex); 
-}
-
-void
-GEOM_VertexSource:: 
-Clear()
-{
-  myData->myVertexSet.Clear();
-}
+{ 
+  myVertexSet.Add(theVertex); 
+} 
  
 int GEOM_VertexSource::RequestData(vtkInformation *vtkNotUsed(request),
                                    vtkInformationVector **vtkNotUsed(inputVector),
@@ -72,7 +62,7 @@ int GEOM_VertexSource::RequestData(vtkInformation *vtkNotUsed(request),
   aPolyData->SetPoints(aPts);
   aPts->Delete();
 
-  TVertexSet::Iterator anIter(myData->myVertexSet);
+  TVertexSet::Iterator anIter(myVertexSet);
   for(; anIter.More(); anIter.Next()){
     const TopoDS_Vertex& aVertex = anIter.Value();
     OCC2VTK(aVertex,aPolyData,aPts);
index d3e64c1c827ed00174a4c642d7faf0e195e670e5..d0ca91e35773f1e37fde88eb8a3f7a9d5ea0e2e5 100755 (executable)
 #include "OCC2VTK.h" 
  
 #include <TopoDS_Vertex.hxx> 
+#include <TopTools_ShapeMapHasher.hxx>
+#include <NCollection_Map.hxx> 
+typedef NCollection_Map<TopoDS_Vertex, TopTools_ShapeMapHasher> TVertexSet; 
  
 #include <vtkPoints.h> 
 #include <vtkPolyDataAlgorithm.h> 
 
 class vtkPolyData;
-class VertexSourceInternal;
 
 class OCC2VTK_EXPORT GEOM_VertexSource: public vtkPolyDataAlgorithm
 { 
@@ -37,7 +40,7 @@ public:
   static GEOM_VertexSource* New(); 
  
   void AddVertex(const TopoDS_Vertex& theVertex); 
-  void Clear();
+  void Clear(){ myVertexSet.Clear();} 
  
   static  
   void OCC2VTK(const TopoDS_Vertex& theVertex,  
@@ -45,7 +48,7 @@ public:
                vtkPoints* thePts); 
  
 protected: 
-  VertexSourceInternal* myData;
+  TVertexSet myVertexSet; 
  
   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
  
index cf91f71e6948930db091e61c7ae7a49b62de2504..8c94300f5247a473796c8eb6423c1f40b851bb16 100755 (executable)
@@ -18,7 +18,6 @@
 //
 
 #include "GEOM_WireframeFace.h"
-#include "OCC2VTK_internal.h"
 
 #include <GEOMUtils_Hatcher.hxx>
  
@@ -64,7 +63,7 @@ int GEOM_WireframeFace::RequestData(vtkInformation *vtkNotUsed(request),
   aPolyData->SetPoints(aPts);
   aPts->Delete();
 
-  TFaceSet::Iterator anIter(myData->myFaceSet);
+  TFaceSet::Iterator anIter(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
deleted file mode 100644 (file)
index 32e2869..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-#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