Hi,<br><br>How do you name blocks? I was patching the ParaView code how Takuya posted previously on the mailing list and putting the name as field data for each block. Unfortunately the latest changes in the CVS stop this from working.<br>
<br>If there is a better way to do naming I'd prefer to use that.<br><br>Thanks,<br>Paul<br><br>PS this was the post with the patch I was applying -<br><br>2008/3/7 OSHIMA Takuya <<a href="mailto:oshima@eng.niigata-u.ac.jp">oshima@eng.niigata-u.ac.jp</a>>:<br>
Hi,<br>
<br>
As I play with the new composite dataset structures, I came to think<br>
it would indeed be nice if ParaView3 can handle datasets with string<br>
labels ("Porous Material," "Air," ... , rather than "DataSet 0,"<br>
"DataSet 1," ...). I mean, for example, VTK/IO/vtkEnsight6Reader.cxx<br>
has a fragment of code to assign its output a string label.<br>
<br>
vtkCharArray* nmArray = vtkCharArray::New();<br>
nmArray->SetName("Name");<br>
size_t len = strlen(name);<br>
nmArray->SetNumberOfTuples<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">(static_cast<vtkIdType>(len)+1);<br>
char* copy = nmArray->GetPointer(0);<br>
memcpy(copy, name, len);<br>
copy[len] = '\0';<br>
output->GetFieldData()->AddArray(nmArray);<br>
nmArray->Delete();<br>
<br>
I can do the same thing to each member dataset in a MultiBlockDataSet,<br>
but it doesn't seem there's a way to display the labels in<br>
ParaView. However if I rewrite the code a bit for Information tab of<br>
Object Inspector (of the CVS head)<br>
<br>
--- Qt/Components/pqProxyInformationWidget.cxx.orig 2008-02-20 08:56:03.000000000 +0900<br>
+++ Qt/Components/pqProxyInformationWidget.cxx 2008-03-07 18:40:06.000000000 +0900<br>
@@ -387,7 +387,8 @@<br>
{<br>
QTreeWidgetItem* node = 0;<br>
<br>
- QString label = info? info->GetPrettyDataTypeString() : "NA";<br>
+ QString label = info?<br>
+ (parentItem? info->GetName() : info->GetPrettyDataTypeString()): "NA";<br>
if (parentItem)<br>
{<br>
node = new QTreeWidgetItem(parentItem, QStringList(label));<br>
<br>
or the one for Properties tab of the Extract Block filter,<br>
<br>
--- Qt/Components/pqSignalAdaptorCompositeTreeWidget.cxx.orig 2008-03-01 10:59:23.000000000 +0900<br>
+++ Qt/Components/pqSignalAdaptorCompositeTreeWidget.cxx 2008-03-07 18:12:23.000000000 +0900<br>
@@ -395,7 +395,15 @@<br>
for (unsigned int cc=0; cc < cinfo->GetNumberOfChildren(); cc++)<br>
{<br>
vtkPVDataInformation* childInfo = cinfo->GetDataInformation(cc);<br>
- QString childLabel = QString("DataSet %1").arg(cc);<br>
+ QString childLabel;<br>
+ if(childInfo)<br>
+ {<br>
+ childLabel = QString("DataSet %1 %2").arg(cc).arg(childInfo->GetName());<br>
+ }<br>
+ else<br>
+ {<br>
+ childLabel = QString("DataSet %1").arg(cc);<br>
+ }<br>
bool is_leaf = true;<br>
if (childInfo && childInfo->GetCompositeDataInformation()->GetDataIsComposite())<br>
{<br>
<br>
I can see the string labels in addition to dataset numbers. Searching<br>
the list archives of ParaView and VTK I found several similar<br>
discussions held in the past. The modifications above are just<br>
concepts, not ment to be applied to the real source, but would things<br>
like this be an option?<br>
<br>
Takuya</blockquote><br><br><div class="gmail_quote">2008/4/30 OSHIMA Takuya <<a href="mailto:oshima@eng.niigata-u.ac.jp">oshima@eng.niigata-u.ac.jp</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I'm so happy to see the string block labeling feature has been finally<br>
added to the CVS head!<br>
<br>
However I found a problem when I ran the Extract Block filter to a<br>
vtkMultiBlockDataSet which has the block structure as shown by the<br>
attached picture1.png (the Properties panel of the Extract Block<br>
filter). In this case I expect to see the labels for the selected<br>
blocks "roofEndWeb" and "internalField" after running the filter, but<br>
in reality what I got was "roofEndWeb" and "1: Unstructured Grid" as<br>
shown by picture2.png (the Information panel of the same filter). The<br>
problem occurrs only when Prune Output is turned on.<br>
<br>
My guess is that the line 232 of vtkExtractBlock.cxx<br>
<br>
clone->GetMetaData(index)->Copy(prunedBlock->GetMetaData(cc));<br>
<br>
should be<br>
<br>
clone->GetMetaData(index)->Copy(prunedBlock->GetMetaData(static_cast<br>
<unsigned int>(0)));<br>
<br>
? (this worked for the case, but I'm not so sure.)<br>
<font color="#888888"><br>
Takuya<br>
</font><br>_______________________________________________<br>
ParaView mailing list<br>
<a href="mailto:ParaView@paraview.org">ParaView@paraview.org</a><br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br>