00001 #pragma ident "$Id: Marker.cpp 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 #include <sstream> 00028 #include <iomanip> 00029 00030 #include "Marker.hpp" 00031 00032 namespace vdraw 00033 { 00038 std::string Marker::uniqueName(void) const 00039 { 00040 using namespace std; 00041 00042 stringstream ss; 00043 switch(mark) 00044 { 00045 case DOT: 00046 ss << "dot"; 00047 break; 00048 case PLUS: 00049 ss << "plus"; 00050 break; 00051 case X: 00052 ss << "X"; 00053 break; 00054 } 00055 ss << range << "x"; 00056 ss << hex << setw(6) << setfill('0') << markerColor.getRGB(); 00057 00058 return ss.str(); 00059 } 00060 00065 bool Marker::shapeEquals(const Marker& other) const 00066 { 00067 return ((mark == other.getMark()) && (range == other.getRange())); 00068 } 00069 00070 bool Marker::equals( const Marker& other ) const 00071 { 00072 /* 00073 * \note these first two are commented as the basic shape ability has been 00074 * removed from marker at this point. 00075 */ 00076 00077 // This gets too complicated to check. 00078 //if ( !usesDefault ) return false; 00079 00080 // This one default, other not. 00081 //if ( !other.hasDefaultMark() ) return false; 00082 00083 return ((this->shapeEquals(other)) && (markerColor == other.getColor())); 00084 00085 // Check if the marks are different. 00086 //if ( mark != other.getMark() ) return false; 00087 00088 // Check if the mark colors are different. 00089 //if ( markerColor != other.getColor() ) return false; 00090 00091 // Check if the ranges are different 00092 //if ( range != other.getRange() ) return false; 00093 00094 // Bothe use the same default mark and color. 00095 //return true; 00096 } 00097 00098 } 00099 00100
1.3.9.1