//-------------------------------------------------------------------
void wxVtkMPR2DView::Configure(){
wxVtk2DBaseView::Configure();
//-------------------------------------------------------------------
void wxVtkMPR2DView::Configure(){
wxVtk2DBaseView::Configure();
if(img!=NULL){
double* origin = img->GetOrigin();
img->GetExtent(x1,x2,y1,y2,z1,z2);
if(img!=NULL){
double* origin = img->GetOrigin();
img->GetExtent(x1,x2,y1,y2,z1,z2);
_lineAMapper->SetInput(_pdA);
_lineAMapper->ImmediateModeRenderingOn();
_lineAActor->SetMapper(_lineAMapper);
_lineAMapper->SetInput(_pdA);
_lineAMapper->ImmediateModeRenderingOn();
_lineAActor->SetMapper(_lineAMapper);
_ptsB->SetPoint(1, 1000 , 1000 , 1000 );
// _lineBActor->GetProperty()->BackfaceCullingOn();
_ptsB->SetPoint(1, 1000 , 1000 , 1000 );
// _lineBActor->GetProperty()->BackfaceCullingOn();
- 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 ( 0 , (y1+y2)/2 , (z1+z2)/2 );
- camera->SetParallelScale( (z2-z1)/3.0 );
- }
+ if(_imageViewer2XYZ){
+ _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor );
+ _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineBActor );
+ 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 ( 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==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 );
- }
-*/
+ 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 );
+ }
+ */
- if (_direction==0) { // YZ
- 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) { // XZ
- 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) { // XY
- 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 );
- }
-
+ if (_direction==0) { // YZ
+ 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) { // XZ
+ 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) { // XY
+ 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 );
+ }
+
_ptsA->SetPoint(0, x2, y1 , z );
_ptsA->SetPoint(1, x2, y2 , z );
_ptsB->SetPoint(0, x2, y , z1);
_ptsB->SetPoint(1, x2, y , z2);
}
if (_direction==1) { // XZ
_ptsA->SetPoint(0, x2, y1 , z );
_ptsA->SetPoint(1, x2, y2 , z );
_ptsB->SetPoint(0, x2, y , z1);
_ptsB->SetPoint(1, x2, y , z2);
}
if (_direction==1) { // XZ
_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) { // XY
_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) { // XY
// _ptsA->SetPoint(0, x1 , y , -z2 );
// _ptsA->SetPoint(1, x2 , y , -z2 );
// _ptsB->SetPoint(0, x , y1, -z2 );
// _ptsA->SetPoint(0, x1 , y , -z2 );
// _ptsA->SetPoint(1, x2 , y , -z2 );
// _ptsB->SetPoint(0, x , y1, -z2 );