summaryrefslogtreecommitdiffstats
path: root/kstars/kstars/csegment.cpp
blob: 24242022f3a56cd8b3fd1f705b66526cff2b6293 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/***************************************************************************
                          csegment.cpp  -  K Desktop Planetarium
                             -------------------
    begin                : Sun Feb 1 2004
    copyright            : (C) 2004 by Jason Harris
    email                : kstars@30doradus.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "csegment.h"
#include "skypoint.h"

CSegment::CSegment() : Name1(), Name2() {
	Nodes.setAutoDelete( true );
}

void CSegment::addPoint( double ra, double dec ) {
	SkyPoint *p = new SkyPoint( ra, dec );
	Nodes.append( p );
}

bool CSegment::setNames( TQString n1, TQString n2 ) {
	if ( n1.length() == 3 && n2.length() == 3 ) {
		Name1 = n1; 
		Name2 = n2;
		return true;
	} else {
		return false;
	}
}

bool CSegment::borders( TQString cname ) {
	if ( Name1 == cname || Name2 == cname ) return true;
	return false;
}