]> Creatis software - creaMaracasVisu.git/commitdiff
*** empty log message ***
authordonadio <donadio>
Tue, 14 Apr 2009 17:29:24 +0000 (17:29 +0000)
committerdonadio <donadio>
Tue, 14 Apr 2009 17:29:24 +0000 (17:29 +0000)
lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx

index 663d888bf43301b899d13e9eb913721a49dc8467..a2b89d7dea2e27b51f790f7608d30ba22c3d698d 100644 (file)
@@ -145,6 +145,7 @@ manualContourModelLine::manualContourModelLine()
 : manualContourModel()
 {
        SetNumberOfPointsSpline(2);
+       SetNumberOfPointsSpline(2);
 }
 
 manualContourModelLine::~manualContourModelLine()
@@ -1625,6 +1626,7 @@ bool manualViewContour::ifTouchContour(int x,int y,int z){
 
     unsigned int i, nps,nps_t;
     nps          = _sizePointsContour;
+       
        if (this->_manContModel->IfCloseContour()==true)
        {
                nps_t = nps;
@@ -1633,7 +1635,7 @@ bool manualViewContour::ifTouchContour(int x,int y,int z){
        }
 
        //ED
-       printf("\n>%d ",nps_t);
+       //printf("\n Number of points %d ",nps_t);
 
        for( i = 0; i < nps_t; i++ ) 
        {
@@ -1644,7 +1646,7 @@ bool manualViewContour::ifTouchContour(int x,int y,int z){
                d3= sqrt( (ppB[0]-ppA[0])*(ppB[0]-ppA[0]) + (ppB[1]-ppA[1])*(ppB[1]-ppA[1]) + (ppB[2]-ppA[2])*(ppB[2]-ppA[2]));
 
                //ED
-               printf("%d %f %f %f - ", i,d1,d2,d3);   
+               //printf("\n Dist1 %f Dist2 %f Dist3 %f PT %d", d1,d2,d3,i);    
 
                if (  ((d1+d2)>=d3) &&  ((d1+d2)<=d3*1.3) ) 
                {
@@ -2250,10 +2252,11 @@ void manualViewRoi::GetMinMax(double &minX,double &minY, double &maxX, double &m
 
 // ----------------------------------------------------------------------------
 
+
 bool manualViewRoi::ifTouchContour(int x,int y, int z) // virtual
 {
        bool    result=false;
-       double  px1=99999,py1=99999,px2=-9999,py2=-99999;
+       double  px1=99999,py1=99999,px2=-99999,py2=-99999;
 
        GetMinMax(px1,py1, px2, py2);
 
@@ -2285,7 +2288,6 @@ bool manualViewRoi::ifTouchContour(int x,int y, int z) // virtual
        return result;
 }
 
-
 // ----------------------------------------------------------------------------
 
 void manualViewRoi::InitMove(int x, int y, int z)  // virtual
index 0613e1688fa2cea488b1d98379c4fef319fbde8a..6de905c825af16ac90a6a0a68ffd092ba496f320 100644 (file)
@@ -946,6 +946,8 @@ void mBarRange::OnMouseMove(wxMouseEvent& event )
                                                createAndSendEvent( wxEVT_TSBAR_ACTUAL );       
 //                                             createAndSendEvent( 98765 );
 
+//printf("EED creaMaracasVisu mBarRange::OnMouseMove XXXXXXX \n");
+
                                        }
                                        else if( validPos_ActualTri && _in_rangeProperty )
                                        // the tringle in between start and end
index 17c3616c058f56dccf4d5a6d3bb130754e04067b..64b9e0a29537cbd546184434d4cba029596e648f 100644 (file)
@@ -1348,13 +1348,111 @@ void vtkInfoTextImage::PutPixelIntensity(int xx, int yy, int zz)
        char zTzxt[20];
        char resultText[50];
        strcpy(resultText,"GL: ");
-       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);
+       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);
+               }
 
-       } else {
+               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);