From 8b75d0d7ee7c2aed68f1663282127c8e9932e705 Mon Sep 17 00:00:00 2001 From: Eduardo Davila Date: Thu, 14 May 2009 11:42:06 +0000 Subject: [PATCH] BUG MacOs --- .../wxWindows/widgets/pPlotter/Histogram.cxx | 17 ++++++++++++++--- .../wxWindows/widgets/pPlotter/Histogram.h | 6 ++++-- .../wxWindows/widgets/pPlotter/mathplot.cxx | 15 ++++++++++++--- .../widgets/pPlotter/pGraphicalFunction.cxx | 1 - .../widgets/pPlotter/pPlotterLayer.cxx | 19 ++++++++++++++----- .../widgets/pPlotter/pPlotterScaleX.cxx | 13 ++++++++++--- .../widgets/pPlotter/pPlotterScaleY.cxx | 13 ++++++++++--- .../widgets/pPlotter/pPlotterWindow.cxx | 1 + 8 files changed, 65 insertions(+), 20 deletions(-) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.cxx index 5e56df7..c84931f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.cxx @@ -33,12 +33,15 @@ END_EVENT_TABLE() // Constructor //---------------------- - Histogram::Histogram( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int flag,vtkImageData* imageData): +//EED Borrame 07Mai2009 +//Histogram::Histogram( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int flag,vtkImageData* imageData): + Histogram::Histogram( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int flag): wxPanel(parent,id,pos,size,flag) { SetBackgroundColour(wxColour(255,255,255)); //histogram - histogram= new pHistogram(imageData); +//EED Borrame 07Mai2009 +// histogram= new pHistogram(imageData); //plotter plotter=new pPlotterWindow(this, -1, wxPoint(0,0), wxSize(742,476), wxSUNKEN_BORDER ); @@ -53,8 +56,9 @@ END_EVENT_TABLE() idHistogram=-1; +//EED Borrame 07Mai2009 //drawing - drawHistogram(); +// drawHistogram(); } @@ -65,6 +69,13 @@ END_EVENT_TABLE() delete plotter; } + + void Histogram::Configure(vtkImageData* imageData) + { + histogram= new pHistogram(imageData); + drawHistogram(); + } + /* Draw the histogram in the plotter */ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.h index 576da99..c51f0e5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.h @@ -38,7 +38,9 @@ public: //HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int flag ); - Histogram( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int flag,vtkImageData* imageData); +//EED Borrame 07Mai2009 +// Histogram( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int flag,vtkImageData* imageData); + Histogram( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int flag); ~Histogram(); @@ -60,7 +62,7 @@ public: */ int getHistogramPoint(int gValue); int getHistogramSize(); - + void Configure(vtkImageData* imageData); private: diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.cxx index 7661bee..4b37ef9 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.cxx @@ -440,7 +440,7 @@ void mpWindow::Fit() { int cx, cy; GetClientSize( &cx, &cy); - + double d; d = m_maxX - m_minX; if (d!=0) @@ -562,6 +562,7 @@ void mpWindow::OnPaint( wxPaintEvent &event ) { wxPaintDC dc(this); dc.GetSize(&m_scrX, &m_scrY); +printf("EED mpWindow::OnPaint %d %d\n",m_scrX,m_scrY); //m_scrX=200; //m_scrY=200; @@ -589,7 +590,14 @@ void mpWindow::OnPaint( wxPaintEvent &event ) //dc.SetDeviceOrigin(70,40); //dc.SetAxisOrientation(false,true); temp_dc.SetAxisOrientation(true,false); - dc.Blit(0,0, m_scrX, m_scrY, &temp_dc,-70,-m_scrY+40); + + //EED 14mai2009 + //dc.Blit(0,0, m_scrX, m_scrY, &temp_dc,-70,-m_scrY+40); + + temp_dc.SetDeviceOrigin(0,0); + dc.Blit(0,0, m_scrX, m_scrY, &temp_dc,0,0); + + delete _bitmap_functions; //_bitmap_functions //dc.SetAxisOrientation(false,true); @@ -688,12 +696,13 @@ bool mpWindow::UpdateBBox() return first == FALSE; } -void mpWindow :: UpdateAll() +void mpWindow::UpdateAll() { if (UpdateBBox()) { int cx, cy; GetClientSize( &cx, &cy); +printf("EED mpWindow::UpdateAll %d %d\n",cx,cy); //const int sx = (int)((m_maxX - m_minX) * GetScaleX()); // JPRx //const int sy = (int)((m_maxY - m_minY) * GetScaleY()); // JPRx diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx index 0eed1ed..a425cb9 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx @@ -159,7 +159,6 @@ bool pGraphicalFunction:: AddNewPoint(int x,int y) */ bool pGraphicalFunction::AddPoint(int aX, int aY,bool order) { - printf("EED %p pGraphicalFunction::AddPoint %p (%d %d) \n", this, logicFunction, aX, aY); bool added=false; if (logicFunction!=NULL){ added=logicFunction -> AddPoint( aX, aY,order ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterLayer.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterLayer.cxx index 7767471..37c7ba2 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterLayer.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterLayer.cxx @@ -276,6 +276,7 @@ bool pPlotterLayer::initializePolygon(wxPoint* points,double x1, double y1,doubl } else return setted; + return setted; } /** @@ -416,7 +417,7 @@ void pPlotterLayer::drawPoints(wxDC & dc,mpWindow & w) int offsetpx=getOffsetPixelsXv(); int offsetpy=getOffsetPixelsYv(); //traslation - int xTraslation=getXTraslation(); +// int xTraslation=getXTraslation(); //EED /*wxPen mypen(*wxBLACK, 5, wxSOLID); dc.SetPen(mypen);*/ /***********/ @@ -477,7 +478,7 @@ void pPlotterLayer::drawLineToMousePoint(wxDC & dc,mpWindow & w) getMinShowed(minX,minY); /***********/ //traslation - int xTraslation=getXTraslation(); +// int xTraslation=getXTraslation(); //EED if(node) { @@ -567,10 +568,18 @@ void pPlotterLayer::Plot(wxDC & dc, mpWindow & w) Managing the drawing */ int orgx=70; - int orgy=w.GetScrY()-40; + + +//EED 14Mai2009 +// int orgy=w.GetScrY()-40; +// dc.SetDeviceOrigin( orgx ,orgy); +// dc.SetAxisOrientation(true,true); + + int orgy = 40; dc.SetDeviceOrigin( orgx ,orgy); - dc.SetAxisOrientation(true,true); + dc.SetAxisOrientation(true,false); + //if the user dont want to see the points of the function and if he stops drawing //we have to draw the function @@ -607,7 +616,7 @@ void pPlotterLayer::Plot(wxDC & dc, mpWindow & w) { dc.SetPen(wxPen( wxColour(255,0,0),1,wxDOT )); int offsetpx = getOffsetPixelsXv(); - int offsetpy = getOffsetPixelsYv(); +// int offsetpy = getOffsetPixelsYv(); //EED int realX_guide = w.getRealGuideX(); if( realX_guide!=-1 ) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleX.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleX.cxx index 9543da6..28ce942 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleX.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleX.cxx @@ -50,11 +50,18 @@ void pPlotterScaleX::Plot(wxDC& dc, mpWindow& w) int offsetX=w.getOffsetX(); //setting origins - const int orgy = w.GetScrY()-40; + + //EED 14Mai2009 + //const int orgy = w.GetScrY()-40; +// dc.SetDeviceOrigin(70,orgy); +// dc.SetAxisOrientation(true,true); //EED MacOx ??? + + const int orgy = 40; + dc.SetDeviceOrigin(70,orgy); + dc.SetAxisOrientation(true,false); + //const int extend = w.GetScrX()-100; //JPRx - dc.SetDeviceOrigin(70,orgy); - dc.SetAxisOrientation(true,true); //draw the axe dc.DrawLine(0,0,(max-min)*scaleX,0); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleY.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleY.cxx index 96cf2cf..18d585e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleY.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleY.cxx @@ -51,11 +51,18 @@ void pPlotterScaleY::Plot(wxDC& dc, mpWindow& w) //setting origins - const int orgy = w.GetScrY()-40; - const int extend = w.GetScrY()-50; + +//EED 14Mai2009 +// const int orgy = w.GetScrY()-40; +// dc.SetDeviceOrigin(70,orgy); +// dc.SetAxisOrientation(true,true); //EED MacOx ??? + + const int orgy = 40; dc.SetDeviceOrigin(70,orgy); - dc.SetAxisOrientation(true,true); + dc.SetAxisOrientation(true,false); + // const int extend = w.GetScrY()-50; //EED + //draw the axe dc.DrawLine( 0,0, 0, (max-min)*scaleY); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx index 5bc7148..76ffc6a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx @@ -200,6 +200,7 @@ wxPoint pPlotterWindow:: getRealPoint(wxPoint pixelPoint) void pPlotterWindow::setActualScales() { // int maxX,maxY,minX,minY; // JPRx + int maxX,maxY;//,minX,minY; // JPRx //EED /* if the function is drawed interactively the maxX and the maxY in actual are sets by the user -- 2.46.2