Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
InclusionActor.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_InclusionActor_H_
10#define model_InclusionActor_H_
11
12#include <Eigen/Dense>
13
14#include <QWidget>
15#include <QGridLayout>
16#include <QCheckBox>
17#include <QSlider>
18
19#include <vtkVersion.h>
20#include <vtkSmartPointer.h>
21#include <vtkPoints.h>
22#include <vtkPointData.h>
23#include <vtkDoubleArray.h>
24#include <vtkPolyData.h>
25#include <vtkSphereSource.h>
26#include <vtkGlyph3D.h>
27#include <vtkPolyDataMapper.h>
28#include <vtkActor.h>
29#include <vtkUnstructuredGrid.h>
30#include <vtkLookupTable.h>
31#include <vtkGenericOpenGLRenderWindow.h>
32#include <vtkFloatArray.h>
33#include <vtkProperty.h>
34#include <vtkRenderer.h>
35#include <vtkDataSetMapper.h>
36
39
40
41// VTK documentation
42// http://vtk.1045678.n5.nabble.com/VTK-slow-to-display-300-vtkSphereSource-in-real-time-td5740730.html
43// http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Scaleglyph3D
44// http://hiraku0n.blogspot.com/2012/10/writing-scalar-and-vector-field-in-vtk.html
45// http://vtk.1045678.n5.nabble.com/Glyphing-vtkImageData-scalars-3D-as-arrows-td3199837.html
46
47namespace model
48{
49
50 struct InclusionActor : public QWidget
51 {
52
53 static constexpr int dim=3;
54 typedef Eigen::Matrix<float,dim,1> VectorDim;
55 typedef Eigen::Matrix<float,dim,dim,1> MatrixDim;
56
57 Q_OBJECT
58
59 private slots:
60 void modify();
61
62 private:
63 vtkGenericOpenGLRenderWindow* const renderWindow;
64 QGridLayout* mainLayout;
65 QCheckBox* showInclusions;
66 QSlider* sliderInclusionOpacity;
67
68
69 vtkSmartPointer<vtkUnstructuredGrid> grid;
70 vtkSmartPointer<vtkSphereSource> sphereSource;
71 vtkSmartPointer<vtkGlyph3D> glyph3D;
72 vtkSmartPointer<vtkPolyDataMapper> mapper;
73 vtkSmartPointer<vtkActor> actor;
74 vtkSmartPointer<vtkLookupTable> lookUpColors;
75
76 vtkSmartPointer<vtkPolyDataMapper> ellipsoidalMapper;
77 vtkSmartPointer<vtkActor> ellipsoidalActor;
78
79 vtkSmartPointer<vtkDataSetMapper> polyhedronMapper;
80 vtkSmartPointer<vtkActor> polyhedronActor;
81
82 public:
84 const std::shared_ptr<InclusionMicrostructure<3>> inclusions;
85
86
87 public:
88 InclusionActor(vtkGenericOpenGLRenderWindow* const,vtkRenderer* const,const DefectiveCrystal<3>& configFields_in);
90
91 };
92
93}
94#endif
Eigen::Matrix< float, dim, 1 > VectorDim
const std::shared_ptr< InclusionMicrostructure< 3 > > inclusions
static constexpr int dim
InclusionActor(vtkGenericOpenGLRenderWindow *const, vtkRenderer *const, const DefectiveCrystal< 3 > &configFields_in)
const DefectiveCrystal< 3 > & defectiveCrystal
Eigen::Matrix< float, dim, dim, 1 > MatrixDim