/home/martin/workspace/OpenStreetNav/src/displayer/LineDisplayStyle.cpp
Go to the documentation of this file.
00001 /*
00002  * LineDisplayStyle.cpp
00003  *
00004  *  Created on: Dec 29, 2011
00005  *      Author: martin
00006  */
00007 
00008 #include "LineDisplayStyle.h"
00009 
00010 namespace display
00011 {
00012 
00013 LineDisplayStyle::LineDisplayStyle(double red, double green, double blue, double alpha, double thickness):
00014     red(red),
00015     green(green),
00016     blue(blue),
00017     alpha(alpha),
00018     thickness(thickness * 0.005)
00019 {
00020 }
00021 
00022 LineDisplayStyle::~LineDisplayStyle()
00023 {
00024 }
00025 
00026 void LineDisplayStyle::prepare(Cairo::RefPtr<Cairo::Context> cr) const
00027 {
00028     cr->set_source_rgba(red, green, blue, alpha);
00029     cr->set_line_width(thickness);
00030     cr->set_line_cap(Cairo::LineCap::LINE_CAP_SQUARE);
00031 }
00032 
00033 void LineDisplayStyle::exec(Cairo::RefPtr<Cairo::Context> cr) const
00034 {
00035     cr->stroke();
00036 }
00037 
00038 }
00039 
00040 /* namespace display */
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines