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

RLC::CNetworksArea Class Reference

A circuit drawing class. More...

#include <networksarea.hh>

List of all members.

Public Member Functions

 CNetworksArea ()
 A constructor.
 ~CNetworksArea ()
 A destructor.
void openCircuitFile ()
 Circuit opening method.
void solveCircuit ()
 Circuit solving method.
void clearCircuit ()
 Circuit clearing method.

Protected Member Functions

bool mf_drawNetting ()
 Draws netting.
bool mf_drawArrow (int fieldX, int fieldY, int rot=0, float proportion=0.6)
 Draws arrow.
Gdk::Point mf_fieldCoords (Gdk::Point coords)
 Function returning network field coords.
CElementmf_getFieldElement (Gdk::Point fieldCoords)
 Return a pointer to element in a field.
void mf_drawCircuit ()
 Circuit drawing method.
bool on_networksarea_configure_event (GdkEventConfigure *event)
bool on_networksarea_expose_event (GdkEventExpose *event)
bool on_networksarea_motion_notify_event (GdkEventMotion *event)
bool on_networksarea_button_press_event (GdkEventButton *event)
bool on_networksarea_button_release_event (GdkEventButton *event)

Protected Attributes

Glib::RefPtr< Gdk::Pixmap > m_RefPixmap_NetworksArea
 A pixmap where the circuit is drawn.
Glib::RefPtr< Gdk::GC > m_RefGC_NetworksArea
 Main gtkmm graphics context used as argument in all drawing functions.
Gdk::Color m_Color_Blue
 Color variable.
Gdk::Color m_Color_Green
 Color variable.
Gdk::Color m_Color_Red
 Color variable.
Gdk::Color m_Color_Black
 Color variable.
Gdk::Color m_Color_White
 Color variable.
Gdk::Color m_Color_Beige
 Color variable.
Gdk::Color m_Color_BG
Gdk::Color m_Color_FG
Gdk::Color m_Color_Element
Gdk::Color m_Color_Node
Gdk::Color m_Color_Branch
Gdk::Color m_Color_NameText
Gdk::Color m_Color_ValueText
Gdk::Color m_Color_FrameBG
Gdk::Color m_Color_Chart
Gdk::Color m_Color_Axis
int m_SquareSize
 Netting field size.
int m_NodeSize
 Node size.
CCircuit m_Circuit_Edited
 Edited Circuit.
CCircuitSolver m_circuitKiller
 CCircuitSolver variable used to solver m_Circuit_Edited.
RLC::CSignalFrame m_SignalFrame_Element
 Signal frame variable.
bool m_circuitIsChanged
 If true the circuit is changed.
bool m_pixmapIsConfigured
 If true the pixmap is configured.
bool m_circuitIsLoaded
 If true the circuit is loaded.
bool m_circuitIsSolved
 If true the circuit is solved.
Glib::RefPtr< Pango::Context > m_RefContext_Main
 Pango context mostly used for drawing Layout objects.

Friends

class CCircuit
class CElement
class CVoltage
class CVoltage_u
class CVoltage_i
class CCurent
class CCurent_u
class CCurent_i
class CResistor
class CCapasistor
class CInductor
class CNode
class CSignalFrame


Detailed Description

A circuit drawing class.

This class handles everything that is connected with drawing. It also handles opening the circuit to draw.


Constructor & Destructor Documentation

CNetworksArea::CNetworksArea  ) 
 

A constructor.

Reads config, set variables, connect singals with handlers, allocates color maps.

CNetworksArea::~CNetworksArea  ) 
 

A destructor.

Does not really do anything for now.


Member Function Documentation

void CNetworksArea::clearCircuit  ) 
 

Circuit clearing method.

This calls clearing methods for m_Circuit_Edited and m_circuitKiller in a secure way of opening another file for example.

bool CNetworksArea::mf_drawArrow int  fieldX,
int  fieldY,
int  rot = 0,
float  proportion = 0.6
[protected]
 

Draws arrow.

This method is used to draw arrows oriented in 4 possible ways: right, left, up, down. This is used to draw elements with arrow, for example voltages or currents.

Parameters:
fieldX a horizontal coordinate of a netting field (most left are zeros).
fieldY a vertical coordinate of a netting field (most up are zeros).
rot rotation of an arrow. Possibilities are: right(0), up(1), left(2), down(3). All other values are threatened as zero.
proportion a proportion of an arrow. This value is understood as the part of squareSize that will be the half of arrow's length.
See also:
m_SquareSize

void CNetworksArea::mf_drawCircuit  )  [protected]
 

Circuit drawing method.

This method draws a network netting and a circuit itself. It clears a m_RefPixmap_NetworksArea so that the circuit is not drawn one on another/ In future this will be only called when the circuit will really change.

bool CNetworksArea::mf_drawNetting  )  [protected]
 

Draws netting.

Draws the basic netting that is at a background. The field size it defined in m_squareSize variable.

See also:
m_squareSize

Gdk::Point CNetworksArea::mf_fieldCoords Gdk::Point  coords  )  [protected]
 

Function returning network field coords.

This function converts normal pixel coords to network field coords.

Parameters:
coords pixel coordinates on the NetworkArea
Returns:
coordinates of field where pixel with coords from argument is placed.

CElement * CNetworksArea::mf_getFieldElement Gdk::Point  fieldCoords  )  [protected]
 

Return a pointer to element in a field.

This function returns a pointer to CElement object that is placed in a field that coords are given.

