]> Creatis software - creaMaracasVisu.git/commitdiff
#3144 creaMaracasVisu Bug New Normal - changeWx28to30
authorEduardo DAVILA <davila@localhost.localdomain>
Fri, 6 Oct 2017 07:20:42 +0000 (09:20 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Fri, 6 Oct 2017 07:20:42 +0000 (09:20 +0200)
lib/Kernel/VTKObjects/SurfaceRenderer/CMakeLists.txt
lib/maracasVisuLib/CMakeLists.txt
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramBase.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange2.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx

index 642301603acc0aa52f9f6baea6d265db23a4b671..9866ea17098d481d9a663a7dfd2646275f5d3ab7 100644 (file)
@@ -108,7 +108,7 @@ IF ( BUILD_${LIBRARY_NAME} )
       ${WXWIDGETS_LIBRARIES}
   #    ${KWWidgets_LIBRARIES}
       ${VTK_LIBRARIES}
-      creaMaracasVisu
+##EED-creaMaracasVisu-SHARED      creaMaracasVisu
       #${ITK_LIBRARIES}
   #    ${GDCM_LIBRARIES}
   #    ${BOOST_LIBRARIES}
index fe7909c9be782b8c27157cc3140f8bd140843fbc..d4896a4fce372c711f44b5d0a99de1ca535b2b8d 100644 (file)
@@ -164,11 +164,13 @@ IF ( BUILD_${LIBRARY_NAME} )
                #creaMaracasVisu_CutModule_interface
 
 
-             BaseVolumeRenderer
-             BaseSurfaceRenderer
-             KernelVolumeRenderer
-             KernelViewerWidgets
-             KernelSurfaceRenderer
+            BaseVolumeRenderer
+            BaseSurfaceRenderer
+            KernelVolumeRenderer
+            KernelViewerWidgets
+            KernelSurfaceRenderer
+                       GUIWxSurfaceRenderer
+                       GUIWxVolumeRenderer
 
 #EED CM
             #KernelVolumeRenderer
@@ -199,6 +201,9 @@ IF ( BUILD_${LIBRARY_NAME} )
 
 
   # CREATE THE TARGET
+set (${LIBRARY_NAME}_SHARED SHARED)
+message(EED mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm  "${${LIBRARY_NAME}_SHARED}" )
+message(EED mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm  ${LIBRARY_NAME} )
   ADD_LIBRARY (${LIBRARY_NAME} ${${LIBRARY_NAME}_SHARED} ${${LIBRARY_NAME}_SOURCES} ${${LIBRARY_NAME}_HEADERS})
 
   # LINK
index a57426a12cbc3f01e780887858dfa2feb91302b5..acdeae952af351ee731266151eec9187c49d959c 100644 (file)
 //-----------------------------------------------------------------------------
 void HistogramMinMaxLevel::onBarRangeChange(wxCommandEvent& event)
 {
-       printf ("EED HistogramMinMaxLevel::onBarrangeChange\n");
        Histogram*                      histogram               = (Histogram*)GetConcretComponent();
        pPlotterWindow*         plotterwindow   = histogram->GetPlotterWindow();        
 
index eb6d6333cde0e8af09cfef6ef48d58f81d539ffe..24628b6ae9b43032f0b3667dcd34ce05eda1d1c1 100644 (file)
@@ -49,6 +49,7 @@
 //----------------------------------------------------------------------------
 
 IMPLEMENT_CLASS(HistogramWidget, wxWindow)
+
 //----------------------------------------------------------------------------
 // Event Table
 //----------------------------------------------------------------------------
index e55575c2bfab2f6f11d6b6827c78f49fbe2c2d6a..4850d1322dcc64f1b66a7a396159ffb125c67d60 100644 (file)
@@ -203,6 +203,7 @@ private:
         int type;      
         
         DECLARE_CLASS(HistogramWidget);
+
         //----------------------------------------------------------------------------
        // wxWidget macro use declaration for handdling events
        //----------------------------------------------------------------------------
index fc10c87e1f46234dae366cb8fb8549c6b803659a..489d46740378b397f99be174e0b14a589daaa084 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "mBarRange.h"
 
-
 //const wxEventType wxEVT_TSBAR = wxNewEventType();
 
 DEFINE_EVENT_TYPE(wxEVT_TSBAR)
@@ -39,13 +38,12 @@ DEFINE_EVENT_TYPE(wxEVT_TSBAR_END)
 DEFINE_EVENT_TYPE(wxEVT_TSBAR_MOVED)
 DEFINE_EVENT_TYPE(wxEVT_SELECTION_END)
 
-
-
 //----------------------------------------------------------------------------
 //EVENT TABLE
 //----------------------------------------------------------------------------
 
 IMPLEMENT_CLASS(mBarRange, wxScrolledWindow)
+
 BEGIN_EVENT_TABLE(mBarRange, wxScrolledWindow)
        EVT_PAINT (mBarRange::OnPaint)
        EVT_SIZE  (mBarRange::OnSize)
@@ -79,8 +77,6 @@ mBarRange::mBarRange(wxWindow *parent, int w, int h)
        SetHeight(h);
        _initialPoint           = 0;
        trianglesHalfWidth      = 5;
-       
-
        // Setting the default parts colors
        start_Colour            =       wxColour(1,0,255,254);
        actual_Colour           =       wxColour(255,255,202);
@@ -88,7 +84,6 @@ mBarRange::mBarRange(wxWindow *parent, int w, int h)
        bar_Colour                      =       wxColour(255,0,255);
        backgroundColor     =   parent ->GetBackgroundColour();
        guideLineColor          =   wxColour(255,0,0);
-
        //actual is in _start and end
        //false means that it could be anywhere
        _moveActualWithBar      =       false;
@@ -96,16 +91,13 @@ mBarRange::mBarRange(wxWindow *parent, int w, int h)
        _selectionMoveId        =       -1;
        realX_vertical_line =   -1;
        activeState                     =       false;
-       _actual=0;
-       deviceEndMargin = 0;
-
+       _actual                         =       0;
+       deviceEndMargin         =       0;
        SetOrientation(true);
        setIfWithActualDrawed(true);
-
        b_popmenu.Append (cntID_CHANGE_COLOR, _("Change Color"), _("Changes the color of the selected part"));
        b_popmenu.Append (cntID_ENABLE_ACTUAL, _("Enable actual in range"), _("Enables/Disables the actual triangle to be or not in range"));
        b_popmenu.Append (cntID_MOVABLE_ACTUAL_BAR, _("Move actual-bar simultaneously"), _("Disables the actual triangle to move with the bar"));
-
        SetSize(w,h);
 }
 
@@ -116,6 +108,7 @@ mBarRange::mBarRange(wxWindow *parent, int w, int h)
 mBarRange::~mBarRange()
 {
 }
+
 //---------------------------------------------------------------------------
 //Draw bar: vertical or Horizontal
 //---------------------------------------------------------------------------
@@ -184,6 +177,7 @@ int mBarRange::GetPixelStart()
 {
        return ((_start - _min)*(_w-deviceEndMargin))/(_max - _min);    
 }
+
 //----------------------------------------------------------------------------
 // param i: value in pixels
 //----------------------------------------------------------------------------
@@ -192,6 +186,7 @@ void mBarRange::SetPixelStart(int i)
        _start = _min+((i - deviceStart_x)*( _max - _min))/(_w-deviceEndMargin);
        
 }
