]> Creatis software - creaMaracasVisu.git/commitdiff
*** empty log message ***
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 5 Mar 2009 14:59:18 +0000 (14:59 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 5 Mar 2009 14:59:18 +0000 (14:59 +0000)
bbtk/src/bbmaracasvisuImageActor.cxx [new file with mode: 0644]
bbtk/src/bbmaracasvisuImageActor.h [new file with mode: 0644]
lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp

diff --git a/bbtk/src/bbmaracasvisuImageActor.cxx b/bbtk/src/bbmaracasvisuImageActor.cxx
new file mode 100644 (file)
index 0000000..166901c
--- /dev/null
@@ -0,0 +1,54 @@
+#include "bbmaracasvisuImageActor.h"
+#include "bbcreaMaracasVisuPackage.h"
+
+#include "vtkImageShiftScale.h" 
+
+namespace bbcreaMaracasVisu
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ImageActor)
+BBTK_BLACK_BOX_IMPLEMENTATION(ImageActor,bbtk::AtomicBlackBox);
+void ImageActor::Process()
+{
+
+       if ((bbGetInputIn()!=NULL) && (bbGetInputRenderer()!=NULL))
+       {
+               
+               imageactor = vtkImageActor::New();
+               vtkImageShiftScale *imageshiftscale = vtkImageShiftScale::New();
+               imageshiftscale->SetInput( bbGetInputIn() );    
+               imageshiftscale->SetOutputScalarTypeToUnsignedChar();   
+               imageactor->SetInput( imageshiftscale->GetOutput() );   
+               imageactor->SetUserTransform( bbGetInputTransform() );  
+       }
+       // Interface Update
+       if ((firsttime==true) && (bbGetInputRenderer()!=NULL ))
+       {
+               firsttime=false;
+                       bbGetInputRenderer()->AddActor( imageactor );
+       }
+}
+void ImageActor::bbUserConstructor()
+{
+    firsttime = true;
+    imageactor = NULL;
+
+    bbSetInputIn(NULL);
+    bbSetInputTransform(NULL);
+    bbSetInputRenderer(NULL);
+  
+}
+void ImageActor::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
+{
+
+  
+}
+void ImageActor::bbUserDestructor()
+{
+
+  
+}
+}
+// EO namespace bbcreaMaracasVisu
+
+
diff --git a/bbtk/src/bbmaracasvisuImageActor.h b/bbtk/src/bbmaracasvisuImageActor.h
new file mode 100644 (file)
index 0000000..e952673
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef __bbcreaMaracasVisuImageActor_h_INCLUDED__
+#define __bbcreaMaracasVisuImageActor_h_INCLUDED__
+#include "bbcreaMaracasVisu_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+
+#include <vtkImageData.h>
+#include <vtkImageActor.h>
+#include <vtkRenderer.h>
+#include <vtkTransform.h>
+#include <vtkLinearTransform.h>
+
+
+namespace bbcreaMaracasVisu
+{
+
+class bbcreaMaracasVisu_EXPORT ImageActor
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(ImageActor,bbtk::AtomicBlackBox);
+//==================================================================
+/// User callback called in the box contructor
+virtual void bbUserConstructor();
+/// User callback called in the box copy constructor
+virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
+/// User callback called in the box destructor
+virtual void bbUserDestructor();
+//==================================================================
+  BBTK_DECLARE_INPUT(In,vtkImageData*);
+  BBTK_DECLARE_INPUT(Transform,vtkLinearTransform*);
+  BBTK_DECLARE_INPUT(Renderer,vtkRenderer*);
+//  BBTK_DECLARE_OUTPUT(Out,double);
+  BBTK_PROCESS(Process);
+  void Process();
+  bool firsttime;
+  vtkImageActor *imageactor;
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageActor,bbtk::AtomicBlackBox);
+BBTK_NAME("ImageActor");
+BBTK_AUTHOR("InfoDev CREATIS-LRMN");
+BBTK_DESCRIPTION("put image in a 3D univers");
+BBTK_CATEGORY("");
+BBTK_INPUT(ImageActor,In,"Image input",vtkImageData*,"");
+BBTK_INPUT(ImageActor,Transform,"Transform",vtkLinearTransform*,"");
+BBTK_INPUT(ImageActor,Renderer,"Renderer",vtkRenderer*,"");
+//BBTK_OUTPUT(ImageActor,Out,"First output",double,"");
+BBTK_END_DESCRIBE_BLACK_BOX(ImageActor);
+}
+// EO namespace bbcreaMaracasVisu
+
+#endif // __bbcreaMaracasVisuImageActor_h_INCLUDED__
+
index 9027e39629128c57c76343f02a4562ccf34e743d..9067adc3a470e12826922cfaa2313b05929103a8 100644 (file)
@@ -1,5 +1,5 @@
 
-#include <vtkActor.h> 
+#include <vtkActor.h>
 #include <vtkProperty.h>
 
 #include <vtkCellArray.h>
@@ -78,7 +78,7 @@ manualContourModelCircle::~manualContourModelCircle()
 
 
 // ----------------------------------------------------------------------------
