[vtkusers] upgrade vtk from vtk 5.0 to 5.8
Gishara Indeewarie
gish.777 at gmail.com
Fri Jun 22 07:16:02 EDT 2012
Hi David,
I think below is where the error coming from.
Sorry for my last email.
Thanks.
vtkSmartPointer<vtkScalarBarWidget> barWidget_
// initialize widget objects
barWidget_.TakeReference(vtkScalarBarWidget::New());
barWidget_->SetScalarBarActor(barActor_);
barWidget_->SetInteractor(win_->GetInteractor());
vtkScalarBarRepresentation *rep =
vtkScalarBarRepresentation::SafeDownCast(barWidget_->GetRepresentation());
On Fri, Jun 22, 2012 at 4:43 PM, Gishara Indeewarie <gish.777 at gmail.com>wrote:
> Thanks for the reply David. It is somewhat a large and old (MFC) project
> and I want to add some new vtk features.
> I want to use vtk 5.8 there.
> I found a place where vtk have been used in the code as below:
>
> template<typename V,typename T> vtkSmartPointer<V> vtk_std_data(const T&
> data)
> {
> vtkSmartPointer<V> vtk; vtk.TakeReference(V::New());
> if( data.begin()!=data.end() )
> std::copy(data.begin(),data.end(),vtk->WritePointer(0,data.size()));
> return vtk;
> }
>
> template<typename V> vtkSmartPointer<V> vtk_data(vtkDataArray* data)
> {
> vtkSmartPointer<V> vtk; vtk.TakeReference(V::New());
> vtk->SetData(data);
> return vtk;
> }
>
> template<typename V> vtkSmartPointer<V> vtk_data_set(vtkPoints* data)
> {
> vtkSmartPointer<V> vtk; vtk.TakeReference(V::New());
> vtk->SetPoints(data);
> return vtk;
> }
>
> Thanks again.
>
>
> On Fri, Jun 22, 2012 at 4:31 PM, David Doria <daviddoria at gmail.com> wrote:
>
>> On Fri, Jun 22, 2012 at 6:33 AM, Gishara Indeewarie <gish.777 at gmail.com>
>> wrote:
>> > Hi all,
>> >
>> > I want to upgrade vtk version of my project from 5.0 to 5.8. When I
>> tried to
>> > link vtk 5.8 I get erors as follow:
>> >
>> > C:\VTK_New\include\vtk-5.8\vtkSmartPointer.h(43) : error C2664:
>> > 'vtkSmartPointer<T>::CheckType' : cannot convert parameter 1 from
>> > 'vtkScalarBarActor *' to 'vtkScalarBarWidget *'
>> > 1> with
>> > 1> [
>> > 1> T=vtkScalarBarWidget
>> > 1> ]
>> > 1> Types pointed to are unrelated; conversion requires
>> > reinterpret_cast, C-style cast or function-style cast
>> > 1> .\vtk\vtkPBFEAView.cpp(313) : see reference to function
>> template
>> > instantiation
>> 'vtkSmartPointer<T>::vtkSmartPointer<vtkScalarBarActor>(const
>> > vtkSmartPointer<vtkScalarBarActor> &)' being compiled
>> > 1> with
>> > 1> [
>> > 1> T=vtkScalarBarWidget
>> > 1> ]
>> > 1>C:\VTK_New\include\vtk-5.8\vtkSmartPointer.h(60) : error C2664:
>> > 'vtkSmartPointer<T>::CheckType' : cannot convert parameter 1 from
>> > 'vtkScalarBarWidget *' to 'vtkScalarBarActor *'
>> > 1> with
>> > 1> [
>> > 1> T=vtkScalarBarActor
>> > 1> ]
>> > 1> Types pointed to are unrelated; conversion requires
>> > reinterpret_cast, C-style cast or function-style cast
>> > 1> .\vtk\vtkPBFEAView.cpp(1952) : see reference to function
>> template
>> > instantiation 'vtkSmartPointer<T> &vtkSmartPointer<T>::operator
>> > =<vtkScalarBarWidget>(const vtkSmartPointer<vtkScalarBarWidget> &)'
>> being
>> > compiled
>> > 1> with
>> > 1> [
>> > 1> T=vtkScalarBarActor
>> > 1> ]
>> >
>> > Can anyone tell me the reason for these errors and how to fix them.
>> > Thanks a lot.
>> >
>> >
>> > --
>> > Gish
>>
>> Can you show us the code that is generating these errors?
>>
>> David
>>
>
>
>
> --
> Gish
>
--
Gish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120622/7f32fcdf/attachment.htm>
More information about the vtkusers
mailing list