Quantum Fog  0.9.3
BEAM_SPL.h
1 #pragma once
2 #include "QFog_constants.h"
3 
4 
5 #ifdef _mac_gui_app //''''''''''''''''''''''''''''''''''''''''''''\\.
6 
7  class C_MAIN_VIEW;
8  #include "C_PORT_RELATED.h"
9  #include "C_COLORS.h"
10  #include "C_ARROW_DRAWER.h"
11  #include "UI_MAP.h"
12  #include "TWO_MODE_FUN.h"
13  class QB_NET;
14  class C_PI_WIND;
15  class C_BEAM_SPL_AMP_GEN;
16 
17 #endif //_mac_gui_app \\............................................//
18 
19 
20 
21 #include "NODE.h"
22 
23 //******************************************
24 class BEAM_SPL : public NODE
25 {
26 private:
27 
28 public:
29 
30 
31  BEAM_SPL();
32  virtual ~BEAM_SPL();
33 
34 
35 
36 #ifdef _mac_gui_app //''''''''''''''''''''''''''''''''''''''''''''\\.
37 
38 private:
39  enum {the_rot_ang=15, port_docking_rad = 0, port_greeting_rad = 5 };
40 
41  SInt16 its_icon_dir;
42  //its_icon_dir measures in degrees
43  //the amount of clockwise rotation of the icon
44 
45 // Let nw=northwest, etc. The beam splitter icon before
46 // being rotated has two destination-only ports at nw and ne,
47 // and two source-only ports at se and sw. We will identify
48 // nw=0 and ne=1 (destination ports)
49 // se=2 and sw=3 (source ports):
50  Point its_port_locs_p[4];
51  // max_load=1 for all ports
52  SInt16 its_port_guests_p[4];// the nd_id of guest or negative number if no guest
53 
54 public:
55  STRINGY get_class_str();
56  ND_CLASS_ID get_class_id();
57 
58  VOID init_port_locs();
59  BEAM_SPL(const Point & m_down_pt);
60 
61  USHORT get_port_guest(USHORT sub_nd_id);
62  C_CIRCLE get_docking_cir(USHORT sub_nd_id);
63  BOOLEAN pt_is_in_greeting_cir_of_avail_d_port(
64  const Point & pt,
65  USHORT & sub_nd_id);
66  BOOLEAN pt_is_in_greeting_cir_of_avail_s_port(
67  const Point & pt,
68  USHORT & sub_nd_id);
69  VOID add_nd_to_port_glist(USHORT g_nd_id, USHORT sub_nd_id);
70  VOID remove_nd_from_all_port_glists(USHORT g_nd_id);
71  VOID renumber_nds_of_port_glists(const UI_MAP & map);
72 
73  VOID draw();
74 
75  VOID move_by( const Point & delta);
76 
77 // VOID rotate_rim_pt(Point & pt, SInt16 ang); //ang in degrees
78  VOID refresh_port_locs();
79  VOID rotate();
80  BOOLEAN has_icon_dir();
81  SInt16 get_icon_dir() const;
82  VOID set_icon_dir(SInt16 icon_dir);
83 
84 
85  VOID call_amp_gen(QB_NET * net_p, C_PI_WIND * pi_wind_p);
86  VOID obey_amp_gen(USHORT mx_n_sum, const TWO_MODE_FUN & two_fun, const USHORT * m1x_p,const USHORT * m2x_p,const USHORT * m1y_p,const USHORT * m2y_p);
87 
88 
89 #endif //_mac_gui_app \\............................................//
90 
91 };
92 #pragma mark -
93 
94 #ifdef _mac_gui_app //''''''''''''''''''''''''''''''''''''''''''''\\.
95 
96 //******************************************
97 inline
98 STRINGY BEAM_SPL::get_class_str()
99 {
100  return "BEAM_SPL";
101 }
102 //******************************************
103 inline
104 ND_CLASS_ID BEAM_SPL::get_class_id()
105 {
106  return BEAM_SPL_id;
107 }
108 //******************************************
109 inline
110 USHORT BEAM_SPL::get_port_guest(
111 USHORT sub_nd_id) //in
112 {
113  return its_port_guests_p[sub_nd_id];
114 }
115 //******************************************
116 inline
117 C_CIRCLE BEAM_SPL::get_docking_cir(
118 USHORT sub_nd_id) //in
119 {
120  return C_CIRCLE(its_port_locs_p[sub_nd_id], port_docking_rad);
121 }
122 //******************************************
123 inline
124 VOID BEAM_SPL::add_nd_to_port_glist(
125 USHORT g_nd_id, //in
126 USHORT sub_nd_id) //in
127 {
128  its_port_guests_p[sub_nd_id]= g_nd_id;
129 }
130 //******************************************
131 inline
132 BOOLEAN BEAM_SPL::has_icon_dir()
133 {
134  return true;
135 }
136 //******************************************
137 inline
138 SInt16 BEAM_SPL::get_icon_dir() const
139 {
140  return its_icon_dir;
141 }
142 #endif //_mac_gui_app \\............................................//
143 
Definition: C_MAIN_VIEW.h:24
Definition: STRINGY.h:22
Definition: BEAM_SPL.h:24
Definition: C_BEAM_SPL_AMP_GEN.h:11
Definition: QB_NET.h:34
Definition: TWO_MODE_FUN.h:5
Definition: NODE.h:52
Definition: C_PI_WIND.h:18
Definition: UI_MAP.h:7
Definition: C_PORT_RELATED.h:6