]> Creatis software - creaMaracasVisu.git/commitdiff
BUG MacOs
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 14 May 2009 11:42:06 +0000 (11:42 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 14 May 2009 11:42:06 +0000 (11:42 +0000)
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/Histogram.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/mathplot.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pGraphicalFunction.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterLayer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleX.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterScaleY.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotterWindow.cxx

index 5e56df749aa00e14124ef295a266f22c39059870..c84931f0c2038f46765ac2d0c7861de2030805c8 100644 (file)
@@ -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
        */
index 576da9987ff9dce2840da6f4db37b4bce6acaed0..c51f0e50229a939cd5bce6c47d8760e006b75e19 100644 (file)
@@ -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:
        
index 7661beec1da8001dac586234fb9a2cf3158fff7c..4b37ef916bcf6c4722029202a8758f120a407f1a 100644 (file)
@@ -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
index 0eed1ed66fa2c6317cfc4e3f626cac72e757a2fe..a425cb98722d34aacba2500264ab11a76f0c2b84 100644 (file)
@@ -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 );
index 7767471ff509969fb338dcf2acf87bde04087580..37c7ba27e888de661a642d41591f83af455fd833 100644 (file)
@@ -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 )
index 9543da64e0621798f775e0154bfb5f5c37494876..28ce942f508b5d6aff296d4b6207c2737081553c 100644 (file)
@@ -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);
index 96cf2cfb509beb794b8d9e23d86a4f47794cdf59..18d585ecbd1a990676b7b23595e8794bc56e012b 100644 (file)
@@ -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);
 
index 5bc7148d3787f1fbfb7a3121b5a88df72be23723..76ffc6a7b13b891006e46d79afb5273d8901358a 100644 (file)
@@ -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