]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp
#3093 creaMaracasVisu Feature New Normal - Contour Information in pixels and image...
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / manualContour / manualViewContour.cpp
index f2aac544f42d586b04c478843ea5d26d47b744b6..bddf6aa143923215b8b1ac9036a5dd94384b355c 100644 (file)
@@ -32,7 +32,6 @@
 manualViewContour::manualViewContour()
 {
        _id_viewPoint_for_text  = 0;
-       _mesureScale                    = 1;
        _initialConoturModel    = new manualContourModel();
        
        _minX                                   = 99999;
@@ -62,8 +61,6 @@ void manualViewContour::CopyAttributesTo( manualViewContour * cloneObject)
 {
        // Call to Fathers object
        manualViewBaseContour::CopyAttributesTo(cloneObject);
-
-       cloneObject->SetMesureScale(_mesureScale);
 }
 
 // ---------------------------------------------------------------------------
@@ -181,6 +178,7 @@ void manualViewContour::RefreshContour() // virtual
 // ----------------------------------------------------------------------------
 void manualViewContour::RefreshText()  // virtual
 {
+
        if ((_textActor!=NULL) && ( _textActor->GetProperty()->GetOpacity()!=0 )){
                int size = GetNumberOfPoints();
                char text[50];
@@ -188,16 +186,20 @@ void manualViewContour::RefreshText()  // virtual
                strcpy(resultText, "000");
                char resultText2[250];
                strcpy(resultText2, "000");
+               double spcP[3];
+               spcP[0]=1;
+               spcP[1]=1;
+               spcP[2]=1;
 
 //CMRU 19-08-09 ----------------------------------
                std::string label;
                label = _manContModel->GetLabel();
 // ------------------------------------
-
+       
                if (size==2)
                {
                        strcpy(resultText,"L= ");
-                       gcvt ( _mesureScale * this->_manContModel->GetPathSize(), 5, text );
+                       gcvt ( this->_manContModel->GetPathSize( spcP ), 5, text );
                        strcat(resultText,text);
                        strcat(resultText,"p");
 
@@ -206,7 +208,7 @@ void manualViewContour::RefreshText()  // virtual
                        strcat(resultText,label.c_str());
 
                        strcpy(resultText2,"L= ");
-                       gcvt ( _mesureScale * this->_manContModel->GetPathSize(), 5, text );
+                       gcvt ( this->_manContModel->GetPathSize( _spc ), 5, text );
                        strcat(resultText2,text);
                        strcat(resultText2,"u");
 
@@ -217,34 +219,34 @@ void manualViewContour::RefreshText()  // virtual
                        if (_manContModel->IfCloseContour()==true)
                        {
                                strcpy(resultText,"P= ");
-                               gcvt ( _mesureScale * this->_manContModel->GetPathSize(), 5, text );
+                               gcvt ( this->_manContModel->GetPathSize( spcP ), 5, text );
                                strcat(resultText,text);
                                strcat(resultText,"p");
 
-                               gcvt ( _mesureScale * _mesureScale * this->_manContModel->GetPathArea(), 5, text );
+                               gcvt ( this->_manContModel->GetPathArea( spcP ), 5, text );
                                strcat(resultText,"   A= ");
                                strcat(resultText,text);
                                strcat(resultText,"p^2 ");
 
 
                                strcpy(resultText2,"P= ");
-                               gcvt ( _mesureScale * this->_manContModel->GetPathSize(), 5, text );
+                               gcvt ( this->_manContModel->GetPathSize( _spc ), 5, text );
                                strcat(resultText2,text);
                                strcat(resultText2,"u");
 
-                               gcvt ( _mesureScale * _mesureScale * this->_manContModel->GetPathArea(), 5, text );
+                               gcvt ( this->_manContModel->GetPathArea( _spc ), 5, text );
                                strcat(resultText2,"   A= ");
                                strcat(resultText2,text);
                                strcat(resultText2,"u^2 ");
 
                        } else {
                                strcpy(resultText,"L= ");
-                               gcvt (  _mesureScale * this->_manContModel->GetPathSize(), 5, text );
+                               gcvt ( this->_manContModel->GetPathSize( spcP ), 5, text );
                                strcat(resultText,text);
                                strcat(resultText,"p");
 
                                strcpy(resultText2,"L= ");
-                               gcvt (  _mesureScale * this->_manContModel->GetPathSize(), 5, text );
+                               gcvt ( this->_manContModel->GetPathSize( _spc ), 5, text );
                                strcat(resultText2,text);
                                strcat(resultText2,"u");
 
@@ -388,11 +390,6 @@ void manualViewContour::ClearPoint(int id)
        manualViewBaseContour::DeletePoint( id );
 }
 
-//-------------------------------------------------------------------
-void manualViewContour::SetMesureScale(double mesureScale)
-{
-       _mesureScale = mesureScale;
-}
 //-------------------------------------------------------------------
 void manualViewContour::InitMove(int x, int y, int z)
 {
@@ -411,14 +408,15 @@ void manualViewContour::InitMove(int x, int y, int z)
                this->_initialConoturModel->AddPoint( mp->GetX() - XX, mp->GetY() - YY, mp->GetZ() );
        }
 }
+
 //-------------------------------------------------------------------
 void manualViewContour::MoveContour(int x, int y, int z)
 {
        manualPoint *mpOrigin = NULL;
        manualPoint *mpMoving = NULL;
-       double XX=x;
-       double YY=y;
-       double ZZ=z;
+       double XX = x;
+       double YY = y;
+       double ZZ = z;
 
        TransfromCoordViewWorld(XX,YY,ZZ);
 
@@ -431,6 +429,8 @@ void manualViewContour::MoveContour(int x, int y, int z)
        }
        UpdateViewPoints();
 }
+
+//-------------------------------------------------------------------
 void manualViewContour::MoveContour(int horizontalUnits, int verticalUnits )
 {
        manualPoint *mpOrigin = NULL;