degate 0.1.1
Public Member Functions | Private Member Functions | Private Attributes
degate::Project Class Reference

The project class is a container for project related data. More...

#include <Project.h>

List of all members.

Public Member Functions

 Project (length_t width, length_t height)
 Create a new and empty project.
 Project (length_t width, length_t height, std::string const &_directory, unsigned int layers=0)
 Create a new and empty project.
virtual ~Project ()
 The destructor.
void set_project_directory (std::string const &_directory)
 Set the project directory.
std::string const & get_project_directory ()
 Get the project directory.
BoundingBox const & get_bounding_box () const
 Get the bounding box that represents the covered area for this project.
unsigned int get_width () const
 Get the width of the project.
unsigned int get_height () const
 get the height of a project.
LogicModel_shptr get_logic_model ()
 Get the logic model.
void set_logic_model (LogicModel_shptr _logic_model)
 Set the logic model for a project.
void set_name (std::string _name)
std::string const & get_name () const
void set_description (std::string _description)
std::string const & get_description () const
void set_degate_version (std::string version_str)
std::string const & get_degate_version ()
void set_lambda (length_t l)
length_t get_lambda () const
void set_default_pin_diameter (diameter_t pin_diameter)
diameter_t get_default_pin_diameter () const
void set_default_wire_diameter (diameter_t wire_diameter)
diameter_t get_default_wire_diameter () const
void set_default_port_diameter (diameter_t port_diameter)
diameter_t get_default_port_diameter () const
void set_default_color (ENTITY_COLOR e, color_t c)
 Set the default color for an entity.
color_t get_default_color (ENTITY_COLOR e) const
 Get the default color for an entity.
const default_colors_t get_default_colors () const
 Get all color defaults.
void set_changed (bool state=true)
 Set changed flag to indicate that the project data was changed.
bool is_changed () const
 Check if the project was changed.
time_t get_time_since_last_save () const
 Get time since last "save".
void reset_last_saved_counter ()
 Reset last save counter.
RegularGrid_shptr get_regular_horizontal_grid ()
RegularGrid_shptr get_regular_vertical_grid ()
IrregularGrid_shptr get_irregular_horizontal_grid ()
IrregularGrid_shptr get_irregular_vertical_grid ()
PortColorManager_shptr get_port_color_manager ()
void print (std::ostream &)
 Dump basic meta data for the project as human readable text into an ostream.
void print_all (std::ostream &)
 Dump most meta data for the project as human readable text into an ostream.
void set_server_url (std::string const &server_url)
 Set server url.
std::string get_server_url () const
 Get server url.
transaction_id_t get_last_pulled_tid () const
 Get the last pulled transaction ID.
void set_last_pulled_tid (transaction_id_t tid)
 Set last pulled transaction ID.
double get_pixel_per_um () const
 Get the ratio of pixels per micrometer.
void set_pixel_per_um (double pix_per_um)
 Get the ratio of pixels per micrometer.
int get_template_dimension () const
 Get the template dimension.
void set_template_dimension (int template_dimension)
 Set the template dimension.
void set_font_size (unsigned int font_size)
 Set the default font size.
unsigned int get_font_size () const
 Get the default font size.
RCBase::container_typeget_rcv_blacklist ()
 Get a list of blacklisted Rule Check violations.

Private Member Functions

void init_default_values ()

Private Attributes

BoundingBox bounding_box
std::string name
std::string description
std::string degate_version
std::string directory
std::string server_url
RegularGrid_shptr regular_horizontal_grid
RegularGrid_shptr regular_vertical_grid
IrregularGrid_shptr irregular_horizontal_grid
IrregularGrid_shptr irregular_vertical_grid
bool changed
time_t last_persistent_version
diameter_t default_pin_diameter
diameter_t default_wire_diameter
diameter_t default_port_diameter
length_t lambda
transaction_id_t last_transaction_id
LogicModel_shptr logic_model
PortColorManager_shptr port_color_manager
default_colors_t default_colors
double pixel_per_um
int template_dimension
RCBase::container_type rcv_blacklist
unsigned int font_size

Detailed Description

The project class is a container for project related data.

Definition at line 53 of file Project.h.


Constructor & Destructor Documentation

Project::Project ( length_t  width,
length_t  height 
)

Create a new and empty project.

It will create an empty logic model as well.

Definition at line 33 of file Project.cc.

References init_default_values().

                                                :
  bounding_box(width, height),
  logic_model(new LogicModel(width, height)),
  port_color_manager(new PortColorManager()) {
  init_default_values();
}

Here is the call graph for this function:

Project::Project ( length_t  width,
length_t  height,
std::string const &  _directory,
unsigned int  layers = 0 
)

Create a new and empty project.

It will create an empty logic model as well.

