|
degate 0.1.1
|
#include <BoundingBox.h>
Public Member Functions | |
| BoundingBox () | |
| BoundingBox (int min_x, int max_x, int min_y, int max_y) | |
| BoundingBox (int width, int height) | |
| BoundingBox (const BoundingBox &) | |
| virtual | ~BoundingBox () |
| BoundingBox const & | get_bounding_box () const |
| bool | in_shape (int x, int y, int max_distance=0) const |
| bool | in_bounding_box (BoundingBox const &bbox) const |
| Check if this bounding box is completly within the bounding box given as parameter. | |
| bool | operator== (const BoundingBox &other) const |
| bool | operator!= (const BoundingBox &other) const |
| bool | intersects (BoundingBox const &rect) const |
| bool | complete_within (BoundingBox const &rect) const |
| Check, if rectangle rect is complete within rectangle represented by this. | |
| unsigned int | get_width () const |
| unsigned int | get_height () const |
| int | get_min_x () const |
| int | get_max_x () const |
| int | get_min_y () const |
| int | get_max_y () const |
| int | get_center_x () const |
| int | get_center_y () const |
| void | set_min_x (int min_x) |
| void | set_min_y (int min_y) |
| void | set_max_x (int max_x) |
| void | set_max_y (int max_y) |
| void | set (int min_x, int max_x, int min_y, int max_y) |
| void | shift_x (int delta_x) |
| void | shift_y (int delta_y) |
| void | shift (int delta_x, int delta_y) |
| void | print (std::ostream &os=std::cout, int n_tabs=0) const |
| std::string | to_string () const |
Private Attributes | |
| int | min_x |
| int | max_x |
| int | min_y |
| int | max_y |
Definition at line 30 of file BoundingBox.h.
| BoundingBox::BoundingBox | ( | ) |
| BoundingBox::BoundingBox | ( | int | min_x, |
| int | max_x, | ||
| int | min_y, | ||
| int | max_y | ||
| ) |
| BoundingBox::BoundingBox | ( | int | width, |
| int | height | ||
| ) |
| BoundingBox::BoundingBox | ( | const BoundingBox & | o | ) |
| BoundingBox::~BoundingBox | ( | ) | [virtual] |
Definition at line 54 of file BoundingBox.cc.
{
}
| bool BoundingBox::complete_within | ( | BoundingBox const & | rect | ) | const |
| BoundingBox const & BoundingBox::get_bounding_box | ( | ) | const |
Definition at line 57 of file BoundingBox.cc.
Referenced by degate::autoconnect_interlayer_objects(), degate::autoconnect_objects(), degate::check_object_tangency(), degate::get_bbox_trait_selector< true >::get_bounding_box_for_object(), degate::get_bbox_trait_selector< b >::get_bounding_box_for_object(), degate::ProjectImporter::import_all(), and degate::QuadTree< T >::traverse_downto_bounding_box().
{
return *this;
}

| int BoundingBox::get_center_x | ( | ) | const |
Definition at line 165 of file BoundingBox.cc.
References get_width(), and min_x.

| int BoundingBox::get_center_y | ( | ) | const |
Definition at line 169 of file BoundingBox.cc.
References get_height(), and min_y.
{
return min_y + get_height() / 2;
}

| unsigned int BoundingBox::get_height | ( | ) | const |
Definition at line 110 of file BoundingBox.cc.
Referenced by degate::ImageHistogram< double, double >::check_bounding_box(), get_center_y(), degate::Project::get_height(), degate::LogicModel::get_height(), degate::ImageBase::get_height(), degate::GateTemplate::get_height(), degate::TemplateMatchingInCols::get_next_pos(), degate::TemplateMatchingInRows::get_next_pos(), degate::TemplateMatchingNormal::get_next_pos(), degate::grab_image(), degate::TemplateMatching::prepare_background_images(), degate::ViaMatching::run(), degate::ExternalMatching::run(), and degate::save_part_of_image().

