From 63ee187ed08495d67c09ebb243227175f144615d Mon Sep 17 00:00:00 2001
From: Eduardo DAVILA <davila@localhost.localdomain>
Date: Wed, 22 Nov 2017 15:39:32 +0100
Subject: [PATCH] #3138 creaMaracasVisu Feature New Normal  -  branch
 vtk7itk4wx3

---
 .../manualContourBaseControler.h              |  2 +-
 .../manualContour/manualContourModel.cpp      | 50 +++-------
 .../manualContourModelCircle.cpp              |  3 +-
 .../manualContour/manualContourModelCircle.h  |  1 -
 .../manualContour/manualViewBullEyeSector.cpp | 18 ++--
 .../manualContour/manualViewCircle.cpp        | 57 +++++------
 .../widgets/manualContour/manualViewCircle.h  |  1 +
 .../manualContour/manualViewContour.cpp       | 95 +++++++++----------
 .../widgets/manualContour/manualViewContour.h |  3 +-
 .../widgets/manualContour/manualViewLine.cpp  | 32 ++-----
 .../widgets/manualContour/manualViewRoi.cpp   |  4 +-
 11 files changed, 113 insertions(+), 153 deletions(-)

diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.h
index 8020cc4..4fece95 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.h
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourBaseControler.h
@@ -98,7 +98,7 @@ public:
 	virtual bool  OnRightButtonUp();
 
 	void	SetModelView(manualBaseModel *manContModel, manualViewBaseContour *manViewBaseCont);
-	manualBaseModel		* GetManualContourModel();
+	manualBaseModel			* GetManualContourModel();
 	manualViewBaseContour	* GetManualViewBaseContour();
 
 
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.cpp
index e5ab192..7f4d128 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.cpp
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.cpp
@@ -34,34 +34,25 @@ manualContourModel::manualContourModel()
     _cntSplineX = vtkKochanekSpline::New( );
     _cntSplineY = vtkKochanekSpline::New( );
     _cntSplineZ = vtkKochanekSpline::New( );
-
 	this->SetCloseContour(true);
-
     _cntSplineX->SetDefaultTension( 0 );
 	_cntSplineX->SetDefaultBias( 0 );
 	_cntSplineX->SetDefaultContinuity( 0 );
-
     _cntSplineY->SetDefaultTension( 0 );
 	_cntSplineY->SetDefaultBias( 0 );
 	_cntSplineY->SetDefaultContinuity( 0 );
-
     _cntSplineZ->SetDefaultTension( 0 );
 	_cntSplineZ->SetDefaultBias( 0 );
 	_cntSplineZ->SetDefaultContinuity( 0 );
-
 //JSTG 25-02-08 -------------------------------------------------------------------------------------------------
-
 	// this parameter is reset in the  VIRTUAL manualContourBaseControler::Configure
 	_sizePointsContour	= 100;			//JSTG 25-02-08 The change in the inisialization of these variable is critical.
-
 	_delta_JSTG			= 0.0;
 //---------------------------------------------------------------------------------------------------------------
-
 //CMRU 17-08-09 -------------------------------------------------------------------------------------------------
 	_realSize			= 0.0;
 	_label				= "";
 //---------------------------------------------------------------------------------------------------------------
-
 }
 
 // ----------------------------------------------------------------------------
@@ -72,15 +63,14 @@ manualContourModel::~manualContourModel()
 		delete _lstPoints[i];
 	}
 	_lstPoints.clear();
-
 	_cntSplineX->RemoveAllPoints();
 	_cntSplineY->RemoveAllPoints();
 	_cntSplineZ->RemoveAllPoints();
-
 	_cntSplineX->Delete();
 	_cntSplineY->Delete();
 	_cntSplineZ->Delete();
 }
