@@ -205,7 +205,7 @@ namespace DLFL {
205205 // std::cout << "done reading obj\n;";
206206 }
207207
208- void DLFLObject::writeObject (ostream& o, ostream &omtl, bool with_normals, bool with_tex_coords) {
208+ void DLFLObject::writeObject (ostream& o, ostream &omtl, bool with_normals, bool with_tex_coords) const {
209209 // write mtl file
210210 if (!omtl.fail ())
211211 writeMTL (omtl);
@@ -504,7 +504,7 @@ namespace DLFL {
504504 // printEdgeList();
505505 }
506506
507- void DLFLObject::writeDLFL (ostream& o, ostream &omtl, bool reverse_faces) {
507+ void DLFLObject::writeDLFL (ostream& o, ostream &omtl, bool reverse_faces) const {
508508 // write the mtl file if it exists
509509 if (!omtl.fail ()){
510510 // std::cout<<"mtl file did not fail.\n";
@@ -519,7 +519,7 @@ namespace DLFL {
519519 // std::cout << "writing dlfl\t" << mFilename << "\n";
520520
521521 // Write the vertex list next. Update the vertex index also
522- DLFLVertexPtrList::iterator vf = vertex_list.begin (), vl = vertex_list.end ();
522+ DLFLVertexPtrList::const_iterator vf = vertex_list.begin (), vl = vertex_list.end ();
523523 uint vindex = 0 ;
524524 while ( vf != vl ) {
525525 (*vf)->writeDLFL (o,vindex++);
@@ -528,7 +528,7 @@ namespace DLFL {
528528 o << ' #' << endl;
529529
530530 // Write the face vertices and update the face vertex index also
531- DLFLFacePtrList::iterator ff = face_list.begin (), fl = face_list.end ();
531+ DLFLFacePtrList::const_iterator ff = face_list.begin (), fl = face_list.end ();
532532 DLFLFacePtr fptr;
533533 uint fvindex = 0 ;
534534 while ( ff != fl ) {
@@ -549,7 +549,7 @@ namespace DLFL {
549549 o << ' #' << endl;
550550
551551 // Write the edge list
552- DLFLEdgePtrList::iterator ef = edge_list.begin (), el = edge_list.end ();
552+ DLFLEdgePtrList::const_iterator ef = edge_list.begin (), el = edge_list.end ();
553553 if ( reverse_faces ) {
554554 while ( ef != el ) {
555555 (*ef)->writeDLFLReverse (o);
@@ -619,7 +619,7 @@ namespace DLFL {
619619 return true ;
620620 }
621621
622- bool DLFLObject::writeMTL ( ostream& o ) {
622+ bool DLFLObject::writeMTL ( ostream& o ) const {
623623
624624 // newmtl blinn1SG
625625 // illum 4
@@ -657,11 +657,11 @@ namespace DLFL {
657657
658658 }
659659
660- void DLFLObject::writeLG3d (ostream& o, bool selected) {
660+ void DLFLObject::writeLG3d (ostream& o, bool selected) const {
661661
662662 Vector3dArray coords; int i=0 , j=0 ;
663663 if (selected){
664- vector<DLFLFacePtr>::iterator ff = this ->sel_fptr_array .begin (),
664+ vector<DLFLFacePtr>::const_iterator ff = this ->sel_fptr_array .begin (),
665665 fl = this ->sel_fptr_array .end ();
666666 // Write the object in LG3d (*.m) format for use with the LiveGraphics3D live.jar java archive from Mathworld.com
667667 o << " Graphics3D[{" ;
@@ -687,7 +687,7 @@ namespace DLFL {
687687
688688 }
689689 else {
690- DLFLFacePtrList::iterator ff, fl;
690+ DLFLFacePtrList::const_iterator ff, fl;
691691 ff = face_list.begin ();
692692 fl = face_list.end ();
693693 // Write the object in LG3d (*.m) format for use with the LiveGraphics3D live.jar java archive from Mathworld.com
@@ -714,7 +714,7 @@ namespace DLFL {
714714 }
715715 }
716716
717- void DLFLObject::writeSTL (ostream& o){
717+ void DLFLObject::writeSTL (ostream& o) const {
718718 // if(binary)
719719 // {
720720 // // Write Header
@@ -742,8 +742,8 @@ namespace DLFL {
742742 // }
743743 // else
744744 // {
745- DLFLFacePtrList::iterator ff = face_list.begin ();
746- DLFLFacePtrList::iterator fl = face_list.end ();
745+ DLFLFacePtrList::const_iterator ff = face_list.begin ();
746+ DLFLFacePtrList::const_iterator fl = face_list.end ();
747747 Vector3dArray coords; int i=0 ;
748748
749749 o << " solid ascii\n " ;
0 commit comments