~ubuntu-branches/ubuntu/karmic/gmsh/karmic

« back to all changes in this revision

Viewing changes to Post/PViewData.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Daniel Leidert
  • Date: 2008-05-18 12:46:05 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080518124605-716xqbqeo07o497k
Tags: 2.2.0-2
[Christophe Prud'homme]
* Bug fix: "gmsh ships no .desktop", thanks to Vassilis Pandis (Closes:
  #375770). Applied the Ubuntu patch.

[Daniel Leidert]
* debian/control (Vcs-Svn): Fixed.
  (Build-Depends): Use texlive instead of tetex-bin.
* debian/gmsh.doc-base (Section): Fixed accordingly to doc-base (>= 0.8.10).
* debian/rules: Removed some variable declarations, that lead to double
  configuration and seem to be useless.
  (build/gmsh): Try to avoid multiple runs by using a stamp.
  (orig-tarball): Renamed to get-orig-source and changed to use uscan.
* debian/watch: Added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// $Id: PViewData.cpp,v 1.17 2008-04-06 09:20:17 geuzaine Exp $
 
2
//
 
3
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
 
4
//
 
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.
 
9
//
 
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.
 
14
//
 
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
 
18
// USA.
 
19
// 
 
20
// Please report all bugs and problems to <gmsh@geuz.org>.
 
21
//
 
22
// Contributor(s):
 
23
// 
 
24
 
 
25
#include "PViewData.h"
 
26
#include "Numeric.h"
 
27
#include "Message.h"
 
28
 
 
29
PViewData::PViewData()
 
30
  : _dirty(true), _fileIndex(0)
 
31
{
 
32
}
 
33
 
 
34
bool PViewData::empty()
 
35
{
 
36
  return (!getNumElements() && !getNumStrings2D() && !getNumStrings3D());
 
37
}
 
38
 
 
39
void PViewData::getScalarValue(int step, int ent, int ele, int nod, double &val)
 
40
{
 
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]);
 
46
}
 
47
 
 
48
void PViewData::setNode(int step, int ent, int ele, int nod, double x, double y, double z)
 
49
{
 
50
  Msg(GERROR, "Cannot change node coordinates in this view");
 
51
}
 
52
 
 
53
void PViewData::setValue(int step, int ent, int ele, int nod, int comp, double val)
 
54
{
 
55
  Msg(GERROR, "Cannot change field value in this view");
 
56
}