+
 // ----------------------------------------------------------------------------
 int manualContourModel::AddPoint(double x,double y,double z)
 {
@@ -88,7 +78,6 @@ int manualContourModel::AddPoint(double x,double y,double z)
    mp->SetPoint(x,y,z);
    AddManualPoint(mp);
    //UpdateSpline();
-
    return _lstPoints.size()-1;
 }
 // ----------------------------------------------------------------------------
@@ -187,6 +176,7 @@ void manualContourModel::DeleteAllPoints()
 
 void manualContourModel::MovePoint(int i,double dx,double dy,double dz)
 {
+printf("EED manualContourModel::MovePoint %p \n", this);
 	manualPoint *mp=_lstPoints[i];
 	double x=mp->GetX()+dx;
 	double y=mp->GetY()+dy;
@@ -388,8 +378,6 @@ void manualContourModel::GetSpline_t_Point(double t, double *x, double *y, doubl
 }
 
 // ----------------------------------------------------------------------------
-
-
 /*void manualContourModel::GetSplinePoint(double t, double &x, double &y, double &z)
 {
 	if (_lstPoints.size()==0)
@@ -413,19 +401,18 @@ void manualContourModel::GetSpline_t_Point(double t, double *x, double *y, doubl
 		z	= _cntSplineZ->Evaluate(t);
 	}
 }*/
+
 // ----------------------------------------------------------------------------
 double manualContourModel::GetPathSize(double *spc)
 {
 	double result = 0;
 	double x1,y1,z1;
 	double x2,y2,z2;
-
 // JSTG 25-02-08 -----------------------------
 	//double t,delta;
 	//int i,np,nps;
 	int i;
 //--------------------------------------------
-
 	if (_lstPoints.size()==2)
 	{
 		x1 = spc[0] * _lstPoints[0]->GetX();
@@ -438,7 +425,6 @@ double manualContourModel::GetPathSize(double *spc)
 	}
 	if (_lstPoints.size()>2)
 	{
-
 // JSTG 25-02-08 ------------------------------------------
 		//np  = _lstPoints.size( );
 		//nps = 200;
@@ -446,7 +432,6 @@ double manualContourModel::GetPathSize(double *spc)
 		UpdateSpline();
 		//GetSplinePoint(0,x1,y1,z1);
 		GetSpline_i_Point(0,&x1,&y1,&z1);
-
 		x1 = spc[0] * x1; 
 		y1 = spc[1] * y1; 
 		z1 = spc[2] * z1; 
@@ -466,11 +451,9 @@ double manualContourModel::GetPathSize(double *spc)
 			z1=z2;
 		}// for
 	}
-
 	return result;
 }
 
-
 // ----------------------------------------------------------------------------
 double manualContourModel::GetPathArea(double *spc)
 {
@@ -485,7 +468,6 @@ double manualContourModel::GetPathArea(double *spc)
 		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
@@ -513,9 +495,7 @@ double manualContourModel::GetPathArea(double *spc)
 			x2=spc[0]*x2;
 			y2=spc[1]*y2;
 			z2=spc[2]*z2;
-			area +=
-					(x1 * y2 ) -
-					( x2 * y1 );
+			area += (x1 * y2 ) - ( x2 * y1 );
 			if (z1!=z2)
 			{
 				okArea=false;
@@ -558,7 +538,6 @@ double manualContourModel::GetPathArea(double *spc)
 // 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)
 {
 	double  distMin=999999999;
@@ -604,12 +583,11 @@ void manualContourModel::GetNearestPointAndNormal(double *p, double *rp,  double
 				rn[0] = x2-x1;
 				rn[1] = y2-y1;
 				rn[2] = z2-z1;
-			}
-			x2=x1;
-			y2=y1;
-			z2=z1;
+			} // if
+			x2 = x1;
+			y2 = y1;
+			z2 = z1;
 		}// for
-
 // JSTG 25-02-08 ------------------------------------------
 		//if (tback==0)
 		if (iback==0)
@@ -618,10 +596,10 @@ void manualContourModel::GetNearestPointAndNormal(double *p, double *rp,  double
 			//GetSplinePoint(t,x1,y1,z1);
 			GetSpline_i_Point(i,&x1,&y1,&z1);
 //----------------------------------------------------------
-			rn[0]=rp[0]-x1;
-			rn[1]=rp[1]-y1;
-			rn[2]=rp[2]-z1;
-		}
+			rn[0] = rp[0]-x1;
+			rn[1] = rp[1]-y1;
+			rn[2] = rp[2]-z1;
+		} // if iback 
 	} else {
 		rp[0] = 0;
 		rp[1] = 0;
@@ -629,11 +607,11 @@ void manualContourModel::GetNearestPointAndNormal(double *p, double *rp,  double
 		rn[0] = -1;
 		rn[1] = 0;
 		rn[2] = 0;
-	}
+	} // if np
 }
 
 // ----------------------------------------------------------------------------