Parameters:
fieldCoords coords of a field from which we want to get a CElement pointer
Returns:
return CElement pointer to a CElement that is a fieldCoords field. Or 0 if there is none.

bool CNetworksArea::on_networksarea_button_press_event GdkEventButton *  event  )  [protected]
 

bool CNetworksArea::on_networksarea_button_release_event GdkEventButton *  event  )  [protected]
 

bool CNetworksArea::on_networksarea_configure_event GdkEventConfigure *  event  )  [protected]
 

bool CNetworksArea::on_networksarea_expose_event GdkEventExpose *  event  )  [protected]
 

bool CNetworksArea::on_networksarea_motion_notify_event GdkEventMotion *  event  )  [protected]
 

void CNetworksArea::openCircuitFile  ) 
 

Circuit opening method.

Calls file chooser dialog, to give user a way to select circuit file. Then loads it, and draw.

void CNetworksArea::solveCircuit  ) 
 

Circuit solving method.

After calling this a m_Circuit_Edited will be solved by m_circuitKiller.

See also:
m_Circuit_Edited

m_circuitKiller


Friends And Related Function Documentation

friend class CCapasistor [friend]
 

friend class CCircuit [friend]
 

friend class CCurent [friend]
 

friend class CCurent_i [friend]
 

friend class CCurent_u [friend]
 

friend class CElement [friend]
 

friend class CInductor [friend]
 

friend class CNode [friend]
 

friend class CResistor [friend]
 

friend class CSignalFrame [friend]
 

friend class CVoltage [friend]
 

friend class CVoltage_i [friend]
 

friend class CVoltage_u [friend]
 


Member Data Documentation

CCircuit RLC::CNetworksArea::m_Circuit_Edited [protected]
 

Edited Circuit.

bool RLC::CNetworksArea::m_circuitIsChanged [protected]
 

If true the circuit is changed.

The same as some variables below this is a state variable used mostly for drawing and keeping circuit states.

bool RLC::CNetworksArea::m_circuitIsLoaded [protected]
 

If true the circuit is loaded.

bool RLC::CNetworksArea::m_circuitIsSolved [protected]
 

If true the circuit is solved.

CCircuitSolver RLC::CNetworksArea::m_circuitKiller [protected]
 

CCircuitSolver variable used to solver m_Circuit_Edited.

Gdk::Color RLC::CNetworksArea::m_Color_Axis [protected]
 

Gdk::Color RLC::CNetworksArea::m_Color_Beige [protected]
 

Color variable.

Used so that we don's have to reallocate it every time we use it. Other color variables are the same.

Gdk::Color RLC::CNetworksArea::m_Color_BG [protected]
 

Gdk::Color RLC::CNetworksArea::m_Color_Black [protected]
 

Color variable.

Used so that we don's have to reallocate it every time we use it. Other color variables are the same.

Gdk::Color RLC::CNetworksArea::m_Color_Blue [protected]
 

Color variable.

Used so that we don's have to reallocate it every time we use it. Other color variables are the same.

Gdk::Color RLC::CNetworksArea::m_Color_Branch [protected]
 

Gdk::Color RLC::CNetworksArea::m_Color_Chart [protected]
 

Gdk::Color RLC::CNetworksArea::m_Color_Element [protected]
 

Gdk::Color RLC::CNetworksArea::m_Color_FG [protected]
 

Gdk::Color RLC::CNetworksArea::m_Color_FrameBG [protected]
 

Gdk::Color RLC::CNetworksArea::m_Color_Green [protected]
 

Color variable.

Used so that we don's have to reallocate it every time we use it. Other color variables are the same.

Gdk::Color RLC::CNetworksArea::m_Color_NameText [protected]
 

Gdk::Color RLC::CNetworksArea::m_Color_Node [protected]
 

Gdk::Color RLC::CNetworksArea::m_Color_Red [protected]
 

Color variable.

Used so that we don's have to reallocate it every time we use it. Other color variables are the same.

Gdk::Color RLC::CNetworksArea::m_Color_ValueText [protected]
 

Gdk::Color RLC::CNetworksArea::m_Color_White [protected]
 

Color variable.

Used so that we don's have to reallocate it every time we use it. Other color variables are the same.

int RLC::CNetworksArea::m_NodeSize [protected]
 

Node size.

This is a node size defined as 0.15 of m_SquareSize so that a proporction is good (const know) after resizing a network.

bool RLC::CNetworksArea::m_pixmapIsConfigured [protected]
 

If true the pixmap is configured.

Glib::RefPtr<Pango::Context> RLC::CNetworksArea::m_RefContext_Main [protected]
 

Pango context mostly used for drawing Layout objects.

Glib::RefPtr<Gdk::GC> RLC::CNetworksArea::m_RefGC_NetworksArea [protected]
 

Main gtkmm graphics context used as argument in all drawing functions.

Glib::RefPtr<Gdk::Pixmap> RLC::CNetworksArea::m_RefPixmap_NetworksArea [protected]
 

A pixmap where the circuit is drawn.

RLC::CSignalFrame RLC::CNetworksArea::m_SignalFrame_Element [protected]
 

Signal frame variable.

This represents a frame with a signal that shows up when a mouse is over a element after solving the circuit.

int RLC::CNetworksArea::m_SquareSize [protected]
 

Netting field size.

This is the length of a side of the square (field) that is the background for drawing circuits.


The documentation for this class was generated from the following files:
Generated on Sun Jan 16 11:06:00 2005 for RolLerCoaster by  doxygen 1.3.9.1