GLVis  v4.2
Accurate and flexible finite element visualization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
vsvector3d.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-443271.
4 //
5 // This file is part of the GLVis visualization tool and library. For more
6 // information and source code availability see https://glvis.org.
7 //
8 // GLVis is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 #ifndef GLVIS_VSVECTOR_3D_HPP
13 #define GLVIS_VSVECTOR_3D_HPP
14 
15 #include "mfem.hpp"
16 #include "gl/types.hpp"
17 using namespace mfem;
18 
20 {
21 protected:
22 
23  Vector *solx, *soly, *solz;
24  int drawvector, scal_func;
27 
28  GridFunction *VecGridF;
29  FiniteElementSpace *sfes;
30 
31  void Init();
32 
33  Array<int> vflevel;
34  Array<double> dvflevel;
35 
36 public:
37  int ianim, ianimd, ianimmax, drawdisp;
38 
39  VisualizationSceneVector3d(Mesh & m, Vector & sx, Vector & sy, Vector & sz);
40  VisualizationSceneVector3d (GridFunction &vgf);
41 
42  void NewMeshAndSolution(Mesh *new_m, GridFunction *new_v);
43 
44  virtual ~VisualizationSceneVector3d();
45 
46  virtual std::string GetHelpString() const;
47 
48  void NPressed();
49  virtual void PrepareFlat();
50  virtual void Prepare();
51  virtual void PrepareLines();
52 
53  void PrepareFlat2();
54  void PrepareLines2();
55 
56  void DrawVector (gl3::GlBuilder& builder,
57  int type, double v0, double v1, double v2,
58  double sx, double sy, double sz, double s);
59  virtual void PrepareVectorField();
60  void PrepareDisplacedMesh();
61  void ToggleVectorField(int i);
62 
63  void SetScalarFunction();
64  void ToggleScalarFunction();
65 
66  virtual void PrepareCuttingPlane();
67 
68  void ToggleDisplacements() {drawdisp = (drawdisp+1)%2;};
69 
70  virtual gl3::SceneInfo GetSceneObjs();
71 
72  virtual void EventUpdateColors()
73  { Prepare(); PrepareVectorField(); PrepareCuttingPlane(); };
74 
75  void ToggleVectorFieldLevel(int v);
76  void AddVectorFieldLevel();
77  void RemoveVectorFieldLevel();
78 };
79 
80 #endif
Array< double > dvflevel
Definition: vsvector3d.hpp:34
thread_local int ianim
Definition: vsvector.cpp:107
gl3::GlDrawable vector_buf
Definition: vsvector3d.hpp:25
FiniteElementSpace * sfes
Definition: vsvector3d.hpp:29
gl3::GlDrawable displine_buf
Definition: vsvector3d.hpp:26
Crude fixed-function OpenGL emulation helper.
Definition: types.hpp:261
virtual void EventUpdateColors()
Definition: vsvector3d.hpp:72