-manualContourModel * manualContourModel :: Clone() // virtual
+manualContourModel * manualContourModel::Clone() // virtual
 {
 	manualContourModel * clone = new manualContourModel();
 	CopyAttributesTo(clone);
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModelCircle.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModelCircle.cpp
index f606f98..b6b361c 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModelCircle.cpp
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModelCircle.cpp
@@ -80,7 +80,8 @@ void manualContourModelCircle::UpdateSpline() // virtal
 	int nps = GetNumberOfPointsSpline();
 	_deltaAngle=(3.14159265*2)/(nps-1);
 
-	if (np==2){
+	if (np==2)
+	{
 		mpA			= GetManualPoint(0);
 		mpB			= GetManualPoint(1);
 		difX		= mpA->GetX() - mpB->GetX();
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModelCircle.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModelCircle.h
index 1d6a411..a8d3d1d 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModelCircle.h
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModelCircle.h
@@ -42,7 +42,6 @@ private:
 	double		_centerX;
 	double		_centerY;
 	double		_centerZ;
-
 	virtual int		GetTypeModel();  
 	virtual void	UpdateSpline();
 };
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBullEyeSector.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBullEyeSector.cpp
index 6c8765e..cbb4ec1 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBullEyeSector.cpp
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBullEyeSector.cpp
@@ -36,18 +36,18 @@ manualViewBullEyeSector::manualViewBullEyeSector()
 void manualViewBullEyeSector::RefreshContour()
 {
 //EED004
-	int i,nps;
-	double x,y,z;
-	double xx,yy,zz;
+	int 	i,nps;
+	double 	x,y,z;
+	double 	xx,yy,zz;
 //----------------------------------
 	//EED 27 Juin 2012
     //Boundaring box	
-	_minX=99999;
-	_minY=99999;
-	_minZ=99999;
-	_maxX=-99999;
-	_maxY=-99999;
-	_maxZ=-99999;
+	_minX = 99999;
+	_minY = 99999;
+	_minZ = 99999;
+	_maxX = -99999;
+	_maxY = -99999;
+	_maxZ = -99999;
 	_manContModel->UpdateSpline();
     nps = _manContModel->GetNumberOfPointsSpline();
 	if ( _pts!=NULL )
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewCircle.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewCircle.cpp
index 12d97e4..2fa468b 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewCircle.cpp
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewCircle.cpp
@@ -30,8 +30,6 @@
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 
-// EED08
-
 manualViewCircle::manualViewCircle()
 {
 //	_sizePointsContour=5;   // default 100
@@ -41,7 +39,6 @@ manualViewCircle::~manualViewCircle()
 {
 }
 
-
 // ----------------------------------------------------------------------------
 manualViewCircle * manualViewCircle :: Clone()
 {
@@ -51,14 +48,12 @@ manualViewCircle * manualViewCircle :: Clone()
 }
 
 // ---------------------------------------------------------------------------
-
 void manualViewCircle::CopyAttributesTo( manualViewCircle * cloneObject)
 {
 	// Fathers object
 	manualViewBaseContour::CopyAttributesTo(cloneObject);
 }
 
-
 // ----------------------------------------------------------------------------
 int manualViewCircle::GetType() // virtual
 {
@@ -86,11 +81,11 @@ void manualViewCircle::GetMinMax(double &minX,double &minY, double &maxX, double
 		maxX=mpA->GetX()+radio;
 		maxY=mpA->GetY()+radio;
 	} else {
-		minX=0;
-		maxX=0;
-		minY=0;
-		maxY=0;
-	}
+		minX	= 0;
+		maxX	= 0;
+		minY	= 0;
+		maxY	= 0;
+	} // if np
 }
 
 
@@ -99,60 +94,60 @@ void manualViewCircle::GetMinMax(double &minX,double &minY, double &maxX, double
 void manualViewCircle::InitMove(int x, int y, int z)  // virtual
 {
 	manualPoint *mp;
-	double XX=x;
-	double YY=y;
-	double ZZ=z;
+	double 		XX = x;
+	double 		YY = y;
+	double 		ZZ = z;
 	TransfromCoordViewWorld(XX,YY,ZZ);
-
-	if (_manContModel->GetSizeLstPoints()==2){
+	if (_manContModel->GetSizeLstPoints()==2)
+	{
 		mp = _manContModel->GetManualPoint(0);
-		_dp0[0]= mp->GetX() - XX;
-		_dp0[1]= mp->GetY() - YY;
-		_dp0[2]= mp->GetZ();
-
-		mp = _manContModel->GetManualPoint(1);
-		_dp1[0]= mp->GetX() - XX;
-		_dp1[1]= mp->GetY() - YY;
-		_dp1[2]= mp->GetZ();
+		_dp0[0] = mp->GetX() - XX;
+		_dp0[1] = mp->GetY() - YY;
+		_dp0[2] = mp->GetZ();
+		mp 		= _manContModel->GetManualPoint(1);
+		_dp1[0] = mp->GetX() - XX;
+		_dp1[1] = mp->GetY() - YY;
+		_dp1[2] = mp->GetZ();
 /*
 		mp = _manContModel->GetManualPoint(2);
 		_dp2[0]= mp->GetX() - XX;
 		_dp2[1]= mp->GetY() - YY;
 		_dp2[2]= mp->GetZ();
-
 		mp = _manContModel->GetManualPoint(3);
 		_dp3[0]= mp->GetX() - XX;
 		_dp3[1]= mp->GetY() - YY;
 		_dp3[2]= mp->GetZ();
 */
-	}
+	} // if 
 }
 
-
 // ----------------------------------------------------------------------------
 void manualViewCircle::MoveContour(int x, int y, int z) // virtual
 {
+printf("EED  manualViewCircle::MoveContour %p \n", this);
 	manualPoint *mp;
 	double XX=x;
 	double YY=y;
 	double ZZ=z;
 	TransfromCoordViewWorld(XX,YY,ZZ);
-
 	mp = _manContModel->GetManualPoint(0);
 	mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]);
-
 	mp = _manContModel->GetManualPoint(1);
 	mp->SetPoint(_dp1[0]+XX,_dp1[1]+YY,_dp0[2]);
-
 //	mp = _manContModel->GetManualPoint(2);
 //	mp->SetPoint(_dp2[0]+XX,_dp2[1]+YY,_dp0[2]);
-
 //	mp = _manContModel->GetManualPoint(3);
 //	mp->SetPoint(_dp3[0]+XX,_dp3[1]+YY,_dp0[2]);
-
 	UpdateViewPoint(0);
 	UpdateViewPoint(1);
 //	UpdateViewPoint(2);
 //	UpdateViewPoint(3);
+}
 
+// ----------------------------------------------------------------------------
+bool manualViewCircle::ShowLineVersion()
+{
+	return false;
 }
+
+
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewCircle.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewCircle.h
index dc58111..643c9e9 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewCircle.h
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewCircle.h
@@ -47,6 +47,7 @@ public:
 	virtual void InitMove(int x, int y, int z);
 	virtual void MoveContour(int x, int y, int z);
 	void GetMinMax(double &minX,double &minY, double &maxX, double &maxY);
+	virtual	bool ShowLineVersion();
 
 private:
 	double				_dp0[3];
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp
index 0c082a2..32ef7e7 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp
@@ -32,8 +32,7 @@
 manualViewContour::manualViewContour()
 {
 	_id_viewPoint_for_text	= 0;
-	_initialConoturModel	= new manualContourModel();
-	
+	_initialConoturModel	= new manualContourModel();	
 	_minX					= 99999;
 	_minY					= 99999;
 	_maxX					= -99999;
@@ -78,37 +77,45 @@ void manualViewContour::Save(FILE *pFile)
 }
 
 // ----------------------------------------------------------------------------
-
 void manualViewContour::Open(FILE *pFile)
 {
 }
 
+// ----------------------------------------------------------------------------
+bool manualViewContour::ShowLineVersion()   // virtual
+{
+	bool result = false;
+    int np	= GetNumberOfPoints( );
+	if (np==2) 
+	{
+		result=true;
+	}
+	return result;
+}
+
 // ----------------------------------------------------------------------------
 void manualViewContour::RefreshContour() // virtual
 {
-	int i,np,nps;
+	int i,nps;
 //JSTG 25-02-08 --------------------
 	//double t,delta, x,y,z;
 	double x,y,z;
 	double xx,yy,zz;
 //----------------------------------
-
-    np	= GetNumberOfPoints( );
-
-	if (np==2) 
+	if ( ShowLineVersion()==true ) 
 	{
 		SetCellArray(false);
 		manualPoint *mpA = _manContModel->GetManualPoint(0);
 		manualPoint *mpB = _manContModel->GetManualPoint(1);		
 		if ( _pts!=NULL )
 		{
-			xx=mpA->GetX() * _spc[0];
-			yy=mpA->GetY() * _spc[1];
-			zz=mpA->GetZ() * _spc[2];
-			_minX=xx;
-			_minY=yy;
-			_maxX=xx;
-			_maxY=yy;
+			xx		= mpA->GetX() * _spc[0];
+			yy		= mpA->GetY() * _spc[1];
+			zz		= mpA->GetZ() * _spc[2];
+			_minX	= xx;
+			_minY	= yy;
+			_maxX	= xx;
+			_maxY	= yy;
 			_pts->SetPoint(0 , xx , yy , zz  );
 			xx=mpB->GetX() * _spc[0];
 			yy=mpB->GetY() * _spc[1];
@@ -128,12 +135,13 @@ void manualViewContour::RefreshContour() // virtual
 
 		//EED 27 Juin 2012
 		//Boundaring box	
-		_minX=99999;
-		_minY=99999;
-		_maxX=-99999;
-		_maxY=-99999;
+		_minX = 99999;
+		_minY = 99999;
+		_maxX = -99999;
+		_maxY = -99999;
 		if ( _pts!=NULL )
 		{
+		    int np	= GetNumberOfPoints( );
 			if (np>=2  )
 			{
 				for( i = 0; i < nps; i++ )
@@ -163,11 +171,10 @@ void manualViewContour::RefreshContour() // virtual
 			} // if
 		} // _pts!=NULL
 	} //np==2
-
-	_minX=_minX-1.0;
-	_minY=_minY-1.0;
-	_maxX=_maxX+1.0;
-	_maxY=_maxY+1.0;
+	_minX = _minX-1.0;
+	_minY = _minY-1.0;
+	_maxX = _maxX+1.0;
+	_maxY = _maxY+1.0;
 
 //EED 2017-03-02
 	if (_pts!=NULL) 
@@ -292,50 +299,43 @@ void manualViewContour::RefreshText()  // virtual
 // ----------------------------------------------------------------------------
 bool manualViewContour::ifTouchContour(int x,int y,int z)
 {
-	bool result=false;
-
-	double xx=x;
-	double yy=y;
-	double zz=z;
+	bool result	= false;
+	double xx	= x;
+	double yy	= y;
+	double zz	= z;
 	double ppA[3];
 	double ppB[3];
 	double d1,d2,d3;
 	TransfromCoordViewWorld(xx,yy,zz);
-
 //EED 27 sep 2006
 	xx = xx * _spc[0];
 	yy = yy * _spc[1];
 	zz = zz * _spc[2];
-
-	if ( (xx>=_minX) &&  (yy>=_minY) && (xx<=_maxX) && (yy<=_maxY)) {  // inside the boundaring box
-	
-
-		if (_manContModel->GetSizeLstPoints()==2)
+	if ( (xx>=_minX) &&  (yy>=_minY) && (xx<=_maxX) && (yy<=_maxY)) 
+	{  // inside the boundaring box
+		if ( ShowLineVersion()==true )
 		{
 			manualPoint *mpA = _manContModel->GetManualPoint(0);
 			manualPoint *mpB = _manContModel->GetManualPoint(1);
 			_pts->GetPoint(0, ppA);
 			double dirVec[3];
-
 			// direction of the segment
             dirVec[0] = mpB->GetX() - mpA->GetX();			
             dirVec[1] = mpB->GetY() - mpA->GetY();			
             dirVec[2] = mpB->GetZ() - mpA->GetZ();			
-
-
 			// proj = mpA + k*dirVec
 			double num;
 			double den = 0.0 ;
-			num	=	dirVec[0]*( xx-mpA->GetX() );
-			num	=	num + dirVec[1]*( yy-mpA->GetY() );
-			num	=	num + dirVec[2]*( zz-mpA->GetZ() );
+			num	= dirVec[0]*( xx-mpA->GetX() );
+			num	= num + dirVec[1]*( yy-mpA->GetY() );
+			num	= num + dirVec[2]*( zz-mpA->GetZ() );
 			den=dirVec[0]*dirVec[0] + dirVec[1]*dirVec[1] + dirVec[2]*dirVec[2];
 			double k;
 			if (den!=0) 
 			{
-				k=num/den;
+				k = num/den;
 			} else {
-				k=99999999;
+				k = 99999999;
 			}
 			// projection of th point xx,yy,zz  in segment mpA,mpB
 			double projX = mpA->GetX() + k*dirVec[0];
@@ -348,14 +348,14 @@ bool manualViewContour::ifTouchContour(int x,int y,int z)
 			{ 
 				result=true;
 			} // if d1
-		} else{
+		} else {
 			unsigned int i, nps,nps_t;
 			nps	  = _sizePointsContour;
 			if (this->_manContModel->IfCloseContour()==true)
 			{
 				nps_t = nps;
 			} else {
-			nps_t = nps-1;
+				nps_t = nps-1;
 			} // if close
 			for( i = 0; i < nps_t; i++ ) 
 			{
@@ -366,13 +366,12 @@ 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]));
 				if (  ((d1+d2)>=d3) &&  ((d1+d2)<=d3*1.3) ) 
 				{
-					result=true;
-					i=nps;
+					result	= true;
+					i		= nps;
 				} // if
 			} // for i
 		} // if GetSizeLstPoints()==2
 	} // if min max
-
 	return result;
 }
 
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.h
index 64caa62..8e1c143 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.h
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.h
@@ -40,9 +40,10 @@ public:
 	virtual ~manualViewContour();
 	virtual manualViewContour * Clone();
 	void CopyAttributesTo( manualViewContour *cloneObject );
-	virtual int GetType();
+	virtual int  GetType();
 	virtual void Save(FILE *pFile);
 	virtual void Open(FILE *pFile);
+	virtual	bool ShowLineVersion();
 	virtual void RefreshContour();
 	virtual bool ifTouchContour(int x,int y, int z);
 	virtual void InitMove(int x, int y, int z);
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewLine.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewLine.cpp
index 2e892e9..031ac73 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewLine.cpp
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewLine.cpp
@@ -41,7 +41,6 @@ manualViewLine::~manualViewLine()
 {
 }
 
-
 // ----------------------------------------------------------------------------
 manualViewLine * manualViewLine :: Clone()
 {
@@ -51,7 +50,6 @@ manualViewLine * manualViewLine :: Clone()
 }
 
 // ---------------------------------------------------------------------------
-
 void manualViewLine::CopyAttributesTo( manualViewLine * cloneObject)
 {
 	// Fathers object
@@ -64,9 +62,7 @@ int manualViewLine::GetType() // virtual
 	return 6;
 }
 
-
 // ----------------------------------------------------------------------------
-
 void manualViewLine::InitMove(int x, int y, int z)  // virtual
 {
 	manualPoint *mp;
@@ -74,39 +70,31 @@ void manualViewLine::InitMove(int x, int y, int z)  // virtual
 	double YY=y;
 	double ZZ=z;
 	TransfromCoordViewWorld(XX,YY,ZZ);
-
 	if (_manContModel->GetSizeLstPoints()==2)
 	{
 		mp = _manContModel->GetManualPoint(0);
-		_dp0[0]= mp->GetX() - XX;
-		_dp0[1]= mp->GetY() - YY;
-		_dp0[2]= mp->GetZ();
-
+		_dp0[0] = mp->GetX() - XX;
+		_dp0[1] = mp->GetY() - YY;
+		_dp0[2] = mp->GetZ();
 		mp = _manContModel->GetManualPoint(1);
-		_dp1[0]= mp->GetX() - XX;
-		_dp1[1]= mp->GetY() - YY;
-		_dp1[2]= mp->GetZ();
-
-	}
+		_dp1[0] = mp->GetX() - XX;
+		_dp1[1] = mp->GetY() - YY;
+		_dp1[2] = mp->GetZ();
+	} // if
 }
 
-
 // ----------------------------------------------------------------------------
 void manualViewLine::MoveContour(int x, int y, int z) // virtual 
 {
 	manualPoint *mp;
-	double XX=x;
-	double YY=y;
-	double ZZ=z;
+	double 		XX = x;
+	double 		YY = y;
+	double 		ZZ = z;
 	TransfromCoordViewWorld(XX,YY,ZZ);
-
 	mp = _manContModel->GetManualPoint(0);
 	mp->SetPoint(_dp0[0]+XX,_dp0[1]+YY,_dp0[2]);
-
 	mp = _manContModel->GetManualPoint(1);
 	mp->SetPoint(_dp1[0]+XX,_dp1[1]+YY,_dp0[2]);
-
-
 	UpdateViewPoint(0);
 	UpdateViewPoint(1);
 }
diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewRoi.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewRoi.cpp
index a55eb55..1f868ec 100644
--- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewRoi.cpp
+++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewRoi.cpp
@@ -70,7 +70,6 @@ void manualViewRoi::RefreshContour() // virtual
 			{
 				ii=i%np;
 				mp = _manContModel->GetManualPoint(ii);
-
 	//EEDx6
 				double XX=mp->GetX(),YY=mp->GetY(),ZZ=mp->GetZ();
 	//			wxVtk2DBaseView *wxvtk2Dbasevie = (wxVtk2DBaseView*)this->GetWxVtkBaseView();
@@ -79,8 +78,7 @@ void manualViewRoi::RefreshContour() // virtual
 	//EED 27 sep 2007
 	//			_pts->SetPoint(i, XX,YY,ZZ );
 				_pts->SetPoint(i, XX*_spc[0] , YY*_spc[1] , ZZ*_spc[2] );
-			} //  rof
-
+			} //  for
 		} else {
 				_pts->SetPoint(0, 0 , 0 , 0);
 				_pts->SetPoint(1, 0 , 0 , 0);
-- 
2.49.0