Definition at line 41 of file Project.cc.

References init_default_values().

                                                                                                  :
  bounding_box(width, height),
  directory(_directory),
  logic_model(new LogicModel(width, height, layers)),
  port_color_manager(new PortColorManager()) {
  init_default_values();
}

Here is the call graph for this function:

Project::~Project ( ) [virtual]

The destructor.

Definition at line 49 of file Project.cc.

                  {
}

Member Function Documentation

BoundingBox const & Project::get_bounding_box ( ) const

Get the bounding box that represents the covered area for this project.

Definition at line 60 of file Project.cc.

References bounding_box.

                                                   {
  return bounding_box;
}
color_t Project::get_default_color ( ENTITY_COLOR  e) const

Get the default color for an entity.

Returns:
Returns the default color. If there is no default setting 0 is returned.

Definition at line 274 of file Project.cc.

References default_colors.

                                                       {
  default_colors_t::const_iterator i = default_colors.find(e);
  if(i == default_colors.end()) return 0;
  else return i->second;
}
const default_colors_t Project::get_default_colors ( ) const

Get all color defaults.

Definition at line 280 of file Project.cc.

References default_colors.

                                                         {
  return default_colors;
}
diameter_t Project::get_default_pin_diameter ( ) const

Definition at line 118 of file Project.cc.

References default_pin_diameter.

                                                   {
  return default_pin_diameter;
}
diameter_t Project::get_default_port_diameter ( ) const

Definition at line 134 of file Project.cc.

References default_port_diameter.

                                                    {
  return default_port_diameter;
}
diameter_t Project::get_default_wire_diameter ( ) const

Definition at line 126 of file Project.cc.

References default_wire_diameter.

                                                    {
  return default_wire_diameter;
}
std::string const & Project::get_degate_version ( )

Definition at line 102 of file Project.cc.

References degate_version.

                                             {
  return degate_version;
}
std::string const & Project::get_description ( ) const

Definition at line 94 of file Project.cc.

References description.

                                                {
  return description;
}
unsigned int Project::get_font_size ( ) const

Get the default font size.

Definition at line 305 of file Project.cc.

References font_size.

                                          {
  return font_size;
}
unsigned int Project::get_height ( ) const

get the height of a project.

Definition at line 68 of file Project.cc.

References bounding_box, and degate::BoundingBox::get_height().

                                       {
  return bounding_box.get_height();
}

Here is the call graph for this function:

IrregularGrid_shptr Project::get_irregular_horizontal_grid ( )

Definition at line 165 of file Project.cc.

References irregular_horizontal_grid.

IrregularGrid_shptr Project::get_irregular_vertical_grid ( )

Definition at line 169 of file Project.cc.

References irregular_vertical_grid.

length_t Project::get_lambda ( ) const

Definition at line 110 of file Project.cc.

References lambda.

                                   {
  return lambda;
}
transaction_id_t Project::get_last_pulled_tid ( ) const

Get the last pulled transaction ID.

Definition at line 261 of file Project.cc.

References last_transaction_id.

                                                    {
  return last_transaction_id;
}
LogicModel_shptr Project::get_logic_model ( )

Get the logic model.

The logic model should be present all time. This means that you can call this method and should not receive a NULL pointer.

Definition at line 72 of file Project.cc.

References logic_model.

                                          {
  return logic_model;
}
std::string const & Project::get_name ( ) const

Definition at line 86 of file Project.cc.

References name.

                                         {
  return name;
}
double Project::get_pixel_per_um ( ) const

Get the ratio of pixels per micrometer.

Definition at line 284 of file Project.cc.

References pixel_per_um.

                                       {
  return pixel_per_um;
}
PortColorManager_shptr Project::get_port_color_manager ( )

Definition at line 173 of file Project.cc.

References port_color_manager.

                                                       {
  return port_color_manager;
}
std::string const & Project::get_project_directory ( )

Get the project directory.

Definition at line 56 of file Project.cc.

References directory.

                                                {
  return directory;
}
RCBase::container_type & Project::get_rcv_blacklist ( )

Get a list of blacklisted Rule Check violations.

Definition at line 310 of file Project.cc.

References rcv_blacklist.

                                                  {
  return rcv_blacklist;
}
RegularGrid_shptr Project::get_regular_horizontal_grid ( )

Definition at line 157 of file Project.cc.

References regular_horizontal_grid.

RegularGrid_shptr Project::get_regular_vertical_grid ( )

Definition at line 161 of file Project.cc.

References regular_vertical_grid.

                                                     {
  return regular_vertical_grid;
}
std::string Project::get_server_url ( ) const

Get server url.

Definition at line 257 of file Project.cc.

References server_url.

                                        {
  return server_url;
}
int Project::get_template_dimension ( ) const

