|
|
|
@ -28,34 +28,34 @@ using std::max;
|
|
|
|
|
using std::min;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
KTreemapTile::KTreemapTile( KTreemapView * tqparentView,
|
|
|
|
|
KTreemapTile * tqparentTile,
|
|
|
|
|
KTreemapTile::KTreemapTile( KTreemapView * parentView,
|
|
|
|
|
KTreemapTile * parentTile,
|
|
|
|
|
KFileInfo * orig,
|
|
|
|
|
const TQRect & rect,
|
|
|
|
|
KOrientation orientation )
|
|
|
|
|
: TQCanvasRectangle( rect, tqparentView->canvas() )
|
|
|
|
|
, _parentView( tqparentView )
|
|
|
|
|
, _parentTile( tqparentTile )
|
|
|
|
|
: TQCanvasRectangle( rect, parentView->canvas() )
|
|
|
|
|
, _parentView( parentView )
|
|
|
|
|
, _parentTile( parentTile )
|
|
|
|
|
, _orig( orig )
|
|
|
|
|
{
|
|
|
|
|
init();
|
|
|
|
|
|
|
|
|
|
if ( tqparentTile )
|
|
|
|
|
_cushionSurface = tqparentTile->cushionSurface();
|
|
|
|
|
if ( parentTile )
|
|
|
|
|
_cushionSurface = parentTile->cushionSurface();
|
|
|
|
|
|
|
|
|
|
createChildren( rect, orientation );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
KTreemapTile::KTreemapTile( KTreemapView * tqparentView,
|
|
|
|
|
KTreemapTile * tqparentTile,
|
|
|
|
|
KTreemapTile::KTreemapTile( KTreemapView * parentView,
|
|
|
|
|
KTreemapTile * parentTile,
|
|
|
|
|
KFileInfo * orig,
|
|
|
|
|
const TQRect & rect,
|
|
|
|
|
const KCushionSurface & cushionSurface,
|
|
|
|
|
KOrientation orientation )
|
|
|
|
|
: TQCanvasRectangle( rect, tqparentView->canvas() )
|
|
|
|
|
, _parentView( tqparentView )
|
|
|
|
|
, _parentTile( tqparentTile )
|
|
|
|
|
: TQCanvasRectangle( rect, parentView->canvas() )
|
|
|
|
|
, _parentView( parentView )
|
|
|
|
|
, _parentTile( parentTile )
|
|
|
|
|
, _orig( orig )
|
|
|
|
|
, _cushionSurface( cushionSurface )
|
|
|
|
|
{
|
|
|
|
@ -189,7 +189,7 @@ KTreemapTile::createSquarifiedChildren( const TQRect & rect )
|
|
|
|
|
while ( *it )
|
|
|
|
|
{
|
|
|
|
|
KFileInfoList row = squarify( tqchildrenRect, scale, it );
|
|
|
|
|
tqchildrenRect = tqlayoutRow( tqchildrenRect, scale, row );
|
|
|
|
|
tqchildrenRect = layoutRow( tqchildrenRect, scale, row );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -261,7 +261,7 @@ KTreemapTile::squarify( const TQRect & rect,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQRect
|
|
|
|
|
KTreemapTile::tqlayoutRow( const TQRect & rect,
|
|
|
|
|
KTreemapTile::layoutRow( const TQRect & rect,
|
|
|
|
|
double scale,
|
|
|
|
|
KFileInfoList & row )
|
|
|
|
|
{
|
|
|
|
@ -332,7 +332,7 @@ KTreemapTile::tqlayoutRow( const TQRect & rect,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Subtract the tqlayouted area from the rectangle.
|
|
|
|
|
// Subtract the layouted area from the rectangle.
|
|
|
|
|
|
|
|
|
|
TQRect newRect;
|
|
|
|
|
|
|
|
|
@ -427,10 +427,10 @@ KTreemapTile::renderCushion()
|
|
|
|
|
// Cache some values. They are used for each loop iteration, so let's try
|
|
|
|
|
// to keep multiple indirect references down.
|
|
|
|
|
|
|
|
|
|
int ambientLight = tqparentView()->ambientLight();
|
|
|
|
|
double lightX = tqparentView()->lightX();
|
|
|
|
|
double lightY = tqparentView()->lightY();
|
|
|
|
|
double lightZ = tqparentView()->lightZ();
|
|
|
|
|
int ambientLight = parentView()->ambientLight();
|
|
|
|
|
double lightX = parentView()->lightX();
|
|
|
|
|
double lightY = parentView()->lightY();
|
|
|
|
|
double lightZ = parentView()->lightZ();
|
|
|
|
|
|
|
|
|
|
double xx2 = cushionSurface().xx2();
|
|
|
|
|
double xx1 = cushionSurface().xx1();
|
|
|
|
@ -440,7 +440,7 @@ KTreemapTile::renderCushion()
|
|
|
|
|
int x0 = rect.x();
|
|
|
|
|
int y0 = rect.y();
|
|
|
|
|
|
|
|
|
|
TQColor color = tqparentView()->tileColor( _orig );
|
|
|
|
|
TQColor color = parentView()->tileColor( _orig );
|
|
|
|
|
int maxRed = max( 0, color.red() - ambientLight );
|
|
|
|
|
int maxGreen = max( 0, color.green() - ambientLight );
|
|
|
|
|
int maxBlue = max( 0, color.blue() - ambientLight );
|
|
|
|
|