AtilaCalculatorSoftware  2.3.4
C++ Interface for Atila fem resources files
main_window.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Project: AtilaCalculatorSoftware
4  File: main_window.h
5 
6  Copyright (c) 2020
7  All rights reserved.
8 
9 =========================================================================*/
10 #ifndef ATILACALCULATORSOFTWARE_MAIN_WINDOW_H
11 #define ATILACALCULATORSOFTWARE_MAIN_WINDOW_H
12 
14 #include "ui_MainWindow.h"
15 
16 #include <QFileDialog>
17 #include <QMainWindow>
18 #include <QStringListModel>
19 #include <vtkAxesActor.h>
20 #include <vtkDataSetMapper.h>
21 #include <vtkGenericOpenGLRenderWindow.h>
22 #include <vtkInteractorStyleRubberBandZoom.h>
23 #include <vtkInteractorStyleTrackballCamera.h>
24 #include <vtkLookupTable.h>
25 #include <vtkNamedColors.h>
26 #include <vtkNew.h>
27 #include <vtkOrientationMarkerWidget.h>
28 #include <vtkPolyDataMapper.h>
29 #include <vtkProperty.h>
30 #include <vtkRenderWindow.h>
31 #include <vtkRenderer.h>
32 #include <vtkRendererCollection.h>
33 #include <vtkScalarBarActor.h>
34 #include <vtkSmartPointer.h>
35 #include <vtkSphereSource.h>
36 #include <vtkVersion.h>
37 #include <vtkVertexGlyphFilter.h>
38 
43 class MainWindow : public QMainWindow, private Ui::MainWindow {
44  Q_OBJECT
45  public:
49  explicit MainWindow(char* dataDirectory);
50 
51  public slots:
55  void slotExit();
56 
60  void slotOpenFile();
61 
65  void slotZoomArea();
66 
71 
75  void slotShowNodes();
76 
80  void slotResetCamera();
81 
82  private:
86  void initAxes();
87 
93  void showResult(Result& result, const int& component);
94 
100  void show3DPoly(Result& result, const int& component);
101 
107  void showNodes();
108 
114  void loadBinaryData(const std::string& filename);
115 
119  void unloadBinaryData();
120 
124  void setBinaryElements();
125 
129  void clearBinaryElements();
130 
135  void setBinaryResults();
136 
140  void clearBinaryResults();
141 
146 
150  vtkSmartPointer<vtkOrientationMarkerWidget> axesWidget;
151 
155  QStringListModel* informationListModel;
156 
160  vtkProp* nodeActor = nullptr;
161 
166 
170  Result* lastResult = nullptr;
171 
176 };
177 
178 #endif
BinaryDataWrapper * binary
Data imported from the current .res file.
Definition: main_window.h:165
void show3DPoly(Result &result, const int &component)
Show the 3D polygon of the given result.
Definition: main_window.cpp:229
void slotZoomArea()
Allow the user to select an area to zoom on.
Definition: main_window.cpp:122
void loadBinaryData(const std::string &filename)
Read binary data and load it, then print the scalars and show the object, also set the "Results" menu...
Definition: main_window.cpp:313
QString objectDirectory
Path to directory that stores the objects to open.
Definition: main_window.h:145
void slotShowNodes()
Shows the objects node if toggled on checked, otherwise hide it.
Definition: main_window.cpp:142
void slotResetCamera()
Reset the camera view as default.
Definition: main_window.cpp:159
Wrapper around the BinaryData class that allows to interact with VTK.
Definition: binary_data_wrapper.h:40
void unloadBinaryData()
Clear and destruct loaded binary data.
Definition: main_window.cpp:335
void initAxes()
Initialize axes view.
Definition: main_window.cpp:172
Representation of all the results and their components read from a res file.
Definition: result.h:28
vtkSmartPointer< vtkOrientationMarkerWidget > axesWidget
Movable widget that shows the axes.
Definition: main_window.h:150
void setBinaryElements()
Add action item to "Elements" menu for each elements of the loaded meshes.
Definition: main_window.cpp:355
void slotOpenFile()
Open and read object file, then render it.
Definition: main_window.cpp:106
void slotInteractWithObject()
Reset the interactor to allow object interaction after zoomArea.
Definition: main_window.cpp:132
void clearBinaryElements()
Remove all actions of the "Elements" menu.
Definition: main_window.cpp:381
Result * lastResult
Last loaded result.
Definition: main_window.h:170
void showNodes()
Show the nodes of the result.
Definition: main_window.cpp:276
void slotExit()
Stop the application.
Definition: main_window.cpp:100
int lastResultComponent
Last loaded result component.
Definition: main_window.h:175
void setBinaryResults()
Add action item to "Results" menu for each component of each loaded results of binary data...
Definition: main_window.cpp:387
vtkProp * nodeActor
Actor of node showing.
Definition: main_window.h:160
void clearBinaryResults()
Remove all actions of the "Results" menu.
Definition: main_window.cpp:436
void showResult(Result &result, const int &component)
Load result and show elements.
Definition: main_window.cpp:196
QStringListModel * informationListModel
Information module model.
Definition: main_window.h:155
Qt main window.
Definition: main_window.h:43
MainWindow(char *dataDirectory)
Definition: main_window.cpp:22