#include <GEOMAlgo_AlgoTools.hxx>
+#include <Basics_OCCTVersion.hxx>
+
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Dir2d.hxx>
(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;
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;
(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;
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;
(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;
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;
#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>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx>
-#include <BOPInt_Context.hxx>
-
#include <TopTools_ListOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
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,
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,
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,
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
#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>
//
#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>
// <peter@PREFEX>
//
#include <GEOMAlgo_GluerAlgo.hxx>
+#if OCC_VERSION_LARGE > 0x06070100
+#include <IntTools_Context.hxx>
+#else
#include <BOPInt_Context.hxx>
+#endif
//=======================================================================
//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;
}
//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;
}
void GEOMAlgo_GluerAlgo::Perform()
{
if (myContext.IsNull()) {
+#if OCC_VERSION_LARGE > 0x06070100
+ myContext=new IntTools_Context;
+#else
myContext=new BOPInt_Context;
+#endif
}
}
#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>
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;
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;
#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>
if (!myContext.IsNull()) {
myContext.Nullify();
}
+#if OCC_VERSION_LARGE > 0x06070100
+ myContext=new IntTools_Context;
+#else
myContext=new BOPInt_Context;
+#endif
//
BuildSolid();
//
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) {
// <pkv@irinox>
//
#include <GEOMAlgo_ShapeAlgo.hxx>
+#if OCC_VERSION_LARGE > 0x06070100
+#include <IntTools_Context.hxx>
+#else
#include <BOPInt_Context.hxx>
+#endif
//=======================================================================
//function : 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;
}
//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;
}
void GEOMAlgo_ShapeAlgo::Perform()
{
if (myContext.IsNull()) {
+#if OCC_VERSION_LARGE > 0x06070100
+ myContext=new IntTools_Context;
+#else
myContext=new BOPInt_Context;
+#endif
}
}
#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>
//=======================================================================
//! 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) ;
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
//
#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>
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);
//
#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>
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();
//
#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>
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);
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;
//
#include "GEOM_EdgeSource.h"
+#include "OCC2VTK_internal.h"
#include <vtkObjectFactory.h>
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)
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 )
#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();
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();
void operator=(const GEOM_EdgeSource&);
};
-
#endif //GEOM_EDGESOURCE_H
//
#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::
#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
{
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,
//
#include "GEOM_ShadingFace.h"
+#include "OCC2VTK_internal.h"
#include <vtkObjectFactory.h>
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);
//
#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),
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);
#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
{
static GEOM_VertexSource* New();
void AddVertex(const TopoDS_Vertex& theVertex);
- void Clear(){ myVertexSet.Clear();}
+ void Clear();
static
void OCC2VTK(const TopoDS_Vertex& theVertex,
vtkPoints* thePts);
protected:
- TVertexSet myVertexSet;
+ VertexSourceInternal* myData;
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
//
#include "GEOM_WireframeFace.h"
+#include "OCC2VTK_internal.h"
#include <GEOMUtils_Hatcher.hxx>
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);
--- /dev/null
+#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