|
degate 0.1.1
|
Representation of an electrically connectable marker object. More...
#include <EMarker.h>

Public Member Functions | |
| EMarker (int _x, int _y, diameter_t _diameter=5) | |
| Constructor for a via object. | |
| virtual | ~EMarker () |
| Destructor for a via object. | |
| virtual const std::string | get_descriptive_identifier () const |
| Get a human readable string that describes the whole logic model object. | |
| virtual const std::string | get_object_type_name () const |
| Get a human readable string that names the object type. | |
| void | print (std::ostream &os, int n_tabs) const |
| Print the object. | |
| void | shift_x (int delta_x) |
| Shift the shape vertically. | |
| void | shift_y (int delta_y) |
| Shift the shape horizontally. | |
| void | set_x (int x) |
| void | set_y (int y) |
| void | set_diameter (unsigned int diameter) |
| virtual bool | in_bounding_box (BoundingBox const &bbox) const |
| Check if this shape is in the bounding box. | |
| virtual BoundingBox const & | get_bounding_box () const |
| Get the bounding box. | |
| virtual bool | in_shape (int x, int y, int max_distance=0) const |
| Check in the Point with coordinates x and y is within the area of the shape. | |
Protected Member Functions | |
| virtual object_id_t | push_object_to_server (std::string const &server_url) |
Representation of an electrically connectable marker object.
| EMarker::EMarker | ( | int | _x, |
| int | _y, | ||
| diameter_t | _diameter = 5 |
||
| ) |
Constructor for a via object.
Definition at line 28 of file EMarker.cc.
: Circle(_x, _y, _diameter) { }
| EMarker::~EMarker | ( | ) | [virtual] |
| virtual BoundingBox const& degate::EMarker::get_bounding_box | ( | ) | const [inline, virtual] |
Get the bounding box.
Reimplemented from degate::Circle.
Definition at line 92 of file EMarker.h.
Referenced by print().
{
return Circle::get_bounding_box();
}

| const std::string EMarker::get_descriptive_identifier | ( | ) | const [virtual] |
Get a human readable string that describes the whole logic model object.
The string should be unique in order to let the user identify the concrete object. But that is not a must.
Reimplemented from degate::LogicModelObjectBase.
Definition at line 35 of file EMarker.cc.
References degate::LogicModelObjectBase::get_name(), degate::LogicModelObjectBase::get_object_id(), and degate::LogicModelObjectBase::has_name().
{
if(has_name()) {
boost::format fmter("emarker %1% (%2%)");
fmter % get_name() % get_object_id();
return fmter.str();
}
else {
boost::format fmter("emarker (%1%)");
fmter % get_object_id();
return fmter.str();
}
}

| const std::string EMarker::get_object_type_name | ( | ) | const [virtual] |
Get a human readable string that names the object type.
Here it is "EMarker".
Reimplemented from degate::LogicModelObjectBase.
Definition at line 48 of file EMarker.cc.
{
return std::string("EMarker");
}
| virtual bool degate::EMarker::in_bounding_box | ( | BoundingBox const & | bbox | ) | const [inline, virtual] |
Check if this shape is in the bounding box.
Note: it is somhow unclear if this 'in' means complete within or if an intersection is sufficient.
Reimplemented from degate::Circle.
Definition at line 88 of file EMarker.h.
{
return Circle::in_bounding_box(bbox);
}
| virtual bool degate::EMarker::in_shape | ( | int | x, |
| int | y, | ||
| int | max_distance = 0 |
||
| ) | const [inline, virtual] |
Check in the Point with coordinates x and y is within the area of the shape.
Reimplemented from degate::Circle.
Definition at line 96 of file EMarker.h.
{
return Circle::in_shape(x, y, max_distance);
}
| void EMarker::print | ( | std::ostream & | os, |
| int | n_tabs | ||
| ) | const [virtual] |
Print the object.
Implements degate::PlacedLogicModelObject.
Definition at line 53 of file EMarker.cc.
References degate::gen_tabs(), get_bounding_box(), degate::LogicModelObjectBase::get_name(), degate::LogicModelObjectBase::get_object_id(), degate::Circle::get_x(), degate::Circle::get_y(), and degate::BoundingBox::to_string().
{
os
<< gen_tabs(n_tabs) << "EMarker name : " << get_name() << std::endl
<< gen_tabs(n_tabs) << "Object ID : " << get_object_id() << std::endl
<< gen_tabs(n_tabs) << "EMarker position : " << get_x() << " / " << get_y() << std::endl
<< gen_tabs(n_tabs) << "Bounding box : " << Circle::get_bounding_box().to_string() << std::endl
<< std::endl;
;
}

