#include <algorithm>
+#ifdef _MSC_VER
+#include <cfloat>
+#define isfinite _finite
+#endif
+
+#ifdef __GNUC__
+#include <cmath>
+#endif
+
#include "VisioGraphic.h"
#include "gvcjob.h"
namespace Visio
{
+ using namespace std;
+
static const float INCHES_PER_POINT = 1.0 / 72.0;
Fill::Fill(unsigned char red, unsigned char green, unsigned char blue, double transparency):
{
double xscale = 1.0 / (last.x - first.x);
double yscale = 1.0 / (last.y - first.y);
- if (isinf(xscale))
+ if (isfinite(xscale) == 0)
xscale = 0.0;
- if (isinf(yscale))
+ if (isfinite(yscale) == 0)
yscale = 0.0;
gvputs(job, "<MoveTo>");
gvprintf(job, "<Y F='Height*%f'/>", (_points[_pointCount - 1].y - first.y) * yscale);
/* Knot[P-1] */
- gvprintf(job, "<A>%d</A>", std::max(_pointCount - 4, 0));
+ gvprintf(job, "<A>%d</A>", max(_pointCount - 4, 0));
/* Ctl[P-1].Weight */
gvputs(job, "<B>1</B>");
gvputs(job, "<D>1</D>");
/* Knot[P], Degree, XType, YType */
- gvprintf(job, "<E F='NURBS(%d, 3, 0, 0", std::max(_pointCount - 3, 0));
+ gvprintf(job, "<E F='NURBS(%d, 3, 0, 0", max(_pointCount - 3, 0));
for (int i = 1; i < _pointCount; ++i)
/* Ctl[i].X, Ctl[i].Y, Knot[i], Ctl[i].Weight */
gvprintf(job, ", %f, %f, %d, 1",
(_points[i].x - first.x) * xscale,
(_points[i].y - first.y) * yscale,
- std::max(i - 3, 0));
+ max(i - 3, 0));
gvputs(job, ")'/>");
gvputs(job, "</NURBSTo>\n");
/* compute scale. if infinite, scale by 0 instead */
double xscale = 1.0 / (last.x - first.x);
double yscale = 1.0 / (last.y - first.y);
- if (isinf(xscale))
+ if (isfinite(xscale) == 0)
xscale = 0.0;
- if (isinf(yscale))
+ if (isfinite(yscale) == 0)
yscale = 0.0;
gvputs(job, "<MoveTo>");
/* compute scale. if infinite, scale by 0 instead */
double xscale = 1.0 / (last.x - first.x);
double yscale = 1.0 / (last.y - first.y);
- if (isinf(xscale))
+ if (isfinite(xscale) == 0)
xscale = 0.0;
- if (isinf(yscale))
+ if (isfinite(yscale) == 0)
yscale = 0.0;
gvputs(job, "<MoveTo>");
* AT&T Research, Florham Park NJ *
**********************************************************/
+#ifdef _MSC_VER
+#include <cfloat>
+#define isfinite _finite
+#endif
+
+#ifdef __GNUC__
+#include <cmath>
+#endif
+
#include "VisioRender.h"
#include "const.h"
namespace Visio
{
+ using namespace std;
+
static const float INCHES_PER_POINT = 1.0 / 72.0;
static const float ZERO_ADJUST = 0.125;
/* compute scale. if infinite, scale by 0 instead */
double xscale = 1.0 / (outerBounds.UR.x - outerBounds.LL.x);
double yscale = 1.0 / (outerBounds.UR.y - outerBounds.LL.y);
- if (isinf(xscale))
+ if (isfinite(xscale) == 0)
xscale = 0.0;
- if (isinf(yscale))
+ if (isfinite(yscale) == 0)
yscale = 0.0;
gvprintf(job, "<Shape ID='%d' Type='Shape'>\n", ++_shapeId);