+
 //----------------------------------------------------------------------------
 // _actual of the pixel rectangle
 //----------------------------------------------------------------------------
@@ -199,6 +194,7 @@ int mBarRange::GetPixelActual()
 {
        return ((_actual - _min)*(_w-deviceEndMargin))/(_max - _min);
 }
+
 //----------------------------------------------------------------------------
 // param i: value in pixels
 //----------------------------------------------------------------------------
@@ -206,6 +202,7 @@ void mBarRange::SetPixelActual(int i)
 {
        _actual = _min + (i-deviceStart_x)*(_max-_min)/(_w-deviceEndMargin);
 }
+
 //----------------------------------------------------------------------------
 // _end of the pixel rectangle
 //----------------------------------------------------------------------------
@@ -213,6 +210,7 @@ int mBarRange::GetPixelEnd()
 {
        return ((_end - _min)*(_w-deviceEndMargin))/(_max - _min);
 }
+
 //----------------------------------------------------------------------------
 // param i: value in pixels to be converted to real logical value
 //----------------------------------------------------------------------------
@@ -220,10 +218,10 @@ void mBarRange::SetPixelEnd(int i)
 {
        _end = _min + (i-deviceStart_x)*(_max-_min)/(_w-deviceEndMargin);
 }
+
 //----------------------------------------------------------------------------
 // Logical max of the triangle
 //----------------------------------------------------------------------------
