1
/***************************************************************************
3
A simple line composed of two endpoints
6
copyright : (C) 2004 by Gary E.Sherman
7
email : sherman at mrcc.com
8
***************************************************************************/
10
/***************************************************************************
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
17
***************************************************************************/
18
/* $Id: qgsline.cpp,v 1.1 2004/10/24 16:48:21 gsherman Exp $ */
30
// Create a line from two points
31
QgsLine::QgsLine(QgsPoint &p1, QgsPoint &p2) : mBegin(p1), mEnd(p2)
41
/// Sets the begin point of the line
42
void QgsLine::setBegin(QgsPoint &p1)
46
/// Sets the end point of the line
47
void QgsLine::setEnd(QgsPoint &p2)
52
/// Get the begin point of the line
53
QgsPoint QgsLine::begin() const
58
/// Get the end point of the line
59
QgsPoint QgsLine::end() const
64
//! String representation of the line
65
QString QgsLine::stringRep() const
67
return QString("Not implemented");
70
//! As above but with precision for string representaton of a line
71
QString QgsLine::stringRep(int thePrecision) const
73
return QString("Not implemented");
76
/*! Return the well known text representation for the line.
77
* The wkt is created without an SRID.
78
* @return Well known text
80
QString QgsLine::wellKnownText()
82
return QString("Not implemented");
86
//! Inequality operator
87
bool QgsLine::operator!=(const QgsLine &other)
89
// Note this function assumes that "flipped" lines are not equal,
90
// thus preserving the concept of direction
91
if((mBegin != other.begin()) || (mEnd != other.end()))
102
QgsLine & QgsLine::operator=(const QgsLine &other)
106
mBegin = other.begin();