Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
GlidePlaneActor.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_GlidePlaneActor_h_
10#define model_GlidePlaneActor_h_
11
12
13#include <deque>
14#include <string>
15
16#include <QWidget>
17#include <QGridLayout>
18#include <QCheckBox>
19#include <QLineEdit>
20#include <QComboBox>
21#include <QGroupBox>
22#include <QLabel>
23
24#include <vtkGenericOpenGLRenderWindow.h>
25#include <vtkVersion.h>
26#include <vtkSmartPointer.h>
27#include <vtkPolyData.h>
28#include <vtkPolyDataMapper.h>
29#include <vtkActor.h>
30#include <vtkMath.h>
31#include <vtkProperty.h>
32#include <vtkTubeFilter.h>
33#include <vtkPolyLine.h>
34#include <vtkSphereSource.h>
35#include <vtkArrowSource.h>
36#include <vtkGlyph3D.h>
37#include <vtkDoubleArray.h>
38#include <vtkPointData.h>
39#include <vtkLabeledDataMapper.h>
40#include <vtkFloatArray.h>
41#include <vtkRenderer.h>
42#include <vtkDataSetMapper.h>
43
44#include <IDreader.h>
45//#include <PlanarPolygon.h>
48#include <MeshPlane.h>
49#include <Polycrystal.h>
50#include <GlidePlaneFactory.h>
51#include <GlidePlaneNoise.h>
52//#include <ConfigurationFields.h>
54#include <TriangularMesh.h>
56
57namespace model
58{
59
61 {
63
64 std::map<Eigen::Matrix<double,2,1>,int,CompareType> uniquePointsIDs;
65 std::vector<Eigen::Matrix<double,2,1>> points;
66 std::vector<Eigen::Matrix<int,2,1>> segments;
67 const std::shared_ptr<GlidePlane<3>>& glidePlane;
68 std::shared_ptr<GlidePlaneBase> planeBase;
69
70 SingleGlidePlaneActor(const std::shared_ptr<GlidePlane<3>>& glidePlane_in);
71 void appendClosedPolygon(const std::vector<Eigen::Matrix<double,2,1>>& newPoints);
72
73 };
74
75 struct GlidePlaneActor : public QWidget
76 {
77
78 Q_OBJECT
79 private slots:
80 void modify();
81 void computeGlidePlaneNoise();
82
83 private:
84 vtkGenericOpenGLRenderWindow* const renderWindow;
85 vtkRenderer* const renderer;
86 DefectiveCrystal<3>& defectiveCrystal;
87 const std::shared_ptr<DislocationNetwork<3>> dislocationNetwork;
88 QGridLayout* mainLayout;
89 QGroupBox* glidePlanesGroup;
90
91 vtkSmartPointer<vtkLookupTable> lut;
92 std::array<std::pair<double,double>,3> valuesMinMax;
93 QGroupBox* glidePlanesNoiseGroup;
94 QLabel* noiseMeshSizeLabel;
95 QLineEdit* noiseMeshSizeEdit;
96 QLabel* grainNoiseLabel;
97 QComboBox* grainNoiseBox;
98 QComboBox* slipSystemNoiseBox;
99 QComboBox* glidePlanesNoiseBox;
100 QLineEdit* ss1NoiseMin;
101 QLineEdit* ss1NoiseMax;
102 QLineEdit* ss2NoiseMin;
103 QLineEdit* ss2NoiseMax;
104 QLineEdit* sfNoiseMin;
105 QLineEdit* sfNoiseMax;
106
107// vtkSmartPointer<vtkPoints> noisePts;
108// vtkSmartPointer<vtkCellArray> noiseTriangles;
109// vtkSmartPointer<vtkUnsignedCharArray> noiseColors;
110 std::deque<std::tuple<double,double,double>> noiseValues;
111 vtkSmartPointer<vtkPolyData> noisePolydata;
112 vtkSmartPointer<vtkDataSetMapper> noiseMapper;
113 vtkSmartPointer<vtkActor> noiseActor;
114
115
116 QGroupBox* stackingFaultGroup;
117 vtkSmartPointer<vtkPolyData> glidePlanePolydata;
118 vtkSmartPointer<vtkPolyDataMapper> glidePlaneMapper;
119 vtkSmartPointer<vtkActor> glidePlaneActor;
120
121 vtkSmartPointer<vtkLookupTable> stackingFaultLut;
122 QLineEdit* sfeMinEdit;
123 QLineEdit* sfeMaxEdit;
124 vtkSmartPointer<vtkPolyData> stackingFaultPolydata;
125 vtkSmartPointer<vtkPolyDataMapper> stackingFaultMapper;
126 vtkSmartPointer<vtkActor> stackingFaultActor;
127
128// std::map<size_t,std::vector<vtkSmartPointer<vtkDataSetMapper>>> noiseMappers;
129// std::map<size_t,std::vector<vtkSmartPointer<vtkActor>>> noiseActors;
130// Eigen::Array<double,2,2> noiseLimits;
131
132 public:
133
134
135 GlidePlaneActor(vtkGenericOpenGLRenderWindow* const,vtkRenderer* const,DefectiveCrystal<3>& defectiveCrystal_in);
136 void updateConfiguration();
139
140 };
141
142} // namespace model
143#endif
GlidePlaneActor(vtkGenericOpenGLRenderWindow *const, vtkRenderer *const, DefectiveCrystal< 3 > &defectiveCrystal_in)
std::map< Eigen::Matrix< double, 2, 1 >, int, CompareType > uniquePointsIDs
std::vector< Eigen::Matrix< int, 2, 1 > > segments
std::vector< Eigen::Matrix< double, 2, 1 > > points
void appendClosedPolygon(const std::vector< Eigen::Matrix< double, 2, 1 > > &newPoints)
SingleGlidePlaneActor(const std::shared_ptr< GlidePlane< 3 > > &glidePlane_in)
CompareVectorsByComponent< double, 2, float > CompareType
std::shared_ptr< GlidePlaneBase > planeBase
const std::shared_ptr< GlidePlane< 3 > > & glidePlane