[vtkusers] matrix output VERY hard to read
David Doria
daviddoria+vtk at gmail.com
Wed Oct 21 19:03:51 EDT 2009
On Wed, Oct 21, 2009 at 6:52 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> I agree with Jeff that a method for pretty-printing would be handy. A
> generic way of doing this is to create a "formatting" object that can
> be sent to PrintSelf:
>
> void PrintSelf(ostream& os, vtkIndent indent, vtkPrintFormat *format);
>
> The "format" object could provide information about precision, column
> widths, and "level of detail" i.e. whether to print all attributes or
> just the important ones i.e. the data values.
>
> This would be an optional method, i.e. if any object that didn't
> define the new form of PrintSelf would fall back to the old PrintSelf.
> The reason to modify PrintSelf, instead of adding new methods, is
> because it makes it easy to convert relevant object (matrix,
> transform, array) over to the new system.
>
> There could be two ways of invoking the pretty-print methods:
>
> vtkPrintFormat::Print(ostream &stream, vtkObject *object);
>
> vtkObject::Print(ostream &stream, vtkPrintFormat *format);
>
> Overall, this would be fairly easy to implement and would be very
> general-purpose. In fact it is general enough to even encompass such
> things as serialization of VTK objects.
>
> David
> ___
David Gobbi,
That sounds like a very reasonable idea to me. Are you or Jeff
interested in setting up the framework? Once it's setup, I'd be happy
to try to write a few of the Print functions. We should make a list of
things that could really use the new idea: vtkMatrix4x4,
vtk*Transform, vtk*Array, ?
This "level of detail" is also a nice feature, almost all the classes
could eventually be updated to have a few different levels of detail.
Thanks,
David
More information about the vtkusers
mailing list