45 vtkRenderer *
const rndr)
46 : renderWindow(renWin)
50 mainLayout(new QGridLayout(this))
52 showA(new QCheckBox(this))
54 showB(new QCheckBox(this))
60 aPolyData(vtkSmartPointer<vtkPolyData>::New())
62 aGlyphs(vtkSmartPointer<vtkGlyph3D>::New())
64 aMapper(vtkSmartPointer<vtkPolyDataMapper>::New())
66 aActor(vtkSmartPointer<vtkActor>::New())
68 bPolyData(vtkSmartPointer<vtkPolyData>::New())
70 bGlyphs(vtkSmartPointer<vtkGlyph3D>::New())
72 bMapper(vtkSmartPointer<vtkPolyDataMapper>::New())
74 bActor(vtkSmartPointer<vtkActor>::New())
92 showA->setText(
"lattice A");
93 showA->setChecked(
true);
94 aActor->SetVisibility(
true);
95 showB->setText(
"lattice B");
96 showB->setChecked(
true);
97 bActor->SetVisibility(
true);
116 connect(
showA, SIGNAL(stateChanged(
int)),
this, SLOT(
modify()));
117 connect(
showB, SIGNAL(stateChanged(
int)),
this, SLOT(
modify()));
128 vtkSmartPointer<vtkSphereSource>::New()->GetOutputPort());
130 aGlyphs->SetScaleModeToScaleByVector();
132 aGlyphs->SetColorModeToColorByScalar();
136 aActor->GetProperty()->SetColor(1.0, 0.0, 0.0);
141 vtkSmartPointer<vtkSphereSource>::New()->GetOutputPort());
143 bGlyphs->SetScaleModeToScaleByVector();
145 bGlyphs->SetColorModeToColorByScalar();
149 bActor->GetProperty()->SetColor(0.0, 0.0, 1.0);
194 std::cout<<
"Updating BiCrystal..."<<std::flush;
195 const auto t0= std::chrono::system_clock::now();
197 vtkSmartPointer<vtkPoints> aPoints(vtkSmartPointer<vtkPoints>::New());
198 vtkSmartPointer<vtkPoints> bPoints(vtkSmartPointer<vtkPoints>::New());
201 for(
int i=-N;i<N+1;++i)
203 for(
int j=-N;j<N+1;++j)
205 for(
int k=-N;k<N+1;++k)
207 const Eigen::Matrix<double,3,1> Pa(bc->A.latticeBasis*(Eigen::Matrix<double,3,1>()<<i,j,k).finished());
208 aPoints->InsertNextPoint(Pa.data());
209 const Eigen::Matrix<double,3,1> Pb(bc->B.latticeBasis*(Eigen::Matrix<double,3,1>()<<i,j,k).finished());
210 bPoints->InsertNextPoint(Pb.data());
265 std::cout<<
magentaColor<<
" ["<<(std::chrono::duration<double>(std::chrono::system_clock::now()-t0)).count()<<
" sec]"<<
defaultColor<<std::endl;