KDChart::PieAttributes Class Reference

#include <KDChartPieAttributes.h>

List of all members.


Detailed Description

A set of attributes controlling the appearance of pie charts.

Definition at line 38 of file KDChartPieAttributes.h.


Public Member Functions

bool explode () const
 
Returns:
whether the respective pie piece(s) will be exploded.

qreal explodeFactor () const
 
Returns:
the explode factor set by setExplode or by setExplodeFactor.

qreal gapFactor (bool circular) const
bool operator!= (const PieAttributes &other) const
PieAttributesoperator= (const PieAttributes &)
bool operator== (const PieAttributes &) const
 PieAttributes (const PieAttributes &)
 PieAttributes ()
void setExplode (bool explode)
 Enable or disable exploding the respective pie piece(s).
void setExplodeFactor (qreal factor)
 Set the explode factor.
void setGapFactor (bool circular, qreal factor)
 ~PieAttributes ()

Constructor & Destructor Documentation

PieAttributes::PieAttributes (  ) 

Definition at line 47 of file KDChartPieAttributes.cpp.

00048     : _d( new Private() )
00049 {
00050 }

PieAttributes::PieAttributes ( const PieAttributes r  ) 

Definition at line 52 of file KDChartPieAttributes.cpp.

00053     : _d( new Private( *r.d ) )
00054 {
00055 }

PieAttributes::~PieAttributes (  ) 

Definition at line 67 of file KDChartPieAttributes.cpp.

00068 {
00069     delete _d; _d = 0;
00070 }


Member Function Documentation

bool PieAttributes::explode (  )  const

Returns:
whether the respective pie piece(s) will be exploded.

Definition at line 92 of file KDChartPieAttributes.cpp.

References d.

Referenced by KDChart::RingDiagram::paint().

00093 {
00094     return (d->explodeFactor != 0.0);
00095 }

qreal PieAttributes::explodeFactor (  )  const

Returns:
the explode factor set by setExplode or by setExplodeFactor.

Definition at line 102 of file KDChartPieAttributes.cpp.

References d.

Referenced by KDChart::RingDiagram::calculateDataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), operator<<(), operator==(), KDChart::RingDiagram::paint(), and KDChart::PieDiagram::paintInternal().

00103 {
00104     return d->explodeFactor;
00105 }

qreal PieAttributes::gapFactor ( bool  circular  )  const

Definition at line 115 of file KDChartPieAttributes.cpp.

References d.

Referenced by operator==(), and KDChart::RingDiagram::paint().

00116 {
00117         return circular ? d->tangentialGapFactor : d->radialGapFactor;
00118 }

bool KDChart::PieAttributes::operator!= ( const PieAttributes other  )  const

Definition at line 78 of file KDChartPieAttributes.h.

References KDGantt::operator==().

00078 { return !operator==(other); }

PieAttributes & PieAttributes::operator= ( const PieAttributes r  ) 

Definition at line 57 of file KDChartPieAttributes.cpp.

References d.

00058 {
00059     if( this == &r )
00060         return *this;
00061 
00062     *d = *r.d;
00063 
00064     return *this;
00065 }

bool PieAttributes::operator== ( const PieAttributes r  )  const

Definition at line 73 of file KDChartPieAttributes.cpp.

References explodeFactor(), and gapFactor().

00074 {
00075     return 
00076         explodeFactor()   == r.explodeFactor() &&
00077         gapFactor( true ) == r.gapFactor( true ) &&
00078         gapFactor( false) == r.gapFactor( false);
00079 }

void PieAttributes::setExplode ( bool  explode  ) 

Enable or disable exploding the respective pie piece(s).

The default explode factor is 10 percent; use setExplodeFactor to specify a different factor.

Note:
This is a convenience function: Calling setExplode( true ) does the same as calling setExplodeFactor( 0.1 ), and calling setExplode( false ) does the same as calling setExplodeFactor( 0.0 ).
See also:
setExplodeFactor

Definition at line 87 of file KDChartPieAttributes.cpp.

References d.

00088 {
00089     d->explodeFactor = (enabled ? 0.1 : 0.0);
00090 }

void PieAttributes::setExplodeFactor ( qreal  factor  ) 

Set the explode factor.

The explode factor is a qreal between 0 and 1, and is interpreted as a percentage of the total available radius of the pie.

See also:
setExplode

Definition at line 97 of file KDChartPieAttributes.cpp.

References d.

00098 {
00099     d->explodeFactor = factor;
00100 }

void PieAttributes::setGapFactor ( bool  circular,
qreal  factor 
)

Definition at line 107 of file KDChartPieAttributes.cpp.

References d.

00108 {
00109         if ( circular )
00110                 d->tangentialGapFactor = factor;
00111         else
00112                 d->radialGapFactor = factor;
00113 }


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