Calculate transformation to unit cube This shall be applied to all data.
Camera is fixed.
571 auto data=vtkDataSet::SafeDownCast(
data_producer->GetOutputDataObject(0));
594 throw std::runtime_error(
"Specify either view volume or dataset for figure\n");
597 transform = vtkSmartPointer<vtkTransform>::New();
600 double ysize=data_bounds[3]-data_bounds[2];
601 double zsize=data_bounds[5]-data_bounds[4];
602 if (
state.spacedim==2) zsize=0;
603 double xysize=std::max(xsize,ysize);
604 double xyzsize=std::max(xysize,zsize);
611 if (
state.keep_aspect)
614 transform->Translate(0,0.5*(xsize-ysize)/xyzsize,0);
616 transform->Translate(0.5*(ysize-xsize)/xyzsize,0,0);
618 transform->Scale(1.0/xyzsize, 1.0/xyzsize,1.0/xyzsize);
622 if (
state.aspect>1.0)
634 transform->Translate(-data_bounds[0],-data_bounds[2],-data_bounds[4]);
636 double p0[3]={data_bounds[0],data_bounds[2],data_bounds[4]};
637 double p1[3]={data_bounds[1],data_bounds[3],data_bounds[5]};
638 double tp0[3],tp1[3];