diff --git a/Fltk/GUI_Projection.cpp b/Fltk/GUI_Projection.cpp index e6aa5d5333bc794a7f212f45f620c6d21ef8d733..72fcf3911aca48bd31de3ce3992ac3200235a172 100644 --- a/Fltk/GUI_Projection.cpp +++ b/Fltk/GUI_Projection.cpp @@ -265,6 +265,13 @@ void browse_cb(Fl_Widget *w, void *data) projection *p = e->getCurrentProjection(); if(p){ + if(!GMODEL->faceByTag(p->face->tag())){ + // the projection face is not in the model: add it and reset all + // selections + GMODEL->add(p->face); + e->getEntities().clear(); + e->getElements().clear(); + } p->face->setVisibility(true); p->group->show(); } @@ -577,25 +584,17 @@ void mesh_parameterize_cb(Fl_Widget* w, void* data) // display geometry surfaces opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1); - // create one instance of each available projection surface - std::vector<FProjectionFace*> faces; - if(faces.empty()){ + // create the (static) editor + static projectionEditor *editor = 0; + if(!editor){ + std::vector<FProjectionFace*> faces; int tag = GMODEL->numFace(); faces.push_back(new FProjectionFace(GMODEL, ++tag, new CylindricalProjectionSurface(tag))); faces.push_back(new FProjectionFace(GMODEL, ++tag, new RevolvedParabolaProjectionSurface(tag))); + editor = new projectionEditor(faces); } - - // make each projection surface invisible and - for(unsigned int i = 0; i < faces.size(); i++){ - faces[i]->setVisibility(false); - GMODEL->add(faces[i]); - } - - // launch editor - static projectionEditor *editor = 0; - if(!editor) editor = new projectionEditor(faces); editor->show(); } diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp index 2f4bf54116ac0038d68c4f25e7eb141a26308b6c..2c7ed6def8a2539baa658c79571f77451e49545b 100644 --- a/Geo/GModel.cpp +++ b/Geo/GModel.cpp @@ -1,4 +1,4 @@ -// $Id: GModel.cpp,v 1.42 2007-05-23 15:35:33 geuzaine Exp $ +// $Id: GModel.cpp,v 1.43 2007-08-03 14:57:09 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -30,8 +30,11 @@ void GModel::destroy() for(riter it = firstRegion(); it != lastRegion(); ++it) delete *it; regions.clear(); - for(fiter it = firstFace(); it != lastFace(); ++it) - delete *it; + for(fiter it = firstFace(); it != lastFace(); ++it){ + // projection faces are persistent and should never be deleted + if((*it)->geomType() != GEntity::ProjectionFace) + delete *it; + } faces.clear(); for(eiter it = firstEdge(); it != lastEdge(); ++it) delete *it; diff --git a/contrib/FourierModel/Makefile b/contrib/FourierModel/Makefile index 64cf1d0215e93c0997c9f4cd64666a820a495e1c..e2ce305570adeb6eab1dd0ef5d5499f85cf14a16 100644 --- a/contrib/FourierModel/Makefile +++ b/contrib/FourierModel/Makefile @@ -49,3 +49,39 @@ depend: rm -f Makefile.new # DO NOT DELETE THIS LINE +ProjectionSurface.o: ProjectionSurface.cpp ProjectionSurface.h +CylindricalProjectionSurface.o: CylindricalProjectionSurface.cpp \ + CylindricalProjectionSurface.h ProjectionSurface.h +RevolvedParabolaProjectionSurface.o: \ + RevolvedParabolaProjectionSurface.cpp \ + RevolvedParabolaProjectionSurface.h Utils.h ProjectionSurface.h +Patch.o: Patch.cpp Patch.h ProjectionSurface.h +FPatch.o: FPatch.cpp Message.h FPatch.h Patch.h ProjectionSurface.h \ + PartitionOfUnity.h +ContinuationPatch.o: ContinuationPatch.cpp Message.h ContinuationPatch.h \ + Patch.h ProjectionSurface.h FM_Info.h PartitionOfUnity.h \ + Interpolator1D.h +ExactPatch.o: ExactPatch.cpp Message.h ExactPatch.h Patch.h \ + ProjectionSurface.h FM_Info.h +Curve.o: Curve.cpp Curve.h +FCurve.o: FCurve.cpp FCurve.h Curve.h Patch.h ProjectionSurface.h +IntersectionCurve.o: IntersectionCurve.cpp Message.h IntersectionCurve.h \ + Curve.h Patch.h ProjectionSurface.h FM_Info.h +BlendedPatch.o: BlendedPatch.cpp BlendedPatch.h Message.h Patch.h \ + ProjectionSurface.h BlendOperator.h FM_Info.h PartitionOfUnity.h +BlendOperator.o: BlendOperator.cpp BlendOperator.h FM_Info.h Patch.h \ + ProjectionSurface.h +FM_Edge.o: FM_Edge.cpp FM_Edge.h Curve.h FM_Vertex.h Message.h +FM_Face.o: FM_Face.cpp FM_Face.h Patch.h ProjectionSurface.h FM_Edge.h \ + Curve.h FM_Vertex.h Message.h +FM_Info.o: FM_Info.cpp FM_Info.h +FM_Reader.o: FM_Reader.cpp Message.h FM_Reader.h Curve.h \ + IntersectionCurve.h Patch.h ProjectionSurface.h FM_Info.h ExactPatch.h \ + ContinuationPatch.h PartitionOfUnity.h Interpolator1D.h \ + CylindricalProjectionSurface.h RevolvedParabolaProjectionSurface.h \ + Utils.h FM_Face.h FM_Edge.h FM_Vertex.h BlendOperator.h BlendedPatch.h +FM_Vertex.o: FM_Vertex.cpp +Message.o: Message.cpp Message.h +Utils.o: Utils.cpp Utils.h Message.h +PartitionOfUnity.o: PartitionOfUnity.cpp PartitionOfUnity.h +Interpolator1D.o: Interpolator1D.cpp Interpolator1D.h Message.h