#  Copyright (c) 1997-2004
#  Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany)
#  http://www.math.tu-berlin.de/polymake,  mailto:polymake@math.tu-berlin.de
#
#  This program is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by the
#  Free Software Foundation; either version 2, or (at your option) any
#  later version: http://www.gnu.org/licenses/gpl.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#-----------------------------------------------------------------------------
#  $Project: polymake $$Id: VisualPointSet.pm,v 1.2 2006/02/27 00:09:30 gawrilow Exp $

###############################################################################
#
#  Visual::PointSet  - a cloud of points
#

package Visual::PointSet;

use Struct (
   [ '@ISA' => 'Visual::Object' ],

   # [ "coord vector", ... ]
   [ '@Vertices | Points' => 'check_points( #% )', 'croak("Points missing")' ],

   # ambient dimension (detected by Points)
   '$Dim',

   #    "string sting ..."	to be split on the white spaces
   # or [ "string", ... ]
   # or "hidden"		suppress any labels
   #    default: point indices (0,1,...) as labels
   [ '$VertexLabels | PointLabels' => 'unify_labels( #% )', 'undef' ],

   #    "R G B"			same color for all points
   # or [ "R G B", ... ]	indexed by point number
   # or { number => "R G B" }	keyed by point number
   # or sub { }			point number -> "R G B"
   [ '$VertexColor | PointColor' => 'unify_decor( #% )', '$Visual::Color::vertices' ],

   #  the same formats as for PointColor
   #  recognized values:
   #    "thickness N"		diameter of circles representing the points
   #    "hidden"		draw neither circles nor point labels
   [ '$VertexStyle | PointStyle' => 'unify_decor( #% )' ],

   # boolean: don't show this object at the session start (only makes sense for interactive viewers)
   '$Hidden',
);

sub new {
   my $self=&_new;
   $self->Dim ||= dim($self->Points);
   $self;
}

declare %decorations=( PointLabels => enum('hidden'), VertexLabels => enum('hidden') );
@decorations{qw( Name Title PointColor PointStyle VertexColor VertexStyle Hidden )}=();

1

# Local Variables:
# c-basic-offset:3
# End:
