Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
DefectiveCrystalActor.h
Go to the documentation of this file.
1/* This file is part of MODEL, the Mechanics Of Defect Evolution Library.
2 *
3 * Copyright (C) 2011 by Giacomo Po <gpo@ucla.edu>.
4 *
5 * model is distributed without any warranty under the
6 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
7 */
8
9#ifndef model_DefectiveCrystalActor_h_
10#define model_DefectiveCrystalActor_h_
11
12#include <QGroupBox>
13#include <QGridLayout>
14#include <QCheckBox>
15#include <QLabel>
16#include <WrappingTabWidget.h>
17#include <QTextEdit>
18#include <QLineEdit>
19#include <QToolButton>
20#include <QVTKOpenGLStereoWidget.h>
21
22#include <vtkRenderer.h>
23#include <vtkGenericOpenGLRenderWindow.h>
24
26//#include <ConfigurationFields.h>
29#include <DDFieldWidget.h>
30#include <SurfaceMeshActor.h>
31#include <FrameCameraRotation.h>
33#include <SimplicialMesh.h>
34#include <NetworkNodeActor.h>
35#include <NetworkLinkActor.h>
36#include <NetworkLoopActor.h>
37#include <InclusionActor.h>
38#include <GlidePlaneActor.h>
39#include <QuadratureActor.h>
40#include <ChartActor.h>
41#include <SlipSystemTab.h>
42#include <QCheckBox>
43
44// added std library
45#include <memory>
46#include <QTimer>
47
48namespace model
49{
50 struct DefectiveCrystalActor : public QWidget
51 {
52
53 Q_OBJECT
54
55
56 public:
57 vtkGenericOpenGLRenderWindow* const renderWindow;
58 QVTKOpenGLStereoWidget* const qvtkGLwidget;
59// const DefectiveCrystalTraitsIO& traitsIO;
60// SlipSystemTab::SlipSystemColorMapType slipSystemColorMap;
73
74 private:
75 std::unique_ptr<DefectiveCrystalConfigIO<3>> configuration;
76 std::unique_ptr<DefectiveCrystalAuxIO<3>> auxiliary;
77 QTimer *const playbackTimer;
78 bool playing = false;
79 bool updatingFrame = false;
80 void refreshFrame(size_t frameID);
81 vtkRenderer *const renderer;
82 PeriodicImagesWidget* periodicImages;
83 FrameCameraRotation frameRotation;
84 Eigen::Vector3d rotationAxis = Eigen::Vector3d::UnitZ();
85 double rotationDegreesPerFrame = 0.0;
86 double cameraAdvancePerFrame = 0.0;
87 size_t loadedFrameID = 0;
88 bool frameLoaded = false;
89 bool readRotationSettings();
90 void updateRotationSettings();
91
92 private slots:
93 bool updateConfiguration();
94 bool nextConfiguration();
95 bool prevConfiguration();
96 void playConfigurations();
97
98 public slots:
99 void stopConfigurations();
100
101 signals:
102 void frameChanged(qulonglong frameID);
103
104 public:
105
106 QGridLayout* mainLayout;
107 QLineEdit* frameIDedit;
108 QToolButton* plusFrameButton;
109 QToolButton* playFrameButton;
110 QToolButton* stopFrameButton;
111 QToolButton* minusFrameButton;
116 QCheckBox* saveImage;
117 QLabel* frameStatus;
119
120 DefectiveCrystalActor(vtkGenericOpenGLRenderWindow* const,
121 vtkRenderer* const ren,
122 QVTKOpenGLStereoWidget* const qvtkGLwidget_in,
123 DefectiveCrystalBase<3>& ddBase_in);
124 ~DefectiveCrystalActor() override;
125 bool updateConfiguration(const size_t& frameID);
126 void modify();
129 const DefectiveCrystalAuxIO<3>& auxIO() const;
131
132 };
133
134}
135#endif
QVTKOpenGLStereoWidget *const qvtkGLwidget
vtkGenericOpenGLRenderWindow *const renderWindow
void frameChanged(qulonglong frameID)
DefectiveCrystal< 3 > defectiveCrystal
DefectiveCrystalBase< 3 > & ddBase
DefectiveCrystalActor(vtkGenericOpenGLRenderWindow *const, vtkRenderer *const ren, QVTKOpenGLStereoWidget *const qvtkGLwidget_in, DefectiveCrystalBase< 3 > &ddBase_in)
const DefectiveCrystalConfigIO< 3 > & configIO() const
const DefectiveCrystalAuxIO< 3 > & auxIO() const