9class Canvas :
public Fl_Gl_Window {
16 GlColorStack() : colorstack() {}
18 void Push(
double r,
double g,
double b,
double a = 1.0) { Push(Color(r, g, b, a)); }
22 glColor4f(col.r, col.g, col.b, col.a);
27 if (colorstack.size() < 1)
28 PRINT_WARN1(
"Attempted to ColorStack.Pop() but ColorStack %p is empty",
29 static_cast<void *
>(
this));
31 Color &old = colorstack.top();
33 glColor4f(old.r, old.g, old.b, old.a);
37 unsigned int Length() {
return colorstack.size(); }
39 std::stack<Color> colorstack;
42 std::list<Model *> models_sorted;
44 Camera *current_camera;
46 PerspectiveCamera perspective_camera;
52 bool clicked_empty_space;
53 int empty_space_startx, empty_space_starty;
54 std::list<Model *> selected_models;
55 Model *last_selection;
60 void RecordRay(
double x1,
double y1,
double x2,
double y2);
63 void DrawGlobalGrid();
65 void AddModel(
Model *mod);
66 void RemoveModel(
Model *mod);
70 showBlocks, showBlur, showClock, showData, showFlags, showFollow, showFootprints, showGrid,
71 showOccupancy, showScreenshots, showStatus, showTrailArrows, showTrailRise, showTrails,
72 showVoxels, pCamOn, visualizeAll;
97 virtual int handle(
int event);
98 void resize(
int X,
int Y,
int W,
int H);
100 void CanvasToWorld(
int px,
int py,
double *wx,
double *wy,
double *wz);
111 void PushColor(
double r,
double g,
double b,
double a) { colorstack.Push(r, g, b, a); }
125 bool IsTopView() {
return ((fabs(camera.yaw()) < 0.1) && (fabs(camera.pitch()) < 0.1)); }
void InitGl()
Definition canvas.cc:96
unsigned long frames_rendered_count
Definition canvas.hh:80
void DrawBoundingBoxes()
Definition canvas.cc:691
static void perspectiveCb(Fl_Widget *w, void *p)
Definition canvas.cc:1116
void PushColor(double r, double g, double b, double a)
Definition canvas.hh:111
void CanvasToWorld(int px, int py, double *wx, double *wy, double *wz)
Definition canvas.cc:306
void resize(int X, int Y, int W, int H)
Definition canvas.cc:1254
~Canvas()
Definition canvas.cc:198
void select(Model *mod)
Definition canvas.cc:281
friend class Model
Definition canvas.hh:11
static void TimerCallback(Canvas *canvas)
Definition canvas.cc:42
void setDirtyBuffer(void)
Definition canvas.hh:108
virtual void draw()
Definition canvas.cc:1214
void DrawBlocks()
Definition canvas.cc:685
virtual int handle(int event)
Definition canvas.cc:345
bool dirtyBuffer(void) const
Definition canvas.hh:109
void LeaveScreenCS()
Definition canvas.cc:1050
void unSelectAll()
Definition canvas.cc:300
Model * getModel(int x, int y)
Definition canvas.cc:203
WorldGui * world
Definition canvas.hh:79
std::map< std::string, Option * > _custom_options
Definition canvas.hh:83
void unSelect(Model *mod)
Definition canvas.cc:292
void EnterScreenCS()
Definition canvas.cc:1036
void InitTextures()
Definition canvas.cc:129
void FixViewport(int W, int H)
Definition canvas.cc:577
Canvas(WorldGui *world, int x, int y, int width, int height)
Definition canvas.cc:53
void DrawFloor()
Definition canvas.cc:668
void createMenuItems(Fl_Menu_Bar *menu, std::string path)
Definition canvas.cc:1130
bool selected(Model *mod)
Definition canvas.cc:276
int screenshot_frame_skip
Definition canvas.hh:81
virtual void renderFrame()
Definition canvas.cc:756
friend class WorldGui
Definition canvas.hh:10
void InvertView(uint32_t invertflags)
void PushColor(Color col)
Definition canvas.hh:110
void resetCamera()
Definition canvas.cc:705
void Screenshot()
Definition canvas.cc:1059
void PopColor()
Definition canvas.hh:112
bool graphics
Definition canvas.hh:78
void Save(Worldfile *wf, int section)
Definition canvas.cc:1189
bool IsTopView()
Definition canvas.hh:125
bool VisualizeAll()
Definition canvas.hh:115
void Load(Worldfile *wf, int section)
Definition canvas.cc:1153
Definition worldfile.hh:67
The Stage library uses its own namespace.
Definition canvas.hh:8
unsigned long msec_t
Definition stage.hh:200
#define PRINT_WARN1(m, a)
Definition stage.hh:604