<commit_before>/////////////////////////////////////////////
//QTree.h the header of quadtree class
//Description: This class is a general component that can make quadtree support for other components
////////////////////////////////////////////
//The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); 
//you may not use this file except in compliance with the License. You may obtain a copy of the License at 
//http://www.mozilla.org/MPL/ 
//Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 
//ANY KIND, either express or implied. See the License for the specific language governing rights and 
//limitations under the License. 
//
// The original Author is Neio(<EMAIL>) and released as public domain in July 2009 to be a part of MapWinGIS.
// The contributors should list themselves and their modifications here.
//////////////////////////////////////////////////////////
#pragma once
using namespace std;

#define MAX_LEAF_NODES 100

class QTreeExtent
{
public:
	double left;
	double right;
	double top;//max
	double bottom;//min
public:
	QTreeExtent(){
		this->left = this->right = this->top = this->bottom = 0.0;
	};
	QTreeExtent(double left,double right,double top ,double bottom)
	{
		this->left = left;
		this->right = right;
		this->top  = top;
		this->bottom = bottom;
	}
	bool Contain(const QTreeExtent& o)
	{
		return (left <= o.left
			&& right>=o.right
			&& top >= o.top
			&& bottom <= o.bottom);

	}

	bool ContainIn(const QTreeExtent& o)
	{
		return (left >= o.left
			&& right<=o.right
			&& top <= o.top
			&& bottom >= o.bottom);

	}

	bool IntersectIn(QTreeExtent& o)
	{
		return !(o.right < left
			||o.left > right
			||o.top < bottom
			|| o.bottom > top
			);
	}<commit_msg>Bugfix: adding a zero-extent node to an empty QTree caused a stack overflow exception<commit_after>/////////////////////////////////////////////
//QTree.h the header of quadtree class
//Description: This class is a general component that can make quadtree support for other components
////////////////////////////////////////////
//The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); 
//you may not use this file except in compliance with the License. You may obtain a copy of the License at 
//http://www.mozilla.org/MPL/ 
//Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 
//ANY KIND, either express or implied. See the License for the specific language governing rights and 
//limitations under the License. 
//
// The original Author is Neio(<EMAIL>) and released as public domain in July 2009 to be a part of MapWinGIS.
// The contributors should list themselves and their modifications here.
//////////////////////////////////////////////////////////
#pragma once
using namespace std;

#define MAX_LEAF_NODES 100

class QTreeExtent
{
public:
	double left;
	double right;
	double top;//max
	double bottom;//min
public:
	QTreeExtent(){
		this->left = this->right = this->top = this->bottom = 0.0;
	};
	QTreeExtent(double left,double right,double top ,double bottom)
	{
        // Ensure the extent has a width > 0
        if (abs(left - right) < 0.0005) {
            left -= 0.00025;
            right += 0.00025;
        }
        // Ensure the extent has a height > 0
        if (abs(top - bottom) < 0.0005) {
            bottom -= 0.00025;
            top += 0.00025;
        }

		this->left = left;
		this->right = right;
		this->top  = top;
		this->bottom = bottom;
	}
	bool Contain(const QTreeExtent& o)
	{
		return (left <= o.left
			&& right>=o.right
			&& top >= o.top
			&& bottom <= o.bottom);

	}

	bool ContainIn(const QTreeExtent& o)
	{
		return (left >= o.left
			&& right<=o.right
			&& top <= o.top
			&& bottom >= o.bottom);

	}

	bool IntersectIn(QTreeExtent& o)
	{
		return !(o.right < left
			||o.left > right
			||o.top < bottom
			|| o.bottom > top
			);
	}
{'fraction_non_alphanumeric': 0.1774193548387097, 'fraction_numerical': 0.014616935483870967, 'mean_word_length': 2.2586206896551726, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2189292', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1148, 'n_words': 441}