// 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 );
idHistogram=-1;
+//EED Borrame 07Mai2009
//drawing
- drawHistogram();
+// drawHistogram();
}
delete plotter;
}
+
+ void Histogram::Configure(vtkImageData* imageData)
+ {
+ histogram= new pHistogram(imageData);
+ drawHistogram();
+ }
+
/*
Draw the histogram in the plotter
*/
//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();
*/
int getHistogramPoint(int gValue);
int getHistogramSize();
-
+ void Configure(vtkImageData* imageData);
private:
{
int cx, cy;
GetClientSize( &cx, &cy);
-
+
double d;
d = m_maxX - m_minX;
if (d!=0)
{
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;
//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);
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
*/
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 );
}
else
return setted;
+ return setted;
}
/**
int offsetpx=getOffsetPixelsXv();
int offsetpy=getOffsetPixelsYv();
//traslation
- int xTraslation=getXTraslation();
+// int xTraslation=getXTraslation(); //EED
/*wxPen mypen(*wxBLACK, 5, wxSOLID);
dc.SetPen(mypen);*/
/***********/
getMinShowed(minX,minY);
/***********/
//traslation
- int xTraslation=getXTraslation();
+// int xTraslation=getXTraslation(); //EED
if(node)
{
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
{
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 )
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);
//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);
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