From: donadio Date: Tue, 14 Apr 2009 17:29:24 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: EED.02Oct2009~107 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=f09e0658d1c37d9a90c27dedffad8ce24bb8fcf0;p=creaMaracasVisu.git *** empty log message *** --- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp index 663d888..a2b89d7 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp @@ -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 diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx index 0613e16..6de905c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx @@ -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 diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx index 17c3616..64b9e0a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx @@ -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);