[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 15:42:47 EDT 2018


Interesting - I tried e.g. test1.A.ply for which the current method (GetFilenameExtension) returned .A.ply as extension.
On the other hand, using GetFilenameLastExtension resulted in the correct identification of  just .ply as extension.

This was on windows 8.1 with vtk 8.0 - maybe there is variation between platforms?

Best wishes,
  Markus


Arthritis Research UK Centre for Sport, Exercise and Osteoarthritis
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


-----Original Message-----
From: Bill Lorensen [mailto:bill.lorensen at gmail.com] 
Sent: 31 March 2018 20:34
To: Heller M.O.
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] suggestion for a tweak in Cxx example: ReadAllPolyDataTypes.cxx / ReadAllPolyDataTypesDemo.cxx

Sounds like a good idea, but give me an example of a filename that fails with the current example. I tried a file named Torso.new.vtp an it was read fine.

Bill

On Sat, Mar 31, 2018 at 9:40 AM, Heller M.O. <M.O.Heller at soton.ac.uk> wrote:
> 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
>
> -------------------------------------------------------------------
>
> 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
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://vtk.org/mailman/listinfo/vtkusers
>



--
Unpaid intern in BillsParadise at noware dot com


More information about the vtkusers mailing list