1
// $Id: PViewData.cpp,v 1.17 2008-04-06 09:20:17 geuzaine Exp $
3
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
5
// This program is free software; you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation; either version 2 of the License, or
8
// (at your option) any later version.
10
// This program is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
15
// You should have received a copy of the GNU General Public License
16
// along with this program; if not, write to the Free Software
17
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20
// Please report all bugs and problems to <gmsh@geuz.org>.
25
#include "PViewData.h"
29
PViewData::PViewData()
30
: _dirty(true), _fileIndex(0)
34
bool PViewData::empty()
36
return (!getNumElements() && !getNumStrings2D() && !getNumStrings3D());
39
void PViewData::getScalarValue(int step, int ent, int ele, int nod, double &val)
41
int numComp = getNumComponents(step, ent, ele);
42
std::vector<double> d(numComp);
43
for(int comp = 0; comp < numComp; comp++)
44
getValue(step, ent, ele, nod, comp, d[comp]);
45
val = ComputeScalarRep(numComp, &d[0]);
48
void PViewData::setNode(int step, int ent, int ele, int nod, double x, double y, double z)
50
Msg(GERROR, "Cannot change node coordinates in this view");
53
void PViewData::setValue(int step, int ent, int ele, int nod, int comp, double val)
55
Msg(GERROR, "Cannot change field value in this view");