29#ifndef __KDCHARTDATAREGION__
30#define __KDCHARTDATAREGION__
33#include <tqpointarray.h>
35#include "KDChartGlobal.h"
40struct KDCHART_EXPORT KDChartDataRegion
42 typedef TQValueList<TQPointArray> PointArrayList;
49 KDChartDataRegion( TQRegion region, uint r, uint c, uint ch )
52 pRegion =
new TQRegion( region );
58 KDChartDataRegion( uint r, uint c, uint ch, TQPointArray array )
61 pArray =
new TQPointArray( array );
67 KDChartDataRegion( uint r, uint c, uint ch, TQRect rect )
70 pRect =
new TQRect( rect );
75 KDChartDataRegion( uint r, uint c, uint ch, PointArrayList * list,
bool takeOwnership )
79 pPointArrayList = list;
81 pPointArrayList =
new PointArrayList( * list );
91 delete pPointArrayList;
102 TQRegion region()
const
104 if( pPointArrayList && ! pPointArrayList->empty() ){
106 PointArrayList::iterator it;
107 for ( it = pPointArrayList->begin(); it != pPointArrayList->end(); ++it ){
108 region += TQRegion( *it );
115 return TQRegion( *pArray );
117 return TQRegion( *pRect );
123 if( pPointArrayList && ! pPointArrayList->empty() ){
125 PointArrayList::iterator it;
126 for ( it = pPointArrayList->begin(); it != pPointArrayList->end(); ++it ){
127 rect = rect.unite( (*it).boundingRect() );
132 return pRegion->boundingRect();
134 return pArray->boundingRect();
140 bool contains(
const TQPoint & p)
const
142 if( pPointArrayList && ! pPointArrayList->empty() ){
143 PointArrayList::iterator it;
144 for ( it = pPointArrayList->begin(); it != pPointArrayList->end(); ++it ){
145 TQRegion region( *it );
146 if( region.contains( p ) )
152 return pRegion->contains( p );
154 return TQRegion( *pArray ).contains( p );
156 return pRect->contains( p );
177 TQPointArray* pArray;
179 TQRegion* pTextRegion;
183 PointArrayList* pPointArrayList;
The collection class used by KD Chart to store data region information.