From 665264575933194f40774a46080732914acfc397 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Thu, 20 Mar 2008 11:05:08 +0000 Subject: [PATCH] *** empty log message *** --- Post/PViewDataGModel.cpp | 6 ++++-- Post/PViewDataGModel.h | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Post/PViewDataGModel.cpp b/Post/PViewDataGModel.cpp index b4b7d662ce..132d8d95a5 100644 --- a/Post/PViewDataGModel.cpp +++ b/Post/PViewDataGModel.cpp @@ -1,4 +1,4 @@ -// $Id: PViewDataGModel.cpp,v 1.32 2008-03-20 10:52:37 geuzaine Exp $ +// $Id: PViewDataGModel.cpp,v 1.33 2008-03-20 11:05:08 geuzaine Exp $ // // Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle // @@ -206,6 +206,8 @@ GEntity *PViewDataGModel::getEntity(int step, int ent) bool PViewDataGModel::getValue(int step, int dataIndex, int comp, double &val) { if(dataIndex < 0 || dataIndex >= (int)_steps[step]->getNumData()) return false; - val = _steps[step]->getData(dataIndex)[comp]; + double *d = _steps[step]->getData(dataIndex); + if(!d) return false; + val = d[comp]; return true; } diff --git a/Post/PViewDataGModel.h b/Post/PViewDataGModel.h index 34b97db440..d7529bbb04 100644 --- a/Post/PViewDataGModel.h +++ b/Post/PViewDataGModel.h @@ -154,9 +154,9 @@ class PViewDataGModel : public PViewData { // create old-style list-based dataset from this one //PViewDataList *convertToPViewDataList(); - // direct access to GModel entities and direct access to value by - // dataIndex + // direct access to GModel entities GEntity *getEntity(int step, int ent); + // direct access to value by dataIndex bool getValue(int step, int dataIndex, int comp, double &val); // I/O routines -- GitLab