From c98de02846f2c75d46c208889de2960d16545519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 4 Feb 2019 08:45:12 +0100 Subject: [PATCH 1/4] Added unittest to check ply reader --- src/Unittests/TestFiles/sphere840.ply | 1271 +++++++++++++++++++++ src/Unittests/unittests_read_write_PLY.cc | 17 + 2 files changed, 1288 insertions(+) create mode 100644 src/Unittests/TestFiles/sphere840.ply diff --git a/src/Unittests/TestFiles/sphere840.ply b/src/Unittests/TestFiles/sphere840.ply new file mode 100644 index 00000000..446dacc0 --- /dev/null +++ b/src/Unittests/TestFiles/sphere840.ply @@ -0,0 +1,1271 @@ +ply +format ascii 1.0 +element vertex 422 +property float x +property float y +property float z +element face 840 +property list uchar int vertex_indices +end_header +0 0 -127 +5 25 -125 +10 24 -125 +15 21 -125 +19 17 -125 +22 13 -125 +25 8 -125 +26 2 -125 +26 -3 -125 +25 -9 -125 +22 -14 -125 +19 -18 -125 +15 -22 -125 +10 -25 -125 +5 -26 -125 +0 -27 -125 +-6 -26 -125 +-11 -25 -125 +-16 -22 -125 +-20 -18 -125 +-23 -14 -125 +-26 -9 -125 +-27 -3 -125 +-27 2 -125 +-26 8 -125 +-23 13 -125 +-20 17 -125 +-16 21 -125 +-11 24 -125 +-6 25 -125 +-1 26 -125 +10 50 -117 +21 47 -117 +30 41 -117 +38 34 -117 +44 25 -117 +49 15 -117 +51 5 -117 +51 -6 -117 +49 -16 -117 +44 -26 -117 +38 -35 -117 +30 -42 -117 +21 -48 -117 +10 -51 -117 +0 -52 -117 +-11 -51 -117 +-22 -48 -117 +-31 -42 -117 +-39 -35 -117 +-45 -26 -117 +-50 -16 -117 +-52 -6 -117 +-52 5 -117 +-50 15 -117 +-45 25 -117 +-39 34 -117 +-31 41 -117 +-22 47 -117 +-11 50 -117 +-1 51 -117 +15 73 -103 +30 68 -103 +43 60 -103 +55 49 -103 +64 37 -103 +70 23 -103 +74 7 -103 +74 -8 -103 +70 -24 -103 +64 -38 -103 +55 -50 -103 +43 -61 -103 +30 -69 -103 +15 -74 -103 +0 -75 -103 +-16 -74 -103 +-31 -69 -103 +-44 -61 -103 +-56 -50 -103 +-65 -38 -103 +-71 -24 -103 +-75 -8 -103 +-75 7 -103 +-71 23 -103 +-65 37 -103 +-56 49 -103 +-44 60 -103 +-31 68 -103 +-16 73 -103 +-1 74 -103 +19 92 -85 +38 86 -85 +55 76 -85 +70 63 -85 +81 47 -85 +89 29 -85 +93 9 -85 +93 -10 -85 +89 -30 -85 +81 -48 -85 +70 -64 -85 +55 -77 -85 +38 -87 -85 +19 -93 -85 +0 -95 -85 +-20 -93 -85 +-39 -87 -85 +-56 -77 -85 +-71 -64 -85 +-82 -48 -85 +-90 -30 -85 +-94 -10 -85 +-94 9 -85 +-90 29 -85 +-82 47 -85 +-71 63 -85 +-56 76 -85 +-39 86 -85 +-20 92 -85 +-1 94 -85 +22 107 -64 +44 100 -64 +64 88 -64 +81 73 -64 +95 54 -64 +104 33 -64 +109 11 -64 +109 -12 -64 +104 -34 -64 +95 -55 -64 +81 -74 -64 +64 -89 -64 +44 -101 -64 +22 -108 -64 +0 -110 -64 +-23 -108 -64 +-45 -101 -64 +-65 -89 -64 +-82 -74 -64 +-96 -55 -64 +-105 -34 -64 +-110 -12 -64 +-110 11 -64 +-105 33 -64 +-96 54 -64 +-82 73 -64 +-65 88 -64 +-45 100 -64 +-23 107 -64 +-1 109 -64 +25 118 -40 +49 110 -40 +70 97 -40 +89 80 -40 +104 60 -40 +114 37 -40 +120 12 -40 +120 -13 -40 +114 -38 -40 +104 -61 -40 +89 -81 -40 +70 -98 -40 +49 -111 -40 +25 -119 -40 +0 -121 -40 +-26 -119 -40 +-50 -111 -40 +-71 -98 -40 +-90 -81 -40 +-105 -61 -40 +-115 -38 -40 +-121 -13 -40 +-121 12 -40 +-115 37 -40 +-105 60 -40 +-90 80 -40 +-71 97 -40 +-50 110 -40 +-26 118 -40 +-1 120 -40 +26 123 -14 +51 115 -14 +74 102 -14 +93 84 -14 +109 63 -14 +120 39 -14 +125 13 -14 +125 -14 -14 +120 -40 -14 +109 -64 -14 +93 -85 -14 +74 -103 -14 +51 -116 -14 +26 -124 -14 +0 -127 -14 +-27 -124 -14 +-52 -116 -14 +-75 -103 -14 +-94 -85 -14 +-110 -64 -14 +-121 -40 -14 +-126 -14 -14 +-126 13 -14 +-121 39 -14 +-110 63 -14 +-94 84 -14 +-75 102 -14 +-52 115 -14 +-27 123 -14 +-1 126 -14 +26 123 13 +51 115 13 +74 102 13 +93 84 13 +109 63 13 +120 39 13 +125 13 13 +125 -14 13 +120 -40 13 +109 -64 13 +93 -85 13 +74 -103 13 +51 -116 13 +26 -124 13 +0 -127 13 +-27 -124 13 +-52 -116 13 +-75 -103 13 +-94 -85 13 +-110 -64 13 +-121 -40 13 +-126 -14 13 +-126 13 13 +-121 39 13 +-110 63 13 +-94 84 13 +-75 102 13 +-52 115 13 +-27 123 13 +-1 126 13 +25 118 39 +49 110 39 +70 97 39 +89 80 39 +104 60 39 +114 37 39 +120 12 39 +120 -13 39 +114 -38 39 +104 -61 39 +89 -81 39 +70 -98 39 +49 -111 39 +25 -119 39 +0 -121 39 +-26 -119 39 +-50 -111 39 +-71 -98 39 +-90 -81 39 +-105 -61 39 +-115 -38 39 +-121 -13 39 +-121 12 39 +-115 37 39 +-105 60 39 +-90 80 39 +-71 97 39 +-50 110 39 +-26 118 39 +-1 120 39 +22 107 63 +44 100 63 +64 88 63 +81 73 63 +95 54 63 +104 33 63 +109 11 63 +109 -12 63 +104 -34 63 +95 -55 63 +81 -74 63 +64 -89 63 +44 -101 63 +22 -108 63 +0 -110 63 +-23 -108 63 +-45 -101 63 +-65 -89 63 +-82 -74 63 +-96 -55 63 +-105 -34 63 +-110 -12 63 +-110 11 63 +-105 33 63 +-96 54 63 +-82 73 63 +-65 88 63 +-45 100 63 +-23 107 63 +-1 109 63 +19 92 84 +38 86 84 +55 76 84 +70 63 84 +81 47 84 +89 29 84 +93 9 84 +93 -10 84 +89 -30 84 +81 -48 84 +70 -64 84 +55 -77 84 +38 -87 84 +19 -93 84 +0 -95 84 +-20 -93 84 +-39 -87 84 +-56 -77 84 +-71 -64 84 +-82 -48 84 +-90 -30 84 +-94 -10 84 +-94 9 84 +-90 29 84 +-82 47 84 +-71 63 84 +-56 76 84 +-39 86 84 +-20 92 84 +-1 94 84 +15 73 102 +30 68 102 +43 60 102 +55 49 102 +64 37 102 +70 23 102 +74 7 102 +74 -8 102 +70 -24 102 +64 -38 102 +55 -50 102 +43 -61 102 +30 -69 102 +15 -74 102 +0 -75 102 +-16 -74 102 +-31 -69 102 +-44 -61 102 +-56 -50 102 +-65 -38 102 +-71 -24 102 +-75 -8 102 +-75 7 102 +-71 23 102 +-65 37 102 +-56 49 102 +-44 60 102 +-31 68 102 +-16 73 102 +-1 74 102 +10 50 116 +21 47 116 +30 41 116 +38 34 116 +44 25 116 +49 15 116 +51 5 116 +51 -6 116 +49 -16 116 +44 -26 116 +38 -35 116 +30 -42 116 +21 -48 116 +10 -51 116 +0 -52 116 +-11 -51 116 +-22 -48 116 +-31 -42 116 +-39 -35 116 +-45 -26 116 +-50 -16 116 +-52 -6 116 +-52 5 116 +-50 15 116 +-45 25 116 +-39 34 116 +-31 41 116 +-22 47 116 +-11 50 116 +-1 51 116 +5 25 124 +10 24 124 +15 21 124 +19 17 124 +22 13 124 +25 8 124 +26 2 124 +26 -3 124 +25 -9 124 +22 -14 124 +19 -18 124 +15 -22 124 +10 -25 124 +5 -26 124 +0 -27 124 +-6 -26 124 +-11 -25 124 +-16 -22 124 +-20 -18 124 +-23 -14 124 +-26 -9 124 +-27 -3 124 +-27 2 124 +-26 8 124 +-23 13 124 +-20 17 124 +-16 21 124 +-11 24 124 +-6 25 124 +-1 26 124 +0 0 127 +3 0 1 2 +3 0 2 3 +3 0 3 4 +3 0 4 5 +3 0 5 6 +3 0 6 7 +3 0 7 8 +3 0 8 9 +3 0 9 10 +3 0 10 11 +3 0 11 12 +3 0 12 13 +3 0 13 14 +3 0 14 15 +3 0 15 16 +3 0 16 17 +3 0 17 18 +3 0 18 19 +3 0 19 20 +3 0 20 21 +3 0 21 22 +3 0 22 23 +3 0 23 24 +3 0 24 25 +3 0 25 26 +3 0 26 27 +3 0 27 28 +3 0 28 29 +3 0 29 30 +3 0 30 1 +3 1 32 2 +3 32 1 31 +3 2 33 3 +3 33 2 32 +3 3 34 4 +3 34 3 33 +3 4 35 5 +3 35 4 34 +3 5 36 6 +3 36 5 35 +3 6 37 7 +3 37 6 36 +3 7 38 8 +3 38 7 37 +3 8 39 9 +3 39 8 38 +3 9 40 10 +3 40 9 39 +3 10 41 11 +3 41 10 40 +3 11 42 12 +3 42 11 41 +3 12 43 13 +3 43 12 42 +3 13 44 14 +3 44 13 43 +3 14 45 15 +3 45 14 44 +3 15 46 16 +3 46 15 45 +3 16 47 17 +3 47 16 46 +3 17 48 18 +3 48 17 47 +3 18 49 19 +3 49 18 48 +3 19 50 20 +3 50 19 49 +3 20 51 21 +3 51 20 50 +3 21 52 22 +3 52 21 51 +3 22 53 23 +3 53 22 52 +3 23 54 24 +3 54 23 53 +3 24 55 25 +3 55 24 54 +3 25 56 26 +3 56 25 55 +3 26 57 27 +3 57 26 56 +3 27 58 28 +3 58 27 57 +3 28 59 29 +3 59 28 58 +3 29 60 30 +3 60 29 59 +3 30 31 1 +3 31 30 60 +3 31 62 32 +3 62 31 61 +3 32 63 33 +3 63 32 62 +3 33 64 34 +3 64 33 63 +3 34 65 35 +3 65 34 64 +3 35 66 36 +3 66 35 65 +3 36 67 37 +3 67 36 66 +3 37 68 38 +3 68 37 67 +3 38 69 39 +3 69 38 68 +3 39 70 40 +3 70 39 69 +3 40 71 41 +3 71 40 70 +3 41 72 42 +3 72 41 71 +3 42 73 43 +3 73 42 72 +3 43 74 44 +3 74 43 73 +3 44 75 45 +3 75 44 74 +3 45 76 46 +3 76 45 75 +3 46 77 47 +3 77 46 76 +3 47 78 48 +3 78 47 77 +3 48 79 49 +3 79 48 78 +3 49 80 50 +3 80 49 79 +3 50 81 51 +3 81 50 80 +3 51 82 52 +3 82 51 81 +3 52 83 53 +3 83 52 82 +3 53 84 54 +3 84 53 83 +3 54 85 55 +3 85 54 84 +3 55 86 56 +3 86 55 85 +3 56 87 57 +3 87 56 86 +3 57 88 58 +3 88 57 87 +3 58 89 59 +3 89 58 88 +3 59 90 60 +3 90 59 89 +3 60 61 31 +3 61 60 90 +3 61 92 62 +3 92 61 91 +3 62 93 63 +3 93 62 92 +3 63 94 64 +3 94 63 93 +3 64 95 65 +3 95 64 94 +3 65 96 66 +3 96 65 95 +3 66 97 67 +3 97 66 96 +3 67 98 68 +3 98 67 97 +3 68 99 69 +3 99 68 98 +3 69 100 70 +3 100 69 99 +3 70 101 71 +3 101 70 100 +3 71 102 72 +3 102 71 101 +3 72 103 73 +3 103 72 102 +3 73 104 74 +3 104 73 103 +3 74 105 75 +3 105 74 104 +3 75 106 76 +3 106 75 105 +3 76 107 77 +3 107 76 106 +3 77 108 78 +3 108 77 107 +3 78 109 79 +3 109 78 108 +3 79 110 80 +3 110 79 109 +3 80 111 81 +3 111 80 110 +3 81 112 82 +3 112 81 111 +3 82 113 83 +3 113 82 112 +3 83 114 84 +3 114 83 113 +3 84 115 85 +3 115 84 114 +3 85 116 86 +3 116 85 115 +3 86 117 87 +3 117 86 116 +3 87 118 88 +3 118 87 117 +3 88 119 89 +3 119 88 118 +3 89 120 90 +3 120 89 119 +3 90 91 61 +3 91 90 120 +3 91 122 92 +3 122 91 121 +3 92 123 93 +3 123 92 122 +3 93 124 94 +3 124 93 123 +3 94 125 95 +3 125 94 124 +3 95 126 96 +3 126 95 125 +3 96 127 97 +3 127 96 126 +3 97 128 98 +3 128 97 127 +3 98 129 99 +3 129 98 128 +3 99 130 100 +3 130 99 129 +3 100 131 101 +3 131 100 130 +3 101 132 102 +3 132 101 131 +3 102 133 103 +3 133 102 132 +3 103 134 104 +3 134 103 133 +3 104 135 105 +3 135 104 134 +3 105 136 106 +3 136 105 135 +3 106 137 107 +3 137 106 136 +3 107 138 108 +3 138 107 137 +3 108 139 109 +3 139 108 138 +3 109 140 110 +3 140 109 139 +3 110 141 111 +3 141 110 140 +3 111 142 112 +3 142 111 141 +3 112 143 113 +3 143 112 142 +3 113 144 114 +3 144 113 143 +3 114 145 115 +3 145 114 144 +3 115 146 116 +3 146 115 145 +3 116 147 117 +3 147 116 146 +3 117 148 118 +3 148 117 147 +3 118 149 119 +3 149 118 148 +3 119 150 120 +3 150 119 149 +3 120 121 91 +3 121 120 150 +3 121 152 122 +3 152 121 151 +3 122 153 123 +3 153 122 152 +3 123 154 124 +3 154 123 153 +3 124 155 125 +3 155 124 154 +3 125 156 126 +3 156 125 155 +3 126 157 127 +3 157 126 156 +3 127 158 128 +3 158 127 157 +3 128 159 129 +3 159 128 158 +3 129 160 130 +3 160 129 159 +3 130 161 131 +3 161 130 160 +3 131 162 132 +3 162 131 161 +3 132 163 133 +3 163 132 162 +3 133 164 134 +3 164 133 163 +3 134 165 135 +3 165 134 164 +3 135 166 136 +3 166 135 165 +3 136 167 137 +3 167 136 166 +3 137 168 138 +3 168 137 167 +3 138 169 139 +3 169 138 168 +3 139 170 140 +3 170 139 169 +3 140 171 141 +3 171 140 170 +3 141 172 142 +3 172 141 171 +3 142 173 143 +3 173 142 172 +3 143 174 144 +3 174 143 173 +3 144 175 145 +3 175 144 174 +3 145 176 146 +3 176 145 175 +3 146 177 147 +3 177 146 176 +3 147 178 148 +3 178 147 177 +3 148 179 149 +3 179 148 178 +3 149 180 150 +3 180 149 179 +3 150 151 121 +3 151 150 180 +3 151 182 152 +3 182 151 181 +3 152 183 153 +3 183 152 182 +3 153 184 154 +3 184 153 183 +3 154 185 155 +3 185 154 184 +3 155 186 156 +3 186 155 185 +3 156 187 157 +3 187 156 186 +3 157 188 158 +3 188 157 187 +3 158 189 159 +3 189 158 188 +3 159 190 160 +3 190 159 189 +3 160 191 161 +3 191 160 190 +3 161 192 162 +3 192 161 191 +3 162 193 163 +3 193 162 192 +3 163 194 164 +3 194 163 193 +3 164 195 165 +3 195 164 194 +3 165 196 166 +3 196 165 195 +3 166 197 167 +3 197 166 196 +3 167 198 168 +3 198 167 197 +3 168 199 169 +3 199 168 198 +3 169 200 170 +3 200 169 199 +3 170 201 171 +3 201 170 200 +3 171 202 172 +3 202 171 201 +3 172 203 173 +3 203 172 202 +3 173 204 174 +3 204 173 203 +3 174 205 175 +3 205 174 204 +3 175 206 176 +3 206 175 205 +3 176 207 177 +3 207 176 206 +3 177 208 178 +3 208 177 207 +3 178 209 179 +3 209 178 208 +3 179 210 180 +3 210 179 209 +3 180 181 151 +3 181 180 210 +3 181 212 182 +3 212 181 211 +3 182 213 183 +3 213 182 212 +3 183 214 184 +3 214 183 213 +3 184 215 185 +3 215 184 214 +3 185 216 186 +3 216 185 215 +3 186 217 187 +3 217 186 216 +3 187 218 188 +3 218 187 217 +3 188 219 189 +3 219 188 218 +3 189 220 190 +3 220 189 219 +3 190 221 191 +3 221 190 220 +3 191 222 192 +3 222 191 221 +3 192 223 193 +3 223 192 222 +3 193 224 194 +3 224 193 223 +3 194 225 195 +3 225 194 224 +3 195 226 196 +3 226 195 225 +3 196 227 197 +3 227 196 226 +3 197 228 198 +3 228 197 227 +3 198 229 199 +3 229 198 228 +3 199 230 200 +3 230 199 229 +3 200 231 201 +3 231 200 230 +3 201 232 202 +3 232 201 231 +3 202 233 203 +3 233 202 232 +3 203 234 204 +3 234 203 233 +3 204 235 205 +3 235 204 234 +3 205 236 206 +3 236 205 235 +3 206 237 207 +3 237 206 236 +3 207 238 208 +3 238 207 237 +3 208 239 209 +3 239 208 238 +3 209 240 210 +3 240 209 239 +3 210 211 181 +3 211 210 240 +3 211 242 212 +3 242 211 241 +3 212 243 213 +3 243 212 242 +3 213 244 214 +3 244 213 243 +3 214 245 215 +3 245 214 244 +3 215 246 216 +3 246 215 245 +3 216 247 217 +3 247 216 246 +3 217 248 218 +3 248 217 247 +3 218 249 219 +3 249 218 248 +3 219 250 220 +3 250 219 249 +3 220 251 221 +3 251 220 250 +3 221 252 222 +3 252 221 251 +3 222 253 223 +3 253 222 252 +3 223 254 224 +3 254 223 253 +3 224 255 225 +3 255 224 254 +3 225 256 226 +3 256 225 255 +3 226 257 227 +3 257 226 256 +3 227 258 228 +3 258 227 257 +3 228 259 229 +3 259 228 258 +3 229 260 230 +3 260 229 259 +3 230 261 231 +3 261 230 260 +3 231 262 232 +3 262 231 261 +3 232 263 233 +3 263 232 262 +3 233 264 234 +3 264 233 263 +3 234 265 235 +3 265 234 264 +3 235 266 236 +3 266 235 265 +3 236 267 237 +3 267 236 266 +3 237 268 238 +3 268 237 267 +3 238 269 239 +3 269 238 268 +3 239 270 240 +3 270 239 269 +3 240 241 211 +3 241 240 270 +3 241 272 242 +3 272 241 271 +3 242 273 243 +3 273 242 272 +3 243 274 244 +3 274 243 273 +3 244 275 245 +3 275 244 274 +3 245 276 246 +3 276 245 275 +3 246 277 247 +3 277 246 276 +3 247 278 248 +3 278 247 277 +3 248 279 249 +3 279 248 278 +3 249 280 250 +3 280 249 279 +3 250 281 251 +3 281 250 280 +3 251 282 252 +3 282 251 281 +3 252 283 253 +3 283 252 282 +3 253 284 254 +3 284 253 283 +3 254 285 255 +3 285 254 284 +3 255 286 256 +3 286 255 285 +3 256 287 257 +3 287 256 286 +3 257 288 258 +3 288 257 287 +3 258 289 259 +3 289 258 288 +3 259 290 260 +3 290 259 289 +3 260 291 261 +3 291 260 290 +3 261 292 262 +3 292 261 291 +3 262 293 263 +3 293 262 292 +3 263 294 264 +3 294 263 293 +3 264 295 265 +3 295 264 294 +3 265 296 266 +3 296 265 295 +3 266 297 267 +3 297 266 296 +3 267 298 268 +3 298 267 297 +3 268 299 269 +3 299 268 298 +3 269 300 270 +3 300 269 299 +3 270 271 241 +3 271 270 300 +3 271 302 272 +3 302 271 301 +3 272 303 273 +3 303 272 302 +3 273 304 274 +3 304 273 303 +3 274 305 275 +3 305 274 304 +3 275 306 276 +3 306 275 305 +3 276 307 277 +3 307 276 306 +3 277 308 278 +3 308 277 307 +3 278 309 279 +3 309 278 308 +3 279 310 280 +3 310 279 309 +3 280 311 281 +3 311 280 310 +3 281 312 282 +3 312 281 311 +3 282 313 283 +3 313 282 312 +3 283 314 284 +3 314 283 313 +3 284 315 285 +3 315 284 314 +3 285 316 286 +3 316 285 315 +3 286 317 287 +3 317 286 316 +3 287 318 288 +3 318 287 317 +3 288 319 289 +3 319 288 318 +3 289 320 290 +3 320 289 319 +3 290 321 291 +3 321 290 320 +3 291 322 292 +3 322 291 321 +3 292 323 293 +3 323 292 322 +3 293 324 294 +3 324 293 323 +3 294 325 295 +3 325 294 324 +3 295 326 296 +3 326 295 325 +3 296 327 297 +3 327 296 326 +3 297 328 298 +3 328 297 327 +3 298 329 299 +3 329 298 328 +3 299 330 300 +3 330 299 329 +3 300 301 271 +3 301 300 330 +3 301 332 302 +3 332 301 331 +3 302 333 303 +3 333 302 332 +3 303 334 304 +3 334 303 333 +3 304 335 305 +3 335 304 334 +3 305 336 306 +3 336 305 335 +3 306 337 307 +3 337 306 336 +3 307 338 308 +3 338 307 337 +3 308 339 309 +3 339 308 338 +3 309 340 310 +3 340 309 339 +3 310 341 311 +3 341 310 340 +3 311 342 312 +3 342 311 341 +3 312 343 313 +3 343 312 342 +3 313 344 314 +3 344 313 343 +3 314 345 315 +3 345 314 344 +3 315 346 316 +3 346 315 345 +3 316 347 317 +3 347 316 346 +3 317 348 318 +3 348 317 347 +3 318 349 319 +3 349 318 348 +3 319 350 320 +3 350 319 349 +3 320 351 321 +3 351 320 350 +3 321 352 322 +3 352 321 351 +3 322 353 323 +3 353 322 352 +3 323 354 324 +3 354 323 353 +3 324 355 325 +3 355 324 354 +3 325 356 326 +3 356 325 355 +3 326 357 327 +3 357 326 356 +3 327 358 328 +3 358 327 357 +3 328 359 329 +3 359 328 358 +3 329 360 330 +3 360 329 359 +3 330 331 301 +3 331 330 360 +3 331 362 332 +3 362 331 361 +3 332 363 333 +3 363 332 362 +3 333 364 334 +3 364 333 363 +3 334 365 335 +3 365 334 364 +3 335 366 336 +3 366 335 365 +3 336 367 337 +3 367 336 366 +3 337 368 338 +3 368 337 367 +3 338 369 339 +3 369 338 368 +3 339 370 340 +3 370 339 369 +3 340 371 341 +3 371 340 370 +3 341 372 342 +3 372 341 371 +3 342 373 343 +3 373 342 372 +3 343 374 344 +3 374 343 373 +3 344 375 345 +3 375 344 374 +3 345 376 346 +3 376 345 375 +3 346 377 347 +3 377 346 376 +3 347 378 348 +3 378 347 377 +3 348 379 349 +3 379 348 378 +3 349 380 350 +3 380 349 379 +3 350 381 351 +3 381 350 380 +3 351 382 352 +3 382 351 381 +3 352 383 353 +3 383 352 382 +3 353 384 354 +3 384 353 383 +3 354 385 355 +3 385 354 384 +3 355 386 356 +3 386 355 385 +3 356 387 357 +3 387 356 386 +3 357 388 358 +3 388 357 387 +3 358 389 359 +3 389 358 388 +3 359 390 360 +3 390 359 389 +3 360 361 331 +3 361 360 390 +3 361 392 362 +3 392 361 391 +3 362 393 363 +3 393 362 392 +3 363 394 364 +3 394 363 393 +3 364 395 365 +3 395 364 394 +3 365 396 366 +3 396 365 395 +3 366 397 367 +3 397 366 396 +3 367 398 368 +3 398 367 397 +3 368 399 369 +3 399 368 398 +3 369 400 370 +3 400 369 399 +3 370 401 371 +3 401 370 400 +3 371 402 372 +3 402 371 401 +3 372 403 373 +3 403 372 402 +3 373 404 374 +3 404 373 403 +3 374 405 375 +3 405 374 404 +3 375 406 376 +3 406 375 405 +3 376 407 377 +3 407 376 406 +3 377 408 378 +3 408 377 407 +3 378 409 379 +3 409 378 408 +3 379 410 380 +3 410 379 409 +3 380 411 381 +3 411 380 410 +3 381 412 382 +3 412 381 411 +3 382 413 383 +3 413 382 412 +3 383 414 384 +3 414 383 413 +3 384 415 385 +3 415 384 414 +3 385 416 386 +3 416 385 415 +3 386 417 387 +3 417 386 416 +3 387 418 388 +3 418 387 417 +3 388 419 389 +3 419 388 418 +3 389 420 390 +3 420 389 419 +3 390 391 361 +3 391 390 420 +3 391 421 392 +3 392 421 393 +3 393 421 394 +3 394 421 395 +3 395 421 396 +3 396 421 397 +3 397 421 398 +3 398 421 399 +3 399 421 400 +3 400 421 401 +3 401 421 402 +3 402 421 403 +3 403 421 404 +3 404 421 405 +3 405 421 406 +3 406 421 407 +3 407 421 408 +3 408 421 409 +3 409 421 410 +3 410 421 411 +3 411 421 412 +3 412 421 413 +3 413 421 414 +3 414 421 415 +3 415 421 416 +3 416 421 417 +3 417 421 418 +3 418 421 419 +3 419 421 420 +3 420 421 391 \ No newline at end of file diff --git a/src/Unittests/unittests_read_write_PLY.cc b/src/Unittests/unittests_read_write_PLY.cc index 82370bb3..df48c515 100644 --- a/src/Unittests/unittests_read_write_PLY.cc +++ b/src/Unittests/unittests_read_write_PLY.cc @@ -81,6 +81,23 @@ TEST_F(OpenMeshReadWritePLY, LoadSimplePLY) { } +/* + * Just load a ply + */ +TEST_F(OpenMeshReadWritePLY, LoadSimplePLYNoEndl) { + + mesh_.clear(); + + bool ok = OpenMesh::IO::read_mesh(mesh_, "sphere840.ply"); + + EXPECT_TRUE(ok) << "Unable to load sphere840.ply"; + + EXPECT_EQ(422u , mesh_.n_vertices()) << "The number of loaded vertices is not correct!"; + EXPECT_EQ(1260u , mesh_.n_edges()) << "The number of loaded edges is not correct!"; + EXPECT_EQ(840u , mesh_.n_faces()) << "The number of loaded faces is not correct!"; + +} + /* * Just load a ply file and set vertex color option before loading */ -- GitLab From dd9917cacc28422166877ba7618896b9b386a188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 4 Feb 2019 08:46:26 +0100 Subject: [PATCH 2/4] - Improved unittest description --- src/Unittests/unittests_read_write_PLY.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Unittests/unittests_read_write_PLY.cc b/src/Unittests/unittests_read_write_PLY.cc index df48c515..d428ec12 100644 --- a/src/Unittests/unittests_read_write_PLY.cc +++ b/src/Unittests/unittests_read_write_PLY.cc @@ -82,7 +82,7 @@ TEST_F(OpenMeshReadWritePLY, LoadSimplePLY) { } /* - * Just load a ply + * Load a ply ascii file without a newline at the end of the file */ TEST_F(OpenMeshReadWritePLY, LoadSimplePLYNoEndl) { -- GitLab From 471874bce57d0404e964dd8a2a0648dfbfd791fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 4 Feb 2019 08:47:17 +0100 Subject: [PATCH 3/4] refs #64 --- src/Unittests/unittests_read_write_PLY.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Unittests/unittests_read_write_PLY.cc b/src/Unittests/unittests_read_write_PLY.cc index d428ec12..dd83ff81 100644 --- a/src/Unittests/unittests_read_write_PLY.cc +++ b/src/Unittests/unittests_read_write_PLY.cc @@ -83,6 +83,7 @@ TEST_F(OpenMeshReadWritePLY, LoadSimplePLY) { /* * Load a ply ascii file without a newline at the end of the file + * */ TEST_F(OpenMeshReadWritePLY, LoadSimplePLYNoEndl) { -- GitLab From 4c2c8f34c06ca6a09b91ead728af539ec1048916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 4 Feb 2019 08:52:41 +0100 Subject: [PATCH 4/4] - PLY Reader: Fix file load for ASCII PLY without a newline at the end of the file (Thanks to Mathieu Lamarre for the patch ) closes #64 --- Doc/changelog.docu | 1 + src/OpenMesh/Core/IO/reader/PLYReader.cc | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Doc/changelog.docu b/Doc/changelog.docu index b497a8b6..4f12db85 100644 --- a/Doc/changelog.docu +++ b/Doc/changelog.docu @@ -27,6 +27,7 @@
  • PLY Reader: Allowing the PLY reader to read custom face ( Thanks to morgan Leborgne for the patch)
  • PLY Reader: Fixed endless loop on unknown property list type
  • PLY Reader: Fix hang when reading directly from istream (Thanks to Paul LorĂ© for the patch)
  • +
  • PLY Reader: Fix file load for ASCII PLY without a newline at the end of the file (Thanks to Mathieu Lamarre for the patch )
  • OM Writer/Reader: Update file format version to 2.0. Older files can still be read, but older OpenMesh versions cannot read new format.
  • OM Writer/Reader: Fixed inconsistent writing/reading of edge properties
  • OM Writer/Reader: Add option to store status
  • diff --git a/src/OpenMesh/Core/IO/reader/PLYReader.cc b/src/OpenMesh/Core/IO/reader/PLYReader.cc index 1b35d53d..4617afe9 100644 --- a/src/OpenMesh/Core/IO/reader/PLYReader.cc +++ b/src/OpenMesh/Core/IO/reader/PLYReader.cc @@ -306,6 +306,14 @@ bool _PLYReader_::read_ascii(std::istream& _in, BaseImporter& _bi, const Options for (std::vector::iterator e_it = elements_.begin(); e_it != elements_.end(); ++e_it) { + if (_in.eof()) { + if (err_enabled) + omerr().enable(); + + omerr() << "Unexpected end of file while reading." << std::endl; + return false; + } + if (e_it->element_== VERTEX) { // read vertices: @@ -475,14 +483,6 @@ bool _PLYReader_::read_ascii(std::istream& _in, BaseImporter& _bi, const Options } } - if (_in.eof()) { - if (err_enabled) - omerr().enable(); - - omerr() << "Unexpected end of file while reading." << std::endl; - return false; - } - if(e_it->element_== FACE) // stop reading after the faces since additional elements are not preserved anyway break; -- GitLab