Program: wxMaracas
Module: $RCSfile: wxMPRWidget.cxx,v $
Language: C++
- Date: $Date: 2009/04/01 08:41:35 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2009/04/23 10:15:56 $
+ Version: $Revision: 1.10 $
Copyright: (c) 2002, 2003
License:
GetInteractorStyleBaseView()->AddInteractorStyleMaracas( _interactorstyleplane2D );
vtkCamera *camera =_imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->GetActiveCamera();
+
camera->SetViewUp ( 0 , 1 , 0 );
- camera->SetFocalPoint ((0+_sizeIma)/2 , (0+_sizeIma)/2 , 0 );
camera->SetPosition ((0+_sizeIma)/2 , (0+_sizeIma)/2 , 10000 );
+
+ camera->SetFocalPoint ((0+_sizeIma)/2 , (0+_sizeIma)/2 , 0 );
camera->SetClippingRange(0.01, 100000);
camera->ComputeViewPlaneNormal();
camera->SetParallelScale( _sizeIma/3.0 );
vtkCamera *camera =_imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->GetActiveCamera();
+
+//EED 17Avril2009
+/*
if (_direction==0) {
camera->SetViewUp ( 0 , -1 , 0 );
camera->SetPosition ( -10000,(y1+y2)/2 , (z1+z2)/2 );
camera->SetFocalPoint ((x1+x2)/2 , (y1+y2)/2 , 0 );
camera->SetParallelScale( (x2-x1)/3.0 );
}
-
+ */
+
+ if (_direction==0) {
+ camera->SetViewUp ( 0 , 1 , 0 );
+ camera->SetPosition ( 10000,(y1+y2)/2 , (z1+z2)/2 );
+ camera->SetFocalPoint ( 0 , (y1+y2)/2 , (z1+z2)/2 );
+ camera->SetParallelScale( (z2-z1)/3.0 );
+ }
+
+ if (_direction==1) {
+ camera->SetViewUp ( 0 , 0 , -1 );
+ camera->SetPosition ((x1+x2)/2 , 10000 , (z1+z2)/2 );
+ camera->SetFocalPoint ((x1+x2)/2 , 0 , (z1+z2)/2 );
+ camera->SetParallelScale( (x2-x1)/3.0 );
+ }
+
+ if (_direction==2) {
+ camera->SetViewUp ( 0 , 1 , 0 );
+ camera->SetPosition ((x1+x2)/2 , (y1+y2)/2 , 10000);
+ camera->SetFocalPoint ((x1+x2)/2 , (y1+y2)/2 , 0 );
+ camera->SetParallelScale( (x2-x1)/3.0 );
+ }
+
+
+
}
// _imageViewer2XYZ->GetVtkImageViewer2()->SetColorWindow (160);
}
if (_direction==1) {
_imageViewer2XYZ->SetYSlice( (int)(GetVtkmprbasedata()->GetY()) );
- _ptsA->SetPoint(0, x1 , y2 , z );
+ _ptsA->SetPoint(0, x1 , y2 , z );
_ptsA->SetPoint(1, x2 , y2 , z );
_ptsB->SetPoint(0, x , y2 , z1);
_ptsB->SetPoint(1, x , y2 , z2);
}
if (_direction==2) {
_imageViewer2XYZ->SetZSlice( (int)(GetVtkmprbasedata()->GetZ()) );
- _ptsA->SetPoint(0, x1 , y , -z2 );
- _ptsA->SetPoint(1, x2 , y , -z2 );
- _ptsB->SetPoint(0, x , y1, -z2 );
- _ptsB->SetPoint(1, x , y2, -z2 );
+ _imageViewer2XYZ->SetZSlice( (int)(GetVtkmprbasedata()->GetZ()) );
+ // _ptsA->SetPoint(0, x1 , y , -z2 );
+ // _ptsA->SetPoint(1, x2 , y , -z2 );
+ // _ptsB->SetPoint(0, x , y1, -z2 );
+ // _ptsB->SetPoint(1, x , y2, -z2 );
+
+ _ptsA->SetPoint(0, x1 , y , z2 );
+ _ptsA->SetPoint(1, x2 , y , z2 );
+ _ptsB->SetPoint(0, x , y1, z2 );
+ _ptsB->SetPoint(1, x , y2, z2 );
}
_backX=x;
_backY=y;
double contBeforPorc = 100*(double)contBefor/(double)totalSubVolume;
double contAfterPorc = 100*(double)contAfter/(double)totalSubVolume;
infoToVo.Printf(_T("%dx%dx%d = %d"),dim[0],dim[1],dim[2], dim[0]*dim[1]*dim[2] );
- infoSuVo.Printf(_T("%d") , totalSubVolume);
+ infoSuVo.Printf(_T("%ld") , totalSubVolume);
infoSuVoA.Printf(_T("%.2f"), _actualCuttingModel->GetTheoricVolume() );
- infoPixLe.Printf(_T("%d pix. (%.2f %s) - %.2f mm^3"),contBefor, contBeforPorc ,_T("%"),contBefor*volumeUnit);
- infoPixHi.Printf(_T("%d pix. (%.2f %s) - %.2f mm^3"),contAfter, contAfterPorc ,_T("%"),contAfter*volumeUnit);
+ infoPixLe.Printf(_T("%ld pix. (%.2f %s) - %.2f mm^3"),contBefor, contBeforPorc ,_T("%"),contBefor*volumeUnit);
+ infoPixHi.Printf(_T("%ld pix. (%.2f %s) - %.2f mm^3"),contAfter, contAfterPorc ,_T("%"),contAfter*volumeUnit);
_infoToVo->SetLabel(infoToVo);
_infoSuVo->SetLabel(infoSuVo);