summaryrefslogtreecommitdiffstats
path: root/libkdeedu/kdeeduplot/kplotobject.cpp
blob: b5aaf8d8910a80f2058d5f828f2384b844784f2b (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
44
45
46
47
48
49
/***************************************************************************
                          kplotobject.cpp - A list of points to be plotted
                             -------------------
    begin                : Sun 18 May 2003
    copyright            : (C) 2003 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 <tqpainter.h>
#include <kdebug.h>
#include "kplotobject.h"

KPlotObject::KPlotObject() {
	KPlotObject( "", "white", POINTS );
}

KPlotObject::KPlotObject( const TQString &n, const TQString &c, PTYPE t, unsigned int s, unsigned int p ) {
	//We use the set functions because they may include data validation
	setName( n );
	setColor( c );
	setType( t );
	setSize( s );
	setParam( p );

	pList.setAutoDelete( true );
}

KPlotObject::~KPlotObject()
{
}

void KPlotObject::removePoint( unsigned int index ) {
	if ( index > pList.count() - 1 ) {
		kdWarning() << "Ignoring attempt to remove non-existent plot object" << endl;
		return;
	}

	pList.remove( index );
}