https://github.com/FreeCAD/FreeCAD/blob/master/src/Mod/Part/App/TopoShape.cpp
| 188 | |
| 189 | // https://github.com/FreeCAD/FreeCAD/blob/master/src/Mod/Part/App/TopoShape.cpp |
| 190 | void write_binary(TopoDS_Shape shp, std::string& s) { |
| 191 | std::ostringstream out; |
| 192 | |
| 193 | BinTools_ShapeSet theShapeSet; |
| 194 | |
| 195 | Standard_Integer shapeId = theShapeSet.Add(shp); |
| 196 | Standard_Integer locId = theShapeSet.Locations().Index(shp.Location()); |
| 197 | Standard_Integer orient = static_cast<int>(shp.Orientation()); |
| 198 | |
| 199 | theShapeSet.Write(out); |
| 200 | BinTools::PutInteger(out, shapeId); |
| 201 | BinTools::PutInteger(out, locId); |
| 202 | BinTools::PutInteger(out, orient); |
| 203 | |
| 204 | s = out.str(); |
| 205 | } |
| 206 | |
| 207 | TopoDS_Shape read_text(const std::string& s) { |
| 208 | std::stringstream stream(s); |