00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef NETWORKSAREA_HH
00024 #define NETWORKSAREA_HH
00025
00026 #include <gtkmm/drawingarea.h>
00027 #include <gdkmm/colormap.h>
00028 #include <pangomm/context.h>
00029
00030 #include <CCircuit.hh>
00031 #include <signalframe.hh>
00032 #include <CCircuitSolver.hh>
00033
00038 namespace RLC
00039 {
00040
00041
00047 class CNetworksArea : public Gtk::DrawingArea
00048 {
00049 friend class CCircuit;
00050 friend class CElement;
00051 friend class CVoltage;
00052 friend class CVoltage_u;
00053 friend class CVoltage_i;
00054 friend class CCurent;
00055 friend class CCurent_u;
00056 friend class CCurent_i;
00057 friend class CResistor;
00058 friend class CCapasistor;
00059 friend class CInductor;
00060 friend class CNode;
00061 friend class CSignalFrame;
00062
00063 public:
00069 CNetworksArea();
00070
00075 ~CNetworksArea();
00076
00082 void openCircuitFile();
00083
00090 void solveCircuit();
00091
00097 void clearCircuit();
00098
00099
00100
00101
00102 protected:
00109 bool mf_drawNetting();
00110
00124 bool mf_drawArrow(int fieldX, int fieldY, int rot = 0, float proportion = 0.6);
00125
00132 Gdk::Point mf_fieldCoords(Gdk::Point coords);
00133
00142 CElement* mf_getFieldElement(Gdk::Point fieldCoords);
00143
00150 void mf_drawCircuit();
00151
00152
00153
00154 bool on_networksarea_configure_event(GdkEventConfigure* event);
00155 bool on_networksarea_expose_event(GdkEventExpose* event);
00156 bool on_networksarea_motion_notify_event(GdkEventMotion* event);
00157 bool on_networksarea_button_press_event(GdkEventButton* event);
00158 bool on_networksarea_button_release_event(GdkEventButton* event);
00159
00163 Glib::RefPtr<Gdk::Pixmap> m_RefPixmap_NetworksArea;
00167 Glib::RefPtr<Gdk::GC> m_RefGC_NetworksArea;
00168
00169
00175 Gdk::Color m_Color_Blue, m_Color_Green, m_Color_Red, m_Color_Black, m_Color_White,
00176 m_Color_Beige;
00177 Gdk::Color m_Color_BG, m_Color_FG, m_Color_Element, m_Color_Node, m_Color_Branch,
00178 m_Color_NameText, m_Color_ValueText, m_Color_FrameBG, m_Color_Chart,
00179 m_Color_Axis;
00180
00186 int m_SquareSize;
00192 int m_NodeSize;
00193
00197 CCircuit m_Circuit_Edited;
00201 CCircuitSolver m_circuitKiller;
00207 RLC::CSignalFrame m_SignalFrame_Element;
00208
00214 bool m_circuitIsChanged;
00218 bool m_pixmapIsConfigured;
00222 bool m_circuitIsLoaded;
00226 bool m_circuitIsSolved;
00227
00231 Glib::RefPtr<Pango::Context> m_RefContext_Main;
00232
00233
00234
00235
00236
00237
00238
00239 };
00240
00241 }
00242
00243
00244 #endif // NETWORKSAREA_HH
00245