Class: CqlsBeamer::Scene

Inherits:
Object
  • Object
show all
Defined in:
lib/dyndoc/plugins/tex/beamer.rb

Constant Summary collapse

@@scenes =
{}
@@curScene =
nil

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, dim) ⇒ Scene

Returns a new instance of Scene.



82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 82

def initialize(name,dim)
  @name=name
  @scene=Group.new
  @unit="cm"
  @dim=dim.map{|e| e.to_s}
  @txt=""
  #default values
  @align="left,top"
  @minipage=""
  Scene[name]=self
  @@curScene=self
end

Instance Attribute Details

#alignObject

default values for actors in its scene



65
66
67
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 65

def align
  @align
end

#bgObject

Returns the value of attribute bg.



63
64
65
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63

def bg
  @bg
end

#cptObject

Returns the value of attribute cpt.



63
64
65
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63

def cpt
  @cpt
end

#dimObject

Returns the value of attribute dim.



63
64
65
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63

def dim
  @dim
end

#fgObject

Returns the value of attribute fg.



63
64
65
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63

def fg
  @fg
end

#framedObject

Returns the value of attribute framed.



63
64
65
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63

def framed
  @framed
end

#minipageObject

default values for actors in its scene



65
66
67
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 65

def minipage
  @minipage
end

#nameObject

Returns the value of attribute name.



63
64
65
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63

def name
  @name
end

#roundedObject

Returns the value of attribute rounded.



63
64
65
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63

def rounded
  @rounded
end

#sceneObject

Returns the value of attribute scene.



63
64
65
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63

def scene
  @scene
end

#txtObject

Returns the value of attribute txt.



63
64
65
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63

def txt
  @txt
end

#unitObject

Returns the value of attribute unit.



63
64
65
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 63

def unit
  @unit
end

Class Method Details

.[](key) ⇒ Object



74
75
76
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 74

def Scene.[](key)
  @@scenes[key]
end

.[]=(key, val) ⇒ Object



70
71
72
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 70

def Scene.[]=(key,val)
  @@scenes[key]=val
end

.currentObject



78
79
80
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 78

def Scene.current
  @@curScene
end

Instance Method Details

#append(obj) ⇒ Object Also known as: <<



101
102
103
104
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 101

def append(obj)
  @@curScene=self
  @scene.append(obj)
end

#firstObject



108
109
110
111
112
113
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 108

def first
  txt=""
  txt += "\\setbeamercolor{#{@name}color}{fg=#{fg},bg=#{@bg}}\n\\begin{beamercolorbox}[wd=#{dim[2]+@unit},ht=#{dim[3]+@unit},rounded=#{@rounded}]{#{@name}color}" if @framed
  txt+="\\pgfsetxvec{\\pgfpoint{#{dim[2]+@unit}}{0cm}}\n\\pgfsetyvec{\\pgfpoint{0cm}{#{dim[3]+@unit}}}\n\\begin{pgfpicture}{#{dim[0]+@unit}}{#{dim[1]+@unit}}{#{dim[2]+@unit}}{#{dim[3]+@unit}}\n"
  return txt
end

#initObject



95
96
97
98
99
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 95

def init
  @scene.init
  @txt=""
  @cpt[0]=1
end

#lastObject



115
116
117
118
119
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 115

def last
  txt="\\end{pgfpicture}\n"
  txt += "\\end{beamercolorbox}" if @framed
  return txt
end

#outputObject



121
122
123
124
# File 'lib/dyndoc/plugins/tex/beamer.rb', line 121

def output
  @scene.output(@txt)
  return @txt
end