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

fine-tuning

parent 13a5bad2
No related branches found
No related tags found
No related merge requests found
...@@ -127,8 +127,8 @@ static void mergePostProcessingFile(const std::string &fileName) ...@@ -127,8 +127,8 @@ static void mergePostProcessingFile(const std::string &fileName)
GModel *old = GModel::current(); GModel *old = GModel::current();
if(haveMesh){ if(haveMesh){
GModel *m = new GModel(); GModel *m = new GModel();
m->setVisibility(0);
GModel::setCurrent(m); GModel::setCurrent(m);
m->setVisibility(false);
} }
MergeFile(fileName); MergeFile(fileName);
GModel::setCurrent(old); GModel::setCurrent(old);
......
...@@ -102,7 +102,7 @@ PView::PView(std::string xname, std::string yname, ...@@ -102,7 +102,7 @@ PView::PView(std::string xname, std::string yname,
_options->axesLabel[0] = xname; _options->axesLabel[0] = xname;
} }
PView::PView(std::string name, std::string type, PView::PView(std::string name, std::string type,
GModel *model, std::map<int, std::vector<double> > &data, GModel *model, std::map<int, std::vector<double> > &data,
double time, int numComp) double time, int numComp)
{ {
...@@ -129,7 +129,7 @@ PView::PView(std::string name, std::string type, ...@@ -129,7 +129,7 @@ PView::PView(std::string name, std::string type,
_options->targetError); _options->targetError);
} }
void PView::addStep(GModel *model, std::map<int, std::vector<double> > &data, void PView::addStep(GModel *model, std::map<int, std::vector<double> > &data,
double time, int numComp) double time, int numComp)
{ {
PViewDataGModel *d = dynamic_cast<PViewDataGModel*>(_data); PViewDataGModel *d = dynamic_cast<PViewDataGModel*>(_data);
...@@ -153,14 +153,14 @@ PView::~PView() ...@@ -153,14 +153,14 @@ PView::~PView()
for(unsigned int i = 0; i < list.size(); i++) for(unsigned int i = 0; i < list.size(); i++)
if(list[i]->getAliasOf() == _num) if(list[i]->getAliasOf() == _num)
return; return;
// do not delete if this view is an alias and 1) if the original // do not delete if this view is an alias and 1) if the original
// still exists, or 2) if there are other aliases to the same view // still exists, or 2) if there are other aliases to the same view
if(_aliasOf) if(_aliasOf)
for(unsigned int i = 0; i < list.size(); i++) for(unsigned int i = 0; i < list.size(); i++)
if(list[i]->getNum() == _aliasOf || list[i]->getAliasOf() == _aliasOf) if(list[i]->getNum() == _aliasOf || list[i]->getAliasOf() == _aliasOf)
return; return;
Msg::Debug("Deleting data in View[%d] (unique num = %d)", _index, _num); Msg::Debug("Deleting data in View[%d] (unique num = %d)", _index, _num);
delete _data; delete _data;
} }
...@@ -183,7 +183,7 @@ void PView::setOptions(PViewOptions *val) ...@@ -183,7 +183,7 @@ void PView::setOptions(PViewOptions *val)
} }
PViewData *PView::getData(bool useAdaptiveIfAvailable) PViewData *PView::getData(bool useAdaptiveIfAvailable)
{ {
if(useAdaptiveIfAvailable && _data->getAdaptiveData() && !_data->isRemote()) if(useAdaptiveIfAvailable && _data->getAdaptiveData() && !_data->isRemote())
return _data->getAdaptiveData()->getData(); return _data->getAdaptiveData()->getData();
else else
...@@ -191,11 +191,11 @@ PViewData *PView::getData(bool useAdaptiveIfAvailable) ...@@ -191,11 +191,11 @@ PViewData *PView::getData(bool useAdaptiveIfAvailable)
} }
void PView::setChanged(bool val) void PView::setChanged(bool val)
{ {
_changed = val; _changed = val;
// reset the eye position everytime we change the view so that the // reset the eye position everytime we change the view so that the
// arrays get resorted for transparency // arrays get resorted for transparency
if(_changed) _eye = SPoint3(0., 0., 0.); if(_changed) _eye = SPoint3(0., 0., 0.);
} }
void PView::combine(bool time, int how, bool remove) void PView::combine(bool time, int how, bool remove)
...@@ -284,7 +284,8 @@ void PView::combine(bool time, int how, bool remove) ...@@ -284,7 +284,8 @@ void PView::combine(bool time, int how, bool remove)
PView *PView::getViewByName(std::string name, int timeStep, int partition) PView *PView::getViewByName(std::string name, int timeStep, int partition)
{ {
for(unsigned int i = 0; i < list.size(); i++){ // search views from most recently to least recently added
for(int i = list.size() - 1; i >= 0; i--){
if(list[i]->getData()->getName() == name && if(list[i]->getData()->getName() == name &&
((timeStep < 0 || !list[i]->getData()->hasTimeStep(timeStep)) || ((timeStep < 0 || !list[i]->getData()->hasTimeStep(timeStep)) ||
(partition < 0 || !list[i]->getData()->hasPartition(timeStep, partition)))) (partition < 0 || !list[i]->getData()->hasPartition(timeStep, partition))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment