Marker.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: Marker.hpp 1644 2009-01-27 19:26:14Z ckiesch $"
00002 
00004 
00005 //============================================================================
00006 //
00007 //  This file is part of GPSTk, the GPS Toolkit.
00008 //
00009 //  The GPSTk is free software; you can redistribute it and/or modify
00010 //  it under the terms of the GNU Lesser General Public License as published
00011 //  by the Free Software Foundation; either version 2.1 of the License, or
00012 //  any later version.
00013 //
00014 //  The GPSTk is distributed in the hope that it will be useful,
00015 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 //  GNU Lesser General Public License for more details.
00018 //
00019 //  You should have received a copy of the GNU Lesser General Public
00020 //  License along with GPSTk; if not, write to the Free Software Foundation,
00021 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //  
00023 //  Copyright 2004, The University of Texas at Austin
00024 //
00025 //============================================================================
00026 
00027 
00028 #ifndef VDRAW_MARKER_H
00029 #define VDRAW_MARKER_H
00030 
00031 #include<string>
00032 #include<list>
00033 
00034 #include "Color.hpp"
00035 
00036 namespace vdraw
00037 {
00040 
00041 
00058   class Marker {
00059 
00060     public:
00061 
00063       enum Mark{PLUS,X,DOT};
00064 
00068       Marker(void) 
00069         : mark(DOT), range(1), usesDefault(true) {};
00070 
00078       Marker(Mark imark, double irange=1.0, Color icolor=Color::BLACK) 
00079         : mark(imark), range(irange), usesDefault(true), markerColor(icolor) {};
00080 
00081       /*
00082        * Constructor.
00083        * @param ishape The desired custom shape for the marker, in relative coordinates.
00084        * @param maxrange This is strongly suggested for SVG as it might not turn out correctly otherwise.
00085        */
00086       //Marker(BasicShape ishape, double maxrange=0) 
00087       //      : range(maxrange), usesDefault(false), markerShape(ishape) {};
00088 
00089       /*
00090        * Constructor.
00091        * @param ishape The desired custom shape for the marker, in relative coordinates.
00092        * @param icolor The color to override the colors inside the shape.
00093        * @param maxrange This is strongly suggested for SVG as it might not turn out correctly otherwise.
00094        */
00095       //Marker(BasicShape ishape, Color icolor, double maxrange=0) 
00096       //      : range(maxrange), usesDefault(false), markerColor(icolor), useMarkerColor(true), markerShape(ishape) {};
00097 
00101       static Marker clear() { return Marker(DOT,0,Color::CLEAR); }
00102 
00103       /*
00104        * Accessor.
00105        * @return The shape that the marker is set as.
00106        */
00107       //BasicShape getMarker(void) const { return markerShape; };
00108 
00113       Mark getMark(void) const { return mark; };
00114 
00119       Color getColor(void) const { return markerColor; };
00120 
00127       double getRange(void) const { return range; };
00128 
00133       void setColor(const Color& newColor) { markerColor=newColor; }
00134 
00136       bool hasDefaultMark(void) const { return usesDefault; };
00137      
00139       std::string uniqueName(void) const;
00140 
00151       bool shapeEquals(const Marker& other) const;
00152 
00157       bool equals(const Marker& other) const;
00158 
00160       bool operator==(const Marker& rhs) const {return this->equals(rhs);};
00161 
00163       bool operator!=(const Marker& rhs) const {return !this->equals(rhs);};
00164 
00165     protected:
00166 
00167     private:
00168 
00170       Mark mark;
00171 
00173       double range;
00174 
00176       bool usesDefault;
00177 
00179       Color markerColor;
00180 
00182       bool useMarkerColor;
00183 
00185       //BasicShape markerShape;
00186 
00187   }; // class Marker
00188 
00190 
00191 } // namespace vdraw
00192 
00193 #endif //VDRAW_MARKER_H
00194 

Generated on Wed Feb 8 03:31:00 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1