#12827: Expand Animation class to accept more graphics types
-----------------------------------------+----------------------------------
       Reporter:  niles                  |         Owner:  jason, was
           Type:  enhancement            |        Status:  new       
       Priority:  major                  |     Milestone:  sage-5.0  
      Component:  graphics               |    Resolution:            
       Keywords:  animate, graphics, 3D  |   Work issues:            
Report Upstream:  N/A                    |     Reviewers:            
        Authors:                         |     Merged in:            
   Dependencies:                         |      Stopgaps:            
-----------------------------------------+----------------------------------
Changes (by niles):

 * cc: gutow, nbruin (added)


Comment:

 A first patch is up now, which makes the type-checking of the Animate
 class more inclusive.  However I am now leaning toward a different idea:
 adding an `img()` method to each of the major graphics classes defined as
 follows:

 {{{
 def img(self, *args, **kwds):
     return self.save(*args, **kwds)
 }}}

 Then for the Animation class, or other situations where an image
 representation of an object is required, one would call the `img()`
 method, and reject the object if it has no such method.  To handle new
 object types, one would implement an `img()` method for those types.  As I
 understand them, this is more closely aligned with the principles of
 object-oriented programming, and thus more appropriate for Sage library
 code.

 I would appreciate hearing further thoughts on the relative merits of the
 current patch v.s. the `img()` method idea, as well as thoughts on naming
 this method (other suggestions are `save_as_bitmap()` and
 `render_image()`).  Maybe the name should be prefixed or suffixed with an
 underscore too?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12827#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to