-
Notifications
You must be signed in to change notification settings - Fork 341
[IO] Update MeshVTKLoader so that it can read polydata description of meshes #5821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[IO] Update MeshVTKLoader so that it can read polydata description of meshes #5821
Conversation
|
Hi @remibessard |
|
Ha, thx for sharing this information. But I will be happy to use this code when it will replace the VTKLoader in SOFA, that's for sure ! |
| //// Process line | ||
| //std::cout << "Line: "; | ||
| //for (int v : values) std::cout << v << " "; | ||
| //std::cout << "\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| //// Process line | |
| //std::cout << "Line: "; | |
| //for (int v : values) std::cout << v << " "; | |
| //std::cout << "\n"; |
| //VTKDataIO<Vec<3, std::int32_t> >* d = new VTKDataIO<Vec<3, std::int32_t> >; | ||
| //d->read(polys2.str(), 0); | ||
| //BaseVTKDataIO* d = BaseVTKReader::newVTKDataIO(string(typeStrTemp)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| //VTKDataIO<Vec<3, std::int32_t> >* d = new VTKDataIO<Vec<3, std::int32_t> >; | |
| //d->read(polys2.str(), 0); | |
| //BaseVTKDataIO* d = BaseVTKReader::newVTKDataIO(string(typeStrTemp)); |
| //BaseVTKDataIO* d = BaseVTKReader::newVTKDataIO(string(typeStrTemp)); | ||
| //d->read(polys4.str(), 0); | ||
| //d->read(polys5.str(), 0); | ||
| //d->read(polys6.str(), 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| //BaseVTKDataIO* d = BaseVTKReader::newVTKDataIO(string(typeStrTemp)); | |
| //d->read(polys4.str(), 0); | |
| //d->read(polys5.str(), 0); | |
| //d->read(polys6.str(), 0); |
| //if (currentNodeName.compare("PolyData") == 0) | ||
| //{ | ||
| // dataArrayNode = node->FirstChildElement("DataArray"); | ||
| // for (; dataArrayNode; | ||
| // dataArrayNode = dataArrayNode->NextSiblingElement("DataArray")) | ||
| // { | ||
| // dataArrayElement = dataArrayNode->ToElement(); | ||
| // checkError(dataArrayElement); | ||
| // const string currentDataArrayName = string(dataArrayElement->Attribute("Name")); | ||
| // BaseVTKDataIO* celldata = loadDataArray(dataArrayElement, numberOfCells); | ||
| // checkError(celldata); | ||
| // celldata->name = currentDataArrayName; | ||
| // inputCellDataVector.push_back(celldata); | ||
| // } | ||
| //} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| //if (currentNodeName.compare("PolyData") == 0) | |
| //{ | |
| // dataArrayNode = node->FirstChildElement("DataArray"); | |
| // for (; dataArrayNode; | |
| // dataArrayNode = dataArrayNode->NextSiblingElement("DataArray")) | |
| // { | |
| // dataArrayElement = dataArrayNode->ToElement(); | |
| // checkError(dataArrayElement); | |
| // const string currentDataArrayName = string(dataArrayElement->Attribute("Name")); | |
| // BaseVTKDataIO* celldata = loadDataArray(dataArrayElement, numberOfCells); | |
| // checkError(celldata); | |
| // celldata->name = currentDataArrayName; | |
| // inputCellDataVector.push_back(celldata); | |
| // } | |
| //} |
Being new in this process I will proobably mixup things...
Here is a small update of the MeshVTKLoader so that it can load polydata vtk files.
This was required for my work in PREMYOM to load OpenSim files.
I hope the compilation goes smoothly. If not, the next step will obviously be to correct these potential errors.
[with-all-tests]
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if