adding missing file

svg-export
Don Bright 2014-01-31 06:41:57 -06:00
parent 88ff8ee6d4
commit 54742747ad
2 changed files with 74 additions and 2 deletions

View File

@ -0,0 +1,66 @@
/*
Create an NULL OpenGL context that doesnt actually use any OpenGL code,
and can be compiled on a system without OpenGL.
*/
#include <vector>
#include "OffscreenContext.h"
#include "printutils.h"
#include "imageutils.h"
#include <map>
#include <string>
#include <sstream>
using namespace std;
struct OffscreenContext
{
int width;
int height;
};
void offscreen_context_init(OffscreenContext &ctx, int width, int height)
{
ctx.width = width;
ctx.height = height;
}
string offscreen_context_getinfo(OffscreenContext *ctx)
{
return string("NULLGL");
}
OffscreenContext *create_offscreen_context(int w, int h)
{
OffscreenContext *ctx = new OffscreenContext;
offscreen_context_init( *ctx, w, h );
}
bool teardown_offscreen_context(OffscreenContext *ctx)
{
return true;
}
bool save_framebuffer(OffscreenContext *ctx, char const * filename)
{
std::ofstream fstream(filename,std::ios::out|std::ios::binary);
if (!fstream.is_open()) {
std::cerr << "Can't open file " << filename << " for writing";
return false;
} else {
save_framebuffer(ctx, fstream);
fstream.close();
}
return true;
}
bool save_framebuffer(OffscreenContext *ctx, std::ostream &output)
{
output << "NULLGL framebuffer";
return true;
}

View File

@ -11,8 +11,14 @@ typedef __int64 int64_t;
#include <boost/unordered_map.hpp>
#include <utility>
const double GRID_COARSE = 0.001;
const double GRID_FINE = 0.000001;
//const double GRID_COARSE = 0.001;
//const double GRID_FINE = 0.000001;
/* Using decimals that are exactly convertible to binary floating point
(and then converted exactly to GMPQ Rational in CGAL's engine) provides
at least a 5% speedup for ctest -R CGAL. We choose 1/1024 and 1/(1024*1024)
In python: print '%.64f' % float(fractions.Fraction(1,1024)) */
const double GRID_COARSE = 0.0009765625;
const double GRID_FINE = 0.00000095367431640625;
template <typename T>
class Grid2d