20 GlColorStack() : colorstack() {}
23 void Push(
double r,
double g,
double b,
double a=1.0 )
25 Push( Color(r,g,b,a) );
28 void Push( Color col )
30 colorstack.push( col );
31 glColor4f( col.r, col.g, col.b, col.a );
36 if( colorstack.size() < 1 )
37 PRINT_WARN1(
"Attempted to ColorStack.Pop() but ColorStack %p is empty",
41 Color& old = colorstack.top();
43 glColor4f( old.r, old.g, old.b, old.a );
48 {
return colorstack.size(); }
51 std::stack<Color> colorstack;
54 std::list<Model*> models_sorted;
56 Camera* current_camera;
58 PerspectiveCamera perspective_camera;
64 bool clicked_empty_space;
65 int empty_space_startx, empty_space_starty;
66 std::list<Model*> selected_models;
67 Model* last_selection;
72 void RecordRay(
double x1,
double y1,
double x2,
double y2 );
75 void DrawGlobalGrid();
77 void AddModel(
Model* mod );
78 void RemoveModel(
Model* mod );
123 virtual int handle(
int event );
124 void resize(
int X,
int Y,
int W,
int H);
127 double *wx,
double *wy,
double* wz );
139 { colorstack.Push( col ); }
141 void PushColor(
double r,
double g,
double b,
double a )
142 { colorstack.Push( r,g,b,a ); }
159 bool IsTopView(){
return( (fabs( camera.yaw() ) < 0.1) &&
160 (fabs( camera.pitch() ) < 0.1) ); }
Model class
Definition: stage.hh:1742
WorldGui * world
Definition: canvas.hh:105
The Stage library uses its own namespace.
Definition: canvas.hh:8
~Canvas()
Definition: canvas.cc:218
void InitTextures()
Definition: canvas.cc:144
void select(Model *mod)
Definition: canvas.cc:301
void EnterScreenCS()
Definition: canvas.cc:1087
void setDirtyBuffer(void)
Definition: canvas.hh:135
void DrawFloor()
Definition: canvas.cc:697
virtual int handle(int event)
Definition: canvas.cc:364
void createMenuItems(Fl_Menu_Bar *menu, std::string path)
Definition: canvas.cc:1188
friend class Model
Definition: canvas.hh:13
void DrawBoundingBoxes()
Definition: canvas.cc:720
Canvas(WorldGui *world, int x, int y, int width, int height)
Definition: canvas.cc:56
void DrawBlocks()
Definition: canvas.cc:714
bool graphics
Definition: canvas.hh:104
void resetCamera()
Definition: canvas.cc:734
void PushColor(Color col)
Definition: canvas.hh:138
std::map< std::string, Option *> _custom_options
Definition: canvas.hh:109
void Screenshot()
Definition: canvas.cc:1111
void FixViewport(int W, int H)
Definition: canvas.cc:600
int screenshot_frame_skip
Definition: canvas.hh:107
void CanvasToWorld(int px, int py, double *wx, double *wy, double *wz)
Definition: canvas.cc:327
friend class WorldGui
Definition: canvas.hh:12
void unSelectAll()
Definition: canvas.cc:321
Definition: stage.hh:1498
virtual void draw()
Definition: canvas.cc:1276
void LeaveScreenCS()
Definition: canvas.cc:1101
unsigned long msec_t
Definition: stage.hh:183
Model * getModel(int x, int y)
Definition: canvas.cc:223
void PopColor()
Definition: canvas.hh:144
static void perspectiveCb(Fl_Widget *w, void *p)
Definition: canvas.cc:1173
void Save(Worldfile *wf, int section)
Definition: canvas.cc:1250
void PushColor(double r, double g, double b, double a)
Definition: canvas.hh:141
void Load(Worldfile *wf, int section)
Definition: canvas.cc:1212
bool dirtyBuffer(void) const
Definition: canvas.hh:136
Definition: worldfile.hh:69
void InitGl()
Definition: canvas.cc:111
unsigned long frames_rendered_count
Definition: canvas.hh:106
bool VisualizeAll()
Definition: canvas.hh:148
bool selected(Model *mod)
Definition: canvas.cc:296
void resize(int X, int Y, int W, int H)
Definition: canvas.cc:1324
virtual void renderFrame()
Definition: canvas.cc:787
#define PRINT_WARN1(m, a)
Definition: stage.hh:634
bool IsTopView()
Definition: canvas.hh:159
static void TimerCallback(Canvas *canvas)
Definition: canvas.cc:42
void InvertView(uint32_t invertflags)
void unSelect(Model *mod)
Definition: canvas.cc:312