Get the template dimension.

This is either the height or the width of a gate (template).

Definition at line 293 of file Project.cc.

References template_dimension.

                                          {
  return template_dimension;
}
time_t Project::get_time_since_last_save ( ) const

Get time since last "save".

Returns:
Returns the time in seconds since the project change state was set to false.
See also:
set_changed()

Definition at line 149 of file Project.cc.

References last_persistent_version.

                                               {
  return time(NULL) - last_persistent_version;
}
unsigned int Project::get_width ( ) const

Get the width of the project.

Definition at line 64 of file Project.cc.

References bounding_box, and degate::BoundingBox::get_width().

                                      {
  return bounding_box.get_width();
}

Here is the call graph for this function:

void Project::init_default_values ( ) [private]

Definition at line 207 of file Project.cc.

References degate::DEFAULT_COLOR_ANNOTATION, degate::DEFAULT_COLOR_ANNOTATION_FRAME, degate::DEFAULT_COLOR_EMARKER, degate::DEFAULT_COLOR_GATE, degate::DEFAULT_COLOR_GATE_FRAME, degate::DEFAULT_COLOR_GATE_PORT, degate::DEFAULT_COLOR_GRID, degate::DEFAULT_COLOR_TEXT, degate::DEFAULT_COLOR_VIA_DOWN, degate::DEFAULT_COLOR_VIA_UP, degate::DEFAULT_COLOR_WIRE, default_colors, default_pin_diameter, default_port_diameter, default_wire_diameter, font_size, degate::SingletonBase< Configuration >::get_instance(), degate::Grid::HORIZONTAL, irregular_horizontal_grid, irregular_vertical_grid, lambda, last_transaction_id, pixel_per_um, regular_horizontal_grid, regular_vertical_grid, reset_last_saved_counter(), server_url, set_changed(), and degate::Grid::VERTICAL.

Referenced by Project().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Project::is_changed ( ) const

Check if the project was changed.

Definition at line 145 of file Project.cc.

References changed.

                               {
  return changed;
}
void Project::print ( std::ostream &  os)

Dump basic meta data for the project as human readable text into an ostream.

Definition at line 177 of file Project.cc.

References changed, default_pin_diameter, default_port_diameter, default_wire_diameter, degate_version, description, directory, lambda, and name.

Referenced by print_all().

                                   {
  os
    << endl
    << "================================[ "
    << (name.empty() ? "Unnamed project" : name)
    << " ]=================================" << endl
    << "+ Project description: " << description << endl
    << "+ Degate version: " << degate_version << endl
    << "+ Directory: " << directory << endl
    << "+" << endl
    << "+ Changed: " << (changed ? "true" : "false") << endl
    << "+" << endl
    << "+ Default wire diameter: " << default_wire_diameter << endl
    << "+ Default pin diameter: " << default_pin_diameter << endl
    << "+ Default port diameter: " << default_port_diameter << endl
    << "+ Min distance between electrically isolated objects in pixel (lambda value): " << lambda << endl
    << endl;

}

Here is the caller graph for this function:

void Project::print_all ( std::ostream &  os)

Dump most meta data for the project as human readable text into an ostream.

Definition at line 197 of file Project.cc.

References logic_model, and print().

                                       {
  print(os);
  if(logic_model == NULL) {
    os << "+ The project has no logic model." << endl
       << endl;
  }
  else
    logic_model->print(os);
}

Here is the call graph for this function:

void Project::reset_last_saved_counter ( )

Reset last save counter.

Definition at line 153 of file Project.cc.

References last_persistent_version.

Referenced by init_default_values(), and set_changed().

                                       {
  last_persistent_version = time(NULL);
}

Here is the caller graph for this function:

void Project::set_changed ( bool  state = true)

Set changed flag to indicate that the project data was changed.

This method is normally called from the GUI. If the project was saved to disc, the code should call set_changed(false). Project saving is implemented in ProjectExporter, but because the ProjectExporter might be used for different purposes, this method must be called from the GUI code.

Definition at line 139 of file Project.cc.

References changed, and reset_last_saved_counter().

