~ubuntu-branches/debian/squeeze/gmsh/squeeze

« back to all changes in this revision

Viewing changes to Post/PViewDataRemote.h

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme
  • Date: 2009-09-27 17:36:40 UTC
  • mfrom: (1.2.9 upstream) (8.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090927173640-oxyhzt0eadjfrlwz
[Christophe Prud'homme]
* New upstream release
  + solver code refactoring
  + better IDE integration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
 
2
//
 
3
// See the LICENSE.txt file for license information. Please report all
 
4
// bugs and problems to <gmsh@geuz.org>.
 
5
 
 
6
#ifndef _PVIEW_DATA_REMOTE_H_
 
7
#define _PVIEW_DATA_REMOTE_H_
 
8
 
 
9
#include <vector>
 
10
#include <string>
 
11
#include "PViewData.h"
 
12
#include "SBoundingBox3d.h"
 
13
 
 
14
// The container for a remote dataset (does not contain any actual
 
15
// data!)
 
16
class PViewDataRemote : public PViewData {
 
17
 private: 
 
18
  int _numTimeSteps;
 
19
  double _min, _max;
 
20
  std::vector<double> _timeStepMin, _timeStepMax;
 
21
  SBoundingBox3d _bbox;
 
22
  std::vector<double> _time;
 
23
 public:
 
24
  PViewDataRemote(double min, double max, double time, SBoundingBox3d bbox)
 
25
    : _numTimeSteps(1), _min(min), _max(max), _bbox(bbox)
 
26
  {
 
27
    _time.push_back(time);
 
28
  }
 
29
  ~PViewDataRemote(){}
 
30
  bool finalize(){ return false;}
 
31
  int getNumTimeSteps(){ return _numTimeSteps; }
 
32
  double getMin(int step=-1){ return _min; }
 
33
  double getMax(int step=-1){ return _max; }
 
34
  SBoundingBox3d getBoundingBox(int step=-1){ return _bbox; }
 
35
  double getTime(int step)
 
36
  {
 
37
    if(step >= 0 && step < (int)_time.size()) return _time[step];
 
38
    return 0.; 
 
39
  }
 
40
  int getNumElements(int step=-1, int ent=-1)
 
41
  { 
 
42
    // hack so that it does not retrn 0
 
43
    return -1; 
 
44
  }
 
45
  
 
46
  void setMin(double min){ _min = min; }
 
47
  void setMax(double max){ _min = max; }
 
48
  void setBoundingBox(SBoundingBox3d bbox){ _bbox = bbox; }
 
49
  void setTime(int step, double time)
 
50
  {
 
51
    if(step >= (int)_time.size()) _time.resize(step + 1);
 
52
    _time[step] = time;
 
53
  }
 
54
};
 
55
 
 
56
#endif