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

« back to all changes in this revision

Viewing changes to Graphics/drawContext.h

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme
  • Date: 2009-07-13 15:49:21 UTC
  • mfrom: (7.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090713154921-zer07j8wixwa07ig
Tags: 2.3.1.dfsg-4
[Christophe Prud'homme]
* Bug fix: "gmsh with cgns write support", thanks to Oliver Borm
  (Closes: #529972).
* debian/rules: make sure that Gmsh is built with occ support on all
  platforms thanks to Denis Barbier (#536435).

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
#define _DRAW_CONTEXT_H_
8
8
 
9
9
#include <string>
 
10
#include <vector>
 
11
#include <set>
10
12
#include <FL/gl.h>
11
13
 
12
14
//FIXME: workaround faulty fltk installs
20
22
#include "SBoundingBox3d.h"
21
23
 
22
24
class PView;
 
25
class GModel;
23
26
 
24
27
class drawTransform {
25
28
 public:
70
73
  drawTransform *_transform;
71
74
  GLUquadricObj *_quadric;
72
75
  GLuint _displayLists;
 
76
  std::set<GModel*> _hiddenModels;
 
77
  std::set<PView*> _hiddenViews;
 
78
  std::vector<GLfloat> _bgImage;
 
79
  int _bgImageSize[2];
73
80
 
74
81
 public:
75
82
  double r[3]; // current Euler angles (in degrees!) 
102
109
  {
103
110
    if(_transform) _transform->transformTwoForm(x, y, z); 
104
111
  }
 
112
  void hide(GModel *m){ _hiddenModels.insert(m); }
 
113
  void hide(PView *v){ _hiddenViews.insert(v); }
 
114
  void show(GModel *m)
 
115
  { 
 
116
    std::set<GModel*>::iterator it = _hiddenModels.find(m);
 
117
    if(it != _hiddenModels.end()) _hiddenModels.erase(it); 
 
118
  }
 
119
  void show(PView *v)
 
120
  { 
 
121
    std::set<PView*>::iterator it = _hiddenViews.find(v);
 
122
    if(it != _hiddenViews.end()) _hiddenViews.erase(it); 
 
123
  }
 
124
  void showAll(){ _hiddenModels.clear(); _hiddenViews.clear(); }
 
125
  bool isVisible(GModel *m){ return (_hiddenModels.find(m) == _hiddenModels.end()); }
 
126
  bool isVisible(PView *v){ return (_hiddenViews.find(v) == _hiddenViews.end()); }
105
127
  void createQuadricsAndDisplayLists();
106
128
  void buildRotationMatrix();
107
129
  void setQuaternion(double p1x, double p1y, double p2x, double p2y);
126
148
  void drawAxis(double xmin, double ymin, double zmin,
127
149
                double xmax, double ymax, double zmax, 
128
150
                int nticks, int mikado);
129
 
  void drawAxes(int mode, int tics[3], char format[3][256],
130
 
                char label[3][256], double bb[6], int mikado);
131
 
  void drawAxes(int mode, int tics[3], char format[3][256], 
132
 
                char label[3][256], SBoundingBox3d &bb, int mikado);
 
151
  void drawAxes(int mode, int tics[3], std::string format[3],
 
152
                std::string label[3], double bb[6], int mikado);
 
153
  void drawAxes(int mode, int tics[3], std::string format[3], 
 
154
                std::string label[3], SBoundingBox3d &bb, int mikado);
133
155
  void drawAxes();
134
156
  void drawSmallAxes();
135
157
  void drawScales();
136
 
  void drawString(std::string s, const char *font_name, int font_enum, 
 
158
  void drawString(std::string s, std::string &font_name, int font_enum, 
137
159
                  int font_size, int align);
138
160
  void drawString(std::string s);
139
161
  void drawStringCenter(std::string s);