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

sync changed flag of model-based view with vsibility browser

parent af1d52cb
No related branches found
No related tags found
No related merge requests found
// $Id: Mesh.cpp,v 1.219 2008-03-20 11:44:07 geuzaine Exp $ // $Id: Mesh.cpp,v 1.220 2008-04-17 05:58:09 geuzaine Exp $
// //
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
// //
...@@ -819,8 +819,19 @@ class drawMeshGRegion { ...@@ -819,8 +819,19 @@ class drawMeshGRegion {
// Main drawing routine // Main drawing routine
#include "PView.h"
void Draw_Mesh() void Draw_Mesh()
{ {
GModel *m = GModel::current();
// make sure to flag any model-dependent post-processing view as
// changed if the underlying mesh has, before resetting the changed
// flag
for(unsigned int i = 0; i < PView::list.size(); i++)
if(PView::list[i]->getData()->hasModel(m) && CTX.mesh.changed)
PView::list[i]->setChanged(true);
if(!CTX.mesh.draw) return; if(!CTX.mesh.draw) return;
glPointSize(CTX.mesh.point_size); glPointSize(CTX.mesh.point_size);
...@@ -843,7 +854,6 @@ void Draw_Mesh() ...@@ -843,7 +854,6 @@ void Draw_Mesh()
static bool busy = false; static bool busy = false;
if(!busy){ if(!busy){
busy = true; busy = true;
GModel *m = GModel::current();
int status = m->getMeshStatus(); int status = m->getMeshStatus();
if(CTX.mesh.changed) { if(CTX.mesh.changed) {
Msg(DEBUG, "Mesh has changed: reinitializing drawing data", CTX.mesh.changed); Msg(DEBUG, "Mesh has changed: reinitializing drawing data", CTX.mesh.changed);
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#define VAL_INF 1.e200 #define VAL_INF 1.e200
class GModel;
class nameData; class nameData;
// abstract interface to post-processing view data // abstract interface to post-processing view data
...@@ -119,6 +120,7 @@ class PViewData { ...@@ -119,6 +120,7 @@ class PViewData {
virtual bool hasTimeStep(int step){ return step < getNumTimeSteps(); } virtual bool hasTimeStep(int step){ return step < getNumTimeSteps(); }
virtual bool hasPartition(int part){ return false; } virtual bool hasPartition(int part){ return false; }
virtual bool hasMultipleMeshes(){ return false; } virtual bool hasMultipleMeshes(){ return false; }
virtual bool hasModel(GModel *model, int step=-1){ return false; }
virtual bool useGaussPoints(){ return false; } virtual bool useGaussPoints(){ return false; }
// I/O routines // I/O routines
......
// $Id: PViewDataGModel.cpp,v 1.50 2008-04-16 22:10:53 geuzaine Exp $ // $Id: PViewDataGModel.cpp,v 1.51 2008-04-17 05:58:09 geuzaine Exp $
// //
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
// //
...@@ -420,6 +420,16 @@ bool PViewDataGModel::hasMultipleMeshes() ...@@ -420,6 +420,16 @@ bool PViewDataGModel::hasMultipleMeshes()
return false; return false;
} }
bool PViewDataGModel::hasModel(GModel *model, int step)
{
if(step < 0){
for(unsigned int i = 0; i < _steps.size(); i++)
if(model == _steps[i]->getModel()) return true;
return false;
}
return (model == _steps[step]->getModel());
}
GEntity *PViewDataGModel::getEntity(int step, int ent) GEntity *PViewDataGModel::getEntity(int step, int ent)
{ {
return _steps[step]->getEntity(ent); return _steps[step]->getEntity(ent);
......
...@@ -180,6 +180,7 @@ class PViewDataGModel : public PViewData { ...@@ -180,6 +180,7 @@ class PViewDataGModel : public PViewData {
bool hasTimeStep(int step); bool hasTimeStep(int step);
bool hasPartition(int part); bool hasPartition(int part);
bool hasMultipleMeshes(); bool hasMultipleMeshes();
bool hasModel(GModel *model, int step=-1);
bool useGaussPoints(){ return _type == GaussPointData; } bool useGaussPoints(){ return _type == GaussPointData; }
// get the data type // get the data type
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment