Skip to content
Snippets Groups Projects
Commit c99be7c3 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

projection faces are persistent and should never be deleted
parent d5c13dcd
No related branches found
No related tags found
No related merge requests found
......@@ -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
// create the (static) editor
static projectionEditor *editor = 0;
if(!editor){
std::vector<FProjectionFace*> faces;
if(faces.empty()){
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();
}
......
// $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)
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;
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment