/home/martin/workspace/OpenStreetNav/src/displayer/DisplayElement.h
Go to the documentation of this file.
00001 /*
00002  * DisplayElement.h
00003  *
00004  *  Created on: Dec 7, 2011
00005  *      Author: martin
00006  */
00007 
00008 #ifndef DISPLAYELEMENT_H_
00009 #define DISPLAYELEMENT_H_
00010 
00011 #include "DisplayStyle.h"
00012 #include <memory>
00013 #include <cairomm/context.h>
00014 #include "../projection/projection.h"
00015 
00016 namespace display
00017 {
00018 
00019 enum class DisplayElementType
00020 {
00021     Line = 0
00022 };
00023 
00024 class DisplayElement
00025 {
00026 public:
00027     DisplayElement(std::unique_ptr<DisplayStyle> && disp);
00028     virtual ~DisplayElement();
00029     virtual void draw(Cairo::RefPtr<Cairo::Context> cr, proj::MapProjection& pr) const;
00030     virtual DisplayElementType get_type() const = 0;
00031     virtual bool operator<(DisplayElement const& other) const = 0;
00032     virtual bool operator>(DisplayElement const& other) const = 0;
00033     virtual bool operator<=(DisplayElement const& other) const = 0;
00034     virtual bool operator>=(DisplayElement const& other) const = 0;
00035     virtual bool operator==(DisplayElement const& other) const = 0;
00036     virtual bool operator!=(DisplayElement const& other) const = 0;
00037 protected:
00038     std::unique_ptr<DisplayStyle> disp;
00039     virtual void draw_internal(Cairo::RefPtr<Cairo::Context> cr, proj::MapProjection& pr) const = 0;
00040 
00041 };
00042 
00043 } /* namespace display */
00044 #endif /* DISPLAYELEMENT_H_ */
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines