reformat Qt/qt_clust.cpp
This commit is contained in:
+6
-4
@@ -20,14 +20,15 @@ static void include(QRect& r, const QRect& rect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
A Clusterizer groups rectangles (QRects) into non-overlapping rectangles
|
* A Clusterizer groups rectangles (QRects) into non-overlapping
|
||||||
by a merging heuristic.
|
* rectangles by a merging heuristic.
|
||||||
*/
|
*/
|
||||||
Clusterizer::Clusterizer(int maxclusters) :
|
Clusterizer::Clusterizer(int maxclusters) :
|
||||||
cluster(new QRect[maxclusters]),
|
cluster(new QRect[maxclusters]),
|
||||||
count(0),
|
count(0),
|
||||||
max(maxclusters)
|
max(maxclusters)
|
||||||
{ }
|
{
|
||||||
|
}
|
||||||
|
|
||||||
Clusterizer::~Clusterizer()
|
Clusterizer::~Clusterizer()
|
||||||
{
|
{
|
||||||
@@ -51,7 +52,8 @@ void Clusterizer::add(int x, int y, int w, int h)
|
|||||||
|
|
||||||
void Clusterizer::add(const QRect& rect)
|
void Clusterizer::add(const QRect& rect)
|
||||||
{
|
{
|
||||||
QRect biggerrect(rect.x()-1,rect.y()-1,rect.width()+2,rect.height()+2);
|
QRect biggerrect(rect.x() - 1, rect.y() - 1,
|
||||||
|
rect.width() + 2, rect.height() + 2);
|
||||||
|
|
||||||
//assert(rect.width() > 0 && rect.height() > 0);
|
//assert(rect.width() > 0 && rect.height() > 0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user