Class: PFA::RelativePFA::Node
Constant Summary
Constants included
from MagickPFA
MagickPFA::ABS_BORDERS, MagickPFA::ABS_FONTWEIGHTS, MagickPFA::BORDERS, MagickPFA::CODE_BOITE_ACTE, MagickPFA::CODE_HORLOGE, MagickPFA::CODE_IMAGEMAGICK_NOEUD, MagickPFA::CODE_IMAGEMAGICK_SEQUENCE, MagickPFA::CODE_OFFSET, MagickPFA::CODE_PART_NAME, MagickPFA::CODE_TITRE_PARADIGME, MagickPFA::COLORS, MagickPFA::CONVERT_CMD, MagickPFA::DARKERS, MagickPFA::DIMS_CONSTANTS_PER_THING, MagickPFA::FONTHEIGHT_MAIN_TITLE, MagickPFA::FONTWEIGHTS, MagickPFA::GRAVITIES, MagickPFA::RECTIFS
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from MagickPFA
#act_box_code, #act_name_code, code_for_intro, define_dims_constants, #horloge_code, #horloge_fin, #image_magick_code, rem_const_if_exists, #titre_pfa
#drawnable?, #part?, #printable?
Constructor Details
#initialize(pfa, key, value = nil) ⇒ Node
Returns a new instance of Node.
13
14
15
16
17
|
# File 'lib/pfa/relative_pfa_node.rb', line 13
def initialize(pfa, key, value = nil)
@pfa = pfa
@key = key
parse_raw_value(value)
end
|
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
11
12
13
|
# File 'lib/pfa/relative_pfa_node.rb', line 11
def key
@key
end
|
#pfa ⇒ Object
Returns the value of attribute pfa.
11
12
13
|
# File 'lib/pfa/relative_pfa_node.rb', line 11
def pfa
@pfa
end
|
Instance Method Details
#abs_bottom ⇒ Object
112
113
114
|
# File 'lib/pfa/relative_pfa_node.rb', line 112
def abs_bottom
@abs_bottom ||= MagickPFA::ABS_BOTTOMS[type]
end
|
#abs_data ⇒ Object
Hash Données absolues du nœud
177
178
179
|
# File 'lib/pfa/relative_pfa_node.rb', line 177
def abs_data
@abs_data ||= AbsolutePFA.data[:nodes][key]
end
|
#abs_demiwidth ⇒ Object
200
|
# File 'lib/pfa/relative_pfa_node.rb', line 200
def abs_demiwidth ; @absdemiwidth ||= abs_width / 2 end
|
#abs_duration ⇒ Object
81
82
83
|
# File 'lib/pfa/relative_pfa_node.rb', line 81
def abs_duration
@abs_duration ||= calc_with_fraction_of_duree(abs_data[:abs_duration])
end
|
#abs_end ⇒ Object
77
78
79
|
# File 'lib/pfa/relative_pfa_node.rb', line 77
def abs_end
@abs_end ||= abs_start + abs_duration
end
|
#abs_hcenter ⇒ Object
202
|
# File 'lib/pfa/relative_pfa_node.rb', line 202
def abs_hcenter ; @abshcenter ||= abs_left + abs_demiwidth end
|
#abs_height ⇒ Object
116
117
118
|
# File 'lib/pfa/relative_pfa_node.rb', line 116
def abs_height
@abs_height ||= MagickPFA::HEIGHTS[type]
end
|
#abs_left ⇒ Object
89
90
91
|
# File 'lib/pfa/relative_pfa_node.rb', line 89
def abs_left
@abs_left ||= abs_start.to_px(pfa)end
|
#abs_right ⇒ Object
97
98
99
100
101
102
103
104
105
106
|
# File 'lib/pfa/relative_pfa_node.rb', line 97
def abs_right
@abs_right ||= begin
if id == 'DE' abs_left + abs_width - 2
else
abs_left + abs_width
end
end
end
|
#abs_start ⇒ Object
- PFA::NTime
-
Temps absolu (idéal) de départ
73
74
75
|
# File 'lib/pfa/relative_pfa_node.rb', line 73
def abs_start
@abs_start ||= calc_with_fraction_of_duree(abs_data[:abs_start])
end
|
#abs_top ⇒ Object
108
109
110
|
# File 'lib/pfa/relative_pfa_node.rb', line 108
def abs_top
@abs_top ||= MagickPFA::ABS_TOPS[type]
end
|
#abs_width ⇒ Object
93
94
95
|
# File 'lib/pfa/relative_pfa_node.rb', line 93
def abs_width
@abs_width ||= abs_duration.to_px(pfa)
end
|
#after?(node) ⇒ Bool
le nœud [RelativePFA::Node] node
168
169
170
171
|
# File 'lib/pfa/relative_pfa_node.rb', line 168
def after?(node)
return start_at > node.start_at
end
|
#bottom ⇒ Object
149
150
151
|
# File 'lib/pfa/relative_pfa_node.rb', line 149
def bottom
@bottom ||= MagickPFA::BOTTOMS[type]
end
|
#box_bottom ⇒ Object
Le bas ultime du paradigme ?
205
|
# File 'lib/pfa/relative_pfa_node.rb', line 205
def box_bottom ; @box_bottom ||= top + 13 * MagickPFA::LINE_HEIGHT end
|
#code_image_magick ⇒ Object
19
20
21
|
# File 'lib/pfa/relative_pfa_node.rb', line 19
def code_image_magick
pfa.img_builder.code_image_magick
end
|
#demiheight ⇒ Object
– Des valeurs qui peuvent servir… –
198
|
# File 'lib/pfa/relative_pfa_node.rb', line 198
def demiheight ; @demiheight ||= height / 2 end
|
#demiwidth ⇒ Object
199
|
# File 'lib/pfa/relative_pfa_node.rb', line 199
def demiwidth ; @demiwidth ||= width / 2 end
|
#description(ensure_output = false) ⇒ Object
23
24
25
26
27
|
# File 'lib/pfa/relative_pfa_node.rb', line 23
def description(ensure_output = false)
@description || begin
ensure_output ? "" : nil
end
end
|
#duration ⇒ Object
PFA::NTime Durée Soit elle a été explicitement définie en renseignant le noeud, soit on lui donne la valeur de la durée absolue. Sauf pour les actes, qui possèdent leur propre calcul, étant donné qu’ils dépendent d’autres éléments
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/pfa/relative_pfa_node.rb', line 49
def duration
@duration ||= begin
if type == :part
case key
when :exposition then @end_at = pfa.developpement_part1.start_at
when :developpement_part1 then @end_at = pfa.developpement_part2.start_at
when :developpement_part2 then @end_at = pfa.denouement.start_at
when :denouement then @end_at = PFA::NTime.new(pfa.duration.to_i)
end
end_at - start_at
else
abs_duration
end
end
end
|
#end_at ⇒ Object
- PFA::NTime
-
Temps (relatif) de fin du noeud
40
41
42
|
# File 'lib/pfa/relative_pfa_node.rb', line 40
def end_at
@end_at ||= start_at + duration end
|
#hcenter ⇒ Object
201
|
# File 'lib/pfa/relative_pfa_node.rb', line 201
def hcenter ; @hcenter ||= left + demiwidth end
|
#height ⇒ Object
Hauteur de la boite pour écrire le texte
154
155
156
|
# File 'lib/pfa/relative_pfa_node.rb', line 154
def height
@height ||= (MagickPFA::HEIGHTS[type]).to_i
end
|
#horloge ⇒ Object
- String
-
Horloge du temps (relatif) de départ
66
67
68
|
# File 'lib/pfa/relative_pfa_node.rb', line 66
def horloge
@horloge ||= start_at.to_horloge
end
|
#id ⇒ Object
189
190
191
|
# File 'lib/pfa/relative_pfa_node.rb', line 189
def id
abs_data[:id]
end
|
#img_abs_surface ⇒ Object
120
121
122
|
# File 'lib/pfa/relative_pfa_node.rb', line 120
def img_abs_surface
@img_abs_surface ||= "#{abs_width}x#{abs_height}"
end
|
#img_surface ⇒ Object
158
159
160
|
# File 'lib/pfa/relative_pfa_node.rb', line 158
def img_surface
@img_surface ||= "#{width}x#{height}"
end
|
#left ⇒ Object
126
127
128
|
# File 'lib/pfa/relative_pfa_node.rb', line 126
def left
@left ||= start_at.to_px(pfa)
end
|
#mark ⇒ Object
181
182
183
|
# File 'lib/pfa/relative_pfa_node.rb', line 181
def mark
abs_data[:hname]
end
|
#right ⇒ Object
134
135
136
137
138
139
140
141
142
143
|
# File 'lib/pfa/relative_pfa_node.rb', line 134
def right
@right ||= begin
if id == 'DE' left + width - 2
else
left + width
end
end
end
|
#start_at ⇒ Object
Note:
: défini à l’instantiation
- PFA::NTime
-
Temps (relatif) de début du nœud
35
36
37
|
# File 'lib/pfa/relative_pfa_node.rb', line 35
def start_at
@start_at
end
|
#top ⇒ Object
145
146
147
|
# File 'lib/pfa/relative_pfa_node.rb', line 145
def top
@top ||= MagickPFA::TOPS[type]
end
|
#type ⇒ Object
185
186
187
|
# File 'lib/pfa/relative_pfa_node.rb', line 185
def type
abs_data[:type].to_sym
end
|
#vcenter ⇒ Object
203
|
# File 'lib/pfa/relative_pfa_node.rb', line 203
def vcenter ; @vcenter ||= top + demiheight end
|
#width ⇒ Object
130
131
132
|
# File 'lib/pfa/relative_pfa_node.rb', line 130
def width
@width ||= duration.to_px(pfa)
end
|