[Paraview-developers] Cannot load field data into block table

Shawn Waldon shawn.waldon at kitware.com
Wed Oct 29 13:01:18 EDT 2014


Josh,

I ran across a similar issue last week.  The fix was to patch the VTK that
ParaView builds against.  I've attached the patch that addresses the issue
with multi block data and field data, it is the second commit in this VTK
branch:

http://review.source.kitware.com/#/t/4899

Let me know if this solves your problem,

Shawn

On Wed, Oct 29, 2014 at 12:31 PM, Utkarsh Ayachit <
utkarsh.ayachit at kitware.com> wrote:

> Josh,
>
> Do you have a sharable dataset to reproduce this? I use it's just
> missing code somewhere.
>
> Utkarsh
>
> On Thu, Oct 23, 2014 at 1:29 PM, Joshua Murphy
> <Joshua.Murphy at lasp.colorado.edu> wrote:
> > Hello,
> >
> > I am trying to load some field data into a block data structure
> containing tables.  I am following the same procedure I do with the
> structured grid port on my reader (which works fine), but I cannot seem to
> actually load view the values in the table field data.
> >
> > the attached screen shot shows the problem. The titles for the columns
> load fine, but the actual data does not.  I have printed out the contents
> of the vtkStringArrays and vtkDoubleArrays at the point where I am loading
> them in, and the values are, indeed present.  They just do not show up in
> Paraview (I have tried with version 4.1 and 4.2 on Linux 64 bit).
> >
> > Does anyone have any idea why the values would not be loading?
> >
> > Thanks,
> > Josh
> >
> >
> > _______________________________________________
> > Paraview-developers mailing list
> > Paraview-developers at paraview.org
> > http://public.kitware.com/mailman/listinfo/paraview-developers
> >
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20141029/fb64e961/attachment.html>
-------------- next part --------------
diff --git a/IO/Legacy/vtkCompositeDataReader.cxx b/IO/Legacy/vtkCompositeDataReader.cxx
index 6861bfe..64506b8 100644
--- a/IO/Legacy/vtkCompositeDataReader.cxx
+++ b/IO/Legacy/vtkCompositeDataReader.cxx
@@ -18,6 +18,7 @@
 #include "vtkAMRInformation.h"
 #include "vtkDataObjectTypes.h"
 #include "vtkDoubleArray.h"
+#include "vtkFieldData.h"
 #include "vtkGenericDataObjectReader.h"
 #include "vtkHierarchicalBoxDataSet.h"
 #include "vtkInformation.h"
@@ -244,6 +245,7 @@ int vtkCompositeDataReader::RequestData(vtkInformation *, vtkInformationVector *
 bool vtkCompositeDataReader::ReadCompositeData(vtkMultiBlockDataSet* mb)
 {
   char line[256];
+
   if (!this->ReadString(line))
     {
     vtkErrorMacro("Failed to read block-count");
@@ -306,6 +308,12 @@ bool vtkCompositeDataReader::ReadCompositeData(vtkMultiBlockDataSet* mb)
       }
     }
 
+  if (this->ReadString(line) && strncmp(this->LowerCase(line),"field",5) == 0)
+    {
+    vtkSmartPointer< vtkFieldData > fd = this->ReadFieldData();
+    mb->SetFieldData(fd);
+    }
+
   return true;
 }
 
diff --git a/IO/Legacy/vtkCompositeDataWriter.cxx b/IO/Legacy/vtkCompositeDataWriter.cxx
index faa394a..bf1c3c7 100644
--- a/IO/Legacy/vtkCompositeDataWriter.cxx
+++ b/IO/Legacy/vtkCompositeDataWriter.cxx
@@ -173,6 +173,7 @@ bool vtkCompositeDataWriter::WriteCompositeData(ostream* fp,
     *fp << "ENDCHILD\n";
     }
 
+  this->WriteFieldData(fp, mb->GetFieldData());
   return true;
 }
 


More information about the Paraview-developers mailing list