[vtkusers] Function cast error

Malcolm Drummond malcolm at geovision.co.za
Mon Feb 2 07:17:47 EST 2004


Hi Snehal

I think you mean SetScalars not GetScalars

HTH
Malcolm
  ----- Original Message ----- 
  From: Snehal Srikrishna 
  To: vtkusers at vtk.org 
  Sent: Monday, February 02, 2004 12:00 PM
  Subject: [vtkusers] Function cast error


  Hi vtk users,

  I have been trying to convert the tcl code- 'shepard.tcl' into a c++ code but I am encountering an error in one particular function as shown below:

  TCL code:

  vtkFloatArray scalars
  for {set i 0} {$i<50} {incr i 1} {
      eval scalars InsertValue $i [math Random 0 1]
  }
  vtkPolyData profile
      profile SetPoints points
  profile GetPointData] SetScalars scalars

  C++ code:

  vtkFloatArray *amplitudeScalars=vtkFloatArray::New();
   for(int j=0;j<numFilteredPoints;j++)
   {
    amplitudeScalars->InsertValue(j,filteredPoints->amplitudeValue);
   }
   vtkPolyData *profile=vtkPolyData::New();
   profile->SetPoints(points);
   profile->GetPointData()->GetScalars(amplitudeScalars); 

  The error i am encountering is as follows:

  class vtkDataArray *__thiscall vtkDataSetAttributes::GetScalars(const char *)' : cannot convert parameter 1 from 'class vtkFloatArray *' to 'const char *'
          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast....

  Could anyone one help me on how to fix this?

  Thanks a zillion,

  Snehal


------------------------------------------------------------------------------
  Play the prediction game on MEZ. Win Sehwag's autographed T-shirts. Predict and win on myenjoyzone.com _______________________________________________ This is the private VTK discussion list. Please keep messages on-topic. Check the FAQ at: Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040202/71b7d82a/attachment.htm>


More information about the vtkusers mailing list