MantisBT - VTK | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0005775 | VTK | (No Category) | public | 2007-09-25 03:30 | 2008-06-03 14:48 |
Reporter | emiliano79 | ||||
Assigned To | Sean McBride | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | ||||
Project | |||||
Type | |||||
Summary | 0005775: vtkPLYReader does not work on win and mac ASCII ply files | ||||
Description | The vtkPLYReader is able to load ply files either in binary format or in ASCII format, but in the second case there is a problem with line termination characters. The vtkPLYReader reads only ASCII lines terminating with LF character (0x0A) according to unix-like operating systems: to achieve platform independence, it is supposed to works fine also on win and mac ASCII files. In the former the lines terminate with CR LF (0x0D 0x0A), in the latter lines terminate with CR (0x0D). So the vtkPLYReader has to recognize different line terminations as well. | ||||
Steps To Reproduce | |||||
Additional Information | I have modified the vtkPLY.cxx file to implement platform independent line termination reading. Just replace this section in the vtkPLY.cxx file: /* convert line-feed and tabs into spaces */ /* (this guarentees that there will be a space before the */ /* null character at the end of the string) */ str[BIG_STRING-2] = ' '; str[BIG_STRING-1] = '\0'; for (ptr = str, ptr2 = str_copy; *ptr != '\0'; ptr++, ptr2++) { *ptr2 = *ptr; if (*ptr == '\t') { *ptr = ' '; *ptr2 = ' '; } else if (*ptr == '\n') { *ptr = ' '; *ptr2 = '\0'; break; } } with: /* convert line-feed and tabs into spaces */ /* (this guarentees that there will be a space before the */ /* null character at the end of the string) */ str[BIG_STRING-2] = ' '; str[BIG_STRING-1] = '\0'; for (ptr = str, ptr2 = str_copy; *ptr != '\0'; ptr++, ptr2++) { *ptr2 = *ptr; if (*ptr == '\t') { *ptr = ' '; *ptr2 = ' '; } /* ----------------------------------------------------------------------- *-*-* PATCH *-*-* PATCH *-*-* PATCH *-*-* PATCH *-*-* -------------------------------------------------------------------------- Patch to allow reading PLY files in Unix, Windows and Mac end line format ------------------------------------------------------------------------*/ else if (*ptr == '\r') { *ptr = ' '; *ptr2 = '\0'; } /* ----------------------------------------------------------------------- *-*-* PATCH *-*-* PATCH *-*-* PATCH *-*-* PATCH *-*-* -------------------------------------------------------------------------/ else if (*ptr == '\n') { *ptr = ' '; *ptr2 = '\0'; break; } } | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | ![]() https://www.vtk.org/Bug/file/6221/plyPatch.txt ![]() https://www.vtk.org/Bug/file/6222/TestPLYReader.cxx ![]() https://www.vtk.org/Bug/file/6223/TestPLYReader.png ![]() ![]() https://www.vtk.org/Bug/file/6224/plyTestPatch.txt | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2007-09-25 03:30 | emiliano79 | New Issue | |||
2007-09-25 03:46 | emiliano79 | Note Added: 0009282 | |||
2007-11-12 15:36 | Mathieu Coursolle | File Added: plyPatch.txt | |||
2007-11-12 15:38 | Mathieu Coursolle | Note Added: 0009668 | |||
2007-11-12 16:58 | Mathieu Coursolle | File Added: TestPLYReader.cxx | |||
2007-11-12 16:58 | Mathieu Coursolle | File Added: TestPLYReader.png | |||
2007-11-12 16:59 | Mathieu Coursolle | File Added: plyTestPatch.txt | |||
2007-11-12 17:00 | Mathieu Coursolle | Note Added: 0009669 | |||
2007-11-14 12:38 | Sean McBride | Status | backlog => tabled | ||
2007-11-14 12:38 | Sean McBride | Assigned To | => Sean McBride | ||
2007-11-15 10:50 | Sean McBride | Status | tabled => @80@ | ||
2007-11-15 10:50 | Sean McBride | Resolution | open => fixed | ||
2007-11-15 10:50 | Sean McBride | Note Added: 0009686 | |||
2008-06-03 14:48 | Sean McBride | Status | @80@ => closed | ||
2008-06-03 14:48 | Sean McBride | Note Added: 0012229 | |||
2011-06-16 13:11 | Zack Galbreath | Category | => (No Category) |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|