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