First compilable version of GEOM and SMESH modules.
MESSAGE (this<< " GEOM_Actor::GEOM_Actor");
#endif
- myPolyDataMapper->SetInput(myAppendFilter->GetOutput());
+ myPolyDataMapper->SetInputConnection(myAppendFilter->GetOutputPort());
vtkProperty* aProperty;
myHighlightProp->SetAmbient(0.5);
myHighlightProp->SetPointSize(SALOME_POINT_SIZE);
myHighlightActor->SetProperty(myHighlightProp.GetPointer());
- this->myHighlightActor->SetInput(myAppendFilter->GetOutput(),false);
+ this->myHighlightActor->SetInput(myAppendFilter->GetOutputPort(),false);
myPreHighlightProp->SetColor(0,1,1);
myPreHighlightProp->SetPointSize(SALOME_POINT_SIZE+2);
myPreHighlightProp->SetLineWidth(SALOME_LINE_WIDTH+1);
myPreHighlightProp->SetRepresentationToWireframe();
- myAppendFilter->AddInput(myVertexSource->GetOutput());
- myVertexActor->SetInput(myVertexSource->GetOutput(),false);
+ myAppendFilter->AddInputConnection(myVertexSource->GetOutputPort());
+ myVertexActor->SetInput(myVertexSource->GetOutputPort(),false);
aProperty = myVertexActor->GetProperty();
aProperty->SetRepresentation(VTK_POINTS);
aProperty->SetPointSize(3);
aProperty->SetColor(1, 1, 0);
- myAppendFilter->AddInput(myIsolatedEdgeSource->GetOutput());
- myIsolatedEdgeActor->SetInput(myIsolatedEdgeSource->GetOutput(),false);
+ myAppendFilter->AddInputConnection(myIsolatedEdgeSource->GetOutputPort());
+ myIsolatedEdgeActor->SetInput(myIsolatedEdgeSource->GetOutputPort(),false);
aProperty = myIsolatedEdgeActor->GetProperty();
aProperty->SetRepresentation(VTK_WIREFRAME);
aProperty->SetColor(1, 0, 0);
- myAppendFilter->AddInput(myOneFaceEdgeSource->GetOutput());
- myOneFaceEdgeActor->SetInput(myOneFaceEdgeSource->GetOutput(),false);
+ myAppendFilter->AddInputConnection(myOneFaceEdgeSource->GetOutputPort());
+ myOneFaceEdgeActor->SetInput(myOneFaceEdgeSource->GetOutputPort(),false);
aProperty = myOneFaceEdgeActor->GetProperty();
aProperty->SetRepresentation(VTK_WIREFRAME);
aProperty->SetColor(0, 1, 0);
- myAppendFilter->AddInput(mySharedEdgeSource->GetOutput());
- mySharedEdgeActor->SetInput(mySharedEdgeSource->GetOutput(),false);
+ myAppendFilter->AddInputConnection(mySharedEdgeSource->GetOutputPort());
+ mySharedEdgeActor->SetInput(mySharedEdgeSource->GetOutputPort(),false);
aProperty = mySharedEdgeActor->GetProperty();
aProperty->SetRepresentation(VTK_WIREFRAME);
aProperty->SetColor(1, 1, 0);
- myAppendFilter->AddInput(myWireframeFaceSource->GetOutput());
- myWireframeFaceActor->SetInput(myWireframeFaceSource->GetOutput(),false);
+ myAppendFilter->AddInputConnection(myWireframeFaceSource->GetOutputPort());
+ myWireframeFaceActor->SetInput(myWireframeFaceSource->GetOutputPort(),false);
aProperty = myWireframeFaceActor->GetProperty();
aProperty->SetRepresentation(VTK_WIREFRAME);
aProperty->SetColor(0.5, 0.5, 0.5);
- myShadingFaceActor->SetInput(myShadingFaceSource->GetOutput(),true);
+ myShadingFaceActor->SetInput(myShadingFaceSource->GetOutputPort(),true);
myShadingFaceProp->SetRepresentation(VTKViewer::Representation::Surface);
myShadingFaceProp->SetInterpolationToGouraud();
void Write(vtkPolyData* theDataSet, const char* theFileName){
vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();
MESSAGE ("Write - "<<theFileName<<"' : "<<theDataSet->GetNumberOfPoints()<<"; "<<theDataSet->GetNumberOfCells());
- aWriter->SetInput(theDataSet);
+ aWriter->SetInputData(theDataSet);
aWriter->SetFileName(theFileName);
//aWriter->Write();
aWriter->Delete();
myPolyDataNormals(vtkPolyDataNormals::New(),true),
myActor(VTKViewer_Actor::New(),true)
{
- myStripper->SetInput(myPolyDataNormals->GetOutput());
- myPolyDataMapper->SetInput(myStripper->GetOutput());
+ myStripper->SetInputConnection(myPolyDataNormals->GetOutputPort());
+ myPolyDataMapper->SetInputConnection(myStripper->GetOutputPort());
myActor->SetMapper(myPolyDataMapper.Get());
myActor->PickableOff();
void
GEOM_DeviceActor::
-SetInput(vtkPolyData* thePolyData, bool theUseStripper)
+SetInput(vtkAlgorithmOutput* thePolyData, bool theUseStripper)
{
if(theUseStripper)
- myPolyDataNormals->SetInput(thePolyData);
+ myPolyDataNormals->SetInputConnection(thePolyData);
else
- myPolyDataMapper->SetInput(thePolyData);
+ myPolyDataMapper->SetInputConnection(thePolyData);
}
void
{
return myActor->GetProperty();
}
-
-void \r
-GEOM_DeviceActor:: \r
-SetBackfaceProperty(vtkProperty* theProperty)\r
-{\r
- myActor->SetBackfaceProperty(theProperty);\r
-}\r
- \r
-vtkProperty* \r
-GEOM_DeviceActor:: \r
-GetBackfaceProperty()\r
-{\r
- return myActor->GetBackfaceProperty();\r
-}\r
+
+void
+GEOM_DeviceActor::
+SetBackfaceProperty(vtkProperty* theProperty)
+{
+ myActor->SetBackfaceProperty(theProperty);
+}
+
+vtkProperty*
+GEOM_DeviceActor::
+GetBackfaceProperty()
+{
+ return myActor->GetBackfaceProperty();
+}
void
GEOM_DeviceActor::
#include <vtkObject.h>
+class vtkAlgorithmOutput;
class VTK_EXPORT GEOM_DeviceActor: public vtkObject
{
void SetProperty(vtkProperty* theProperty);
vtkProperty* GetProperty();
- \r
- void SetBackfaceProperty(vtkProperty* theProperty);\r
+
+ void SetBackfaceProperty(vtkProperty* theProperty);
vtkProperty* GetBackfaceProperty();
void SetVisibility(int theVisibility);
int GetVisibility();
- void SetInput(vtkPolyData* thePolyData, bool theUseStripper);
+ void SetInput(vtkAlgorithmOutput* thePolyData, bool theUseStripper);
void AddToRender(vtkRenderer* theRenderer);
void RemoveFromRender(vtkRenderer* theRenderer);
#include <vtkObjectFactory.h>
#include <vtkPolyData.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
// OpenCASCADE Includes
#include <TopExp_Explorer.hxx>
//=======================================================================
-// Function : Execute
+// Function : RequestData
// Purpose :
//=======================================================================
+int GEOM_OCCReader::RequestData(vtkInformation *vtkNotUsed(request),
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
+{
+ vtkInformation *outInfo = outputVector->GetInformationObject(0);
+ vtkPolyData *output = vtkPolyData::SafeDownCast(
+ outInfo->Get(vtkDataObject::DATA_OBJECT()));
-void GEOM_OCCReader::Execute() {
-
- vtkPolyData* output = this->GetOutput();
vtkPoints* Pts = NULL;
vtkCellArray* Cells = NULL;
TopLoc_Location aLoc;
if(aPoly.IsNull()) {
Pts->Delete();
Cells->Delete();
- return;
+ return 0;
}
nbpts = aPoly->NbNodes();
else {
Cells->Delete();
Pts->Delete();
- return;
+ return 0;
}
}
}
Pts->Delete();
Cells->Delete();
-
+ return 1;
}
//=======================================================================
#include "GEOM_OBJECT_defs.hxx"
-#include <vtkPolyDataSource.h>
+#include <vtkAlgorithm.h>
class vtkPoints;
class vtkCellArray;
#include <GeomAbs_IsoType.hxx>
#include <BRepAdaptor_Surface.hxx>
-class GEOM_OBJECT_EXPORT GEOM_OCCReader : public vtkPolyDataSource {
+class GEOM_OBJECT_EXPORT GEOM_OCCReader : public vtkAlgorithm {
// methods
GEOM_OCCReader();
~GEOM_OCCReader();
- void Execute();
+
+ virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
void ComputeShading(vtkPoints* Pts,vtkCellArray* Cells);
void ComputeWireframe(vtkPoints* Pts,vtkCellArray* Cells);
aSrcZ->SetPoint2( aEndZ.X(), aEndZ.Y(), aEndZ.Z() );
vtkAppendPolyData* aRes = vtkAppendPolyData::New();
- aRes->AddInput( aSrcX->GetOutput() );
- aRes->AddInput( aSrcY->GetOutput() );
- aRes->AddInput( aSrcZ->GetOutput() );
+ aRes->AddInputConnection( aSrcX->GetOutputPort() );
+ aRes->AddInputConnection( aSrcY->GetOutputPort() );
+ aRes->AddInputConnection( aSrcZ->GetOutputPort() );
- myMapper->SetInput( aRes->GetOutput() );
+ myMapper->SetInputConnection( aRes->GetOutputPort() );
SALOME_Actor::SetMapper( myMapper );
aSrcX->Delete();
#include <vtkStripper.h>
#include <vtkPolyData.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
vtkStandardNewMacro(GEOM_EdgeSource);
myIsVector = theIsVector;
}
-void
-GEOM_EdgeSource::
-Execute()
+int GEOM_EdgeSource::RequestData(vtkInformation *vtkNotUsed(request),
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
- vtkPolyData* aPolyData = GetOutput();
+ vtkInformation *outInfo = outputVector->GetInformationObject(0);
+ vtkPolyData *aPolyData = vtkPolyData::SafeDownCast(
+ outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
aPolyData->Allocate();
vtkPoints* aPts = vtkPoints::New();
aPolyData->SetPoints(aPts);
anEdge.Orientation( TopAbs_FORWARD );
OCC2VTK(anEdge,aPolyData,aPts,myIsVector||myIsVectorMode);
}
+ return 1;
}
void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
typedef NCollection_Set<TopoDS_Edge> TEdgeSet;
#include <vtkPoints.h>
-#include <vtkPolyDataSource.h>
+#include <vtkAlgorithm.h>
-class OCC2VTK_EXPORT GEOM_EdgeSource: public vtkPolyDataSource
+class vtkPolyData;
+
+class OCC2VTK_EXPORT GEOM_EdgeSource: public vtkAlgorithm
{
public:
- vtkTypeMacro(GEOM_EdgeSource,vtkPolyDataSource);
+ vtkTypeMacro(GEOM_EdgeSource,vtkAlgorithm);
static GEOM_EdgeSource* New();
void AddEdge (const TopoDS_Edge& theEdge,
// representing a vector, can have only one edge.
bool myIsVector, myIsVectorMode;
- void Execute();
+ virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
GEOM_EdgeSource();
~GEOM_EdgeSource();
typedef NCollection_Set<TopoDS_Face> TFaceSet;
#include <vtkPoints.h>
-#include <vtkPolyDataSource.h>
+#include <vtkAlgorithm.h>
-class OCC2VTK_EXPORT GEOM_FaceSource: public vtkPolyDataSource
+class vtkPolyData;
+
+class OCC2VTK_EXPORT GEOM_FaceSource: public vtkAlgorithm
{
public:
- vtkTypeMacro(GEOM_FaceSource,vtkPolyDataSource);
+ vtkTypeMacro(GEOM_FaceSource,vtkAlgorithm);
void AddFace(const TopoDS_Face& theFace);
void Clear(){ myFaceSet.Clear();}
#include <vtkPolyDataMapper.h>
#include <vtkPolyData.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
#include <BRep_Tool.hxx>
#include <Poly_Triangulation.hxx>
-
+
vtkStandardNewMacro(GEOM_ShadingFace);
{
}
-void
-GEOM_ShadingFace::
-Execute()
+int GEOM_ShadingFace::RequestData(vtkInformation *vtkNotUsed(request),
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
- vtkPolyData* aPolyData = GetOutput();
+ vtkInformation *outInfo = outputVector->GetInformationObject(0);
+ vtkPolyData *aPolyData = vtkPolyData::SafeDownCast(
+ outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
aPolyData->Allocate();
vtkPoints* aPts = vtkPoints::New();
aPolyData->SetPoints(aPts);
const TopoDS_Face& aFace = anIter.Value();
OCC2VTK(aFace,aPolyData,aPts);
}
+ return 1;
}
void
vtkPoints* thePts);
protected:
- void Execute();
+ virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
GEOM_ShadingFace();
~GEOM_ShadingFace();
#include <vtkCellArray.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
#include <gp_Pnt.hxx>
#include <BRep_Tool.hxx>
myVertexSet.Add(theVertex);
}
-void
-GEOM_VertexSource::
-Execute()
+int GEOM_VertexSource::RequestData(vtkInformation *vtkNotUsed(request),
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
- vtkPolyData* aPolyData = GetOutput();
+ vtkInformation *outInfo = outputVector->GetInformationObject(0);
+ vtkPolyData *aPolyData = vtkPolyData::SafeDownCast(
+ outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
aPolyData->Allocate();
vtkPoints* aPts = vtkPoints::New();
aPolyData->SetPoints(aPts);
const TopoDS_Vertex& aVertex = anIter.Value();
OCC2VTK(aVertex,aPolyData,aPts);
}
+ return 1;
}
void
typedef NCollection_Set<TopoDS_Vertex> TVertexSet;
#include <vtkPoints.h>
-#include <vtkPolyDataSource.h>
+#include <vtkAlgorithm.h>
-class OCC2VTK_EXPORT GEOM_VertexSource: public vtkPolyDataSource
+class vtkPolyData;
+
+class OCC2VTK_EXPORT GEOM_VertexSource: public vtkAlgorithm
{
public:
- vtkTypeMacro(GEOM_VertexSource,vtkPolyDataSource);
+ vtkTypeMacro(GEOM_VertexSource,vtkAlgorithm);
static GEOM_VertexSource* New();
void AddVertex(const TopoDS_Vertex& theVertex);
protected:
TVertexSet myVertexSet;
- void Execute();
+ virtual int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+ virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
GEOM_VertexSource();
~GEOM_VertexSource();
#include <vtkPolyDataMapper.h>
#include <vtkPolyData.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
#include <Precision.hxx>
#include <BRepTools.hxx>
{
}
-void
-GEOM_WireframeFace::
-Execute()
+int GEOM_WireframeFace::RequestData(vtkInformation *vtkNotUsed(request),
+ vtkInformationVector **inputVector,
+ vtkInformationVector *outputVector)
{
- vtkPolyData* aPolyData = GetOutput();
+ vtkInformation *outInfo = outputVector->GetInformationObject(0);
+ vtkPolyData *aPolyData = vtkPolyData::SafeDownCast(
+ outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
aPolyData->Allocate();
vtkPoints* aPts = vtkPoints::New();
aPolyData->SetPoints(aPts);
const TopoDS_Face& aFace = anIter.Value();
OCC2VTK(aFace,aPolyData,aPts,NbIso,Discret);
}
+ return 1;
}
void GEOM_WireframeFace::SetNbIso(const int theNb[2])
#include <GeomAbs_IsoType.hxx>
#include <BRepAdaptor_Surface.hxx>
-#include <vtkPolyDataSource.h>
+class vtkPolyData;
class OCC2VTK_EXPORT GEOM_WireframeFace: public GEOM_FaceSource
{
vtkPolyData* thePolyData,
vtkPoints* thePts);
- void Execute();
+ virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
GEOM_WireframeFace();
~GEOM_WireframeFace();
GEOM_ShadingFace* myShadingFaceSource = GEOM_ShadingFace::New();
vtkAppendPolyData* myAppendFilter = vtkAppendPolyData::New();
- myAppendFilter->AddInput( myVertexSource->GetOutput() );
- myAppendFilter->AddInput( myIsolatedEdgeSource->GetOutput() );
- myAppendFilter->AddInput( myOneFaceEdgeSource->GetOutput() );
- myAppendFilter->AddInput( mySharedEdgeSource->GetOutput() );
- //myAppendFilter->AddInput( myWireframeFaceSource->GetOutput() ); // iso-lines are unnecessary
- myAppendFilter->AddInput( myShadingFaceSource->GetOutput() );
+ myAppendFilter->AddInputConnection( myVertexSource->GetOutputPort() );
+ myAppendFilter->AddInputConnection( myIsolatedEdgeSource->GetOutputPort() );
+ myAppendFilter->AddInputConnection( myOneFaceEdgeSource->GetOutputPort() );
+ myAppendFilter->AddInputConnection( mySharedEdgeSource->GetOutputPort() );
+ //myAppendFilter->AddInputConnection( myWireframeFaceSource->GetOutputPort() ); // iso-lines are unnecessary
+ myAppendFilter->AddInputConnection( myShadingFaceSource->GetOutputPort() );
float aDeflection = 0.001;
bool anIsVector = false;
Kernel_Utils::Localizer loc;
vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();
- aWriter->SetInput( myAppendFilter->GetOutput() );
+ aWriter->SetInputConnection( myAppendFilter->GetOutputPort() );
aWriter->SetFileName( theFileName.ToCString() );
aWriter->Write();
aWriter->Delete();