KDGantt::Span Class Reference

#include <KDGanttGlobal>

Collaboration diagram for KDGantt::Span:

Collaboration graph
[legend]

List of all members.


Detailed Description

A class representing a start point and a length.

Definition at line 221 of file kdganttglobal.h.


Public Member Functions

qreal end () const
bool equals (const Span &other) const
Span expandedTo (const Span &other) const
bool isValid () const
qreal length () const
Spanoperator= (const Span &other)
void setEnd (qreal end)
void setLength (qreal length)
void setStart (qreal start)
 Span (const Span &other)
 Span (qreal start, qreal length)
 Span ()
qreal start () const

Constructor & Destructor Documentation

KDGantt::Span::Span (  ) 

Definition at line 225 of file kdganttglobal.h.

00225 :
        inline Span() : m_start( -1 ), m_length( 0 ) {}

KDGantt::Span::Span ( qreal  start,
qreal  length 
)

Definition at line 226 of file kdganttglobal.h.

00226 : m_start( -1 ), m_length( 0 ) {}

KDGantt::Span::Span ( const Span other  ) 

Definition at line 227 of file kdganttglobal.h.

00227 : m_start( start ), m_length( length ) {}


Member Function Documentation

qreal KDGantt::Span::end (  )  const

Definition at line 234 of file kdganttglobal.h.

Referenced by KDGantt::AbstractGrid::isSatisfiedConstraint().

00234 { m_length = m_start-end; }

bool KDGantt::Span::equals ( const Span other  )  const

Definition at line 241 of file kdganttglobal.h.

References m_length, and m_start.

Referenced by KDGantt::operator!=().

00242                                                       {
00243             return m_start == other.m_start && m_length == other.m_length;

Span KDGantt::Span::expandedTo ( const Span other  )  const

Definition at line 244 of file kdganttglobal.h.

00245                                                          {
00246             const qreal new_start = qMin(start(),other.start());
00247             return Span( new_start, (end()<other.end())?other.end()-new_start:end()-new_start);

bool KDGantt::Span::isValid (  )  const

Definition at line 239 of file kdganttglobal.h.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

00240 { return m_start >= 0.;}

qreal KDGantt::Span::length (  )  const

Definition at line 237 of file kdganttglobal.h.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE(), KDGantt::DateTimeGrid::mapFromChart(), operator<<(), KDGantt::DateTimeGrid::paintGrid(), and KDGantt::GraphicsItem::updateItem().

00237 { m_length=length; }

Span& KDGantt::Span::operator= ( const Span other  ) 

Definition at line 229 of file kdganttglobal.h.

References m_length, and m_start.

00230 { m_start=other.m_start; m_length=other.m_length; return *this; }

void KDGantt::Span::setEnd ( qreal  end  ) 

Definition at line 233 of file kdganttglobal.h.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

00233 { return m_start; }

void KDGantt::Span::setLength ( qreal  length  ) 

Definition at line 236 of file kdganttglobal.h.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

00237 { m_length=length; }

void KDGantt::Span::setStart ( qreal  start  ) 

Definition at line 231 of file kdganttglobal.h.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

00232 { m_start=start; }

qreal KDGantt::Span::start (  )  const

Definition at line 232 of file kdganttglobal.h.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE(), KDGantt::DateTimeGrid::mapFromChart(), operator<<(), KDGantt::DateTimeGrid::paintGrid(), and KDGantt::GraphicsItem::updateItem().

00232 { m_start=start; }


The documentation for this class was generated from the following file:
Generated on Thu Mar 4 23:27:17 2010 for KD Chart 2 by  doxygen 1.5.4