Hermes2D  2.0
vector_base_view.h
1 // This file is part of Hermes2D.
2 //
3 // Copyright 2005-2008 Jakub Cerveny <jakub.cerveny@gmail.com>
4 // Copyright 2005-2008 Lenka Dubcova <dubcova@gmail.com>
5 // Copyright 2005-2008 Pavel Solin <solin@unr.edu>
6 //
7 // Hermes2D is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // Hermes2D is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with Hermes2D. If not, see <http://www.gnu.org/licenses/>.
19 
20 // $Id: view.h 1086 2008-10-21 09:05:44Z jakub $
21 
22 #ifndef __H2D_VECTOR_BASE_VIEW_H
23 #define __H2D_VECTOR_BASE_VIEW_H
24 #include "vector_view.h"
25 
26 namespace Hermes
27 {
28  namespace Hermes2D
29  {
30  namespace Views
31  {
32  // you can define NOGLUT to turn off all OpenGL stuff in Hermes2D
33 #ifndef NOGLUT
34  template<typename Scalar>
35  class HERMES_API VectorBaseView : public VectorView
36  {
37  public:
38 
39  VectorBaseView(const char* title = "BaseView", WinGeom* wg = NULL);
40 
41  VectorBaseView(char* title, WinGeom* wg = NULL);
42 
43  void show(Space<Scalar>* space);
44 
45  virtual void set_title(const char* t);
46 
47  virtual ~VectorBaseView();
48 
49  protected:
50 
51  Space<Scalar>* space;
52  PrecalcShapeset* pss;
53  Solution<Scalar>* sln;
54 
55  int ndof, component;
56  int base_index;
57 
58  std::string basic_title;
59 
60  void free();
61  void update_solution();
62  void update_title();
63 
64  virtual void on_special_key(int key, int x, int y);
65  virtual const char* get_help_text() const;
66  };
67 #else
68  template<typename Scalar>
69  class HERMES_API VectorBaseView : public VectorView
70  {
71  public:
72  VectorBaseView(const char* title = "BaseView", WinGeom* wg = NULL) { throw Hermes::Exceptions::Exception("GLUT disabled."); }
73 
74  VectorBaseView(char* title, WinGeom* wg = NULL) { throw Hermes::Exceptions::Exception("GLUT disabled."); }
75 
76  void show(Space<Scalar>* space) { throw Hermes::Exceptions::Exception("GLUT disabled."); }
77 
78  virtual void set_title(const char* t) { throw Hermes::Exceptions::Exception("GLUT disabled."); }
79  };
80 
81 #endif
82  }
83  }
84 }
85 #endif