kstars
csegment.cpp
Go to the documentation of this file.00001 /*************************************************************************** 00002 csegment.cpp - K Desktop Planetarium 00003 ------------------- 00004 begin : Sun Feb 1 2004 00005 copyright : (C) 2004 by Jason Harris 00006 email : kstars@30doradus.org 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #include "csegment.h" 00019 #include "skypoint.h" 00020 00021 CSegment::CSegment() : Name1(), Name2() { 00022 Nodes.setAutoDelete( true ); 00023 } 00024 00025 void CSegment::addPoint( double ra, double dec ) { 00026 SkyPoint *p = new SkyPoint( ra, dec ); 00027 Nodes.append( p ); 00028 } 00029 00030 bool CSegment::setNames( QString n1, QString n2 ) { 00031 if ( n1.length() == 3 && n2.length() == 3 ) { 00032 Name1 = n1; 00033 Name2 = n2; 00034 return true; 00035 } else { 00036 return false; 00037 } 00038 } 00039 00040 bool CSegment::borders( QString cname ) { 00041 if ( Name1 == cname || Name2 == cname ) return true; 00042 return false; 00043 }