-manualContourModelCircle * manualContourModelCircle :: Clone()  // virtual 
+manualContourModelCircle * manualContourModelCircle :: Clone()  // virtual
 {
        manualContourModelCircle * clone = new manualContourModelCircle();
        CopyAttributesTo(clone);
@@ -94,7 +94,7 @@ void manualContourModelCircle::CopyAttributesTo( manualContourModelCircle * clon
 }
 
 //----------------------------------------------------------------
-int manualContourModelCircle::GetTypeModel() //virtual 
+int manualContourModelCircle::GetTypeModel() //virtual
 {
        return 3;
 }
@@ -151,7 +151,7 @@ manualContourModelBullEye::~manualContourModelBullEye()
 
 
 // ----------------------------------------------------------------------------
-manualContourModelBullEye * manualContourModelBullEye :: Clone()  // virtual 
+manualContourModelBullEye * manualContourModelBullEye :: Clone()  // virtual
 {
        manualContourModelBullEye * clone = new manualContourModelBullEye();
        CopyAttributesTo(clone);
@@ -167,7 +167,7 @@ void manualContourModelBullEye::CopyAttributesTo( manualContourModelBullEye * cl
 }
 
 //----------------------------------------------------------------
-int manualContourModelBullEye::GetTypeModel() //virtual 
+int manualContourModelBullEye::GetTypeModel() //virtual
 {
        return 4;
 }
@@ -203,7 +203,7 @@ manualContourModelBullEyeSector * manualContourModelBullEye::GetModelSector(int
 }
 
 //----------------------------------------------------------------
-void manualContourModelBullEye::GetSector(int id,      
+void manualContourModelBullEye::GetSector(int id,
                                                double *radioA,
                                                double *radioB,
                                                double *ang,
@@ -255,7 +255,7 @@ int manualContourModelBullEye::GetSizeOfSectorLst()
 //----------------------------------------------------------------
 void manualContourModelBullEye::Save(FILE *ff) // virtual
 {
-       manualContourModel::Save(ff); 
+       manualContourModel::Save(ff);
        int i,size = GetSizeOfSectorLst();
        fprintf(ff,"numberOfSections %d \n",size);
        for ( i=0 ; i<size ; i++ )
@@ -267,7 +267,7 @@ void manualContourModelBullEye::Save(FILE *ff) // virtual
 //----------------------------------------------------------------
 void manualContourModelBullEye::Open(FILE *ff) // virtual
 {
-       manualContourModel::Open(ff); 
+       manualContourModel::Open(ff);
 
        ResetSectors();
 
@@ -278,7 +278,7 @@ void manualContourModelBullEye::Open(FILE *ff) // virtual
 
        fscanf(ff,"%s",tmp); // NumberOfSections
        fscanf(ff,"%s",tmp); // ##
-       numberOfSections = atoi(tmp);  
+       numberOfSections = atoi(tmp);
        for (i=0;i<numberOfSections;i++)
        {
                AddSector(0,1,90,0);
@@ -315,7 +315,7 @@ manualContourModelBullEyeSector::~manualContourModelBullEyeSector()
 
 
 // ----------------------------------------------------------------------------
-manualContourModelBullEyeSector * manualContourModelBullEyeSector :: Clone()  // virtual 
+manualContourModelBullEyeSector * manualContourModelBullEyeSector :: Clone()  // virtual
 {
        manualContourModelBullEyeSector * clone = new manualContourModelBullEyeSector();
        CopyAttributesTo(clone);
@@ -331,7 +331,7 @@ void manualContourModelBullEyeSector::CopyAttributesTo( manualContourModelBullEy
 }
 
 //----------------------------------------------------------------
-int manualContourModelBullEyeSector::GetTypeModel() //virtual 
+int manualContourModelBullEyeSector::GetTypeModel() //virtual
 {
        return 5;
 }
@@ -350,7 +350,7 @@ void manualContourModelBullEyeSector::SetSector(    double radioA,
 }
 
 //----------------------------------------------------------------
-void manualContourModelBullEyeSector::GetSector(       
+void manualContourModelBullEyeSector::GetSector(
                                                double *radioA,
                                                double *radioB,
                                                double *ang,
@@ -413,7 +413,7 @@ void manualContourModelBullEyeSector::GetSpline_i_Point(int i, double *x, double
 //----------------------------------------------------------------
 void manualContourModelBullEyeSector::Save(FILE *ff) // virtual
 {
-       manualContourModel::Save(ff); 
+       manualContourModel::Save(ff);
        fprintf(ff,"rA= %f rB= %f ang= %f deltaAng= %f\n", _radioA,_radioB, _ang , _angDelta);
 }
 
@@ -424,24 +424,24 @@ void manualContourModelBullEyeSector::Open(FILE *ff) // virtual
        fscanf(ff,"%s",tmp); // TypeModel
        fscanf(ff,"%s",tmp); // ##
 
-       manualContourModel::Open(ff); 
+       manualContourModel::Open(ff);
 
 
        fscanf(ff,"%s",tmp); // radioA=
        fscanf(ff,"%s",tmp); // radioA
-       _radioA = atof(tmp);  
+       _radioA = atof(tmp);
 
        fscanf(ff,"%s",tmp); // radioB=
        fscanf(ff,"%s",tmp); // radioB
-       _radioB = atof(tmp);  
+       _radioB = atof(tmp);
 
        fscanf(ff,"%s",tmp); // ang=
        fscanf(ff,"%s",tmp); // ang
-       _ang = atof(tmp);  
+       _ang = atof(tmp);
 
        fscanf(ff,"%s",tmp); // deltaAng=
        fscanf(ff,"%s",tmp); // deltaAng
-       _angDelta = atof(tmp);  
+       _angDelta = atof(tmp);
 }
 
 
@@ -464,7 +464,7 @@ manualContourModelRoi::~manualContourModelRoi()
 
 
 // ----------------------------------------------------------------------------
-manualContourModelRoi * manualContourModelRoi :: Clone()  // virtual 
+manualContourModelRoi * manualContourModelRoi :: Clone()  // virtual
 {
        manualContourModelRoi * clone = new manualContourModelRoi();
        CopyAttributesTo(clone);
@@ -480,7 +480,7 @@ void manualContourModelRoi::CopyAttributesTo( manualContourModelRoi * cloneObjec
 }
 
 //----------------------------------------------------------------
-int manualContourModelRoi::GetTypeModel() //virtual 
+int manualContourModelRoi::GetTypeModel() //virtual
 {
        return 2;
 }
@@ -500,16 +500,16 @@ manualContourModel::manualContourModel()
 
        this->SetCloseContour(true);
 
-    _cntSplineX->SetDefaultTension( 0 ); 
-       _cntSplineX->SetDefaultBias( 0 ); 
-       _cntSplineX->SetDefaultContinuity( 0 ); 
+    _cntSplineX->SetDefaultTension( 0 );
+       _cntSplineX->SetDefaultBias( 0 );
+       _cntSplineX->SetDefaultContinuity( 0 );
 
-    _cntSplineY->SetDefaultTension( 0 ); 
-       _cntSplineY->SetDefaultBias( 0 ); 
+    _cntSplineY->SetDefaultTension( 0 );
+       _cntSplineY->SetDefaultBias( 0 );
        _cntSplineY->SetDefaultContinuity( 0 );
 
-    _cntSplineZ->SetDefaultTension( 0 ); 
-       _cntSplineZ->SetDefaultBias( 0 ); 
+    _cntSplineZ->SetDefaultTension( 0 );
+       _cntSplineZ->SetDefaultBias( 0 );
        _cntSplineZ->SetDefaultContinuity( 0 );
 
 //JSTG 25-02-08 -------------------------------------------------------------------------------------------------
@@ -606,7 +606,7 @@ int manualContourModel::InsertPoint(double x,double y,double z)
        //manualPoint *mp = new manualPoint();
        //mp->SetPoint(x,y,z);
        //std::vector<manualPoint*>::iterator itNum = _lstPoints.begin() + ibak;
-       //_lstPoints.insert(itNum,mp);  
+       //_lstPoints.insert(itNum,mp);
        InsertPoint_id(ibak,x,y,z);
 //----------------------------------------------------------------------------
 
@@ -667,7 +667,7 @@ void manualContourModel::MoveAllPoints(double dx,double dy,double dz)
 // type=0      x,y
 // type=1      y,z
 // type=2      x,z
-int     manualContourModel::GetIdPoint(double x, double y, double z, int i_range,int type)  
+int     manualContourModel::GetIdPoint(double x, double y, double z, int i_range,int type)
 {
        double range = i_range+1;
 
@@ -683,7 +683,7 @@ int  manualContourModel::GetIdPoint(double x, double y, double z, int i_range,in
                if (type==-1)
                {
                        if ((fabs(xx-x)<range) && (fabs(yy-y)<range) && (fabs(zz-z)<range)) {
-                          dd=sqrt(   (xx-x)*(xx-x) + (yy-y)*(yy-y) + (zz-z)*(zz-z) ); 
+                          dd=sqrt(   (xx-x)*(xx-x) + (yy-y)*(yy-y) + (zz-z)*(zz-z) );
                           if (dd<ddmin){
                                   ddmin=dd;
                                   ibak=i;
@@ -693,7 +693,7 @@ int  manualContourModel::GetIdPoint(double x, double y, double z, int i_range,in
                if (type==0)
                {
                        if ((fabs(yy-y)<range) && (fabs(zz-z)<range)) {
-                          dd=sqrt(   (yy-y)*(yy-y) + (zz-z)*(zz-z) ); 
+                          dd=sqrt(   (yy-y)*(yy-y) + (zz-z)*(zz-z) );
                           if (dd<ddmin){
                                   ddmin=dd;
                                   ibak=i;
@@ -703,7 +703,7 @@ int  manualContourModel::GetIdPoint(double x, double y, double z, int i_range,in
                if (type==1)
                {
                        if ((fabs(xx-x)<range) && (fabs(zz-z)<range)) {
-                          dd=sqrt(   (xx-x)*(xx-x)  + (zz-z)*(zz-z) ); 
+                          dd=sqrt(   (xx-x)*(xx-x)  + (zz-z)*(zz-z) );
                           if (dd<ddmin){
                                   ddmin=dd;
                                   ibak=i;
@@ -713,7 +713,7 @@ int  manualContourModel::GetIdPoint(double x, double y, double z, int i_range,in
                if (type==2)
                {
                        if ((fabs(xx-x)<range) && (fabs(yy-y)<range) ) {
-                          dd=sqrt(   (xx-x)*(xx-x) + (yy-y)*(yy-y)  ); 
+                          dd=sqrt(   (xx-x)*(xx-x) + (yy-y)*(yy-y)  );
                           if (dd<ddmin){
                                   ddmin=dd;
                                   ibak=i;
@@ -752,11 +752,11 @@ void manualContourModel::SetCloseContour(bool closeContour)
        _closeContour = closeContour;
        if (_closeContour==true)
        {
-               _cntSplineX->ClosedOn(); 
+               _cntSplineX->ClosedOn();
                _cntSplineY->ClosedOn();
                _cntSplineZ->ClosedOn();
        } else {
-               _cntSplineX->ClosedOff(); 
+               _cntSplineX->ClosedOff();
                _cntSplineY->ClosedOff();
                _cntSplineZ->ClosedOff();
        }
@@ -799,7 +799,7 @@ void manualContourModel::UpdateSpline() // virtual
 
 /*void manualContourModel::GetSplineiPoint(int i, double &x, double &y, double &z)
 {
-       double delta=(double)(_lstPoints.size()) / (double)(_sizePointsContour);        
+       double delta=(double)(_lstPoints.size()) / (double)(_sizePointsContour);
        double t = delta*(double)i;
        GetSplinePoint(t, x, y, z);
 }*/
@@ -833,9 +833,9 @@ void manualContourModel::GetSpline_t_Point(double t, double *x, double *y, doubl
        }
        if (_lstPoints.size()>=2)
        {
-               *x      = _cntSplineX->Evaluate(t); 
-               *y      = _cntSplineY->Evaluate(t); 
-               *z      = _cntSplineZ->Evaluate(t); 
+               *x      = _cntSplineX->Evaluate(t);
+               *y      = _cntSplineY->Evaluate(t);
+               *z      = _cntSplineZ->Evaluate(t);
        }
 }
 
@@ -860,9 +860,9 @@ void manualContourModel::GetSpline_t_Point(double t, double *x, double *y, doubl
        }
        if (_lstPoints.size()>=2)
        {
-               x       = _cntSplineX->Evaluate(t); 
-               y       = _cntSplineY->Evaluate(t); 
-               z       = _cntSplineZ->Evaluate(t); 
+               x       = _cntSplineX->Evaluate(t);
+               y       = _cntSplineY->Evaluate(t);
+               z       = _cntSplineZ->Evaluate(t);
        }
 }*/
 // ----------------------------------------------------------------------------
@@ -891,9 +891,9 @@ double manualContourModel::GetPathSize()
        if (_lstPoints.size()>2)
        {
 
-// JSTG 25-02-08 ------------------------------------------            
+// JSTG 25-02-08 ------------------------------------------
                //np  = _lstPoints.size( );
-               //nps = 200; 
+               //nps = 200;
                //delta=( double ) ( np  ) / ( double ) ( nps  );
                UpdateSpline();
                //GetSplinePoint(0,x1,y1,z1);
@@ -910,7 +910,7 @@ double manualContourModel::GetPathSize()
                        x1=x2;
                        y1=y2;
                        z1=z2;
-               }// for 
+               }// for
        }
 
        return result;
@@ -929,7 +929,7 @@ double manualContourModel::GetPathArea()
                double x2,y2,z2;
                bool okArea=true;
                int i, j;
-         
+
                // This uses Green's theorem:
                // A = 1/2 * sum( xiyi+1 - xi+1yi); pO == pN
                // A < 0 -> A = |A| (a negative value could raise because points are
@@ -941,7 +941,7 @@ double manualContourModel::GetPathArea()
                int nps = GetNumberOfPointsSpline();
                //double delta=( double ) ( np  ) / ( double ) ( nps  );
                UpdateSpline();
-               for( i = 0, area = 0.0; i < nps; i++ ) 
+               for( i = 0, area = 0.0; i < nps; i++ )
                {
                        j = ( i + 1 ) % nps;
                        //ti = delta * (double)i;
@@ -958,12 +958,12 @@ double manualContourModel::GetPathArea()
                        {
                                okArea=false;
                        }
-               }// for 
+               }// for
                area /= 2.0;
                area = fabs( area );
 
 /*
-               for( i = 0, area = 0.0; i < _lstPoints.size(); i++ ) 
+               for( i = 0, area = 0.0; i < _lstPoints.size(); i++ )
                {
                        j = ( i + 1 ) % _lstPoints.size();
                        //  Area
@@ -993,8 +993,8 @@ double manualContourModel::GetPathArea()
 }
 
 // ----------------------------------------------------------------------------
-// p[x,y,z]   :  data in 
-// rp[x,y,z]  :  data out  result point 
+// p[x,y,z]   :  data in
+// rp[x,y,z]  :  data out  result point
 // rn[x,y,z]  :  data out   result normal
 
 void manualContourModel::GetNearestPointAndNormal(double *p, double *rp,  double *rn)
@@ -1015,13 +1015,13 @@ void manualContourModel::GetNearestPointAndNormal(double *p, double *rp,  double
        if (np>=2)
        {
 // JSTG 25-02-08 ------------------------------------------
-               //nps           = 200; 
+               //nps           = 200;
                nps = GetNumberOfPointsSpline();
                //delta = ( double ) ( np  ) / ( double ) ( nps  );
                UpdateSpline();
                //GetSplinePoint(0,x1,y1,z1);
                GetSpline_i_Point(0,&x1,&y1,&z1);
-               for( i = 0; i < nps; i++ ) 
+               for( i = 0; i < nps; i++ )
                {
                        //t = delta * (double)i;
                        //GetSplinePoint(t,x1,y1,z1);
@@ -1031,7 +1031,7 @@ void manualContourModel::GetNearestPointAndNormal(double *p, double *rp,  double
                        dy= y1-p[1];
                        dz= z1-p[2];
                        dist = sqrt( dx*dx + dy*dy + dz*dz );
-                       if (dist<distMin) 
+                       if (dist<distMin)
                        {
                                distMin  = dist;
 //JSTG                 tback = t;
@@ -1046,7 +1046,7 @@ void manualContourModel::GetNearestPointAndNormal(double *p, double *rp,  double
                        x2=x1;
                        y2=y1;
                        z2=z1;
-               }// for 
+               }// for
 
 // JSTG 25-02-08 ------------------------------------------
                //if (tback==0)
@@ -1060,8 +1060,8 @@ void manualContourModel::GetNearestPointAndNormal(double *p, double *rp,  double
                        rn[1]=rp[1]-y1;
                        rn[2]=rp[2]-z1;
                }
-       } 
-       else 
+       }
+       else
        {
                rp[0] = 0;
                rp[1] = 0;
@@ -1090,22 +1090,22 @@ void manualContourModel::Open(FILE *ff) // virtual
 
        fscanf(ff,"%s",tmp); // NumberOfControlPoints
        fscanf(ff,"%s",tmp); // ##
-       numberOfControlPoints = atoi(tmp);  
+       numberOfControlPoints = atoi(tmp);
        for (i=0;i<numberOfControlPoints;i++)
        {
                fscanf(ff,"%s",tmp); // X
-               x = atof(tmp);  
+               x = atof(tmp);
                fscanf(ff,"%s",tmp); // Y
-               y = atof(tmp);  
+               y = atof(tmp);
                fscanf(ff,"%s",tmp); // Z
-               z = atof(tmp);  
+               z = atof(tmp);
                AddPoint(x,y,z);
        }
 }
 
 
 // ----------------------------------------------------------------------------
-int manualContourModel::GetTypeModel() //virtual 
+int manualContourModel::GetTypeModel() //virtual
 {
        // 0 spline
        // 1 spline
@@ -1143,7 +1143,7 @@ void manualContourModel::CopyAttributesTo( manualContourModel * cloneObject)
        {
                cloneObject->AddManualPoint( GetManualPoint( i )->Clone() );
        }
-       cloneObject->SetNumberOfPointsSpline( GetNumberOfPointsSpline () ); 
+       cloneObject->SetNumberOfPointsSpline( GetNumberOfPointsSpline () );
        cloneObject->SetCloseContour( _closeContour );
        cloneObject->UpdateSpline();
 }
@@ -1202,7 +1202,7 @@ void manualViewPoint::SetSelected(bool selected){
 }
 // ----------------------------------------------------------------------------
 void manualViewPoint::SetPosibleSelected(bool posibleSelected){
-       _posibleSelected=posibleSelected;       
+       _posibleSelected=posibleSelected;
 }
 // ----------------------------------------------------------------------------
 bool manualViewPoint::GetSelected(){
@@ -1369,7 +1369,7 @@ void manualViewContour::CopyAttributesTo( manualViewContour * cloneObject)
 {
        // Call to Fathers object
        manualViewBaseContour::CopyAttributesTo(cloneObject);
-       
+
        cloneObject->SetMesureScale(_mesureScale);
 }
 
@@ -1408,8 +1408,8 @@ void manualViewContour::RefreshContour() // virtual
 
        _manContModel->UpdateSpline();
     np = GetNumberOfPoints( );
-       //nps = GetNumberOfPointsSpline(); 
-    nps = _manContModel->GetNumberOfPointsSpline();            
+       //nps = GetNumberOfPointsSpline();
+    nps = _manContModel->GetNumberOfPointsSpline();
        //delta=( double ) ( np  ) / ( double ) ( nps-1  );             //JSTG 25-02-08
 
 //printf ("EED manualViewContour::RefreshContour>> %d %d \n", np,nps);
@@ -1418,28 +1418,28 @@ void manualViewContour::RefreshContour() // virtual
        {
                if (np>=2  )
                {
-                       for( i = 0; i < nps; i++ ) 
+                       for( i = 0; i < nps; i++ )
                        {
-//JSTG 25-02-08 ------------------------------------------------                               
+//JSTG 25-02-08 ------------------------------------------------
                                //t = delta * (double)i;
                                //_manContModel->GetSplinePoint(t,x,y,z);
                                _manContModel->GetSpline_i_Point(i,&x,&y,&z);
 //--------------------------------------------------------------
        // EED 27 sep 2006
-       //                      _pts->SetPoint(i, x,y,z );      
-                               _pts->SetPoint(i , x*_spc[0] , y*_spc[1] , z*_spc[2] );  
+       //                      _pts->SetPoint(i, x,y,z );
+                               _pts->SetPoint(i , x*_spc[0] , y*_spc[1] , z*_spc[2] );
 //if (i%15==0)
 //{
 //     printf ("EED manualViewContour::RefreshContour>> %d : %f %f %f \n", i,x,y,z);
 //}
 
 
-                       }// for 
-               } 
-               else 
+                       }// for
+               }
+               else
                {
-                               _pts->SetPoint(0, 0 , 0 , 0);   
-                               _pts->SetPoint(1, 0 , 0 , 0);   
+                               _pts->SetPoint(0, 0 , 0 , 0);
+                               _pts->SetPoint(1, 0 , 0 , 0);
                } // if
        }
 }
@@ -1521,12 +1521,12 @@ bool manualViewContour::ifTouchContour(int x,int y,int z){
 
 
     unsigned int i, nps,nps_t;
-    nps          = _sizePointsContour; 
-       if (this->_manContModel->IfCloseContour()==true) 
+    nps          = _sizePointsContour;
+       if (this->_manContModel->IfCloseContour()==true)
        {
-               nps_t = nps; 
+               nps_t = nps;
        } else {
-               nps_t = nps-1; 
+               nps_t = nps-1;
        }
 
     for( i = 0; i < nps_t; i++ ) {
@@ -1539,12 +1539,12 @@ bool manualViewContour::ifTouchContour(int x,int y,int z){
                        result=true;
                        i=nps;
                }
-       } 
+       }
        return result;
 }
 
 // ----------------------------------------------------------------------------
-void manualViewContour::DeletePoint(int id) // virtual 
+void manualViewContour::DeletePoint(int id) // virtual
 {
        if (_lstViewPoints.size()>2)
        {
@@ -1567,19 +1567,19 @@ void manualViewContour::SetMesureScale(double mesureScale)
 void manualViewContour::InitMove(int x, int y, int z)
 {
        _initialConoturModel->DeleteAllPoints();
-       
+
        manualPoint *mp = NULL;
        double XX=x;
        double YY=y;
        double ZZ=z;
        TransfromeCoordViewWorld(XX,YY,ZZ);
-               
+
        int i, manualPointsSZ = _manContModel->GetSizeLstPoints();
        for ( i=0; i<manualPointsSZ; i++ )
        {
                mp = _manContModel->GetManualPoint( i );
                this->_initialConoturModel->AddPoint( mp->GetX() - XX, mp->GetY() - YY, mp->GetZ() );
-       }               
+       }
 }
 //-------------------------------------------------------------------
 void manualViewContour::MoveContour(int x, int y, int z)
@@ -1589,7 +1589,7 @@ void manualViewContour::MoveContour(int x, int y, int z)
        double XX=x;
        double YY=y;
        double ZZ=z;
-       
+
        TransfromeCoordViewWorld(XX,YY,ZZ);
 
        int i, manualPointsSZ = _manContModel->GetSizeLstPoints();
@@ -1598,8 +1598,8 @@ void manualViewContour::MoveContour(int x, int y, int z)
                mpOrigin = _manContModel->GetManualPoint( i );
                mpMoving = _initialConoturModel->GetManualPoint(i);
                mpOrigin->SetPoint( mpMoving->GetX()+XX, mpMoving->GetY() + YY, mpMoving->GetZ() );
-       }       
-       UpdateViewPoints();     
+       }
+       UpdateViewPoints();
 }
 void manualViewContour::MoveContour(int horizontalUnits, int verticalUnits )
 {
@@ -1610,8 +1610,8 @@ void manualViewContour::MoveContour(int horizontalUnits, int verticalUnits )
        {
                mpOrigin = _manContModel->GetManualPoint( i );
                mpOrigin->SetPoint( mpOrigin->GetX()+horizontalUnits, mpOrigin->GetY()+verticalUnits, mpOrigin->GetZ() );
-       }       
-       UpdateViewPoints();             
+       }
+       UpdateViewPoints();
 }
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
@@ -1680,13 +1680,13 @@ void manualView3VContour::RefreshContour()  // virtula
        //int nps = GetNumberOfPointsSpline();
        int nps = _manContModel->GetNumberOfPointsSpline();
 //-------------------------------------------------------
-       for( i = 0; i < nps; i++ ) 
+       for( i = 0; i < nps; i++ )
        {
                _pts->GetPoint( i, pp );
                FilterCordinateXYZ(pp[0],pp[1],pp[2]);
 
 //EED 27 sep 2006
-               _pts->SetPoint( i, pp[0] , pp[1] ,pp[2] );      
+               _pts->SetPoint( i, pp[0] , pp[1] ,pp[2] );
        }
 
 }
@@ -1736,12 +1736,12 @@ bool manualView3VContour::ifTouchContour(int x,int y,int z){ // virtual
        zz = zz * _spc[2];
 
     unsigned int i, nps,nps_t;
-    nps          = _sizePointsContour; 
-       if (this->_manContModel->IfCloseContour()==true) 
+    nps          = _sizePointsContour;
+       if (this->_manContModel->IfCloseContour()==true)
        {
-               nps_t = nps; 
+               nps_t = nps;
        } else {
-               nps_t = nps-1; 
+               nps_t = nps-1;
        }
        FilterCordinateXYZ(xx,yy,zz);
 
@@ -1757,7 +1757,7 @@ bool manualView3VContour::ifTouchContour(int x,int y,int z){ // virtual
                        result=true;
                        i=nps;
                }
-       } 
+       }
        return result;
 }
 // ----------------------------------------------------------------------------
@@ -1813,7 +1813,7 @@ int manualView3DContour::GetIdPoint2(int x, int y)
        double p[3],pA[3],pB[3];
 
        double pickPoint[ 3 ], cameraPos[ 3 ];
-       vtkPointPicker* picker = vtkPointPicker::New( );        
+       vtkPointPicker* picker = vtkPointPicker::New( );
        vtkRenderer *pRenderer = this->GetWxVtkBaseView()->GetRenderer();
        picker->Pick( x, y, 0.0, pRenderer );
        pRenderer->GetActiveCamera( )->GetPosition( cameraPos );
@@ -1823,7 +1823,7 @@ int manualView3DContour::GetIdPoint2(int x, int y)
        UtilVtk3DGeometriSelection utilVtk3Dgeometriselection;
        utilVtk3Dgeometriselection.SetDimentions(_w,_h,_d);
 
-       if( utilVtk3Dgeometriselection.FindCubePointsFromPoints( pA, pB, pickPoint, cameraPos )  ) 
+       if( utilVtk3Dgeometriselection.FindCubePointsFromPoints( pA, pB, pickPoint, cameraPos )  )
        {
                double dist,distMin=999999999;
                int i,size=this->_manContModel->GetSizeLstPoints();
@@ -1881,15 +1881,15 @@ void manualViewBullEyeSector::RefreshContour()
 //----------------------------------
 
        _manContModel->UpdateSpline();
-    nps = _manContModel->GetNumberOfPointsSpline();            
+    nps = _manContModel->GetNumberOfPointsSpline();
 
        if ( _pts!=NULL )
        {
-               for( i = 0; i < nps; i++ ) 
+               for( i = 0; i < nps; i++ )
                {
                        _manContModel->GetSpline_i_Point(i,&x,&y,&z);
-                       _pts->SetPoint(i , x*_spc[0] , y*_spc[1] , z*_spc[2] );  
-               }// for 
+                       _pts->SetPoint(i , x*_spc[0] , y*_spc[1] , z*_spc[2] );
+               }// for
        }
 
 }
@@ -1942,7 +1942,7 @@ int manualViewBullEye::GetType() // virtual
 
 // ----------------------------------------------------------------------------
 void manualViewBullEye::RefreshContour() // virtual
-{ 
+{
        // External Rectangle
        manualViewRoi::RefreshContour();
 
@@ -2065,13 +2065,13 @@ void manualViewRoi::RefreshContour() // virtual
        //                      wxvtk2Dbasevie->TransformCoordinate_spacing_ModelToView(XX,YY,ZZ);
 
        //EED 27 sep 2007
-       //                      _pts->SetPoint(i, XX,YY,ZZ );   
-                               _pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] );       
+       //                      _pts->SetPoint(i, XX,YY,ZZ );
+                               _pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] );
                        } //  rof
 
                } else {
-                               _pts->SetPoint(0, 0 , 0 , 0);   
-                               _pts->SetPoint(1, 0 , 0 , 0);   
+                               _pts->SetPoint(0, 0 , 0 , 0);
+                               _pts->SetPoint(1, 0 , 0 , 0);
                } // if
        }
 }
@@ -2087,9 +2087,9 @@ int manualViewRoi::GetType() // virtual
 void manualViewRoi::GetMinMax(double &minX,double &minY, double &maxX, double &maxY)
 {
        double  pp[3];
-       manualPoint *mp;  
+       manualPoint *mp;
     unsigned int i;
-       
+
        minX=99999;
        minY=99999;
        maxX=-99999;
@@ -2097,30 +2097,30 @@ void manualViewRoi::GetMinMax(double &minX,double &minY, double &maxX, double &m
 
        unsigned int size=(unsigned int) _manContModel->GetSizeLstPoints();
 
-       for( i = 0; i < size; i++ ) 
+       for( i = 0; i < size; i++ )
        {
 
                mp=_manContModel->GetManualPoint(i);
                pp[0]=mp->GetX();
                pp[1]=mp->GetY();
+
                // min X
-               if (pp[0]<minX) 
+               if (pp[0]<minX)
                {
                        minX=pp[0];
                }
                //min Y
-               if (pp[1]<minY) 
+               if (pp[1]<minY)
                {
                        minY=pp[1];
                }
                //max X
-               if (pp[0]>maxX) 
+               if (pp[0]>maxX)
                {
                        maxX=pp[0];
                }
                // max Y
-               if (pp[1]>maxY) 
+               if (pp[1]>maxY)
                {
                        maxY=pp[1];
                }
@@ -2133,11 +2133,11 @@ void manualViewRoi::GetMinMax(double &minX,double &minY, double &maxX, double &m
                minY=0;
                maxY=0;
        }
-} 
+}
 
 // ----------------------------------------------------------------------------
 
-bool manualViewRoi::ifTouchContour(int x,int y, int z) // virtual 
+bool manualViewRoi::ifTouchContour(int x,int y, int z) // virtual
 {
        bool    result=false;
        double  px1=99999,py1=99999,px2=-9999,py2=-99999;
@@ -2208,7 +2208,7 @@ void manualViewRoi::InitMove(int x, int y, int z)  // virtual
 
 // ----------------------------------------------------------------------------
 
-void manualViewRoi::MoveContour(int x, int y, int z) // virtual 
+void manualViewRoi::MoveContour(int x, int y, int z) // virtual
 {
        manualPoint *mp;
        double XX=x;
@@ -2231,7 +2231,7 @@ void manualViewRoi::MoveContour(int x, int y, int z) // virtual
        UpdateViewPoint(0);
        UpdateViewPoint(1);
        UpdateViewPoint(2);
-       UpdateViewPoint(3);     
+       UpdateViewPoint(3);
 
 }
 
@@ -2300,11 +2300,11 @@ void manualViewCircle::RefreshContour(){ // virtual
 //                             XX = cos(angle)*radio+mpA->GetX();
 //                             YY = sin(angle)*radio+mpA->GetY();
                                ZZ = mpA->GetZ();
-                               _pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] );       
+                               _pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] );
                        } //  rof
                } else {
-                               _pts->SetPoint(0, 0 , 0 , 0);   
-                               _pts->SetPoint(1, 0 , 0 , 0);   
+                               _pts->SetPoint(0, 0 , 0 , 0);
+                               _pts->SetPoint(1, 0 , 0 , 0);
                } // if
        }
 }
@@ -2342,11 +2342,11 @@ void manualViewCircle::GetMinMax(double &minX,double &minY, double &maxX, double
                minY=0;
                maxY=0;
        }
-} 
+}
 
 /*
 // ----------------------------------------------------------------------------
-bool manualViewCircle::ifTouchContour(int x,int y, int z) // virtual 
+bool manualViewCircle::ifTouchContour(int x,int y, int z) // virtual
 {
        bool    result=false;
        double  px1=99999,py1=99999,px2=-9999,py2=-99999;
@@ -2418,7 +2418,7 @@ void manualViewCircle::InitMove(int x, int y, int z)  // virtual
 
 
 // ----------------------------------------------------------------------------
-void manualViewCircle::MoveContour(int x, int y, int z) // virtual 
+void manualViewCircle::MoveContour(int x, int y, int z) // virtual
 {
        manualPoint *mp;
        double XX=x;
@@ -2441,7 +2441,7 @@ void manualViewCircle::MoveContour(int x, int y, int z) // virtual
        UpdateViewPoint(0);
        UpdateViewPoint(1);
 //     UpdateViewPoint(2);
-//     UpdateViewPoint(3);     
+//     UpdateViewPoint(3);
 
 }
 
@@ -2457,7 +2457,7 @@ void manualViewCircle::MoveContour(int x, int y, int z) // virtual
 
 manualViewBaseContour::manualViewBaseContour()
 {
-       _show_text                      = true; 
+       _show_text                      = true;
        _textActor                      = NULL;
        _manContModel           = NULL;
        _wxvtkbaseview          = NULL;
@@ -2478,7 +2478,7 @@ manualViewBaseContour::manualViewBaseContour()
        _coulorEdit_g           = 1;
        _coulorEdit_b           = 0;
 
-       _coulorNormal_r         = 1;    
+       _coulorNormal_r         = 1;
        _coulorNormal_g         = 0;
        _coulorNormal_b         = 1;
 
@@ -2543,12 +2543,12 @@ void manualViewBaseContour :: AddCompleteContourActor(  bool ifControlPoints )
 // ---------------------------------------------------------------------------
 
 void manualViewBaseContour :: RemoveCompleteContourActor()
-{      
+{
        /*vtkRenderer * theRenderer =*/  _wxvtkbaseview->GetRenderer(); // JPRx ??
         //Removing the spline
        RemoveSplineActor();
        RemoveTextActor();
-       
+
        //Removing each point
        RemoveControlPoints();
        RefreshContour();
@@ -2569,7 +2569,7 @@ void manualViewBaseContour::CopyAttributesTo( manualViewBaseContour * cloneObjec
 {
        // Fathers object
        //XXXX::CopyAttributesTo(cloneObject);
-       
+
        cloneObject-> SetWxVtkBaseView( this->_wxvtkbaseview );
        cloneObject-> SetSelected( this->GetSelected() );
        cloneObject-> SetPosibleSelected( this->GetPosibleSelected() );
@@ -2579,9 +2579,9 @@ void manualViewBaseContour::CopyAttributesTo( manualViewBaseContour * cloneObjec
        cloneObject-> SetSpacing( _spc );
        cloneObject-> SetColorNormalContour( _coulorNormal_r, _coulorNormal_g, _coulorNormal_b );
        cloneObject-> SetColorEditContour( _coulorEdit_r, _coulorEdit_g, _coulorEdit_b );
-       cloneObject-> SetColorSelectContour( _coulorSelection_r, _coulorSelection_g, _coulorSelection_b );      
+       cloneObject-> SetColorSelectContour( _coulorSelection_r, _coulorSelection_g, _coulorSelection_b );
 
-       int i, size = _lstViewPoints.size(); 
+       int i, size = _lstViewPoints.size();
        for ( i=0; i<size; i++ )
        {
                cloneObject->AddPoint(  );
@@ -2604,7 +2604,7 @@ void manualViewBaseContour :: RemoveSplineActor() // virtual
 }
 // ----------------------------------------------------------------------------
 void manualViewBaseContour :: RemoveControlPoints()
-{      
+{
        if (_wxvtkbaseview!=NULL){
                vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
                int i,size=_lstViewPoints.size();
@@ -2612,15 +2612,15 @@ void manualViewBaseContour :: RemoveControlPoints()
                {
                        vtkActor * pointActor = _lstViewPoints[i]->GetVtkActor();
                        theRenderer->RemoveActor( pointActor );
-               } // for        
+               } // for
        } // if
-       SetIfViewControlPoints( false );        
+       SetIfViewControlPoints( false );
 }
 // ----------------------------------------------------------------------------
 void manualViewBaseContour :: AddControlPoints()
 {
        vtkRenderer * theRenderer = _wxvtkbaseview->GetRenderer();
-       SetIfViewControlPoints( true ); 
+       SetIfViewControlPoints( true );
         if( _viewControlPoints )
         {
                int i,size=_lstViewPoints.size();
@@ -2628,7 +2628,7 @@ void manualViewBaseContour :: AddControlPoints()
                {
                        vtkActor * pointActor = _lstViewPoints[i]->GetVtkActor();
                        theRenderer->AddActor( pointActor );
-               }        
+               }
         }
 }
 // ----------------------------------------------------------------------------
@@ -2681,7 +2681,7 @@ void manualViewBaseContour::ConstructVTKObjects()
 {
 //JSTG 29-02-08 -----------------------------------------------
        //int i , nps = _sizePointsContour;
-       int i; 
+       int i;
        int nps = _manContModel->GetNumberOfPointsSpline();
 //-------------------------------------------------------------
        DeleteVtkObjects();
@@ -2690,8 +2690,8 @@ void manualViewBaseContour::ConstructVTKObjects()
 
        for (i=0 ; i<nps ; i++){
                _pts->SetPoint(i,       0       , 0     , 0 );
-       } 
-       // This is for the boundaring inicialisation 
+       }
+       // This is for the boundaring inicialisation
        _pts->SetPoint(0,       -1000   , -1000 , -1000 );
        _pts->SetPoint(1,       1000    , 1000  , 1000 );
 
@@ -2732,7 +2732,7 @@ void manualViewBaseContour::ConstructVTKObjects()
        vtkTextProperty *tprop = _textActor->GetTextProperty();
        tprop->SetFontSize(14);
        tprop->SetFontFamilyToArial();
-       tprop->SetColor(0, 0, 1);       
+       tprop->SetColor(0, 0, 1);
 }
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::CreateNewContour()
@@ -2745,7 +2745,7 @@ void manualViewBaseContour::CreateNewContour()
 }
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::UpdateViewPoint(int id) // virtual
-{  
+{
        manualPoint             *mp             = _manContModel->GetManualPoint(id);
 
 //EEDx6
@@ -2811,8 +2811,8 @@ void manualViewBaseContour::DeleteContour()
        Refresh();
 }
 // ----------------------------------------------------------------------------
-void manualViewBaseContour::DeletePoint(int id) // virtual 
-{ 
+void manualViewBaseContour::DeletePoint(int id) // virtual
+{
        int size=_lstViewPoints.size();
        if ( (id>=0) && (id<size) ){
                manualViewPoint         *mvp    =_lstViewPoints[id];
@@ -2841,7 +2841,7 @@ void manualViewBaseContour::SetSelected(bool selected)
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::SetPosibleSelected(bool posibleSelected)
 {
-       _posibleSelected=posibleSelected;       
+       _posibleSelected=posibleSelected;
 }
 // ----------------------------------------------------------------------------
 bool manualViewBaseContour::GetEditable()
@@ -2894,8 +2894,8 @@ void manualViewBaseContour::SelectAllPoints(bool select)
 }
 //-----------------------------------------------------------------------------
 void manualViewBaseContour:: SetIfViewControlPoints(bool ifShow)
-{      
-       _viewControlPoints = ifShow;    
+{
+       _viewControlPoints = ifShow;
 }
 // ----------------------------------------------------------------------------
 bool manualViewBaseContour:: GetIfViewControlPoints()
@@ -2963,7 +2963,7 @@ bool manualViewBaseContour::SelectPosibleContour(int x, int y, int z)
                                SetPosibleSelected(result);
                        }
                }
-       
+
 
        }
        return result;
@@ -3010,7 +3010,7 @@ double* manualViewBaseContour::GetVectorPointsXManualContour(){
        for (i=0;i<size;i++){
                _pts->GetPoint(i,pp);
                vx[i]=pp[0];
-       }       
+       }
        return vx;
 }
 // ----------------------------------------------------------------------------
@@ -3022,7 +3022,7 @@ double* manualViewBaseContour::GetVectorPointsYManualContour()
        for (i=0;i<size;i++){
                _pts->GetPoint(i,pp);
                vy[i]=pp[1];
-       }       
+       }
        return vy;
 }
 // ----------------------------------------------------------------------------
@@ -3034,7 +3034,7 @@ double* manualViewBaseContour::GetVectorPointsZManualContour()
        for (i=0;i<size;i++){
                _pts->GetPoint(i,pp);
                vz[i]=pp[2];
-       }       
+       }
        return vz;
 }
 // ----------------------------------------------------------------------------
@@ -3050,7 +3050,7 @@ void manualViewBaseContour::Refresh() // virtual
        }
        UpdateColorActor();
 
-       if (_show_text==true) 
+       if (_show_text==true)
        {
                RefreshText();
        }
@@ -3173,7 +3173,7 @@ void manualViewBaseContour::TransfromeCoordViewWorld(double &X, double &Y, doubl
 //EED 27 sep 2007
 //   //EEDx6
 //     wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*)_wxvtkbaseview;
-//     wxvtk2Dbaseview->TransformCoordinate_spacing_ModelToView(X,Y,Z); 
+//     wxvtk2Dbaseview->TransformCoordinate_spacing_ModelToView(X,Y,Z);
 
 }
 // ----------------------------------------------------------------------------
@@ -3204,7 +3204,7 @@ void manualViewBaseContour::InitMove(int x, int y, int z) // virtual
 }
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::MoveContour(int x, int y, int z) // virtual
-{      
+{
 }
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::MoveContour(int horizontalUnits, int verticalUnits )// virtual
@@ -3215,7 +3215,7 @@ void manualViewBaseContour::MoveContour(int horizontalUnits, int verticalUnits )
 void manualViewBaseContour::GetMinMax( double &minX,double &minY, double &minZ, double &maxX, double &maxY, double &maxZ )// virtual
 {
        double  pp[3];
-       manualPoint *mp;  
+       manualPoint *mp;
        int i;
        int size=_manContModel->GetSizeLstPoints();
        minX=99999;
@@ -3228,47 +3228,47 @@ void manualViewBaseContour::GetMinMax( double &minX,double &minY, double &minZ,
                minZ=99999;
                maxZ=-99999;
        }
-       for( i = 0; i < size; i++ ) 
+       for( i = 0; i < size; i++ )
        {
                mp=_manContModel->GetManualPoint(i);
                pp[0]=mp->GetX();
                pp[1]=mp->GetY();
                if ( ifFindZ )
                        pp[2]=mp->GetZ();
+
                // min X
-               if (pp[0]<minX) 
+               if (pp[0]<minX)
                {
                        minX=pp[0];
                }
                //min Y
-               if (pp[1]<minY) 
+               if (pp[1]<minY)
                {
                        minY=pp[1];
                }
                //max X
-               if (pp[0]>maxX) 
+               if (pp[0]>maxX)
                {
                        maxX=pp[0];
                }
                // max Y
-               if (pp[1]>maxY) 
+               if (pp[1]>maxY)
                {
                        maxY=pp[1];
                }
                if ( ifFindZ )
                {
                        // min Z
-                       if (pp[2]<minZ) 
+                       if (pp[2]<minZ)
                        {
                                minZ=pp[2];
                        }
                        // max Z
-                       if (pp[2]>maxZ) 
+                       if (pp[2]>maxZ)
                        {
                                maxZ=pp[2];
                        }
-               }               
+               }
        }
        if ( size<1 )
        {
@@ -3356,9 +3356,9 @@ void manualViewBaseContour::SetSpacing(double spc[3])
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 
-// _type = 0  Sagital  
-// _type = 1  Coronal 
-// _type = 2  Axial   
+// _type = 0  Sagital
+// _type = 1  Coronal
+// _type = 2  Axial
 // _type = -1 View 3D
 
 manualContour3VControler::manualContour3VControler(int type)
@@ -3376,7 +3376,7 @@ manualContour3VControler::~manualContour3VControler()
 }
 
 // ----------------------------------------------------------------------------
-manualContour3VControler * manualContour3VControler :: Clone()  // virtual 
+manualContour3VControler * manualContour3VControler :: Clone()  // virtual
 {
        manualContour3VControler * clone = new manualContour3VControler( this->GetType() );
        CopyAttributesTo(clone);
@@ -3407,14 +3407,14 @@ void manualContour3VControler::AddPoint_Others()
        int i,size=this->_lstManualViewBaseContour.size();
        for ( i = 0 ; i < size ; i++ )
        {
-               mvbc = _lstManualViewBaseContour[i]; 
+               mvbc = _lstManualViewBaseContour[i];
                mvbc->AddPoint();
        }
 
 // EEDhh
 //     if (_manViewBaseCont1!=NULL){
-//             _manViewBaseCont1->AddPoint(); 
-//             _manViewBaseCont2->AddPoint(); 
+//             _manViewBaseCont1->AddPoint();
+//             _manViewBaseCont2->AddPoint();
 //             _manViewBaseCont3->AddPoint();
 //             this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
 //     }
@@ -3444,7 +3444,7 @@ void manualContour3VControler::AddPoint( int x, int y, int z ) // virtual
 
 
                /*int   id              = */ GetManualContourModel()->AddPoint(xx,yy,zz);  // JPRx
-               GetManualViewBaseContour()->AddPoint(); 
+               GetManualViewBaseContour()->AddPoint();
                AddPoint_Others();
 
        }
@@ -3458,15 +3458,15 @@ void manualContour3VControler::InsertPoint_Others(int id)
        int i,size=this->_lstManualViewBaseContour.size();
        for ( i = 0 ; i < size ; i++ )
        {
-               mvbc = _lstManualViewBaseContour[i]; 
+               mvbc = _lstManualViewBaseContour[i];
                mvbc->InsertPoint(id);
        }
 
 /*EEDhh
        if (_manViewBaseCont1!=NULL){
-               _manViewBaseCont1->InsertPoint(id);                             
-               _manViewBaseCont2->InsertPoint(id);                             
-               _manViewBaseCont3->InsertPoint(id);                             
+               _manViewBaseCont1->InsertPoint(id);
+               _manViewBaseCont2->InsertPoint(id);
+               _manViewBaseCont3->InsertPoint(id);
                this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
        }
 */
@@ -3488,7 +3488,7 @@ void manualContour3VControler::InsertPoint(int x, int y, int z)
                        if (_type==0)
                        {
                                xx=_vtkmprbasedata->GetX();
-                       }       
+                       }
 
                        if (_type==1)
                        {
@@ -3497,11 +3497,11 @@ void manualContour3VControler::InsertPoint(int x, int y, int z)
 
                        id      = GetManualContourModel()->InsertPoint(xx,yy,zz);
 
-                       GetManualViewBaseContour()->InsertPoint(id);    
-                       InsertPoint_Others(0);  
+                       GetManualViewBaseContour()->InsertPoint(id);
+                       InsertPoint_Others(0);
 
                } else {
-                       AddPoint(x,y,z);        
+                       AddPoint(x,y,z);
                }
        }
 }
@@ -3509,9 +3509,9 @@ void manualContour3VControler::InsertPoint(int x, int y, int z)
 
 // EEDhh
 /*
-void manualContour3VControler::SetModelView (  manualContourModel *manContModel, 
-                                                                                               manualViewBaseContour *manViewBaseCont0, 
-                                                                                               manualViewBaseContour *manViewBaseCont1, 
+void manualContour3VControler::SetModelView (  manualContourModel *manContModel,
+                                                                                               manualViewBaseContour *manViewBaseCont0,
+                                                                                               manualViewBaseContour *manViewBaseCont1,
                                                                                                manualViewBaseContour *manViewBaseCont2,
                                                                                                manualViewBaseContour *manViewBaseCont3)
 {
@@ -3569,21 +3569,21 @@ void manualContour3VControler::DeleteActualMousePoint_Others(int id)
        int i,size=this->_lstManualViewBaseContour.size();
        for ( i = 0 ; i < size ; i++ )
        {
-               mvbc = _lstManualViewBaseContour[i]; 
-               mvbc->DeletePoint(id);  
+               mvbc = _lstManualViewBaseContour[i];
+               mvbc->DeletePoint(id);
                mvbc->Refresh();
        }
 
 /*
        if (_manViewBaseCont1!=NULL){
-               _manViewBaseCont1->DeletePoint(id);  
-               _manViewBaseCont2->DeletePoint(id);  
+               _manViewBaseCont1->DeletePoint(id);
+               _manViewBaseCont2->DeletePoint(id);
                _manViewBaseCont3->DeletePoint(id);
-       
+
                _manViewBaseCont1->Refresh();
                _manViewBaseCont2->Refresh();
                _manViewBaseCont3->Refresh();
-               
+
                this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
        }
 */
@@ -3591,7 +3591,7 @@ void manualContour3VControler::DeleteActualMousePoint_Others(int id)
 }
 // ----------------------------------------------------------------------------
 void manualContour3VControler::DeleteActualMousePoint(int x, int y)// virtual
-{ 
+{
        int id=GetManualViewBaseContour()->GetIdPoint ( x , y , GetZ() );
        if (id!=-1){
                manualContourBaseControler::DeleteActualMousePoint( x , y );
@@ -3605,30 +3605,30 @@ void manualContour3VControler::MouseMove_Others(int id) // virtual
        int i,size=this->_lstManualViewBaseContour.size();
        for ( i = 0 ; i < size ; i++ )
        {
-               mvbc = _lstManualViewBaseContour[i]; 
+               mvbc = _lstManualViewBaseContour[i];
                mvbc->SelectAllPossibleSelected(false);
                if (id!=-1)
-               {       
+               {
                        mvbc->SetPointPosibleSelected(id,true);
                }
-               mvbc->SetPosibleSelected  (  GetManualViewBaseContour()->GetPosibleSelected()  );   
+               mvbc->SetPosibleSelected  (  GetManualViewBaseContour()->GetPosibleSelected()  );
                mvbc->Refresh();
        }
-       
+
 // EEDhh
-/*     
+/*
        if (_manViewBaseCont1!=NULL){
                _manViewBaseCont1->SelectAllPossibleSelected(false);
                _manViewBaseCont2->SelectAllPossibleSelected(false);
                _manViewBaseCont3->SelectAllPossibleSelected(false);
-               if (id!=-1){            
+               if (id!=-1){
                        _manViewBaseCont1->SetPointPosibleSelected(id,true);
                        _manViewBaseCont2->SetPointPosibleSelected(id,true);
                        _manViewBaseCont3->SetPointPosibleSelected(id,true);
-               } 
-               _manViewBaseCont1->SetPosibleSelected  (  GetManualViewBaseContour()->GetPosibleSelected()  );   
-               _manViewBaseCont2->SetPosibleSelected  (  GetManualViewBaseContour()->GetPosibleSelected()  );   
-               _manViewBaseCont3->SetPosibleSelected  (  GetManualViewBaseContour()->GetPosibleSelected()  );   
+               }
+               _manViewBaseCont1->SetPosibleSelected  (  GetManualViewBaseContour()->GetPosibleSelected()  );
+               _manViewBaseCont2->SetPosibleSelected  (  GetManualViewBaseContour()->GetPosibleSelected()  );
+               _manViewBaseCont3->SetPosibleSelected  (  GetManualViewBaseContour()->GetPosibleSelected()  );
 
                _manViewBaseCont1->Refresh();
                _manViewBaseCont2->Refresh();
@@ -3656,7 +3656,7 @@ void manualContour3VControler::OnChar_Others()
        int i,size=this->_lstManualViewBaseContour.size();
        for ( i = 0 ; i < size ; i++ )
        {
-               mvbc = _lstManualViewBaseContour[i]; 
+               mvbc = _lstManualViewBaseContour[i];
                mvbc->Refresh();
        }
 // EEDhh
@@ -3688,7 +3688,7 @@ void manualContour3VControler::ResetContour_Others()
        int i,size=this->_lstManualViewBaseContour.size();
        for ( i = 0 ; i < size ; i++ )
        {
-               mvbc = _lstManualViewBaseContour[i]; 
+               mvbc = _lstManualViewBaseContour[i];
                mvbc->DeleteContour();
                mvbc->CreateNewContour();
        }
@@ -3715,7 +3715,7 @@ manualContour3DControler::~manualContour3DControler()
 {
 }
 // ----------------------------------------------------------------------------
-manualContour3DControler * manualContour3DControler :: Clone()  // virtual 
+manualContour3DControler * manualContour3DControler :: Clone()  // virtual
 {
        manualContour3DControler * clone = new manualContour3DControler();
        CopyAttributesTo(clone);
@@ -3770,7 +3770,7 @@ void manualContour3DControler::MouseClickLeft(int x, int y) // virtual
 
        manualContourControler::MouseClickLeft(x,y);
 
-} 
+}
 // ----------------------------------------------------------------------------
 bool manualContour3DControler::OnChar()
 {
@@ -3818,7 +3818,7 @@ manualContour3V3DControler::~manualContour3V3DControler()
 }
 
 // ----------------------------------------------------------------------------
-manualContour3V3DControler * manualContour3V3DControler :: Clone()  // virtual 
+manualContour3V3DControler * manualContour3V3DControler :: Clone()  // virtual
 {
        manualContour3V3DControler * clone = new manualContour3V3DControler();
        CopyAttributesTo(clone);
@@ -3883,7 +3883,7 @@ bool manualContour3V3DControler::OnChar() // virtual
 }
 
 // ----------------------------------------------------------------------------
-void manualContour3V3DControler::ResetContour() // virtual 
+void manualContour3V3DControler::ResetContour() // virtual
 {
        manualContourControler::ResetContour();
        _manualcontour3Vcontroler->ResetContour_Others();
@@ -3896,21 +3896,21 @@ void manualContour3V3DControler::ResetContour() // virtual
 
 // _state = 0  // ..nothing..
 // _state = 1  // move with add point
-// _state = 5  // move 
+// _state = 5  // move
 // _state = 6  // move with insert point
 // _state = 7  // move with non selection
 
 manualContourControler::manualContourControler()
 {
        _easyCreation = true;
-       
+
 }
 // ----------------------------------------------------------------------------
 manualContourControler::~manualContourControler()
 {
 }
 // ----------------------------------------------------------------------------
-manualContourControler * manualContourControler :: Clone()  // virtual 
+manualContourControler * manualContourControler :: Clone()  // virtual
 {
        manualContourControler * clone = new manualContourControler();
        CopyAttributesTo(clone);
@@ -3933,7 +3933,7 @@ void manualContourControler::Configure() //virtual
 // ----------------------------------------------------------------------------
 void manualContourControler::MouseClickLeft(int x, int y){
 
-                       
+
        bool ok = false;
        int z   = GetZ();
        int size= GetManualViewBaseContour()->GetNumberOfPoints();
@@ -3944,29 +3944,29 @@ void manualContourControler::MouseClickLeft(int x, int y){
 //EED3131
        if( IsEditable() )
        {
-               if ( (_vtkInteractorStyleBaseView!=NULL) && (GetState()==0) && ( (vtkrenderwindowinteractor!=NULL) && (vtkrenderwindowinteractor->GetShiftKey()==1) ) ) 
-               { 
+               if ( (_vtkInteractorStyleBaseView!=NULL) && (GetState()==0) && ( (vtkrenderwindowinteractor!=NULL) && (vtkrenderwindowinteractor->GetShiftKey()==1) ) )
+               {
                        ok=true;
                        InsertPoint(x,y,z);
                        size++;
                }
                // Start to Insert Control Points with ClickLeft (Empty contour)
                if ((GetState()==0) && (size==0) && (_easyCreation==true) )
-               { 
+               {
                        ok=true;
-                       SetState(1); 
+                       SetState(1);
                        AddPoint(x,y,z);
                }
                // Continuie to Insert Control Points with ClickLeft (After being empty the contour)
-               if ((GetState()==1) && (_easyCreation==true) )  
-               { 
+               if ((GetState()==1) && (_easyCreation==true) )
+               {
                        ok=true;
                        AddPoint(x,y,z);
                        _bakIdPoint=GetNumberOfPointsManualContour() - 1;
                }
                // Insert Control Points IF Contour si Selected
-               if ((GetState()==0) && GetManualViewBaseContour()->GetPosibleSelected() )       
-               {               
+               if ((GetState()==0) && GetManualViewBaseContour()->GetPosibleSelected() )
+               {
                        ok=true;
                        InsertPoint(x,y,z);
                        _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
@@ -3976,14 +3976,14 @@ void manualContourControler::MouseClickLeft(int x, int y){
                if ( (GetState()==0 || GetState()==6) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) )
                {
                        ok=true;
-                       _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);    
+                       _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
                        SetState(5);
                }
                // If nothing selected _state=7
                if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)==-1 ) )
                {
                        //ok=true;
-                       _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);    
+                       _bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
                        SetState(7);
                }
        }
@@ -3991,14 +3991,14 @@ void manualContourControler::MouseClickLeft(int x, int y){
        {
                SetPosibleToMove( true );
                GetManualViewBaseContour()->SetSelected( GetManualViewBaseContour()->GetPosibleSelected() );
-       }       
+       }
        if ( GetState() == 0 && GetManualViewBaseContour()->GetPosibleSelected() )
-       {               
+       {
                SetMoving( true );
-               ok=true;                
+               ok=true;
                GetManualViewBaseContour()->InitMove(x,y,z);
                SetState(6);
-       }               
+       }
        if (ok==true)
        {
                GetManualViewBaseContour()->Refresh();
@@ -4009,11 +4009,11 @@ void manualContourControler::MouseMove(int x, int y) // virtual
 {
        int z=GetZ();
        GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
-       GetManualViewBaseContour()->SelectPosibleContour(x,y,z);        
+       GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
        if (GetState()==1){     SetPoint( _bakIdPoint , x , y ,z); }
        if (GetState()==5){     SetPoint( _bakIdPoint , x , y ,z); }
        if ( GetState()==6 && !IsEditable() && GetPosibleToMove() &&IsMoving() )
-       {               
+       {
                GetManualViewBaseContour()->MoveContour(x,y,z);
        }
        if (GetState()!=7 || GetManualViewBaseContour()->GetPosibleSelected() ){
@@ -4031,16 +4031,16 @@ void manualContourControler::MouseMove(int x, int y) // virtual
 }
 
 // ----------------------------------------------------------------------------
-void manualContourControler::MouseDLeft( int x, int y)//virtual 
+void manualContourControler::MouseDLeft( int x, int y)//virtual
 {
-       manualContourBaseControler::MouseDLeft( x, y);  
+       manualContourBaseControler::MouseDLeft( x, y);
        if ( IsEditable() )
        {
                GetManualViewBaseContour()->AddControlPoints();
                GetManualViewBaseContour()->AddTextActor();
                GetManualViewBaseContour()->Refresh();
                this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
-       }       
+       }
 }
 // ----------------------------------------------------------------------------
 void manualContourControler::SetEasyCreation(bool easyCreation)
@@ -4066,7 +4066,7 @@ manualContourPerpPlaneControler::~manualContourPerpPlaneControler()
 {
 }
 // ----------------------------------------------------------------------------
-manualContourPerpPlaneControler * manualContourPerpPlaneControler :: Clone()  // virtual 
+manualContourPerpPlaneControler * manualContourPerpPlaneControler :: Clone()  // virtual
 {
        manualContourPerpPlaneControler * clone = new manualContourPerpPlaneControler();
        CopyAttributesTo(clone);
@@ -4151,26 +4151,26 @@ bool manualContourPerpPlaneControler::OnChar() // virtual
        return true;
 }
 // ----------------------------------------------------------------------------
-bool manualContourPerpPlaneControler::OnMouseMove() //         virtual 
+bool manualContourPerpPlaneControler::OnMouseMove() //         virtual
 {
        manualContourControler::OnMouseMove();
        return _flagMouseMove;
 }
 // ----------------------------------------------------------------------------
-bool manualContourPerpPlaneControler::OnLeftDClick() //        virtual 
+bool manualContourPerpPlaneControler::OnLeftDClick() //        virtual
 {
        manualContourControler::OnLeftDClick();
        return _flagMouseDClick;
 }
 // ----------------------------------------------------------------------------
-void manualContourPerpPlaneControler::ResetContour() // virtual 
+void manualContourPerpPlaneControler::ResetContour() // virtual
 {
        manualContourControler::ResetContour();
        _manualcontour3Vcontroler->ResetContour_Others();
 }
 
 // ----------------------------------------------------------------------------
-void manualContourPerpPlaneControler::MouseDLeft( int x, int y) // virtual 
+void manualContourPerpPlaneControler::MouseDLeft( int x, int y) // virtual
 {
        _flagMouseDClick=true;
        manualContourControler::MouseDLeft(x,y);
@@ -4192,7 +4192,7 @@ void manualContourPerpPlaneControler::MouseDLeft( int x, int y) // virtual
 //             _vtkmprbasedata->SetZ( mp->GetZ() );
 //             ResetOrientationPlane();
 //             this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting();
-//     } 
+//     }
 }
 
 
@@ -4237,7 +4237,7 @@ manualRoiControler::~manualRoiControler()
 {
 }
 // ----------------------------------------------------------------------------
-manualRoiControler * manualRoiControler :: Clone()  // virtual 
+manualRoiControler * manualRoiControler :: Clone()  // virtual
 {
        manualRoiControler * clone = new manualRoiControler();
        CopyAttributesTo(clone);
@@ -4261,27 +4261,27 @@ void manualRoiControler::Configure() //virtual
 void manualRoiControler::MouseClickLeft(int x, int y){
        int z = GetZ();
        if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ){
-               bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);     
+               bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
                SetState(5);
        }
-       if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true))        { 
+       if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true))        {
                GetManualViewBaseContour()->InitMove(x,y,z);
                SetState(6);
        }
        int size=GetManualViewBaseContour()->GetNumberOfPoints();
-       if (GetState()==0) { 
+       if (GetState()==0) {
                if (size==0){
-                       AddPoint(x,y,z); 
-                       AddPoint(x,y,z); 
-                       AddPoint(x,y,z); 
-                       AddPoint(x,y,z); 
+                       AddPoint(x,y,z);
+                       AddPoint(x,y,z);
+                       AddPoint(x,y,z);
+                       AddPoint(x,y,z);
                } else {
-                       SetPoint(0,x,y,z); 
-                       SetPoint(1,x,y,z); 
-                       SetPoint(2,x,y,z); 
-                       SetPoint(3,x,y,z); 
+                       SetPoint(0,x,y,z);
+                       SetPoint(1,x,y,z);
+                       SetPoint(2,x,y,z);
+                       SetPoint(3,x,y,z);
                }
-               bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);     
+               bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
                SetState(5);
        }
        GetManualViewBaseContour()->Refresh();
@@ -4296,37 +4296,37 @@ void manualRoiControler::MouseMove(int x, int y) // virtual
        GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
        GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
 
-       if (GetState()==5){     
-               SetPoint( bakIdPoint , x , y ,z); 
+       if (GetState()==5){
+               SetPoint( bakIdPoint , x , y ,z);
                if (bakIdPoint==0)
                {
-                       SetPointX( 1 , x ); 
-                       SetPointY( 3 , y ); 
+                       SetPointX( 1 , x );
+                       SetPointY( 3 , y );
                }
                if (bakIdPoint==1)
                {
-                       SetPointX( 0 , x ); 
-                       SetPointY( 2 , y ); 
+                       SetPointX( 0 , x );
+                       SetPointY( 2 , y );
                }
                if (bakIdPoint==2)
                {
-                       SetPointX( 3 , x ); 
-                       SetPointY( 1 , y ); 
+                       SetPointX( 3 , x );
+                       SetPointY( 1 , y );
                }
                if (bakIdPoint==3)
                {
-                       SetPointX( 2 , x ); 
-                       SetPointY( 0 , y ); 
+                       SetPointX( 2 , x );
+                       SetPointY( 0 , y );
                }
        }
-       if (GetState()==6){     
+       if (GetState()==6){
                GetManualViewBaseContour()->MoveContour(x,y,z);
        }
        GetManualViewBaseContour()->Refresh();
 }
 // ----------------------------------------------------------------------------
 void manualRoiControler::DeleteActualMousePoint(int x, int y)  // virtual
-{ 
+{
 }
 // ----------------------------------------------------------------------------
 void manualRoiControler::InitRoi(int ww, int hh, double porcentage)
@@ -4368,8 +4368,8 @@ void manualRoiControler::InitRoi(int ww, int hh, double porcentage)
        GetManualViewBaseContour() ->UpdateViewPoint(3);
 
        SetState(0);
-       GetManualViewBaseContour()->Refresh();  
-}      
+       GetManualViewBaseContour()->Refresh();
+}
 
 // ----------------------------------------------------------------------------
 void manualRoiControler::SetRoi(int x1, int y1,int x2, int y2)
@@ -4418,7 +4418,7 @@ manualCircleControler::~manualCircleControler()
 {
 }
 // ----------------------------------------------------------------------------
-manualCircleControler * manualCircleControler :: Clone()  // virtual 
+manualCircleControler * manualCircleControler :: Clone()  // virtual
 {
        manualCircleControler * clone = new manualCircleControler();
        CopyAttributesTo(clone);
@@ -4442,27 +4442,27 @@ void manualCircleControler::Configure() //virtual
 void manualCircleControler::MouseClickLeft(int x, int y){
        int z = GetZ();
        if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ){
-               bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);     
+               bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
                SetState(5);
        }
-       if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true))        { 
+       if ((GetState()==0) && (GetManualViewBaseContour()->GetPosibleSelected()==true))        {
                GetManualViewBaseContour()->InitMove(x,y,z);
                SetState(6);
        }
        int size=GetManualViewBaseContour()->GetNumberOfPoints();
-       if (GetState()==0) { 
+       if (GetState()==0) {
                if (size==0){
-                       AddPoint(x,y,z); 
-                       AddPoint(x,y,z); 
-//                     AddPoint(x,y,z); 
-//                     AddPoint(x,y,z); 
+                       AddPoint(x,y,z);
+                       AddPoint(x,y,z);
+//                     AddPoint(x,y,z);
+//                     AddPoint(x,y,z);
                } else {
-                       SetPoint(0,x,y,z); 
-                       SetPoint(1,x,y,z); 
-//                     SetPoint(2,x,y,z); 
-//                     SetPoint(3,x,y,z); 
+                       SetPoint(0,x,y,z);
+                       SetPoint(1,x,y,z);
+//                     SetPoint(2,x,y,z);
+//                     SetPoint(3,x,y,z);
                }
-               bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);     
+               bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
                SetState(5);
        }
        GetManualViewBaseContour()->Refresh();
@@ -4478,33 +4478,33 @@ void manualCircleControler::MouseMove(int x, int y) // virtual
        GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
        GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
 
-       if (GetState()==5){     
-               SetPoint( bakIdPoint , x , y ,z); 
+       if (GetState()==5){
+               SetPoint( bakIdPoint , x , y ,z);
 /*
                if (bakIdPoint==0)
                {
-                       SetPointX( 1 , x ); 
-                       SetPointY( 3 , y ); 
+                       SetPointX( 1 , x );
+                       SetPointY( 3 , y );
                }
                if (bakIdPoint==1)
                {
-                       SetPointX( 0 , x ); 
-                       SetPointY( 2 , y ); 
+                       SetPointX( 0 , x );
+                       SetPointY( 2 , y );
                }
 
                if (bakIdPoint==2)
                {
-                       SetPointX( 3 , x ); 
-                       SetPointY( 1 , y ); 
+                       SetPointX( 3 , x );
+                       SetPointY( 1 , y );
                }
                if (bakIdPoint==3)
                {
-                       SetPointX( 2 , x ); 
-                       SetPointY( 0 , y ); 
+                       SetPointX( 2 , x );
+                       SetPointY( 0 , y );
                }
 */
        }
-       if (GetState()==6){     
+       if (GetState()==6){
                GetManualViewBaseContour()->MoveContour(x,y,z);
        }
        GetManualViewBaseContour()->Refresh();
@@ -4513,7 +4513,7 @@ void manualCircleControler::MouseMove(int x, int y) // virtual
 
 // ----------------------------------------------------------------------------
 void manualCircleControler::DeleteActualMousePoint(int x, int y)  // virtual
-{ 
+{
 }
 // ----------------------------------------------------------------------------
 
@@ -4556,8 +4556,8 @@ void manualCircleControler::InitRoi(int ww, int hh, double porcentage)
 //     GetManualViewBaseContour() ->UpdateViewPoint(3);
 
        SetState(0);
-       GetManualViewBaseContour()->Refresh();  
-}      
+       GetManualViewBaseContour()->Refresh();
+}
 
 // ----------------------------------------------------------------------------
 /*
@@ -4602,7 +4602,7 @@ manualContourBaseControler::manualContourBaseControler()
        _state                          = 0;
        _z                                      = -900;
        _editable                       = true;
-       _posibleToMove          = true; 
+       _posibleToMove          = true;
        _moving                         = false;
        _created                        = false;
        _keyBoardMoving         = false;
@@ -4613,7 +4613,7 @@ manualContourBaseControler::~manualContourBaseControler()
 }
 
 // ----------------------------------------------------------------------------
-manualContourBaseControler * manualContourBaseControler :: Clone()  // virtual 
+manualContourBaseControler * manualContourBaseControler :: Clone()  // virtual
 {
        manualContourBaseControler * clone = new manualContourBaseControler();
        CopyAttributesTo(clone);
@@ -4650,7 +4650,7 @@ bool manualContourBaseControler::OnChar()
                int X,Y;
                wxVTKRenderWindowInteractor *_wxVTKiren;
                _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
-               _wxVTKiren->GetEventPosition(X, Y);     
+               _wxVTKiren->GetEventPosition(X, Y);
                //int Z = GetZ(); // JPRx
                // Delete Point
                if ((keyCode==8) || (keyCode==127))
@@ -4662,10 +4662,10 @@ bool manualContourBaseControler::OnChar()
                        }
                        GetManualViewBaseContour()->Refresh();
                        this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
-               }       
+               }
                else
                {
-                       // Magnet 
+                       // Magnet
                        if (keyCode==32)
                        {
                                Magnet(X,Y);
@@ -4673,54 +4673,54 @@ bool manualContourBaseControler::OnChar()
                                this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
                        }
                        else if( !IsEditable() )
-                       {               
+                       {
                                if ( keyCode == 'L' )
-                               {       
-                                       GetManualViewBaseContour()->MoveContour( -1, 0 );       
+                               {
+                                       GetManualViewBaseContour()->MoveContour( -1, 0 );
                                        SetKeyBoardMoving( true );
                                }
                                else if ( keyCode == 'R' )
-                               {                       
-                                       GetManualViewBaseContour()->MoveContour( 1, 0 );        
-                                       SetKeyBoardMoving( true );      
+                               {
+                                       GetManualViewBaseContour()->MoveContour( 1, 0 );
+                                       SetKeyBoardMoving( true );
                                }
                                else if ( keyCode == 'U' )
                                {
-                                       GetManualViewBaseContour()->MoveContour( 0, -1 );       
+                                       GetManualViewBaseContour()->MoveContour( 0, -1 );
                                        SetKeyBoardMoving( true );
                                }
                                else if ( keyCode == 'D' )
                                {
-                                       GetManualViewBaseContour()->MoveContour( 0, 1 );        
+                                       GetManualViewBaseContour()->MoveContour( 0, 1 );
                                        SetKeyBoardMoving( true );
                                }
                                else if ( keyCode == 'W' )//Diagonal left down
                                {
-                                       GetManualViewBaseContour()->MoveContour( -1, 1 );       
+                                       GetManualViewBaseContour()->MoveContour( -1, 1 );
                                        SetKeyBoardMoving( true );
                                }
                                else if ( keyCode == 'Q' )//Diagonal left up
                                {
-                                       GetManualViewBaseContour()->MoveContour( -1, -1 );      
+                                       GetManualViewBaseContour()->MoveContour( -1, -1 );
                                        SetKeyBoardMoving( true );
                                }
                                else if( keyCode == 'P' )//Diagonal right up
                                {
-                                       GetManualViewBaseContour()->MoveContour( 1, -1 );       
+                                       GetManualViewBaseContour()->MoveContour( 1, -1 );
                                        SetKeyBoardMoving( true );
                                }
                                else if( keyCode == 'M' )//Diagonal right down
                                {
-                                       GetManualViewBaseContour()->MoveContour( 1, 1 );        
+                                       GetManualViewBaseContour()->MoveContour( 1, 1 );
                                        SetKeyBoardMoving( true );
                                }
                                if( GetKeyBoardMoving() )
                                {
                                        GetManualViewBaseContour()->Refresh();
-                                       this->_vtkInteractorStyleBaseView->SetRefresh_waiting();        
+                                       this->_vtkInteractorStyleBaseView->SetRefresh_waiting();
                                }
                        }
-               }               
+               }
        }
        return true;
 }
@@ -4752,7 +4752,7 @@ bool manualContourBaseControler::OnLeftButtonDown()
                wxVTKRenderWindowInteractor *wxVTKiren;
                wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
                wxVTKiren->GetEventPosition(X,Y);
-               
+
                MouseClickLeft(X,Y);
        }
        return true;
@@ -4785,7 +4785,7 @@ bool manualContourBaseControler::OnLeftDClick()
        return true;
 }
 // ----------------------------------------------------------------------------
-bool manualContourBaseControler::OnMiddleButtonDown() 
+bool manualContourBaseControler::OnMiddleButtonDown()
 {
 //     SetKeyBoardMoving( false );
        if ( _vtkInteractorStyleBaseView!=NULL )
@@ -4812,7 +4812,7 @@ bool manualContourBaseControler::OnRightButtonDown()
                wxVTKRenderWindowInteractor *wxVTKiren;
                wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
                wxVTKiren->GetEventPosition(X, Y);
-               
+
                SetCompleteCreation( true );
                SetKeyBoardMoving( false );
                MouseClickRight(X,Y);
@@ -4842,19 +4842,19 @@ manualViewBaseContour* manualContourBaseControler::GetManualViewBaseContour()
 }
 // ----------------------------------------------------------------------------
 void manualContourBaseControler::MouseClickLeft(int x, int y) // virtual
-{  
-       
+{
+
 }
 // ----------------------------------------------------------------------------
 void manualContourBaseControler::MouseClickRight(int x, int y)
 {
-       if (_state==1)  
-       { 
+       if (_state==1)
+       {
                _state=0;
        }
        SetEditable( false );
        SetPosibleToMove( false );
-       //_state = 0; 
+       //_state = 0;
        _state=7;
 }
 // ----------------------------------------------------------------------------
@@ -4862,20 +4862,20 @@ void manualContourBaseControler::MouseReleaseLeft(int x, int y)
 {
        if (_state==5){ _state = 0; }
        if (_state==6){ _state = 0; }
-       if (_state==7){ _state = 0; }   
+       if (_state==7){ _state = 0; }
        SetMoving( false );
        GetManualViewBaseContour()->SelectPosibleContour(x,y,GetZ());
        if( GetIfCompleteCreation() && IsEditable() && !GetManualViewBaseContour()->GetPosibleSelected() && (GetManualViewBaseContour()->GetIdPoint(x,y,GetZ())==-1)  )
        {
                SetEditable( false );
-               SetPosibleToMove( false );              
+               SetPosibleToMove( false );
        }
 }
 // ----------------------------------------------------------------------------
 void manualContourBaseControler::MouseDLeft(int x, int y )
 {
-       if (_state==0)  
-       { 
+       if (_state==0)
+       {
                int z=GetZ();
                GetManualViewBaseContour()->SelectPosibleContour(x,y,z);
                GetManualViewBaseContour()->SelectPosiblePoint(x,y,z);
@@ -4913,7 +4913,7 @@ void manualContourBaseControler::SetEditable(  bool condition  )
                        GetManualViewBaseContour()->RemoveControlPoints();
                }
                GetManualViewBaseContour()->SetSelected( condition );
-       }       
+       }
        _editable = condition;
 }
 
@@ -4984,17 +4984,17 @@ double* manualContourBaseControler::GetVectorPointsYManualContour(){
 // ----------------------------------------------------------------------------
 void manualContourBaseControler::DeleteContour(){
        _manViewBaseCont->DeleteContour();
-       _manContModel->DeleteAllPoints(); 
+       _manContModel->DeleteAllPoints();
 }
 // ----------------------------------------------------------------------------
 void manualContourBaseControler::DeleteActualMousePoint(int x, int y)// virtual
-{ 
+{
        if ((_manContModel!=NULL) && (_manViewBaseCont!=NULL) )
        {
                int id=_manViewBaseCont->GetIdPoint(x,y,GetZ());
                if ((id!=-1) && (_manContModel->GetSizeLstPoints()>2) ){
                        _manContModel->DeletePoint(id);
-                       _manViewBaseCont->DeletePoint(id);  
+                       _manViewBaseCont->DeletePoint(id);
                }
        }
        _state = 0;
@@ -5002,7 +5002,7 @@ void manualContourBaseControler::DeleteActualMousePoint(int x, int y)// virtual
 
 // ----------------------------------------------------------------------------
 void manualContourBaseControler::Magnet(int x, int y)
-{ 
+{
        if( IsEditable())
        {
                /*int id= */ _manViewBaseCont->GetIdPoint(x,y,GetZ()); // JPRx
@@ -5042,7 +5042,7 @@ void manualContourBaseControler::AddPoint(int x, int y, int z) // virtual
                double  zz      = z;
                GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz);
                /*int   id              =*/  GetManualContourModel()->AddPoint(xx,yy,zz);  // JPRx
-               GetManualViewBaseContour()->AddPoint(); 
+               GetManualViewBaseContour()->AddPoint();
 //             GetManualViewBaseContour()->UpdateViewPoint(id);
        }
 }
@@ -5058,12 +5058,12 @@ void manualContourBaseControler::InsertPoint(int x,int y,int z)  // virtual
                GetManualViewBaseContour()->TransfromeCoordViewWorld(xx,yy,zz);
                if (GetManualContourModel()->GetSizeLstPoints()>1){
                        id = GetManualContourModel()->InsertPoint(xx,yy,zz);
-                       GetManualViewBaseContour()->InsertPoint(id);                            
+                       GetManualViewBaseContour()->InsertPoint(id);
 //                     GetManualViewBaseContour()->UpdateViewPoint(id);
                } else {
                        GetManualContourModel()->AddPoint(xx,yy,zz);
-                       GetManualViewBaseContour()->AddPoint(); 
-//                     AddPoint(x,y,z);        
+                       GetManualViewBaseContour()->AddPoint();
+//                     AddPoint(x,y,z);
 //                     GetManualViewBaseContour()->UpdateViewPoint(id);
                }
        }