[vtkusers] ColorIsosurface.tcl problem - error vtkStructuredGrid *' to 'class vtkDataSet *'
Ketan Mehta
ketan.mehta at wipro.com
Fri Sep 12 06:49:42 EDT 2003
Hi All,
I am trying to convert all tcl examples to C++ windows examples, ( manual work :( )
To understand better on windows platform.
While converting the example from tcl to C++ on windows, I am getting following
compile error. Same error has been posted earlier.
ERROR::
IsoSurface.cpp(40) : error C2664: 'SetInput' : cannot convert parameter 1 from 'class
vtkStructuredGrid *' to 'class vtkDataSet *'
--------------------------------------------
Platform - VTK 4.2 ( Windowsed installer ) on WinXP
I am using following example and both relevant code are pasted for reference -
C:\Program Files\vtk42\Examples\VisualizationAlgorithms\Tcl\ColorIsosurface.tcl
--------- TCL example ---------------------------
# This example shows how to color an isosurface with other data. Basically
vtkPLOT3DReader pl3d
pl3d SetXYZFileName "$VTK_DATA_ROOT/Data/combxyz.bin"
pl3d SetQFileName "$VTK_DATA_ROOT/Data/combq.bin"
pl3d SetScalarFunctionNumber 100
pl3d SetVectorFunctionNumber 202
pl3d AddFunction 153
pl3d Update
pl3d DebugOn
# The contoru filter uses the labeled scalar (function number 100
# above to generate the contour surface; all other data is interpolated
# during the contouring process.
#
vtkContourFilter iso
iso SetInput [pl3d GetOutput]
iso SetValue 0 .24
------------------ VC++ code for Windows platform ----------------
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkCamera.h"
#include "vtkActor.h"
#include "vtkPolyDataMapper.h"
#include "vtkPLOT3DReader.h"
#include "vtkContourFilter.h"
#include "vtkLODActor.h"
#include "vtkStructuredGridOutlineFilter.h"
#include "vtkContourFilter.h"
#include "vtkPolyDataNormals.h"
main()
{
// Read some data. The important thing here is to read a function as a data
// array as well as the scalar and vector. (here function 153 is named
// "Velocity Magnitude").Later this data array will be used to color the
// isosurface.
vtkPLOT3DReader *pl3d = vtkPLOT3DReader::New();
pl3d->SetXYZFileName("E:/VTKData/Data/combxyz.bin"); // Just for timebeing
pl3d->SetQFileName("E:/VTKData/Data/combq.bin");
pl3d->SetScalarFunctionNumber(100);
pl3d->SetVectorFunctionNumber(202);
pl3d->AddFunction(153);
pl3d->Update();
pl3d->DebugOn();
// The contour filter uses the labeled scalar (function number 100
// above to generate the contour surface; all other data is interpolated
// during the contouring process.
vtkContourFilter *iso = vtkContourFilter::New();
iso->SetInput( pl3d->GetOutput() );
iso->SetValue(0, 0.24);
vtkPolyDataNormals *normals = vtkPolyDataNormals::New();
normals->SetInput( iso->GetOutput() );
normals->SetFeatureAngle(45);
---------------------------------------------------------------
--
Thanks & Regards
Ketan
|------------------------------------------------------------|
|Ketan Mehta | Wipro(HS) | Bangalore | +91-80-5110-3070 x3057|
|+91-80-8522636 | 98454-48492 | ketan.mehta at wipro dot com |
|------------------------------------------------------------|
| Don't let CAN'T attitude discourage ~I N N O V A T I O N~ |
|------------------------------------------------------------|
**************************Disclaimer************************************
Information contained in this E-MAIL being proprietary to Wipro Limited is
'privileged' and 'confidential' and intended for use only by the individual
or entity to which it is addressed. You are notified that any use, copying
or dissemination of the information contained in the E-MAIL in any manner
whatsoever is strictly prohibited.
***************************************************************************
More information about the vtkusers
mailing list