[system] / trunk / pg / lib / Value / Point.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/Value/Point.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2606 Revision 2612
182 return $self->string(undef,$self->{open},$self->{close}); 182 return $self->string(undef,$self->{open},$self->{close});
183} 183}
184 184
185sub string { 185sub string {
186 my $self = shift; my $equation = shift; 186 my $self = shift; my $equation = shift;
187 my $open = shift || $$Value::context->lists->get('Point')->{open}; 187 my $def = ($equation->{context} || $$Value::context)->lists->get('Point');
188 my $close = shift || $$Value::context->lists->get('Point')->{close}; 188 my $open = shift || $def->{open}; my $close = shift || $def->{close};
189 my @coords = (); 189 my @coords = ();
190 foreach my $x (@{$self->data}) { 190 foreach my $x (@{$self->data}) {
191 if (Value::isValue($x)) {push(@coords,$x->string($equation))} else {push(@coords,$x)} 191 if (Value::isValue($x)) {push(@coords,$x->string($equation))} else {push(@coords,$x)}
192 } 192 }
193 return $open.join(',',@coords).$close; 193 return $open.join(',',@coords).$close;
194} 194}
195 195
196sub TeX { 196sub TeX {
197 my $self = shift; my $equation = shift; 197 my $self = shift; my $equation = shift;
198 my $open = shift || $$Value::context->lists->get('Point')->{open}; 198 my $def = ($equation->{context} || $$Value::context)->lists->get('Point');
199 my $close = shift || $$Value::context->lists->get('Point')->{close}; 199 my $open = shift || $def->{open}; my $close = shift || $def->{close};
200 my @coords = (); 200 my @coords = ();
201 foreach my $x (@{$self->data}) { 201 foreach my $x (@{$self->data}) {
202 if (Value::isValue($x)) {push(@coords,$x->TeX($equation))} else {push(@coords,$x)} 202 if (Value::isValue($x)) {push(@coords,$x->TeX($equation))} else {push(@coords,$x)}
203 } 203 }
204 return '\left'.$open.join(',',@coords).'\right'.$close; 204 return '\left'.$open.join(',',@coords).'\right'.$close;

Legend:
Removed from v.2606  
changed lines
  Added in v.2612

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9