#if defined(WIN32)
_iren->Refresh(false);
#else
- _iren->Render();
+
+//EED 01Avril2009
+// _iren->Render();
+ vtkRenderWindowInteractor *vri = GetWxVTKRenderWindowInteractor();
+ vri->vtkRenderWindowInteractor::Render();
+
+
//_iren->Refresh();
#endif
// Text Window Level
vtkTextActor *textActor = vtkTextActor::New();
textActor->SetDisplayPosition(px, py);
- textActor->SetInput("--");
+ textActor->SetInput("0");
// Set coordinates to match the old vtkScaledTextActor default value
textActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
char zTzxt[20];
char resultText[50];
- strcpy(resultText,"NG: ");
- if (ok==true) {
- unsigned short *pOrg=(unsigned short*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
-// itoa (*pOrg,zTzxt,10);
- int tmp=*pOrg;
- sprintf(zTzxt,"%d",tmp);
-
- } else {
+ strcpy(resultText,"GL: ");
+ if (ok==true)
+ {
+ if (imagedata->GetScalarType()==VTK_BIT)
+ {
+ char *pOrg=(char*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ if(*pOrg==0)
+ {
+ sprintf(zTzxt,"%d",0);
+ }
+ else
+ {
+ sprintf(zTzxt,"%d",1);
+ }
+ }
+
+ if (imagedata->GetScalarType()==VTK_CHAR)
+ {
+ char *pOrg=(char*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ int tmp=*pOrg;
+ sprintf(zTzxt,"%d",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_SIGNED_CHAR)
+ {
+ signed char *pOrg=(signed char*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ int tmp=*pOrg;
+ sprintf(zTzxt,"%d",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_UNSIGNED_CHAR)
+ {
+ unsigned char *pOrg=(unsigned char*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ int tmp=*pOrg;
+ sprintf(zTzxt,"%d",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_SHORT)
+ {
+ short *pOrg=(short*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ int tmp=*pOrg;
+ sprintf(zTzxt,"%d",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_UNSIGNED_SHORT)
+ {
+ unsigned short *pOrg=(unsigned short*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ int tmp=*pOrg;
+ sprintf(zTzxt,"%d",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_INT)
+ {
+ int *pOrg=(int*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ sprintf(zTzxt,"%d",*pOrg);
+ }
+
+ if (imagedata->GetScalarType()==VTK_UNSIGNED_INT)
+ {
+ unsigned int *pOrg=(unsigned int*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ int tmp=*pOrg;
+ sprintf(zTzxt,"%d",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_LONG)
+ {
+ long *pOrg=(long*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ double tmp=*pOrg;
+ sprintf(zTzxt,"%3.2f",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_UNSIGNED_LONG)
+ {
+ unsigned long *pOrg=(unsigned long*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ double tmp=*pOrg;
+ sprintf(zTzxt,"%3.2f",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_FLOAT)
+ {
+ long *pOrg=(long*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ double tmp=*pOrg;
+ sprintf(zTzxt,"%3.2f",tmp);
+ }
+
+ if (imagedata->GetScalarType()==VTK_DOUBLE)
+ {
+ double *pOrg=(double*)imagedata->GetScalarPointer ((int)xx,(int)yy,(int)zz);
+ // itoa (*pOrg,zTzxt,10);
+ double tmp=*pOrg;
+ sprintf(zTzxt,"%3.2f",tmp);
+ }
+ }
+ else
+ {
strcpy(zTzxt,"---");
}
strcat(resultText,zTzxt);
_imageViewer2XYZ -> SetExtentDimension(x1,x2,y1,y2,z1,z2);
_imageViewer2XYZ -> GetVtkImageViewer2()->SetupInteractor ( iren );
-printf("EED wxVtk2DBaseView::ResetView podemos 01\n ");
_imageViewer2XYZ->GetVtkImageViewer2()->Render();
-printf("EED wxVtk2DBaseView::ResetView podemos 02\n ");
SetInteractorStyleImage( vtkInteractorStyleBaseView2D::New() );
vtkImageViewer2 *IV2=_imageViewer2XYZ->GetVtkImageViewer2();
vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera();
+
+//EED 17Avril2009
+/*
camera->SetViewUp ( spx*0 , -spy*1 , spz*0 );
camera->SetPosition ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , -spz*10000 );
camera->SetFocalPoint ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0 );
+*/
+ camera->SetViewUp ( spx*0 , spy*1 , spz*0 );
+ camera->SetPosition ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*10000 );
+ camera->SetFocalPoint ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0 );
+
+
camera->SetClippingRange( 0.01 , 1000000 );
camera->ComputeViewPlaneNormal();
camera->SetParallelScale( spx*(x2-x1)/3.0 );
-
+
// text information over the graphic window
_vtkIinfoTextImage = new vtkInfoTextImage();
_vtkIinfoTextImageInteractor = new vtkInfoTextImageInteractor();
// (ResetCamera() method) this vector is used to position the camera
// to look at the data in this direction.
_aCamera = vtkCamera::New();
+//EED 17Avril2009
+/*
_aCamera->SetViewUp (0, 0, -1);
_aCamera->SetPosition (0, 1, 0);
+ */
+ _aCamera->SetViewUp (0, 1, 0);
+ _aCamera->SetPosition (0, 0, 1);
+
_aCamera->SetFocalPoint (0, 0, 0);
_aCamera->ComputeViewPlaneNormal();
}