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

« back to all changes in this revision

Viewing changes to Post/PViewData.h

  • 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
#ifndef _PVIEW_DATA_H_
 
2
#define _PVIEW_DATA_H_
 
3
 
 
4
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
 
5
//
 
6
// This program is free software; you can redistribute it and/or modify
 
7
// it under the terms of the GNU General Public License as published by
 
8
// the Free Software Foundation; either version 2 of the License, or
 
9
// (at your option) any later version.
 
10
//
 
11
// This program is distributed in the hope that it will be useful,
 
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
// GNU General Public License for more details.
 
15
//
 
16
// You should have received a copy of the GNU General Public License
 
17
// along with this program; if not, write to the Free Software
 
18
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 
19
// USA.
 
20
// 
 
21
// Please report all bugs and problems to <gmsh@geuz.org>.
 
22
 
 
23
#include <string>
 
24
#include <vector>
 
25
#include "SBoundingBox3d.h"
 
26
 
 
27
#define VAL_INF 1.e200
 
28
 
 
29
class GModel;
 
30
class nameData;
 
31
 
 
32
// abstract interface to post-processing view data
 
33
class PViewData {
 
34
 private:
 
35
  // flag to mark that the data is 'dirty' and should not be displayed
 
36
  bool _dirty;
 
37
  // name of the view
 
38
  std::string _name;
 
39
  // name of the file the data was loaded from
 
40
  std::string _fileName;
 
41
  // index of the view in the file
 
42
  int _fileIndex;
 
43
 public:
 
44
  PViewData();
 
45
  virtual ~PViewData(){}
 
46
  virtual bool getDirty(){ return _dirty; }
 
47
  virtual void setDirty(bool val){ _dirty = val; }
 
48
  virtual bool finalize(){ _dirty = false; return true; }
 
49
  virtual std::string getName(){ return _name; }
 
50
  virtual void setName(std::string val){ _name = val; }
 
51
  virtual std::string getFileName(){ return _fileName; }
 
52
  virtual void setFileName(std::string val){ _fileName = val; }
 
53
  virtual int getFileIndex(){ return _fileIndex; }
 
54
  virtual void setFileIndex(int val){ _fileIndex = val; }
 
55
  virtual int getNumTimeSteps() = 0;
 
56
  virtual double getTime(int step){ return 0.; }
 
57
  virtual double getMin(int step=-1) = 0;
 
58
  virtual double getMax(int step=-1) = 0;
 
59
  virtual SBoundingBox3d getBoundingBox(int step=-1) = 0;
 
60
  virtual int getNumScalars(int step=-1){ return 0; }
 
61
  virtual int getNumVectors(int step=-1){ return 0; }
 
62
  virtual int getNumTensors(int step=-1){ return 0; }
 
63
  virtual int getNumPoints(int step=-1){ return 0; }
 
64
  virtual int getNumLines(int step=-1){ return 0; }
 
65
  virtual int getNumTriangles(int step=-1){ return 0; }
 
66
  virtual int getNumQuadrangles(int step=-1){ return 0; }
 
67
  virtual int getNumTetrahedra(int step=-1){ return 0; }
 
68
  virtual int getNumHexahedra(int step=-1){ return 0; }
 
69
  virtual int getNumPrisms(int step=-1){ return 0; }
 
70
  virtual int getNumPyramids(int step=-1){ return 0; }
 
71
  // Returns the number of geometrical entities in the view
 
72
  virtual int getNumEntities(int step=-1) = 0;
 
73
  // Returns the number of elements in the ent-th entity, or the total
 
74
  // number of elements if ent < 0
 
75
  virtual int getNumElements(int step=-1, int ent=-1) = 0;
 
76
  // Returns the geometrical dimension of the ele-th element in the
 
77
  // ent-th entity
 
78
  virtual int getDimension(int step, int ent, int ele) = 0;
 
79
  // Returns the number of nodes of the ele-th element in the ent-th
 
80
  // entity
 
81
  virtual int getNumNodes(int step, int ent, int ele) = 0;
 
82
  // Gets/Sets the coordinates and tag of the nod-th node from the
 
83
  // ele-th element in the ent-th entity (if the node has a tag,
 
84
  // getNode returns it)
 
85
  virtual int getNode(int step, int ent, int ele, int nod, 
 
86
                      double &x, double &y, double &z) = 0;
 
87
  virtual void setNode(int step, int ent, int ele, int nod,
 
88
                       double x, double y, double z);
 
89
  virtual void tagNode(int step, int ent, int ele, int nod, int tag){}
 
90
  // Returns the number of componts available for the ele-th element
 
91
  // in the ent-th entity
 
92
  virtual int getNumComponents(int step, int ent, int ele) = 0;
 
93
  // Gets/sets the comp-th component (at the step-th time step)
 
94
  // associated with the node-th node from the ele-th element in the
 
95
  // ent-th entity
 
96
  virtual void getValue(int step, int ent, int ele, int nod, int comp, double &val) = 0;
 
97
  virtual void setValue(int step, int ent, int ele, int nod, int comp, double val);
 
98
  // Returns a scalar value (same as value for scalars, norm for
 
99
  // vectors, etc.) associated with the node-th node from the ele-th
 
100
  // element in the ent-th entity
 
101
  virtual void getScalarValue(int step, int ent, int ele, int nod, double &val);
 
102
  // Returns the number of edges of the ele-th element in the ent-th
 
103
  // entity
 
104
  virtual int getNumEdges(int step, int ent, int ele) = 0;
 
105
  virtual int getNumStrings2D(){ return 0; }
 
106
  virtual int getNumStrings3D(){ return 0; }
 
107
  virtual void getString2D(int i, int step, std::string &str, 
 
108
                           double &x, double &y, double &style){}
 
109
  virtual void getString3D(int i, int step, std::string &str, 
 
110
                           double &x, double &y, double &z, double &style){}
 
111
  virtual void revertElement(int step, int ent, int ele){}
 
112
  virtual bool empty();
 
113
  virtual void smooth(){}
 
114
  virtual bool combineTime(nameData &nd){ return false; }
 
115
  virtual bool combineSpace(nameData &nd){ return false; }
 
116
  virtual bool isAdaptive(){ return false; }
 
117
  virtual bool skipEntity(int step, int ent){ return false; }
 
118
  virtual bool skipElement(int step, int ent, int ele,
 
119
                           bool checkVisibility=false){ return false; }
 
120
  virtual bool hasTimeStep(int step){ return step < getNumTimeSteps(); }
 
121
  virtual bool hasPartition(int part){ return false; }
 
122
  virtual bool hasMultipleMeshes(){ return false; }
 
123
  virtual bool hasModel(GModel *model, int step=-1){ return false; }
 
124
  virtual bool useGaussPoints(){ return false; }
 
125
 
 
126
  // I/O routines
 
127
  virtual bool writeSTL(std::string fileName);
 
128
  virtual bool writeTXT(std::string fileName);
 
129
  virtual bool writePOS(std::string fileName, bool binary=false, bool parsed=true,
 
130
                        bool append=false);
 
131
  virtual bool writeMSH(std::string fileName, bool binary=false);
 
132
  virtual bool writeMED(std::string fileName);
 
133
};
 
134
 
 
135
class nameData{
 
136
 public:
 
137
  std::string name;
 
138
  std::vector<int> indices;
 
139
  std::vector<PViewData*> data;
 
140
};
 
141
 
 
142
#endif