[vtkusers] suggestion for a tweak in Cxx example: ReadAllPolyDataTypes.cxx / ReadAllPolyDataTypesDemo.cxx
Heller M.O.
M.O.Heller at soton.ac.uk
Sat Mar 31 12:40:19 EDT 2018
Dear all,
I used the ReadAllPolyDataTypes.cxx example to create a little command-line tool for file conversion and noted that a small change may make the example code more robust against funny filenames i.e. filenames including multiple dots.
I think it could help to make the example a tad more robust if
line 70 of the ReadAllPolyDataTypes.cxx file was changed from:
std::string extension = vtksys::SystemTools::GetFilenameExtension(std::string(fileName));
to:
std::string extension = vtksys::SystemTools::GetFilenameLastExtension(std::string(fileName));
It took me as an absolute Cxx idiot a while to figure out what the problem was and how to address it.
(A similar change may also be useful for the ReadAllPolyDataTypesDemo.cxx example)
Best wishes, Markus
Arthritis Research UK Centre for Sport, Exercise and Osteoarthritis
www.sportsarthritisresearchuk.org<http://www.sportsarthritisresearchuk.org>
-------------------------------------------------------------------
Prof. Dr. Markus O. Heller
Full Professor of Biomechanics
University of Southampton
Department of Mechanical Engineering
Southampton
SO17 1BJ
United Kingdom
Tel. : +44 (0) 23 8059 4909
Fax : +44 (0) 23 8059 3016
email: m.o.heller at soton.ac.uk
-------------------------------------------------------------------
8th World Congress of Biomechanics, 8-12 July 2018, Dublin, Ireland
http://wcb2018.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180331/0de28702/attachment.html>
More information about the vtkusers
mailing list