-
 double mBarRange::GetMax()
 {
        return _max;
index ecff41e1578394b6e1fbe935d798651ee06cbead..1f61b51259340f20dfd73b5ff23bd4e50bc2d089 100644 (file)
@@ -470,7 +470,10 @@ private:
        wxBitmap        *_bitmap_bar;
        //the info bitmap device 
        wxBitmap        *_bitmap_info;
+
+
        DECLARE_CLASS(BarRange)
+
        // any class wishing to process wxWindows events must use this macro
        DECLARE_EVENT_TABLE()
 };
index cf3441d4938dab199cd5fb8ada9e3889ccfd4de0..b1450dbcd9487ddeb470675a43e7258ed39edc44 100644 (file)
 #ifndef __mBarRange2_h__
 #define __mBarRange2_h__
 
-
 #include <wx/wx.h>
 #include <wx/textctrl.h>
 #include "mBarRange.h"
 
-
 BEGIN_DECLARE_EVENT_TYPES()
        DECLARE_EVENT_TYPE(wxEVT_BarRange2_Change,-1) 
 END_DECLARE_EVENT_TYPES()
 
-
-
        class mBarRange2
                : public wxPanel
                {
                public:
                        mBarRange2(wxWindow * parent,int width, int height);            
                        ~mBarRange2();
-                       void            onTxtCtrl(wxCommandEvent& event);
-                       void            SetMinMaxValue(double,double);
-                       void            SetScalarType(int);
+                       void    onTxtCtrl(wxCommandEvent& event);
+                       void    SetMinMaxValue(double,double);
+                       void    SetScalarType(int);
                        double  GetStartValue();
                        double  GetEndValue();
                private:
@@ -71,7 +67,7 @@ END_DECLARE_EVENT_TYPES()
                        wxTextCtrl                      *_textctrlStart;
                        wxTextCtrl                      *_textctrlEnd;
                        void            onBarRangeChange(wxCommandEvent& event);
-                       wxString CleanNumberStr(wxString string);       
+                       wxString        CleanNumberStr(wxString string);        
                        void            RefreshTextCntrl();
                        void            createAndSendEvent(WXTYPE theEventType);
                        DECLARE_EVENT_TABLE()
index 1a8cd58d65d4b66a55b8ec4d7037a49ae5263cec..63b3cc9ed2a27dfb796d24b2c8a75c8e0166684a 100644 (file)
@@ -61,7 +61,7 @@ pGraphicalFunction:: pGraphicalFunction(wxString name, int flags)
        editable                        = true;
        ifActual                        = false;
        zoomIn                          = false;
-       setOffsetX(0) ;
+       setOffsetX(0);
        setOffsetY(0);
        initialDrawingPoint     = NULL;
        finalDrawingPoint       = NULL;
@@ -108,7 +108,6 @@ void pGraphicalFunction::setUp()
        setEndX(logicFunction->getEndX());
        setStartY(logicFunction->getStartY());
        setEndY(logicFunction->getEndY());
-       
 }
 
 /*
@@ -146,8 +145,6 @@ void pGraphicalFunction::setScales()
        //int dy= logicFunction->getMaxY()-logicFunction->getMinY();
        int dx= maxShowedX-minShowedX;
        int dy= maxShowedY-minShowedY;
-       
-       
        if(dx!=0 && dy!=0)
        {
                double scaleX=(((float)(screenX-100))/dx)*factorZoom;
@@ -156,8 +153,7 @@ void pGraphicalFunction::setScales()
                setScaleY(scaleY);
                logicFunction->setScaleX(scaleX);
                logicFunction->setScaleY(scaleY);
-
-       }
+       }// if dx dy
 }
 /*
 * Includes a point between two existing points of this function. The new point (x,y) was not defined when the function was created.
@@ -166,10 +162,10 @@ void pGraphicalFunction::setScales()
 bool pGraphicalFunction:: AddNewPoint(int x,int y)
 {
        bool added= logicFunction -> AddNewPoint ( x, y );
-       if(!fromWindow)
-        setUp();
-       else
+       if(!fromWindow) 
        {
+        setUp();
+       } else {
                logicFunction->setEndPoints();
                logicFunction->setStartPoints();
        }
@@ -188,10 +184,10 @@ bool pGraphicalFunction::AddPoint(int aX, int aY,bool order)
        bool added=false;
        if (logicFunction!=NULL){
                added=logicFunction -> AddPoint( aX, aY,order );
-               if(!fromWindow)
-                       setUp();
-               else
+               if(!fromWindow) 
                {
+                       setUp();
+               } else {
                        logicFunction->setEndPoints();
                        logicFunction->setStartPoints();
                } // if fromWindow
@@ -208,9 +204,9 @@ bool pGraphicalFunction::DeletePoint(int aX, int aY)
 {
        bool added= logicFunction -> DeletePoint( aX, aY );     
        if(!fromWindow)
-        setUp();
-       else
        {
+        setUp();
+       } else {
                logicFunction->setEndPoints();
                logicFunction->setStartPoints();
        }
@@ -240,10 +236,10 @@ bool pGraphicalFunction::deletePointAt(int index)
 bool pGraphicalFunction::changePoint(wxPoint newCoords, int movingIndexPoint) 
 {
        bool added= (logicFunction -> changePoint( newCoords, movingIndexPoint ));
-       if(!fromWindow)
-        setUp();
-       else
+       if(!fromWindow) 
        {
+               setUp();
+       } else {
                logicFunction->setEndPoints();
                logicFunction->setStartPoints();
        }
@@ -291,15 +287,14 @@ bool pGraphicalFunction:: isInFunction(int x, int y)
        pFunctionPoint* point= new pFunctionPoint(x,y);
        bool inLine;
        before=getBefore(point);
-
        if(before && before->GetNext())
        {
                next = before->GetNext();
                //next = (before->GetNext())->GetNext();
                inLine= isInLine((pFunctionPoint*)before->GetData(),(pFunctionPoint*)next->GetData(),point);
-       }
-       else 
+       } else { 
                inLine=false;
+       }
        return inLine;
 }
 /*
@@ -344,7 +339,6 @@ bool pGraphicalFunction::isInLine(pFunctionPoint* before,pFunctionPoint* next, p
        x=(float)point->getRealX();
        y=(float)point->getRealY();
 
-       
        float d1= (float)sqrt(pow(float(x1-x),2)+ pow(float(y1-y),2));
        float d2= (float)sqrt(pow(float(x2-x),2)+ pow(float(y2-y),2));
        float d=(float)sqrt(pow(float(x2-x1),2)+ pow(float(y2-y1),2));
@@ -467,17 +461,17 @@ void pGraphicalFunction::zooming(int clickedX,int clickedY,int width)
 {
        int xS,yS,x1,x2,y1,y2;
        setScales();
-       xS=clickedX/_scaleX+_offsetX;
-       yS=clickedY/_scaleY+_offsetY;
+       xS = clickedX/_scaleX+_offsetX;
+       yS = clickedY/_scaleY+_offsetY;
        //square
-       x1=(clickedX-width)/_scaleX+_offsetX;
-       x2=(clickedX+width)/_scaleX+_offsetX;
-       y1=(clickedY-width)/_scaleY+_offsetY;
-       y2=(clickedY+width)/_scaleY+_offsetY;
-
-       int numberPoints=getSizePoints();
-       pFunctionPoint* point;
-       wxNode* p;
+       x1 = (clickedX-width)/_scaleX+_offsetX;
+       x2 = (clickedX+width)/_scaleX+_offsetX;
+       y1 = (clickedY-width)/_scaleY+_offsetY;
+       y2 = (clickedY+width)/_scaleY+_offsetY;
+
+       int numberPoints = getSizePoints();
+       pFunctionPoint* point;
+       wxNode*                 p;
        bool inSquare=false,first=false;
        
        //if the user made a zoom
@@ -503,22 +497,20 @@ void pGraphicalFunction::zooming(int clickedX,int clickedY,int width)
                                finalDrawingPoint=point;
                        }
                }
-       }       
-       else
-       {
+       } else {
                //We extend the range of vision in x and y,20 and 10 respectively
                if((_offsetX-20)>=0)
                {
                        _offsetX=_offsetX-20;
-               }
-               else
+               } else {
                        _offsetX=0;
+               }
                if((_offsetY-10)>=0)
                {
                        _offsetY=_offsetY-10;
-               }
-               else
+               } else {
                        _offsetY=0;
+               }
        }
 }