<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2715.400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Hello to all!!!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm writing a program that can add a texture in a
Sphere. The compilation error is:</FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><FONT face=Arial size=2><EM>cannot convert parameter 1 from 'class
vtkPolyData *' to 'class vtkDataSet
*'<BR> Types pointed to are
unrelated; conversion requires reinterpret_cast, C-style cast or
function-style cast<BR>Error executing cl.exe.</EM></FONT></DIV></BLOCKQUOTE>
<DIV dir=ltr><EM><FONT face=Arial size=2></FONT></EM> </DIV>
<DIV dir=ltr>
<DIV><FONT face=Arial size=2>The code is the next. An the error line is
marked.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>const char
*m_TextureFileName=fl_file_chooser("Input Texture File
Name","*.ppm","");</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> if (!
m_TextureFileName)<BR> {<BR> return;<BR> }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>vtkPNMReader *m_TextureReader;<BR> m_TextureReader=vtkPNMReader::New();<BR> m_TextureReader->SetFileName(m_TextureFileName);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2> vtkTexture *m_Texture;<BR> m_Texture=vtkTexture::New();<BR> m_Texture->SetInput(m_TextureReader->GetOutput());<BR> m_Texture->InterpolateOn();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>vtkSphereSource *m_Sphere;<BR> m_Sphere=vtkSphereSource::New();<BR> m_Sphere->SetThetaResolution(7);<BR> m_Sphere->SetPhiResolution(7);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>vtkTextureMapToCylinder
*m_Tmapper;<BR> m_Tmapper=vtkTextureMapToCylinder::New();<BR><STRONG><EM> m_Tmapper->SetInput(m_Sphere->GetOutput());
***************************************************<BR></EM></STRONG> m_Tmapper->PreventSeamOn();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> vtkTransformTextureCoords
*m_Xform;<BR> m_Xform=vtkTransformTextureCoords::New();<BR> m_Xform->
SetInput(m_Tmapper->GetOutput());<BR> m_Xform-> SetScale
(4,4,1);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> vtkDataSetMapper
*m_SphereMapper;<BR> m_SphereMapper=vtkDataSetMapper::New();<BR> m_SphereMapper->SetInput(m_Xform->GetOutput());</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>vtkActor *m_SphereActor;<BR> m_SphereActor=vtkActor::New();<BR> m_SphereActor->SetMapper(m_SphereMapper);<BR> m_SphereActor->SetTexture(m_Texture);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>vtkRenderer *m_SphereRenderer;<BR> m_SphereRenderer=vtkRenderer::New();<BR> m_SphereRenderer->AddActor(m_SphereActor);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>vtkRenderWindow *m_RenderWindow;<BR> m_RenderWindow=vtkRenderWindow::New();</FONT></DIV>
<DIV><FONT face=Arial
size=2> m_RenderWindow->AddRenderer(m_SphereRenderer);</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>vtkRenderWindowInteractor *m_RenderWindowInteractor;<BR> m_RenderWindowInteractor=vtkRenderWindowInteractor::New();<BR> m_RenderWindowInteractor->SetRenderWindow(m_RenderWindow);<BR> m_RenderWindow->Render();<BR> m_RenderWindowInteractor->Start();</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></DIV>
<DIV dir=ltr><FONT face=Arial size=2>I don't know what happens because
vtkPolyDataType is inherited from vtkPointSet, and this from vtkDataSet. So,
There would have no probles. wouldn't there?.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>¿does anybody know what happens?.</FONT></DIV>
<DIV><FONT face=Arial size=2>¿what can I do to solve the problem?.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Sam</FONT></DIV></BODY></HTML>