Skip to content

Commit f3acd2d

Browse files
committed
make Contours contain Labels instead of draw itself
1 parent 8bc9afd commit f3acd2d

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

lib/PDL/Graphics/TriD/Contours.pm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use PDL::ImageND;
2828
use PDL::Graphics::TriD;
2929
use PDL::Graphics::TriD::Objects;
3030
use base qw/PDL::Graphics::TriD::GObject/;
31-
use fields qw/PathIndex ContourPathIndexEnd LabelStart LabelStrings/;
31+
use fields qw/PathIndex ContourPathIndexEnd/;
3232

3333
$PDL::Graphics::TriD::verbose //= 0;
3434

@@ -182,9 +182,7 @@ sub addlabels {
182182
$lp = $lp->glue(1,$lp2);
183183
}
184184
return if !$lp->nelem;
185-
$self->{Points} = $self->{Points}->glue(1,$lp);
186-
$self->{LabelStart} = $self->{Points}->dim(1) - $lp->dim(1);
187-
$self->{LabelStrings} = \@strlist;
185+
$self->add_object(PDL::Graphics::TriD::Labels->new($lp, {Strings=>\@strlist}));
188186
}
189187

190188
=head2 set_colortable($table)

lib/PDL/Graphics/TriD/GL.pm

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,6 @@ sub PDL::Graphics::TriD::Contours::gdraw {
199199
$i++;
200200
$pcnt=$ie+1;
201201
}
202-
if (defined $this->{LabelStart}) {
203-
glColor3d(1,1,1);
204-
PDL::Graphics::OpenGLQ::gl_texts($points->slice(":,$this->{LabelStart}:"),
205-
$this->{LabelStrings});
206-
}
207202
}
208203

209204
# A special construct which always faces the display and takes the entire window

0 commit comments

Comments
 (0)