Referenced by init_default_values().

                                    {
  changed = state;
  if(state == false)
    reset_last_saved_counter();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Project::set_default_color ( ENTITY_COLOR  e,
color_t  c 
)

Set the default color for an entity.

Definition at line 270 of file Project.cc.

References default_colors.

                                                         {
  default_colors[e] = c;
}
void Project::set_default_pin_diameter ( diameter_t  pin_diameter)

Definition at line 114 of file Project.cc.

References default_pin_diameter.

                                                              {
  default_pin_diameter = pin_diameter;
}
void Project::set_default_port_diameter ( diameter_t  port_diameter)

Definition at line 130 of file Project.cc.

References default_port_diameter.

                                                                {
  default_port_diameter = port_diameter;
}
void Project::set_default_wire_diameter ( diameter_t  wire_diameter)

Definition at line 122 of file Project.cc.

References default_wire_diameter.

                                                                {
  default_wire_diameter = wire_diameter;
}
void Project::set_degate_version ( std::string  version_str)

Definition at line 98 of file Project.cc.

References degate_version.

                                                      {
  degate_version = version_str;
}
void Project::set_description ( std::string  _description)

Definition at line 90 of file Project.cc.

References description.

                                                    {
  description = _description;
}
void Project::set_font_size ( unsigned int  font_size)

Set the default font size.

Definition at line 301 of file Project.cc.

References font_size.

                                                  {
  this->font_size = font_size;
}
void Project::set_lambda ( length_t  l)

Definition at line 106 of file Project.cc.

References lambda.

                                   {
  lambda = l;
}
void Project::set_last_pulled_tid ( transaction_id_t  tid)

Set last pulled transaction ID.

Definition at line 265 of file Project.cc.

References last_transaction_id.

                                                      {
  last_transaction_id = tid;
}
void Project::set_logic_model ( LogicModel_shptr  _logic_model)

Set the logic model for a project.

If you reset the logic model, the old logic model will be destroyed.

Definition at line 77 of file Project.cc.

References logic_model.

                                                           {
  logic_model = _logic_model;
}
void Project::set_name ( std::string  _name)

Definition at line 82 of file Project.cc.

References name.

                                      {
  name = _name;
}
void Project::set_pixel_per_um ( double  pix_per_um)

Get the ratio of pixels per micrometer.

Definition at line 288 of file Project.cc.

References pixel_per_um.

                                                {
  pixel_per_um = pix_per_um;
}
void Project::set_project_directory ( std::string const &  _directory)

Set the project directory.

Definition at line 52 of file Project.cc.

References directory.

                                                               {
  directory = _directory;
}
void Project::set_server_url ( std::string const &  server_url)

Set server url.

Definition at line 253 of file Project.cc.

References server_url.

                                                        {
  this->server_url = server_url;
}
void Project::set_template_dimension ( int  template_dimension)

Set the template dimension.

Definition at line 297 of file Project.cc.

References template_dimension.


Member Data Documentation

Definition at line 57 of file Project.h.

Referenced by get_bounding_box(), get_height(), and get_width().

bool degate::Project::changed [private]

Definition at line 70 of file Project.h.

Referenced by is_changed(), print(), and set_changed().

std::string degate::Project::degate_version [private]

Definition at line 61 of file Project.h.

Referenced by get_degate_version(), print(), and set_degate_version().

std::string degate::Project::description [private]

Definition at line 60 of file Project.h.

Referenced by get_description(), print(), and set_description().

std::string degate::Project::directory [private]

Definition at line 62 of file Project.h.

Referenced by get_project_directory(), print(), and set_project_directory().

unsigned int degate::Project::font_size [private]

Definition at line 91 of file Project.h.

Referenced by get_font_size(), init_default_values(), and set_font_size().

Definition at line 67 of file Project.h.

Referenced by get_irregular_horizontal_grid(), and init_default_values().

Definition at line 68 of file Project.h.

Referenced by get_irregular_vertical_grid(), and init_default_values().

Definition at line 76 of file Project.h.

Referenced by get_lambda(), init_default_values(), print(), and set_lambda().

Definition at line 71 of file Project.h.

Referenced by get_time_since_last_save(), and reset_last_saved_counter().

Definition at line 78 of file Project.h.

Referenced by get_last_pulled_tid(), init_default_values(), and set_last_pulled_tid().

Definition at line 80 of file Project.h.

Referenced by get_logic_model(), print_all(), and set_logic_model().

std::string degate::Project::name [private]

Definition at line 59 of file Project.h.

Referenced by get_name(), print(), and set_name().

Definition at line 86 of file Project.h.

Referenced by get_pixel_per_um(), init_default_values(), and set_pixel_per_um().

Definition at line 82 of file Project.h.

Referenced by get_port_color_manager().

Definition at line 89 of file Project.h.

Referenced by get_rcv_blacklist().

Definition at line 65 of file Project.h.

Referenced by get_regular_horizontal_grid(), and init_default_values().

Definition at line 66 of file Project.h.

Referenced by get_regular_vertical_grid(), and init_default_values().

std::string degate::Project::server_url [private]

Definition at line 63 of file Project.h.

Referenced by get_server_url(), init_default_values(), and set_server_url().

Definition at line 87 of file Project.h.

Referenced by get_template_dimension(), and set_template_dimension().


The documentation for this class was generated from the following files: