From: Eduardo DAVILA Date: Fri, 6 Oct 2017 07:20:42 +0000 (+0200) Subject: #3144 creaMaracasVisu Bug New Normal - changeWx28to30 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=cec46a1f16ce39a52292b54a187af0ce2004aab5;p=creaMaracasVisu.git #3144 creaMaracasVisu Bug New Normal - changeWx28to30 --- diff --git a/lib/Kernel/VTKObjects/SurfaceRenderer/CMakeLists.txt b/lib/Kernel/VTKObjects/SurfaceRenderer/CMakeLists.txt index 6423016..9866ea1 100644 --- a/lib/Kernel/VTKObjects/SurfaceRenderer/CMakeLists.txt +++ b/lib/Kernel/VTKObjects/SurfaceRenderer/CMakeLists.txt @@ -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} diff --git a/lib/maracasVisuLib/CMakeLists.txt b/lib/maracasVisuLib/CMakeLists.txt index fe7909c..d4896a4 100644 --- a/lib/maracasVisuLib/CMakeLists.txt +++ b/lib/maracasVisuLib/CMakeLists.txt @@ -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 diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramBase.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramBase.cxx index a57426a..acdeae9 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramBase.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramBase.cxx @@ -117,7 +117,6 @@ //----------------------------------------------------------------------------- void HistogramMinMaxLevel::onBarRangeChange(wxCommandEvent& event) { - printf ("EED HistogramMinMaxLevel::onBarrangeChange\n"); Histogram* histogram = (Histogram*)GetConcretComponent(); pPlotterWindow* plotterwindow = histogram->GetPlotterWindow(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx index eb6d633..24628b6 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx @@ -49,6 +49,7 @@ //---------------------------------------------------------------------------- IMPLEMENT_CLASS(HistogramWidget, wxWindow) + //---------------------------------------------------------------------------- // Event Table //---------------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.h index e55575c..4850d13 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.h @@ -203,6 +203,7 @@ private: int type; DECLARE_CLASS(HistogramWidget); + //---------------------------------------------------------------------------- // wxWidget macro use declaration for handdling events //---------------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx index fc10c87..489d467 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.cxx @@ -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; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.h index ecff41e..1f61b51 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange.h @@ -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() }; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange2.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange2.h index cf3441d..b1450db 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange2.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mBarRange2.h @@ -38,27 +38,23 @@ #ifndef __mBarRange2_h__ #define __mBarRange2_h__ - #include #include #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() diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx index 1a8cd58..63b3cc9 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx @@ -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; + } } }