# ITK IO Mesh OBJ

**URL:** <https://discourse.itk.org/t/itk-io-mesh-obj/435>\
**Category:** Uncategorized\
**Created:** [November 20, 2017, 5:10pm UTC](https://discourse.itk.org/t/itk-io-mesh-obj/435 "2017-11-20T17:10:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.kuegler](https://discourse.itk.org/user_avatar/discourse.itk.org/david.kuegler/32/169_2.png) [@david.kuegler](https://discourse.itk.org/u/david.kuegler)\
**Post date:** [November 20, 2017, 5:10pm UTC](https://discourse.itk.org/t/itk-io-mesh-obj/435/1 "2017-11-20T17:10:00Z")

</div>

Hi everybody,

The reader is still broken ([https://issues.itk.org/jira/browse/ITK-2883#comment-27666](https://issues.itk.org/jira/browse/ITK-2883#comment-27666))

I developed a fix for the vectornormal issue.

… I just need to figure out on how to submit, since gerrit does not work for my superbuild. ☹

Cheers  
David

---

<div class="post-metadata">

**Author:** ![david.kuegler](https://discourse.itk.org/user_avatar/discourse.itk.org/david.kuegler/32/169_2.png) [@david.kuegler](https://discourse.itk.org/u/david.kuegler)\
**Post date:** [November 20, 2017, 5:18pm UTC](https://discourse.itk.org/t/itk-io-mesh-obj/435/2 "2017-11-20T17:18:35Z")

</div>

[0001-BUG-itkOBJMeshIO-did-only-load-meshes-properly-if-th.patch](https://discourse.itk.org/uploads/default/original/1X/ee3941cc4bf8904f729ea5e9e229a62e512fb8e7.patch) (4.9 KB)

uploaded the patch

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [November 20, 2017, 6:41pm UTC](https://discourse.itk.org/t/itk-io-mesh-obj/435/3 "2017-11-20T18:41:28Z")

</div>

Hi David,

Thank you for the patch!

Uploaded to Gerrit here: [http://review.source.kitware.com/#/c/22807/](http://review.source.kitware.com/#/c/22807/)

Thanks,  
Matt

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [November 20, 2017, 9:23pm UTC](https://discourse.itk.org/t/itk-io-mesh-obj/435/4 "2017-11-20T21:23:49Z")

</div>

@david.kuegler You can make a normal checkout of ITK, and [set it up](https://itk.org/Wiki/ITK/Git/Develop) for development. Then do `git fetch http://review.source.kitware.com/ITK refs/changes/07/22807/1 && git checkout FETCH_HEAD` to get the first version of you patch and after you have made changes `git commit --amend` and `git gerrit-push`.

As you might realize, ITK is still supporting old compilers and therefore can’t have C++11 features such as `auto`.

---

<div class="post-metadata">

**Author:** ![david.kuegler](https://discourse.itk.org/user_avatar/discourse.itk.org/david.kuegler/32/169_2.png) [@david.kuegler](https://discourse.itk.org/u/david.kuegler)\
**Post date:** [November 21, 2017, 1:31pm UTC](https://discourse.itk.org/t/itk-io-mesh-obj/435/5 "2017-11-21T13:31:18Z")

</div>

Unfortunately git does not cooperate (The repo has just been created by a checkout and setup…).

$ git fetch [http://review.source.kitware.com/ITK](http://review.source.kitware.com/ITK) refs/changes/07/22807/1 && git checkout FETCH\_HEAD  
From [http://review.source.kitware.com/ITK](http://review.source.kitware.com/ITK)

- branch refs/changes/07/22807/1 -\> FETCH\_HEAD  
error: Your local changes to the following files would be overwritten by checkout:  
Modules/IO/Mesh/src/itkOBJMeshIO.cxx  
Please commit your changes or stash them before you switch branches.  
Aborting

That is itkOBJMeshIO.cxx does not have any changes from top…

---

<div class="post-metadata">

**Author:** ![david.kuegler](https://discourse.itk.org/user_avatar/discourse.itk.org/david.kuegler/32/169_2.png) [@david.kuegler](https://discourse.itk.org/u/david.kuegler)\
**Post date:** [November 21, 2017, 1:40pm UTC](https://discourse.itk.org/t/itk-io-mesh-obj/435/6 "2017-11-21T13:40:08Z")

</div>

Since I spent way too much time trying to get gerrit to work, just patches again.

[0001-BUG-itkOBJMeshIO-did-only-load-meshes-properly-if-th.patch](https://discourse.itk.org/uploads/default/original/1X/63a0a0ec2c77b83ac9cc743648dba509b8f8f4b7.patch) (4.9 KB)

[0002-BUG-itkOBJMeshIO-did-only-load-meshes-properly-if-th.patch](https://discourse.itk.org/uploads/default/original/1X/b7a05a92344796b73b213ffdd7ad3dfc21e65cef.patch) (2.4 KB)

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [November 21, 2017, 3:16pm UTC](https://discourse.itk.org/t/itk-io-mesh-obj/435/7 "2017-11-21T15:16:03Z")

</div>

The updated patch is [here](http://review.source.kitware.com/#/c/22812/). The new list of errors from my local Linux machine are below.

```
/home/dzenan/ITK-git/Modules/IO/Mesh/src/itkOBJMeshIO.cxx: In member function ‘virtual void itk::OBJMeshIO::ReadMeshInformation()’:
/home/dzenan/ITK-git/Modules/IO/Mesh/src/itkOBJMeshIO.cxx:128:39: error: ‘find_if_not’ is not a member of ‘std’
     std::string::iterator starttype = std::find_if_not(line.begin(), line.end(), [&loc](const char l) { return std::isspace(l, loc); });
                                       ^
/home/dzenan/ITK-git/Modules/IO/Mesh/src/itkOBJMeshIO.cxx:128:134: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
     std::string::iterator starttype = std::find_if_not(line.begin(), line.end(), [&loc](const char l) { return std::isspace(l, loc); });
                                                                                                                                      ^
/home/dzenan/ITK-git/Modules/IO/Mesh/src/itkOBJMeshIO.cxx: In member function ‘virtual void itk::OBJMeshIO::ReadPoints(void*)’:
/home/dzenan/ITK-git/Modules/IO/Mesh/src/itkOBJMeshIO.cxx:231:39: error: ‘find_if_not’ is not a member of ‘std’
     std::string::iterator starttype = std::find_if_not(line.begin(), line.end(), [&loc](const char l) { return std::isspace(l, loc); });
                                       ^
/home/dzenan/ITK-git/Modules/IO/Mesh/src/itkOBJMeshIO.cxx:231:134: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
     std::string::iterator starttype = std::find_if_not(line.begin(), line.end(), [&loc](const char l) { return std::isspace(l, loc); });
                                                                                                                                      ^
/home/dzenan/ITK-git/Modules/IO/Mesh/src/itkOBJMeshIO.cxx: In member function ‘virtual void itk::OBJMeshIO::ReadCells(void*)’:
/home/dzenan/ITK-git/Modules/IO/Mesh/src/itkOBJMeshIO.cxx:279:39: error: ‘find_if_not’ is not a member of ‘std’
     std::string::iterator starttype = std::find_if_not(line.begin(), line.end(), [&loc](const char l) { return std::isspace(l, loc); });
                                       ^
/home/dzenan/ITK-git/Modules/IO/Mesh/src/itkOBJMeshIO.cxx:279:134: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
     std::string::iterator starttype = std::find_if_not(line.begin(), line.end(), [&loc](const char l) { return std::isspace(l, loc); });
                                                                                                                                      ^
/home/dzenan/ITK-git/Modules/IO/Mesh/src/itkOBJMeshIO.cxx: In member function ‘virtual void itk::OBJMeshIO::ReadPointData(void*)’:
/home/dzenan/ITK-git/Modules/IO/Mesh/src/itkOBJMeshIO.cxx:351:39: error: ‘find_if_not’ is not a member of ‘std’
     std::string::iterator starttype = std::find_if_not(line.begin(), line.end(), [&loc](const char l) { return std::isspace(l, loc); });
                                       ^
/home/dzenan/ITK-git/Modules/IO/Mesh/src/itkOBJMeshIO.cxx:351:134: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
     std::string::iterator starttype = std::find_if_not(line.begin(), line.end(), [&loc](const char l) { return std::isspace(l, loc); });
                                                                                                                                      ^
```

---

<div class="post-metadata">

**Author:** ![david.kuegler](https://discourse.itk.org/user_avatar/discourse.itk.org/david.kuegler/32/169_2.png) [@david.kuegler](https://discourse.itk.org/u/david.kuegler)\
**Post date:** [November 21, 2017, 4:09pm UTC](https://discourse.itk.org/t/itk-io-mesh-obj/435/8 "2017-11-21T16:09:07Z")

</div>

Well, c++11 makes everything so nice 😉 you get used to it…  
So this should be independent of c++11 now. It works on my test file again, so I hope it would generally work…

[0002-BUG-itkOBJMeshIO-did-only-load-meshes-properly-if-th.patch](https://discourse.itk.org/uploads/default/original/1X/7524caa6e4e349b4346267fb4953025d2d07a299.patch) (9.0 KB)

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [November 21, 2017, 4:15pm UTC](https://discourse.itk.org/t/itk-io-mesh-obj/435/9 "2017-11-21T16:15:57Z")

</div>

It now compiles on my local Linux box. I pushed a new [patch set](http://review.source.kitware.com/#/c/22812/).
