49 ,mainLayout(new QGridLayout(this))
50 ,showA(new QCheckBox(this))
51 ,showB(new QCheckBox(this))
56 ,aPolyData(vtkSmartPointer<vtkPolyData>::New())
57 ,aGlyphs(vtkSmartPointer<vtkGlyph3D>::New())
58 ,aMapper(vtkSmartPointer<vtkPolyDataMapper>::New())
59 ,aActor(vtkSmartPointer<vtkActor>::New())
60,bPolyData(vtkSmartPointer<vtkPolyData>::New())
61,bGlyphs(vtkSmartPointer<vtkGlyph3D>::New())
62,bMapper(vtkSmartPointer<vtkPolyDataMapper>::New())
63,bActor(vtkSmartPointer<vtkActor>::New())
79 showA->setText(
"lattice A");
80 showA->setChecked(
true);
81 aActor->SetVisibility(
true);
82 showB->setText(
"lattice B");
83 showB->setChecked(
true);
84 bActor->SetVisibility(
true);
104 connect(
showA,SIGNAL(stateChanged(
int)),
this, SLOT(
modify()));
105 connect(
showB,SIGNAL(stateChanged(
int)),
this, SLOT(
modify()));
113 aGlyphs->SetSourceConnection(vtkSmartPointer<vtkSphereSource>::New()->GetOutputPort());
115 aGlyphs->SetScaleModeToScaleByVector();
117 aGlyphs->SetColorModeToColorByScalar();
121 aActor->GetProperty()->SetColor(1.0, 0.0, 0.0);
125 bGlyphs->SetSourceConnection(vtkSmartPointer<vtkSphereSource>::New()->GetOutputPort());
127 bGlyphs->SetScaleModeToScaleByVector();
129 bGlyphs->SetColorModeToColorByScalar();
133 bActor->GetProperty()->SetColor(0.0, 0.0, 1.0);
179 std::cout<<
"Updating BiCrystal..."<<std::flush;
180 const auto t0= std::chrono::system_clock::now();
182 vtkSmartPointer<vtkPoints> aPoints(vtkSmartPointer<vtkPoints>::New());
183 vtkSmartPointer<vtkPoints> bPoints(vtkSmartPointer<vtkPoints>::New());
186 for(
int i=-N;i<N+1;++i)
188 for(
int j=-N;j<N+1;++j)
190 for(
int k=-N;k<N+1;++k)
192 const Eigen::Matrix<double,3,1> Pa(bc->A.latticeBasis*(Eigen::Matrix<double,3,1>()<<i,j,k).finished());
193 aPoints->InsertNextPoint(Pa.data());
194 const Eigen::Matrix<double,3,1> Pb(bc->B.latticeBasis*(Eigen::Matrix<double,3,1>()<<i,j,k).finished());
195 bPoints->InsertNextPoint(Pb.data());
250 std::cout<<
magentaColor<<
" ["<<(std::chrono::duration<double>(std::chrono::system_clock::now()-t0)).count()<<
" sec]"<<
defaultColor<<std::endl;