20 #ifndef vsr_cga3D_app_INC
21 #define vsr_cga3D_app_INC
25 #include "draw/vsr_cga3D_draw.h"
26 #include "draw/vsr_cga3D_render.h"
28 #include "util/vsr_cga3D_control.h"
29 #include "gfx/util/gfx_glv_app.h"
32 #include "gl2ps/gl2ps.h"
35 struct App :
public gfx::GFXAppGui {
41 bool bShadedOutput =
true;
45 auto& vd = gfx::GFXAppGui::mContext.interface.io.viewdata;
48 auto p = scene.unproject( io().pos(z) );
50 Vec tz (tv[0], tv[1], tv[2] );
79 stringstream os; os <<
"output_" <<
id << (bShadedOutput ?
".eps" :
".pdf");
83 int state = GL2PS_OVERFLOW, buffsize = 0;
85 string name = os.str();
86 fp = fopen(name.c_str(),
"wb");
88 printf(
"writing %s to %s\n", os.str().c_str(), name.c_str() );
90 glGetIntegerv(GL_VIEWPORT, tv);
93 while(state == GL2PS_OVERFLOW){
95 buffsize += 1024*1024;
98 gl2psBeginPage(
"test",
"gl2psTestSimple", tv , GL2PS_EPS, GL2PS_SIMPLE_SORT,
99 GL2PS_BEST_ROOT | GL2PS_TIGHT_BOUNDING_BOX | GL2PS_SIMPLE_LINE_OFFSET | GL2PS_OCCLUSION_CULL,
100 GL_RGBA, 0, NULL, 0, 0, 0, buffsize, fp,
"out.eps");
102 gl2psBeginPage(
"test",
"gl2psTestSimple", tv , GL2PS_PDF, GL2PS_NO_SORT,
103 GL2PS_NO_PS3_SHADING | GL2PS_BEST_ROOT | GL2PS_TIGHT_BOUNDING_BOX | GL2PS_OCCLUSION_CULL,
104 GL_RGBA, 0, NULL, 0, 0, 0, buffsize, fp,
"out.eps");
107 gl2psEnable(GL2PS_BLEND);
108 gl2psBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
117 state = gl2psEndPage();
static Circle meet(const Dls &s, const Dls &d)
circle intersection of dual spheres
Common Operations Specific to CGA3D.
NVec< 5 > Vec
Vector
Definition: vsr_cga3D_types.h:62
virtual void onKeyDown(const gfx::Keyboard &k)
Called when a keyboard key is pressed.
Definition: vsr_cga3D_app.h:64
static Point point(const Circle &c, VSR_PRECISION t)
Point on Circle at theta t.
Generic Geometric Number Types (templated on an algebra and a basis )
Definition: vsr_algebra.h:69
Inf Infinity
Null Infinity Blade: \(n_\infty\)
Definition: vsr_cga3D_types.h:125
Definition: vsr_cga3D_app.h:35