Hermes2D  3.0
order_view.h
1 // This file is part of Hermes2D.
2 // Hermes2D is free software: you can redistribute it and/or modify
3 // it under the terms of the GNU General Public License as published by
4 // the Free Software Foundation, either version 2 of the License, or
5 // (at your option) any later version.
6 //
7 // Hermes2D is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // GNU General Public License for more details.
11 //
12 // You should have received a copy of the GNU General Public License
13 // along with Hermes2D. If not, see <http://www.gnu.org/licenses/>.
14 
15 // $Id: view.h 1086 2008-10-21 09:05:44Z jakub $
16 
17 #ifndef __H2D_ORDER_VIEW_H
18 #define __H2D_ORDER_VIEW_H
19 #include "view.h"
20 
21 namespace Hermes
22 {
23  namespace Hermes2D
24  {
25  namespace Views
26  {
27  // you can define NOGLUT to turn off all OpenGL stuff in Hermes2D
28 #ifndef NOGLUT
29  static const int H2DV_MAX_VIEWABLE_ORDER = 10;
31 
36  class HERMES_API OrderView : public View
37  {
38  public:
39 
40  OrderView(const char* title = "OrderView", WinGeom* wg = nullptr);
41  // #ifndef _MSC_VER
42  // OrderView(const char* title = "OrderView", WinGeom* wg = nullptr);
43  // #endif
44  OrderView(char* title, WinGeom* wg = nullptr);
45 
46  template<typename Scalar>
47  void show(SpaceSharedPtr<Scalar> space, bool show_edge_orders = false);
48  void set_b_orders(bool set);
49  protected:
50 
51  Orderizer ord;
52  bool b_orders;
53 
54  int num_boxes, order_min;
56  const char* box_names[H2DV_MAX_VIEWABLE_ORDER + 1];
58  char text_buffer[H2DV_MAX_VIEWABLE_ORDER * 4];
60  float order_colors[H2DV_MAX_VIEWABLE_ORDER + 1][3];
61 
63  void init_order_palette(double3* vert);
64 
65  virtual void on_display();
66  virtual void on_key_down(unsigned char key, int x, int y);
67  virtual void scale_dispatch();
68  virtual int measure_scale_labels();
69  virtual const char* get_help_text() const;
70  };
71 #else
72  class HERMES_API OrderView : public View
73  {
74  public:
75 
76  OrderView(const char* title = "OrderView", WinGeom* wg = nullptr) {}
77  OrderView(char* title, WinGeom* wg = nullptr) {}
78 
79  template<typename Scalar>
80  void show(SpaceSharedPtr<Scalar> space, bool show_edge_orders = true) { throw Hermes::Exceptions::Exception("GLUT disabled."); }
81  void set_b_orders(bool set) { throw Hermes::Exceptions::Exception("GLUT disabled."); }
82  };
83 #endif
84  }
85  }
86 }
87 #endif
Definition: adapt.h:24
Used to pass the instances of Space around.
Definition: space.h:34
Represents a simple visualization window.
Definition: view.h:80
File containing View abstract class.
Displays the polynomial degrees of elements.
Definition: order_view.h:36