OCCT dev version porting (6.7.2)

This commit is contained in:
skv 2014-07-09 17:32:02 +04:00
parent 80531775fd
commit 477e6586c0
14 changed files with 42 additions and 307 deletions

View 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>

View 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>

View 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>

View 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>

View 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>

View File

@ -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 )

View File

@ -23,26 +23,26 @@
#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

View File

@ -18,7 +18,6 @@
//
#include "GEOM_FaceSource.h"
#include "OCC2VTK_internal.h"
#include <vtkObjectFactory.h>
@ -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);
myFaceSet.Add(theFace);
}
void
GEOM_FaceSource::
Clear()
{
myData->myFaceSet.Clear();
}
bool
GEOM_FaceSource::
IsEmpty()
{
return myData->myFaceSet.IsEmpty();
}
void
GEOM_FaceSource::

View File

@ -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
@ -24,12 +24,15 @@
#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,

View File

@ -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);

View File

@ -18,7 +18,6 @@
//
#include "GEOM_VertexSource.h"
#include "OCC2VTK_internal.h"
#include <vtkObjectFactory.h>
@ -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);

View File

@ -23,12 +23,15 @@
#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 *);

View File

@ -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);

View File

@ -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