|
degate 0.1.1
|
Represents a wire. More...
#include <Wire.h>

Public Member Functions | |
| Wire (int _from_x, int _from_y, int _to_x, int _to_y, diameter_t _diameter) | |
| The constructor for a wire object. | |
| virtual | ~Wire () |
| Destructor for a wire 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=std::cout, int n_tabs=0) const |
| Print wire. | |
| void | shift_x (int delta_x) |
| Shift the shape vertically. | |
| void | shift_y (int delta_y) |
| Shift the shape horizontally. | |
| 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) |
| Wire::Wire | ( | int | _from_x, |
| int | _from_y, | ||
| int | _to_x, | ||
| int | _to_y, | ||
| diameter_t | _diameter | ||
| ) |
| virtual degate::Wire::~Wire | ( | ) | [inline, virtual] |
| virtual BoundingBox const& degate::Wire::get_bounding_box | ( | ) | const [inline, virtual] |
Get the bounding box.
Reimplemented from degate::Line.
Definition at line 91 of file Wire.h.
{
return Line::get_bounding_box();
}
| const std::string Wire::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 39 of file Wire.cc.
References degate::LogicModelObjectBase::get_name(), degate::LogicModelObjectBase::get_object_id(), and degate::LogicModelObjectBase::has_name().
{
if(has_name()) {
boost::format fmter("wire %1% (%2%)");
fmter % get_name() % get_object_id();
return fmter.str();
}
else {
boost::format fmter("wire (%1%)");
fmter % get_object_id();
return fmter.str();
}
}

| const std::string Wire::get_object_type_name | ( | ) | const [virtual] |
Get a human readable string that names the object type.
Here it is "Wire".
Reimplemented from degate::LogicModelObjectBase.
Definition at line 52 of file Wire.cc.
{
return std::string("Wire");
}
| virtual bool degate::Wire::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::Line.
Definition at line 87 of file Wire.h.
{
return in_bounding_box(bbox);
}
| virtual bool degate::Wire::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::Line.
Definition at line 95 of file Wire.h.
{
return Line::in_shape(x, y, max_distance);
}
| void Wire::print | ( | std::ostream & | os = std::cout, |
| int | n_tabs = 0 |
||
| ) | const [virtual] |
| object_id_t Wire::push_object_to_server | ( | std::string const & | server_url | ) | [protected, virtual] |
Implements degate::RemoteObject.
Definition at line 59 of file Wire.cc.
References degate::Line::get_diameter(), degate::Line::get_from_x(), degate::Line::get_from_y(), degate::PlacedLogicModelObject::get_layer(), degate::Line::get_to_x(), degate::Line::get_to_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("wire"));
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_from_x()));
params.add(xmlrpc_c::value_int(get_from_y()));
params.add(xmlrpc_c::value_int(get_to_x()));
params.add(xmlrpc_c::value_int(get_to_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 wire 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 degate::Wire::shift_x | ( | int | delta_x | ) | [inline, 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::Line.
Definition at line 77 of file Wire.h.
References degate::PlacedLogicModelObject::notify_shape_change().
{
Line::shift_x(delta_x);
notify_shape_change();
}

| void degate::Wire::shift_y | ( | int | delta_y | ) | [inline, 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::Line.
Definition at line 82 of file Wire.h.
References degate::PlacedLogicModelObject::notify_shape_change().
{
Line::shift_y(delta_y);
notify_shape_change();
}

1.7.4