+/*# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# The fact that you are presently reading this means that you have had
+# knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------ */
+
//----------------------------------------------------------------------------
// Class definition include
//----------------------------------------------------------------------------
{
SetName(name);
m_flags = flags;
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
points.DeleteContents(TRUE);
- offsetX=0;
- offsetY=0;
+#else
+ // ...
+#endif
+ offsetX = 0;
+ offsetY = 0;
}
/*
*/
void pPlotterLayer::drawFunction(wxDC & dc,mpWindow & w, int orgy)
{
-
-
int scrwX,scrwY,offsetpx,offsetpy,maxX,minX,maxY,minY;
- wxPoint* ppoints=NULL;
+ wxPoint* ppoints = NULL;
/*
This is the offset of every point scale to the window
pixel
*/
- offsetpx=getOffsetPixelsXv();
- offsetpy=getOffsetPixelsYv();
-
+ offsetpx = getOffsetPixelsXv();
+ offsetpy = getOffsetPixelsYv();
Rewind();
-
dc.GetSize(&scrwX, &scrwY);
-
//Lines between the points
-
int sizedc = dc.GetSize().GetHeight()-orgy;
-
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
GetPoints(points);
-
+#else
+ //...
+#endif
// type of plotter
int type=getmType();
/***********/
//traslation
//int xTraslation=getXTraslation(); //JPRx
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
wxNode* node= points.GetFirst();
+#else
+ wxNode* node= GetPointsPtr()->GetFirst();
+#endif
// int i=1;//points.GetCount()+1; //JPRx
int j=2;
/*
/*
Fill the function if it represented an histogram
*/
- ppoints=(wxPoint*)malloc(sizeof(int)*2*(points.GetCount()+2));
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ ppoints = (wxPoint*)malloc(sizeof(int)*2*(points.GetCount()+2));
+#else
+ ppoints = (wxPoint*)malloc(sizeof(int)*2*(GetPointsPtr()->GetCount()+2));
+#endif
//initialize points
- point.x=-5000;
- point.y=GetYTranslated(sizedc,-5000);
- ppoints[0]=point;
- ppoints[1]=point;
-
+ point.x = -5000;
+ point.y = GetYTranslated(sizedc,-5000);
+ ppoints[0] = point;
+ ppoints[1] = point;
}
-
while (node!=NULL && node->GetNext()!=NULL)
{
pFunctionPoint* pointi=(pFunctionPoint*)node->GetData();
int pyi=(pointi->getRealY()-minY)-offsetY;
int pxj=(pointj->getRealX()-minX)-offsetX;
int pyj=(pointj->getRealY()-minY)-offsetY;
-
-
int cxi=pxi* scaleX + offsetpx; //+ xTraslation;
int cxj=pxj* scaleX + offsetpx; //+ xTraslation;
int cyi=pyi* scaleY+ offsetpy ;
int cyj=pyj* scaleY+ offsetpy ;
//dc.DrawLine(pxi* scaleX + offsetpx,pyi* scaleY+ offsetpy, pxj* scaleX + offsetpx,pyj* scaleY+ offsetpy );
if(type!=2)
+ {
draw(dc,w,pxi* scaleX + offsetpx,pyi* scaleY+ offsetpy, pxj* scaleX + offsetpx,pyj* scaleY+ offsetpy,orgy );
//dc.DrawLine(pxi* scaleX + offsetpx,pyi* scaleY+ offsetpy, pxj* scaleX + offsetpx,pyj* scaleY+ offsetpy );
- else if(type==2)
- {
+ } else if(type==2) {
if(!initializePolygon(ppoints,cxi,cyi,cxj,cyj) && ((cxi<=0 && cxj>=0)||(cxi>=0 && cxj>=0)))
{
point.x=cxj;
ppoints[j]=point;
j++;
- }
- }
-
+ } // if
+ } // if type
node=node->GetNext();
-
}
if(type==2)
{
dc.SetPen(wxPen( wxColour(0,0,0) ,1,wxSOLID ));
//dc.DrawPolygon(vx.size()+2,ppoints,0,0);
dc.DrawPolygon(j+2,ppoints,0,0);
-
- }
-
+ } // if type
}
/**
getDirection(direction);
getSize(sizeP);
//Lines betwen the points
- GetPoints(points);
- wxNode *node=points.GetLast();
- wxNode *node1=points.GetFirst();
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ GetPoints(points);
+ wxNode *node = points.GetLast();
+ wxNode *node1 = points.GetFirst();
+#else
+ wxNode *node = GetPointsPtr()->GetLast();
+ wxNode *node1 = GetPointsPtr()->GetFirst();
+#endif
/*
GetYTranslated(sizedc,(realY_guide/*-w.getMinScrY()*/-offsetX)*scaleX + offsetpx),
scrwX,
GetYTranslated(sizedc,(realY_guide/*-w.getMinScrY()*/-offsetX)*scaleX + offsetpx));
- }
- }
-
+ } // if realY_guide
+ } // if actual
}