Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

networksarea.hh

Go to the documentation of this file.
00001 /*
00002  * RolLerCoaster Linear Networks Solver
00003  *
00004  * RolLerCoaster is the legal property of its developers, whose names are 
00005  * listed in the COPYRIGHT file distributed with this source distribution.
00006  * 
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the free software foundation; either version 2 of the license, or
00010  * (at your option) any later version.
00011  *
00012  * this program is distributed in the hope that it will be useful,
00013  * but without any warranty; without even the implied warranty of
00014  * merchantability or fitness for a particular purpose.  see the
00015  * gnu general public license for more details.
00016  *
00017  * you should have received a copy of the gnu general public license
00018  * along with this program; if not, write to the free software
00019  * foundation, inc., 59 temple place, suite 330, boston, ma  02111-1307  usa
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   // class CMainWindow;
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       // void setParent(CMainWindow* parent); 
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       // bool mf_initFieldElement();
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       // TODO: rewrite this in some kind of array.
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       // int m_maxFieldX;
00234       // int m_maxFieldY;
00235 // 
00236       // std::vector<std::vector<CElement*> > m_vFieldElement;
00237 
00238       // CMainWindow* m_parent;
00239   };
00240   
00241 }
00242 
00243 
00244 #endif // NETWORKSAREA_HH
00245 

Generated on Sun Jan 16 11:05:56 2005 for RolLerCoaster by  doxygen 1.3.9.1