| int BoundingBox::get_max_x | ( | ) | const |
Definition at line 118 of file BoundingBox.cc.
References max_x.
Referenced by degate::BlueChannelImageHistogram::add_area(), degate::GreenChannelImageHistogram::add_area(), degate::RedChannelImageHistogram::add_area(), degate::LightnessImageHistogram::add_area(), degate::SaturationImageHistogram::add_area(), degate::HueImageHistogram::add_area(), degate::ImageHistogram< double, double >::check_bounding_box(), degate::check_object_tangency(), degate::extract_partial_image(), degate::TemplateMatchingInCols::get_next_pos(), degate::TemplateMatching::get_scaled_bounding_box(), degate::ProjectImporter::import_all(), degate::Rectangle::in_bounding_box(), degate::TemplateMatching::init(), degate::QuadTree< T >::print(), degate::WireMatching::run(), and degate::ViaMatching::scan().
{
return max_x;
}

| int BoundingBox::get_max_y | ( | ) | const |
Definition at line 126 of file BoundingBox.cc.
References max_y.
Referenced by degate::BlueChannelImageHistogram::add_area(), degate::GreenChannelImageHistogram::add_area(), degate::RedChannelImageHistogram::add_area(), degate::LightnessImageHistogram::add_area(), degate::SaturationImageHistogram::add_area(), degate::HueImageHistogram::add_area(), degate::ImageHistogram< double, double >::check_bounding_box(), degate::check_object_tangency(), degate::extract_partial_image(), degate::TemplateMatchingInRows::get_next_pos(), degate::TemplateMatching::get_scaled_bounding_box(), degate::ProjectImporter::import_all(), degate::Rectangle::in_bounding_box(), degate::TemplateMatching::init(), degate::QuadTree< T >::print(), degate::WireMatching::run(), and degate::ViaMatching::scan().
{
return max_y;
}

| int BoundingBox::get_min_x | ( | ) | const |
Definition at line 114 of file BoundingBox.cc.
References min_x.
Referenced by degate::BlueChannelImageHistogram::add_area(), degate::GreenChannelImageHistogram::add_area(), degate::RedChannelImageHistogram::add_area(), degate::LightnessImageHistogram::add_area(), degate::SaturationImageHistogram::add_area(), degate::HueImageHistogram::add_area(), degate::ImageHistogram< double, double >::check_bounding_box(), degate::check_object_tangency(), degate::extract_partial_image(), degate::TemplateMatchingInCols::get_next_pos(), degate::TemplateMatchingInRows::get_next_pos(), degate::TemplateMatchingNormal::get_next_pos(), degate::TemplateMatching::get_scaled_bounding_box(), degate::ProjectImporter::import_all(), degate::Rectangle::in_bounding_box(), degate::TemplateMatching::match_single_template(), degate::QuadTree< T >::print(), degate::WireMatching::run(), degate::ExternalMatching::run(), degate::ViaMatching::scan(), and degate::GateTemplate::set_width().
{
return min_x;
}

| int BoundingBox::get_min_y | ( | ) | const |
Definition at line 122 of file BoundingBox.cc.
References min_y.
Referenced by degate::BlueChannelImageHistogram::add_area(), degate::GreenChannelImageHistogram::add_area(), degate::RedChannelImageHistogram::add_area(), degate::LightnessImageHistogram::add_area(), degate::SaturationImageHistogram::add_area(), degate::HueImageHistogram::add_area(), degate::ImageHistogram< double, double >::check_bounding_box(), degate::check_object_tangency(), degate::extract_partial_image(), degate::TemplateMatchingInCols::get_next_pos(), degate::TemplateMatchingInRows::get_next_pos(), degate::TemplateMatchingNormal::get_next_pos(), degate::TemplateMatching::get_scaled_bounding_box(), degate::ProjectImporter::import_all(), degate::Rectangle::in_bounding_box(), degate::TemplateMatching::match_single_template(), degate::QuadTree< T >::print(), degate::WireMatching::run(), degate::ExternalMatching::run(), degate::ViaMatching::scan(), and degate::GateTemplate::set_height().
{
return min_y;
}

| unsigned int BoundingBox::get_width | ( | ) | const |
Definition at line 106 of file BoundingBox.cc.
Referenced by degate::ImageHistogram< double, double >::check_bounding_box(), get_center_x(), degate::TemplateMatchingInCols::get_next_pos(), degate::TemplateMatchingInRows::get_next_pos(), degate::TemplateMatchingNormal::get_next_pos(), degate::Project::get_width(), degate::LogicModel::get_width(), degate::ImageBase::get_width(), degate::GateTemplate::get_width(), degate::grab_image(), degate::TemplateMatching::prepare_background_images(), degate::ExternalMatching::run(), and degate::save_part_of_image().

