Small code adaptations to allow deriving classes from the spreadsheet view
In order to derive own variants of the spreadsheet view, two small adaptations would required in existing PV code:
- in pqStandardServerManagerModelInterface.cxx, the following is required:
QObject* parent = NULL;
QString xmlname = proxy->GetXMLName();
- if (xmlname == pqSpreadSheetView::spreadsheetViewType())
+ if (vtkSMSpreadSheetViewProxy::SafeDownCast(proxy))
{
return new pqSpreadSheetView(group, name, proxy, server, parent);
}
this implies also an #include <vtkSMSpreadSheetViewProxy.h>
- in the vtkSpreadSheetView class, the following functions must be virtual in order to call them also from base class interfaces:
virtual vtkIdType GetNumberOfColumns();
virtual vtkIdType GetNumberOfRows();
virtual const char* GetColumnName(vtkIdType index);
virtual bool IsColumnInternal(vtkIdType index);
virtual bool IsColumnInternal(const char* columnName);
virtual const char* GetColumnLabel(vtkIdType index);
virtual const char* GetColumnLabel(const char* columnName);
virtual bool GetColumnVisibility(vtkIdType index);
virtual vtkVariant GetValue(vtkIdType row, vtkIdType col);
virtual vtkVariant GetValueByName(vtkIdType row, const char* columnName);
virtual bool IsRowSelected(vtkIdType row);
virtual bool IsAvailable(vtkIdType row);
virtual bool Export(vtkCSVExporter* exporter);
virtual vtkTable* FetchBlock(vtkIdType blockindex, bool skipCache = false);