From 477e6586c0dc3d1457bef95c3121cfb65a093439 Mon Sep 17 00:00:00 2001 From: skv Date: Wed, 9 Jul 2014 17:32:02 +0400 Subject: [PATCH] OCCT dev version porting (6.7.2) --- .../AdvancedGUI_DividedCylinderDlg.cxx | 1 - .../AdvancedGUI_SmoothingSurfaceDlg.cxx | 1 - src/BasicGUI/BasicGUI_ArcDlg.cxx | 1 - src/BasicGUI/BasicGUI_CircleDlg.cxx | 1 - src/GenerationGUI/GenerationGUI_PipeDlg.cxx | 1 - src/OCC2VTK/GEOM_EdgeSource.cxx | 19 +- src/OCC2VTK/GEOM_EdgeSource.h | 20 +- src/OCC2VTK/GEOM_FaceSource.cxx | 23 +- src/OCC2VTK/GEOM_FaceSource.h | 13 +- src/OCC2VTK/GEOM_ShadingFace.cxx | 3 +- src/OCC2VTK/GEOM_VertexSource.cxx | 26 +- src/OCC2VTK/GEOM_VertexSource.h | 9 +- src/OCC2VTK/GEOM_WireframeFace.cxx | 3 +- src/OCC2VTK/OCC2VTK_internal.h | 228 ------------------ 14 files changed, 42 insertions(+), 307 deletions(-) delete mode 100644 src/OCC2VTK/OCC2VTK_internal.h diff --git a/src/AdvancedGUI/AdvancedGUI_DividedCylinderDlg.cxx b/src/AdvancedGUI/AdvancedGUI_DividedCylinderDlg.cxx index 682433f1e..4b1a9f288 100644 --- a/src/AdvancedGUI/AdvancedGUI_DividedCylinderDlg.cxx +++ b/src/AdvancedGUI/AdvancedGUI_DividedCylinderDlg.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include #include diff --git a/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx b/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx index 46be04e60..151af6348 100644 --- a/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx +++ b/src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/src/BasicGUI/BasicGUI_ArcDlg.cxx b/src/BasicGUI/BasicGUI_ArcDlg.cxx index 4f0d910de..fff94014c 100644 --- a/src/BasicGUI/BasicGUI_ArcDlg.cxx +++ b/src/BasicGUI/BasicGUI_ArcDlg.cxx @@ -35,7 +35,6 @@ #include #include -#include #include #include #include diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index bd5781fdc..54cbb52be 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -36,7 +36,6 @@ #include #include -#include #include #include #include diff --git a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx index edcbec331..8e264045e 100644 --- a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/src/OCC2VTK/GEOM_EdgeSource.cxx b/src/OCC2VTK/GEOM_EdgeSource.cxx index 0a3a41a0d..2ff7b91c7 100755 --- a/src/OCC2VTK/GEOM_EdgeSource.cxx +++ b/src/OCC2VTK/GEOM_EdgeSource.cxx @@ -18,7 +18,6 @@ // #include "GEOM_EdgeSource.h" -#include "OCC2VTK_internal.h" #include @@ -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 ) diff --git a/src/OCC2VTK/GEOM_EdgeSource.h b/src/OCC2VTK/GEOM_EdgeSource.h index da64b0a52..0c2dbb67a 100755 --- a/src/OCC2VTK/GEOM_EdgeSource.h +++ b/src/OCC2VTK/GEOM_EdgeSource.h @@ -23,26 +23,26 @@ #include "OCC2VTK.h" #include +#include +#include + +typedef NCollection_Map TEdgeSet; #include #include 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 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 diff --git a/src/OCC2VTK/GEOM_FaceSource.cxx b/src/OCC2VTK/GEOM_FaceSource.cxx index 41c4bf547..7067a7282 100755 --- a/src/OCC2VTK/GEOM_FaceSource.cxx +++ b/src/OCC2VTK/GEOM_FaceSource.cxx @@ -18,7 +18,6 @@ // #include "GEOM_FaceSource.h" -#include "OCC2VTK_internal.h" #include @@ -30,35 +29,19 @@ 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:: diff --git a/src/OCC2VTK/GEOM_FaceSource.h b/src/OCC2VTK/GEOM_FaceSource.h index 8a824f8e0..4627f7a48 100755 --- a/src/OCC2VTK/GEOM_FaceSource.h +++ b/src/OCC2VTK/GEOM_FaceSource.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +#include // 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 @@ -24,12 +24,15 @@ #include #include +#include +#include + +typedef NCollection_Map TFaceSet; #include #include 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, diff --git a/src/OCC2VTK/GEOM_ShadingFace.cxx b/src/OCC2VTK/GEOM_ShadingFace.cxx index a802cbce3..9b56761ee 100755 --- a/src/OCC2VTK/GEOM_ShadingFace.cxx +++ b/src/OCC2VTK/GEOM_ShadingFace.cxx @@ -18,7 +18,6 @@ // #include "GEOM_ShadingFace.h" -#include "OCC2VTK_internal.h" #include @@ -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); diff --git a/src/OCC2VTK/GEOM_VertexSource.cxx b/src/OCC2VTK/GEOM_VertexSource.cxx index 9df081137..e313ff865 100755 --- a/src/OCC2VTK/GEOM_VertexSource.cxx +++ b/src/OCC2VTK/GEOM_VertexSource.cxx @@ -18,7 +18,6 @@ // #include "GEOM_VertexSource.h" -#include "OCC2VTK_internal.h" #include @@ -35,29 +34,20 @@ 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); diff --git a/src/OCC2VTK/GEOM_VertexSource.h b/src/OCC2VTK/GEOM_VertexSource.h index d3e64c1c8..d0ca91e35 100755 --- a/src/OCC2VTK/GEOM_VertexSource.h +++ b/src/OCC2VTK/GEOM_VertexSource.h @@ -23,12 +23,15 @@ #include "OCC2VTK.h" #include +#include +#include + +typedef NCollection_Map TVertexSet; #include #include 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 *); diff --git a/src/OCC2VTK/GEOM_WireframeFace.cxx b/src/OCC2VTK/GEOM_WireframeFace.cxx index cf91f71e6..8c94300f5 100755 --- a/src/OCC2VTK/GEOM_WireframeFace.cxx +++ b/src/OCC2VTK/GEOM_WireframeFace.cxx @@ -18,7 +18,6 @@ // #include "GEOM_WireframeFace.h" -#include "OCC2VTK_internal.h" #include @@ -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 index 32e2869e2..000000000 --- a/src/OCC2VTK/OCC2VTK_internal.h +++ /dev/null @@ -1,228 +0,0 @@ -#ifndef OCC2VTK_INTERNAL_H -#define OCC2VTK_INTERNAL_H - -#include -#include -#include -#include - -#include -#include -#include - -template class GEOM_Set - : public NCollection_BaseCollection, - public NCollection_BaseList -{ -public: - typedef NCollection_TListNode SetNode; - typedef NCollection_TListIterator Iterator; - -public: - //! Constructor - GEOM_Set(const Handle(NCollection_BaseAllocator)& theAllocator=0L) : - NCollection_BaseCollection(theAllocator), - NCollection_BaseList() {} - - //! Copy constructor - GEOM_Set (const GEOM_Set& theOther) : - NCollection_BaseCollection(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& theOther) - { - if (this == &theOther) - return; - Clear(); - TYPENAME NCollection_BaseCollection::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::Iterator& - CreateIterator(void) const - { return *(new (this->IterAllocator()) Iterator(*this)); } - -}; - -typedef GEOM_Set TVertexSet; -typedef GEOM_Set TEdgeSet; -typedef GEOM_Set TFaceSet; - -class VertexSourceInternal -{ -public: - TVertexSet myVertexSet; -}; - -class EdgeSourceInternal -{ -public: - TEdgeSet myEdgeSet; -}; - -class FaceSourceInternal -{ -public: - TFaceSet myFaceSet; -}; - -#endif // OCC2VTK_INTERNAL_H -- 2.30.2