myGeomFilter->SetInput( myFieldTransform->GetUnstructuredGridOutput() );
myPSMapper->SetInput( myGeomFilter->GetOutput() );
-
- //vtkXMLImageDataReader* aReader = vtkXMLImageDataReader::New();
- //aReader->SetFileName( "/dn06/salome/ouv/SALOME3/TextureAlphaChannel.vti" );
- //myPSMapper->InitTexture( aReader->GetOutput() );
}
//----------------------------------------------------------------------------
::SetRelativeMinSize(float theRelativeMinSize)
{
myRelativeMinSize = theRelativeMinSize;
- /*
- cout << "VISU_GaussPointsPL::SetRelativeMinSize ";
- cout << myAverageCellSize << " * ";
- cout << myRelativeMinSize << " * 1000.0 = ";
- cout << 1000.0 * myAverageCellSize * myRelativeMinSize << endl;
- */
myPSMapper->SetPointSpriteSize( 0.0 );
myPSMapper->SetPointSpriteMinSize( 1000.0 * myAverageCellSize * myRelativeMinSize );
::SetRelativeMaxSize(float theRelativeMaxSize)
{
myRelativeMaxSize = theRelativeMaxSize;
- /*
- cout << "VISU_GaussPointsPL::SetRelativeMaxSize ";
- cout << myAverageCellSize << " * ";
- cout << myRelativeMaxSize << " * 1000.0 = ";
- cout << 1000.0 * myAverageCellSize * myRelativeMaxSize << endl;
- */
myPSMapper->SetPointSpriteSize( 0.0 );
myPSMapper->SetPointSpriteMaxSize( 1000.0 * myAverageCellSize * myRelativeMaxSize );
VISU_GaussPointsPL
::SetMagnification(float theMagnification)
{
- //cout << "VISU_GaussPointsPL::SetMagnification " << theMagnification << endl;;
myPSMapper->SetPointSpriteMagnification( theMagnification );
Modified();
VISU_GaussPointsPL
::SetImageData(vtkImageData* theImageData)
{
- //cout << "VISU_GaussPointsPL::SetImageData " << theImageData << endl;
- //theImageData->Print( cout );
-
myPSMapper->SetImageData( theImageData );
}
#include <vtkJPEGReader.h>
#include <vtkXMLImageDataWriter.h>
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
int main( int argc, char** argv )
{
- std::cout << "Converting the image to VTI format" << std::endl;
+ if(MYDEBUG) std::cout << "Converting the image to VTI format" << std::endl;
if( argc != 4 )
{
return 1;
}
- std::cout << argv[1] << std::endl;
- std::cout << argv[2] << std::endl;
- std::cout << argv[3] << std::endl;
+ if(MYDEBUG){
+ std::cout << argv[1] << std::endl;
+ std::cout << argv[2] << std::endl;
+ std::cout << argv[3] << std::endl;
+ }
- vtkImageReader2* aReader;
+ vtkImageReader2* aReader = NULL;
if( !strcmp( argv[1], "BMP" ) || !strcmp( argv[1], "bmp" ) )
{
- std::cout << "Input image format - BMP" << std::endl;
+ if(MYDEBUG) std::cout << "Input image format - BMP" << std::endl;
aReader = vtkBMPReader::New();
}
else if( !strcmp( argv[1], "PNG" ) || !strcmp( argv[1], "png" ) )
{
- std::cout << "Input image format - PNG" << std::endl;
+ if(MYDEBUG) std::cout << "Input image format - PNG" << std::endl;
aReader = vtkPNGReader::New();
}
else if( !strcmp( argv[1], "JPG" ) || !strcmp( argv[1], "jpg" ) )
{
- std::cout << "Input image format - JPG" << std::endl;
+ if(MYDEBUG) std::cout << "Input image format - JPG" << std::endl;
aReader = vtkJPEGReader::New();
}
else
std::cout << "Unknown input image format... Must be BMP, PNG or JPG." << std::endl;
return 1;
}
-
aReader->SetFileName( argv[2] );
aReader->Update();
vtkXMLImageDataWriter* aWriter = vtkXMLImageDataWriter::New();
aWriter->SetInput( aReader->GetOutput() );
aWriter->SetFileName( argv[3] );
- return 1 - aWriter->Write();
+ aWriter->Write();
+
+ aWriter->Delete();
+ aReader->Delete();
+
+ return 0;
}