Debug.
SVTK_RecorderDlg.cxx \
SVTK_ImageWriter.cxx \
SVTK_ImageWriterMgr.cxx \
- SVTK_Utils.cxx
-# OUV_PORTING_VTK6: to do
-# vtkPVAxesActor.h \
-# vtkPVAxesActor.cxx \
-# vtkPVAxesWidget.h \
-# vtkPVAxesWidget.cxx
+ SVTK_Utils.cxx \
+ vtkPVAxesActor.h \
+ vtkPVAxesActor.cxx \
+ vtkPVAxesWidget.h \
+ vtkPVAxesWidget.cxx
# internal headers
-I$(srcdir)/../Prs \
-I$(srcdir)/../VTKViewer \
-I$(srcdir)/../OpenGLUtils \
- -DvtkRenderingCore_AUTOINIT="2(vtkInteractionStyle,vtkRenderingOpenGL)"
+ -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingOpenGL,vtkRenderingFreeTypeOpenGL)"
libSVTK_la_LDFLAGS = \
$(VTK_LIBS) $(OGL_LIBS) \
myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 5
- // OUV_PORTING_VTK6: to check
- if(VTKViewer_DataSetMapper* aMapper = dynamic_cast<VTKViewer_DataSetMapper*>(theMapper)){
- aMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort());
- }else if(VTKViewer_PolyDataMapper* aMapper = dynamic_cast<VTKViewer_PolyDataMapper*>(theMapper)){
- aMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort());
- }
+ theMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort());
}
Superclass::SetMapper(theMapper);
}
if ( !myIsShrinkable )
return;
- if ( vtkAlgorithmOutput* aDataSet = myPassFilter[ 0 ]->GetOutputPort() )
+ if ( vtkAlgorithmOutput* anOutput = myPassFilter[ 0 ]->GetOutputPort() )
{
myPassFilter[ 0 ]->Update();
- // OUV_PORTING_VTK6: to do
- /*
- int numCells=aDataSet->GetNumberOfCells();
- int numPts = aDataSet->GetNumberOfPoints();
- //It's impossible to use to apply "shrink" for "empty" dataset
- if (numCells < 1 || numPts < 1)
- return;
- */
- myShrinkFilter->SetInputConnection( aDataSet );
+ if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() )
+ {
+ int numCells=aDataSet->GetNumberOfCells();
+ int numPts = aDataSet->GetNumberOfPoints();
+ //It's impossible to use to apply "shrink" for "empty" dataset
+ if (numCells < 1 || numPts < 1)
+ return;
+ }
+ myShrinkFilter->SetInputConnection( anOutput );
myPassFilter[ 1 ]->SetInputConnection( myShrinkFilter->GetOutputPort() );
myIsShrunk = true;
}
::UnShrink()
{
if ( !myIsShrunk ) return;
- if ( vtkAlgorithmOutput* aDataSet = myPassFilter[ 0 ]->GetOutputPort() )
+ if ( vtkAlgorithmOutput* anOutput = myPassFilter[ 0 ]->GetOutputPort() )
{
- myPassFilter[ 1 ]->SetInputConnection( aDataSet );
+ myPassFilter[ 1 ]->SetInputConnection( anOutput );
myIsShrunk = false;
}
}
#include <QSemaphore>
+#include <vtkAlgorithm.h>
#include <vtkImageData.h>
#include <vtkImageClip.h>
#include <vtkJPEGWriter.h>
//----------------------------------------------------------------------------
SVTK_ImageWriter
::SVTK_ImageWriter(QSemaphore* theSemaphore,
+ vtkAlgorithm* theAlgorithm,
vtkImageData* theImageData,
const std::string& theName,
int theProgressive,
int theQuality):
mySemaphore(theSemaphore),
+ myAlgorithm(theAlgorithm),
myImageData(theImageData),
myName(theName),
myProgressive(theProgressive),
//
if(myConstraint16Flag){
int uExtent[6];
- // OUV_PORTING_VTK6: to do
- /*
- myImageData->UpdateInformation();
- myImageData->GetUpdateExtent(uExtent);
- */
+ myAlgorithm->UpdateInformation();
+ myAlgorithm->GetUpdateExtent(uExtent);
unsigned int width = uExtent[1] - uExtent[0] + 1;
unsigned int height = uExtent[3] - uExtent[2] + 1;
width = (width / 16) * 16;
#include <QThread>
#include <string>
+class vtkAlgorithm;
class vtkImageData;
class QSemaphore;
{
public:
SVTK_ImageWriter(QSemaphore* theSemaphore,
+ vtkAlgorithm* theAlgorithm,
vtkImageData* theImageData,
const std::string& theName,
int theProgressive,
protected:
QSemaphore* mySemaphore;
+ vtkAlgorithm *myAlgorithm;
vtkImageData *myImageData;
std::string myName;
int myProgressive;
#include "SVTK_ImageWriterMgr.h"
#include "SVTK_ImageWriter.h"
+#include <vtkAlgorithm.h>
#include <vtkImageData.h>
#include <QSemaphore>
//----------------------------------------------------------------------------
void
SVTK_ImageWriterMgr
-::StartImageWriter(vtkImageData *theImageData,
+::StartImageWriter(vtkAlgorithm *theAlgorithm,
+ vtkImageData *theImageData,
const std::string& theName,
const int theProgressive,
const int theQuality)
{
SVTK_ImageWriter *anImageWriter =
new SVTK_ImageWriter(mySemaphore,
+ theAlgorithm,
theImageData,
theName,
theProgressive,
#include <vector>
class QString;
+class vtkAlgorithm;
class vtkImageData;
class SVTK_ImageWriter;
class QSemaphore;
~SVTK_ImageWriterMgr();
void
- StartImageWriter(vtkImageData *theImageData,
+ StartImageWriter(vtkAlgorithm *theAlgorithm,
+ vtkImageData *theImageData,
const std::string& theName,
const int theProgressive,
const int theQuality);
vtkImageData *anImageData = vtkImageData::New();
anImageData->DeepCopy(myFilter->GetOutput());
- myWriterMgr->StartImageWriter(anImageData,aName,myProgressiveMode,myQuality);
+ myWriterMgr->StartImageWriter(myFilter,anImageData,aName,myProgressiveMode,myQuality);
myNbWrittenFrames++;
myRenderWindow->AddObserver(vtkCommand::EndEvent,
myErrorStatus = 20;
return;
}
- // OUV_PORTING_VTK6: to do
- /*
- anImageData->UpdateInformation();
- int *anExtent = anImageData->GetWholeExtent();
- anImageData->SetUpdateExtent(anExtent[0], anExtent[1],
- anExtent[2], anExtent[3],
- 0,0);
- anImageData->UpdateData();
- */
+ myFilter->UpdateInformation();
+ myFilter->SetUpdateExtentToWholeExtent();
+ myFilter->Update();
}
#include "SVTK_Recorder.h"
#include "SVTK_RecorderDlg.h"
-// OUV_PORTING_VTK6: to do
-//#include "vtkPVAxesWidget.h"
-//#include "vtkPVAxesActor.h"
+#include "vtkPVAxesWidget.h"
+#include "vtkPVAxesActor.h"
#include "SALOME_ListIteratorOfListIO.hxx"
setCentralWidget(myInteractor);
- // OUV_PORTING_VTK6: to do
- /*
myAxesWidget = vtkPVAxesWidget::New();
myAxesWidget->SetParentRenderer(aRenderer->GetDevice());
myAxesWidget->SetViewport(0, 0, 0.25, 0.25);
anAxesActor->GetZAxisTipProperty()->SetColor( 0.0, 0.0, 1.0 );
anAxesActor->GetZAxisShaftProperty()->SetColor( 0.0, 0.0, 1.0 );
anAxesActor->GetZAxisLabelProperty()->SetColor( 0.0, 0.0, 1.0 );
- */
myView = new SVTK_View(this);
Initialize(myView,theModel);
SVTK_ViewWindow::~SVTK_ViewWindow()
{
myRecorder->Delete();
- // OUV_PORTING_VTK6: to do
- //myAxesWidget->Delete();
+ myAxesWidget->Delete();
}
*/
bool SVTK_ViewWindow::IsStaticTrihedronVisible() const
{
- // OUV_PORTING_VTK6: to do
- //return (bool)myAxesWidget->GetEnabled();
- return false;
+ return (bool)myAxesWidget->GetEnabled();
}
/*!
*/
void SVTK_ViewWindow::SetStaticTrihedronVisible( const bool theIsVisible )
{
- // OUV_PORTING_VTK6: to do
- //myAxesWidget->SetEnabled( (int)theIsVisible );
+ myAxesWidget->SetEnabled( (int)theIsVisible );
}
/*!
class SVTK_ViewParameterDlg;
class SVTK_Recorder;
-// OUV_PORTING_VTK6: to do
-//class vtkPVAxesWidget;
+class vtkPVAxesWidget;
class vtkObject;
class QtxAction;
int myToolBar;
int myRecordingToolBar;
- // OUV_PORTING_VTK6: to do
- //vtkPVAxesWidget* myAxesWidget;
+ vtkPVAxesWidget* myAxesWidget;
Qtx::BackgroundData myBackground;
private:
vtkPolyDataMapper *ymapper = vtkPolyDataMapper::New();
vtkPolyDataMapper *zmapper = vtkPolyDataMapper::New();
- xmapper->SetInput( this->XAxisVectorText->GetOutput() );
- ymapper->SetInput( this->YAxisVectorText->GetOutput() );
- zmapper->SetInput( this->ZAxisVectorText->GetOutput() );
+ xmapper->SetInputConnection( this->XAxisVectorText->GetOutputPort() );
+ ymapper->SetInputConnection( this->YAxisVectorText->GetOutputPort() );
+ zmapper->SetInputConnection( this->ZAxisVectorText->GetOutputPort() );
this->XAxisLabel->SetMapper( xmapper );
this->YAxisLabel->SetMapper( ymapper );
}
//-----------------------------------------------------------------------------
-#if (VTK_MINOR_VERSION>=2)
+#if (VTK_MAJOR_VERSION>5 || VTK_MINOR_VERSION>=2)
// porting to VTK 5.0.x
int vtkPVAxesActor::RenderTranslucentPolygonalGeometry(vtkViewport *vp)
{
{
case vtkPVAxesActor::CYLINDER_SHAFT:
(vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
- SetInput( this->CylinderSource->GetOutput() );
+ SetInputConnection( this->CylinderSource->GetOutputPort() );
break;
case vtkPVAxesActor::LINE_SHAFT:
(vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
- SetInput( this->LineSource->GetOutput() );
+ SetInputConnection( this->LineSource->GetOutputPort() );
break;
case vtkPVAxesActor::USER_DEFINED_SHAFT:
(vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
- SetInput( this->UserDefinedShaft );
+ SetInputData( this->UserDefinedShaft );
}
switch ( this->TipType )
{
case vtkPVAxesActor::CONE_TIP:
(vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
- SetInput( this->ConeSource->GetOutput() );
+ SetInputConnection( this->ConeSource->GetOutputPort() );
break;
case vtkPVAxesActor::SPHERE_TIP:
(vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
- SetInput( this->SphereSource->GetOutput() );
+ SetInputConnection( this->SphereSource->GetOutputPort() );
break;
case vtkPVAxesActor::USER_DEFINED_TIP:
(vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
- SetInput( this->UserDefinedTip );
+ SetInputData( this->UserDefinedTip );
}
- (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->
- GetInput()->Update();
- (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->
- GetInput()->Update();
+ (vtkPolyDataMapper::SafeDownCast(this->XAxisTip->GetMapper()))->Update();
+ (vtkPolyDataMapper::SafeDownCast(this->XAxisShaft->GetMapper()))->Update();
#include "SVTK.h"
#include "vtkProp3D.h"
+#include <vtkVersion.h>
+
class vtkRenderer;
class vtkPropCollection;
class vtkMapper;
// Description:
// Support the standard render methods.
virtual int RenderOpaqueGeometry(vtkViewport *viewport);
-#if (VTK_MINOR_VERSION>=2)
+#if (VTK_MAJOR_VERSION>5 || VTK_MINOR_VERSION>=2)
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport); // porting to VTK 5.0.x
virtual int HasTranslucentPolygonalGeometry(); // porting to VTK 5.0.x
#else
vtkCoordinate *tcoord = vtkCoordinate::New();
tcoord->SetCoordinateSystemToDisplay();
vtkPolyDataMapper2D *mapper = vtkPolyDataMapper2D::New();
- mapper->SetInput(this->Outline);
+ mapper->SetInputData(this->Outline);
mapper->SetTransformCoordinate(tcoord);
this->OutlineActor = vtkActor2D::New();
this->OutlineActor->SetMapper(mapper);
VTKViewer_msg_fr.qm
libVTKViewer_la_CPPFLAGS = $(QT_INCLUDES) $(VTK_INCLUDES) $(CAS_CPPFLAGS) \
- -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT
+ -I$(srcdir)/../Qtx -I$(srcdir)/../SUIT \
+ -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingOpenGL,vtkRenderingFreeTypeOpenGL)"
libVTKViewer_la_LDFLAGS = $(KERNEL_LDFLAGS) $(VTK_LIBS) $(QT_MT_LIBS) \
$(CAS_KERNEL) $(OGL_LIBS) ../Qtx/libqtx.la ../SUIT/libsuit.la
myPassFilter[ anId + 1 ]->SetInputConnection( myPassFilter[ anId ]->GetOutputPort() );
anId++; // 5
- // OUV_PORTING_VTK6: to check
- if(vtkDataSetMapper* aMapper = dynamic_cast<vtkDataSetMapper*>(theMapper)){
- aMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort());
- }else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper)){
- aMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort());
- }
+ theMapper->SetInputConnection(myPassFilter[anId]->GetOutputPort());
}
Superclass::SetMapper(theMapper);
}
vtkUnstructuredGrid* aTransformedGrid;
if(needRotation) {
aTransformedGrid = TransformGrid(aGrid,aAxis,anAngle);
- //aTransformedGrid->Update(); // OUV_PORTING_VTK6: seems to be useless
#ifdef _MY_DEBUG_
cout<<"Need Rotation!!!"<<endl;
#endif
std::vector<double> aScalarValues;
vtkUnstructuredGrid* anArc = BuildArc(aScalarValues);
vtkUnstructuredGrid* anTransArc;
- if(needRotation) {
+ if(needRotation)
anTransArc = TransformGrid(anArc,aAxis,-anAngle);
- //anTransArc->Update(); // OUV_PORTING_VTK6: seems to be useless
- }
else
anTransArc = anArc;
aList.push_back(thePnt2);
aList.push_back(thePnt3);
vtkUnstructuredGrid* aGrid = BuildGrid(aList);
- //aGrid->Update(); // OUV_PORTING_VTK6: seems to be useless
myPoints = aGrid->GetPoints();
myScalarValues.clear();
anImageData->Delete();
anImageData->SetExtent( 0, aWidth-1, 0, aHeight-1, 0, 0 );
- // OUV_PORTING_VTK6: to do (see Scalars Manipulation Functions)
- //anImageData->SetScalarTypeToUnsignedChar();
- //anImageData->SetNumberOfScalarComponents( 4 );
- //anImageData->AllocateScalars();
+ anImageData->AllocateScalars( VTK_UNSIGNED_CHAR, 4 );
unsigned char* aDataPtr = (unsigned char*)anImageData->GetScalarPointer();
aDataPtr[ anId++ ] = aValue * aCoef;
aDataPtr[ anId++ ] = aValue;
}
- //anImageData->Update(); // OUV_PORTING_VTK6: seems to be useless
return anImageData;
}