Ejemplo n.º 1
0
        // For GraphicalWatch
        public static bool Draw(Graphics graphics,
                                IDrawable drawable, Geometry.Traits traits,
                                Settings settings, Colors colors)
        {
            if (drawable == null)
            {
                return(false);
            }

            if (traits != null && traits.CoordinateSystem == Geometry.CoordinateSystem.SphericalPolar)
            {
                throw new Exception("This coordinate system is not yet supported.");
            }

            if (settings.color == Color.Empty)
            {
                settings.color = DefaultColor(drawable, colors);
            }

            Geometry.Box aabb = drawable.Aabb(traits, true);
            if (aabb.IsValid())
            {
                Geometry.Unit unit = (traits != null) ? traits.Unit : Geometry.Unit.None;
                bool          fill = (traits == null);
                Drawer.DrawAxes(graphics, aabb, unit, colors, fill);
                drawable.Draw(aabb, graphics, settings, traits);
            }
            return(true);
        }