| bool BoundingBox::in_bounding_box | ( | BoundingBox const & | bbox | ) | const |
Check if this bounding box is completly within the bounding box given as parameter.
Definition at line 78 of file BoundingBox.cc.
References max_x, max_y, min_x, and min_y.
Referenced by degate::Line::in_bounding_box(), degate::Circle::in_bounding_box(), and degate::QuadTree< T >::traverse_downto_bounding_box().
{
return (min_x >= bbox.min_x &&
max_x <= bbox.max_x &&
min_y >= bbox.min_y &&
max_y <= bbox.max_y);
}

| bool BoundingBox::in_shape | ( | int | x, |
| int | y, | ||
| int | max_distance = 0 |
||
| ) | const |
Definition at line 61 of file BoundingBox.cc.
References max_x, max_y, min_x, and min_y.
Referenced by degate::Line::in_shape().
{
return (x >= min_x - max_distance && x <= max_x + max_distance &&
y >= min_y - max_distance && y <= max_y + max_distance) ? true : false;
}

| bool BoundingBox::intersects | ( | BoundingBox const & | rect | ) | const |
| bool BoundingBox::operator!= | ( | const BoundingBox & | other | ) | const |
Definition at line 73 of file BoundingBox.cc.
{
return !(*this == other);
}
| bool BoundingBox::operator== | ( | const BoundingBox & | other | ) | const |
| void BoundingBox::print | ( | std::ostream & | os = std::cout, |
| int | n_tabs = 0 |
||
| ) | const |
Definition at line 180 of file BoundingBox.cc.
References degate::gen_tabs(), and to_string().

| void BoundingBox::set | ( | int | min_x, |
| int | max_x, | ||
| int | min_y, | ||
| int | max_y | ||
| ) |
| void BoundingBox::set_max_x | ( | int | max_x | ) |
Definition at line 140 of file BoundingBox.cc.
References min_x.
Referenced by degate::TemplateMatching::init(), and degate::GateTemplate::set_width().

| void BoundingBox::set_max_y | ( | int | max_y | ) |
Definition at line 145 of file BoundingBox.cc.
References min_y.
Referenced by degate::TemplateMatching::init(), and degate::GateTemplate::set_height().

| void BoundingBox::set_min_x | ( | int | min_x | ) |
| void BoundingBox::set_min_y | ( | int | min_y | ) |
| void BoundingBox::shift | ( | int | delta_x, |
| int | delta_y | ||
| ) |
| void BoundingBox::shift_x | ( | int | delta_x | ) |
| void BoundingBox::shift_y | ( | int | delta_y | ) |
| std::string BoundingBox::to_string | ( | ) | const |
Definition at line 184 of file BoundingBox.cc.
References max_x, max_y, min_x, and min_y.
Referenced by degate::ImageHistogram< double, double >::check_bounding_box(), degate::Via::print(), degate::GatePort::print(), degate::Gate::print(), degate::EMarker::print(), print(), and degate::Annotation::print().
{
boost::format f("x = %1% .. %2% / y = %3% ... %4%");
f % min_x % max_x % min_y % max_y;
return f.str();
}

int degate::BoundingBox::max_x [private] |
Definition at line 33 of file BoundingBox.h.
Referenced by BoundingBox(), complete_within(), get_max_x(), get_width(), in_bounding_box(), in_shape(), intersects(), operator==(), set_min_x(), shift_x(), and to_string().
int degate::BoundingBox::max_y [private] |
Definition at line 33 of file BoundingBox.h.
Referenced by BoundingBox(), complete_within(), get_height(), get_max_y(), in_bounding_box(), in_shape(), intersects(), operator==(), set_min_y(), shift_y(), and to_string().
int degate::BoundingBox::min_x [private] |
Definition at line 33 of file BoundingBox.h.
Referenced by BoundingBox(), complete_within(), get_center_x(), get_min_x(), get_width(), in_bounding_box(), in_shape(), intersects(), operator==(), set_max_x(), shift_x(), and to_string().
int degate::BoundingBox::min_y [private] |
Definition at line 33 of file BoundingBox.h.
Referenced by BoundingBox(), complete_within(), get_center_y(), get_height(), get_min_y(), in_bounding_box(), in_shape(), intersects(), operator==(), set_max_y(), shift_y(), and to_string().
1.7.4