X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/3a8788fb198a1e0590823745f39fbff81056db09..f5a1e732bf3907cabd004932aba3256b31d9d282:/Constructor/item.h diff --git a/Constructor/item.h b/Constructor/item.h index cf9b714..10070b8 100644 --- a/Constructor/item.h +++ b/Constructor/item.h @@ -11,6 +11,20 @@ #include #include "itemptywnd.h" +typedef enum { NONE, RIGHT, LEFT, MIDDLE } ConnectorSide; +typedef enum { UNDEF, IN, OUT } ConnectorType; + +class Connector { + public: + int id_dest; + ConnectorType type; + Connector& operator= (Connector & c) { + id_dest = c.id_dest; + type = c.type; + return *this; + } +}; + class WorkPlace; class CItem:public Gtk::DrawingArea { @@ -27,29 +41,30 @@ public: int get_position_x(); int get_position_y(); int get_id(); - int get_conector_in(); - int get_conector_out(); int get_img_actual(); + Glib::ustring get_name(); double get_caudal(); void set_position(int _x, int _y); void set_id(int _id); void set_caudal(double _caudal); void set_name(Glib::ustring _name); - void set_conector_in(int _in); - void set_conector_out(int _out); bool is_occupied_area(int _a, int _b); - bool is_other_connection_area(int _a, int _b); + ConnectorType is_other_connection_area(int _a, int _b); virtual void save(FILE *archivo) = 0; virtual bool check_connection()=0; - virtual bool is_connection_area(int _a, int _b)=0; - Glib::ustring get_name(); + virtual void set_default_connector(); + virtual ConnectorType get_connector_type( int _a, int _b ); WorkPlace *workplace; Gtk::Entry *combo_entry; std::list *listaItems; bool is_union; + bool is_connected; + // Hay que ocultarlo --- problemas con el get y el set!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // 0 = izquierda/arriba , 1 = derecha/abajo , 2 = medio. tomando como referencia la imagen inicial de cada item cuando corresponda + std::vector connect_vec; protected: int imgActual; - int ID, conector_in, conector_out; + int ID; Glib::ustring name; double caudal_max; Gtk::Menu menu_popup;