[vtkusers] ImplicitModeller and ContourFilter

Mathieu Malaterre mathieu.malaterre at kitware.com
Fri Mar 26 17:15:52 EST 2004


Forgot the link:

http://vtk.org/pipermail/vtkusers/2002-October/014098.html


Mathieu

Christopher.Moore at noaa.gov wrote:
> Thanks, Mathieu & Yan - I should have caught that one...
> 
> I find that vtk apps are oddly sensitive to the order that the libraries 
> are listed in the Makefile at link time.  I had to move -lvtkHybrid first 
> in the list of vtk libraries before it would compile!  (gcc RH9).
> 
> Cheers,
> Chris
> 
> __________________________________________________________________
> Christopher Moore                email: Christopher.Moore at noaa.gov
> Research Scientist, Oceanography                 tel: 206.526.6779
> University of Washington/JISAO/NOAA-PMEL         fax: 206.526.6744
> ------------------------------------------------------------------
> 
> On Fri, 26 Mar 2004, Mathieu Malaterre wrote:
> 
> 
>>Christopher,
>>
>> > NIso->SetInput((vtkDataSet*) Nmodeller->GetOutput());
>>
>>	VTK uses forward declaration, you should not cast object like this. You 
>>need to include the proper header that's all.
>>	In your case you need:
>>
>>#include "vtkImageData.h"
>>
>>Mathieu
>>
>>Christopher.Moore at noaa.gov wrote:
>>
>>>Thanks for the try, Pingkun, but simply casting the ImplicitModeller 
>>>didn't work - the output is ImageData (the superclass is already DataSet), 
>>>and when I add the cast:
>>>
>>>NIso->SetInput((vtkDataSet*) Nmodeller->GetOutput());
>>>
>>>I get the following errors now:
>>>
>>>/usr/local/lib/vtk/libvtkHybrid.a(vtkImplicitModeller.o)(.text+0x2f): In 
>>>function `vtkImplicitModeller::CollectRevisions(std::basic_ostream<char, 
>>>std::char_traits<char> >&)':: undefined reference to 
>>>`vtkDataSetToImageFilter::CollectRevisions(std::basic_ostream<char,
>>>std::char_traits<char> >&)'
>>>/usr/local/lib/vtk/libvtkHybrid.a(vtkImplicitModeller.o)(.text+0x4e5): In 
>>>function `vtkImplicitModeller::UpdateData(vtkDataObject*)':: undefined reference 
>>>to `vtkDataSetToImageFilter::GetInput()'
>>>/usr/local/lib/vtk/libvtkHybrid.a(vtkImplicitModeller.o)(.text+0xc15): In 
>>>function `vtkImplicitModeller_ThreadedAppend(void*)':: undefined reference 
>>>to `vtkCellLocator::New()'
>>>/usr/local/lib/vtk/libvtkHybrid.a(vtkImplicitModeller.o)(.text+0xfa6): In 
>>>function `vtkImplicitModeller_ThreadedAppend(void*)':: undefined reference to 
>>>`vtkCellLocator::FindClosestPointWithinRadius(float*, float, float*, 
>>>vtkGenericCell*, int&, int&, float&)'
>>>/usr/local/lib/vtk/libvtkHybrid.a(vtkImplicitModeller.o)(.text+0x19c8): In 
>>>function `vtkImplicitModeller::Append(vtkDataSet*)':: undefined reference 
>>>to `vtkStructuredGrid::New()'
>>>
>>>Does anyone have any ideas?
>>>
>>>Cheers,
>>>Chris
>>>
>>>On Fri, 26 Mar 2004, Yan Pingkun wrote:
>>>
>>>
>>>
>>>>vtkImageData is derived from vtkDataSet. So you can call the function
>>>>like this:
>>>>NIso->SetInput((vtkDataSet*) Nmodeller->GetOutput());
>>>>This is caused by the strong type checking character of C++. Sometimes
>>>>it may help us from being trapped by errors.
>>>>
>>>>TCL is a script language. It doesn't match the data type strictly.
>>>>Hence, there's no warning or error on it.
>>>>
>>>>My two cents.
>>>>
>>>>Pingkun
>>>>
>>>>-----Original Message-----
>>>>From: vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org] On Behalf
>>>>Of Christopher.Moore at noaa.gov
>>>>Sent: Friday, March 26, 2004 9:15 AM
>>>>To: vtkusers at vtk.org
>>>>Subject: [vtkusers] ImplicitModeller and ContourFilter
>>>>
>>>>
>>>>
>>>>This is odd:
>>>>
>>>>Now that ImplicitModeller is a DataSetToImageFilter, my ContourFilter 
>>>>complains, but only in C++, not Tcl:
>>>>
>>>> vtkVectorText *letterN = vtkVectorText::New();
>>>> letterN->SetText("N");
>>>>
>>>> vtkImplicitModeller *Nmodeller = vtkImplicitModeller::New();
>>>> Nmodeller->SetInput(letterN->GetOutput());
>>>> Nmodeller->SetMaximumDistance(0.2);
>>>> Nmodeller->SetSampleDimensions(64, 64, 64);
>>>> Nmodeller->SetAdjustDistance(.5);
>>>>
>>>> vtkContourFilter *NIso = vtkContourFilter::New();
>>>> NIso->SetInput(Nmodeller->GetOutput());
>>>> NIso->SetValue(1, .1);
>>>>
>>>>compiler error:
>>>>
>>>>CreateCompass.cxx:138: no matching function for call to 
>>>>`vtkContourFilter::SetInput(vtkImageData*)'
>>>>/usr/local/include/vtk/vtkDataSetToPolyDataFilter.h:44: candidates are: 
>>>>virtual void vtkDataSetToPolyDataFilter::SetInput(vtkDataSet*)
>>>>
>>>>but if I run Examples/Modelling/Tcl/hello.tcl, it seems to run fine with
>>>>
>>>>the same ContourFilter input (vtkImplicitModeller GetOutput).
>>>>
>>>>Am I missing something?  How do I use ImplicitModeller with
>>>>ContourFilter?  
>>>>Why does it work when wrapped in Tcl?
>>>>
>>>>Cheers,
>>>>Chris
>>>>
>>>>__________________________________________________________________
>>>>Christopher Moore                email: Christopher.Moore at noaa.gov
>>>>Research Scientist, Oceanography                 tel: 206.526.6779
>>>>University of Washington/JISAO/NOAA-PMEL         fax: 206.526.6744
>>>>------------------------------------------------------------------
>>>>
>>>>
>>>
>>>
>>>_______________________________________________
>>>This is the private VTK discussion list. 
>>>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>>>Follow this link to subscribe/unsubscribe:
>>>http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>
>>
>>
>>
> 
> 








More information about the vtkusers mailing list