| object_id_t EMarker::push_object_to_server | ( | std::string const & | server_url | ) | [protected, virtual] |
Implements degate::RemoteObject.
Definition at line 91 of file EMarker.cc.
References degate::Circle::get_diameter(), degate::PlacedLogicModelObject::get_layer(), degate::Circle::get_x(), degate::Circle::get_y(), degate::PlacedLogicModelObject::layer, degate::remote_method_call(), and degate::RemoteObject::set_remote_object_id().
{
try {
xmlrpc_c::paramList params;
params.add(xmlrpc_c::value_string("add"));
params.add(xmlrpc_c::value_string("emarker"));
Layer_shptr layer = get_layer();
assert(layer != NULL);
params.add(xmlrpc_c::value_int(layer->get_layer_id()));
params.add(xmlrpc_c::value_int(get_x()));
params.add(xmlrpc_c::value_int(get_y()));
params.add(xmlrpc_c::value_int(get_diameter()));
int const transaction_id =
xmlrpc_c::value_int(remote_method_call(server_url, "degate.push", params));
set_remote_object_id(transaction_id);
std::cout << "Pushed via to server. remote id is: " << transaction_id << std::endl;
return transaction_id;
}
catch(std::exception const& e) {
std::cerr << "Client threw error: " << e.what() << std::endl;
throw XMLRPCException(e.what());
}
catch(...) {
std::cerr << "Client threw unexpected error." << std::endl;
throw XMLRPCException("Client threw unexpected error.");
}
}

| void EMarker::set_diameter | ( | unsigned int | diameter | ) | [virtual] |
Reimplemented from degate::Circle.
Definition at line 85 of file EMarker.cc.
References degate::PlacedLogicModelObject::notify_shape_change().

| void EMarker::set_x | ( | int | x | ) | [virtual] |
Reimplemented from degate::Circle.
Definition at line 75 of file EMarker.cc.
References degate::PlacedLogicModelObject::notify_shape_change().
{
Circle::set_x(x);
notify_shape_change();
}

| void EMarker::set_y | ( | int | y | ) | [virtual] |
Reimplemented from degate::Circle.
Definition at line 80 of file EMarker.cc.
References degate::PlacedLogicModelObject::notify_shape_change().
{
Circle::set_y(y);
notify_shape_change();
}

| void EMarker::shift_x | ( | int | delta_x | ) | [virtual] |
Shift the shape vertically.
Note: If you store this shape in a QuadTree, you have to manage the changes in your QuadTree by yourself.
Reimplemented from degate::Circle.
Definition at line 65 of file EMarker.cc.
References degate::PlacedLogicModelObject::notify_shape_change().
{
Circle::shift_x(delta_x);
notify_shape_change();
}

| void EMarker::shift_y | ( | int | delta_y | ) | [virtual] |
Shift the shape horizontally.
Note: If you store this shape in a QuadTree, you have to manage the changes in your QuadTree by yourself.
Reimplemented from degate::Circle.
Definition at line 70 of file EMarker.cc.
References degate::PlacedLogicModelObject::notify_shape_change().
{
Circle::shift_y(delta_y);
notify_shape_change();
}

1.7.4