~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/covira/spline2_draw.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #include <values.h>
  2 #include <tina/all_tina.h>
  3 #include <tina/brain.h>
  4 #include <tina/brainfuncs.h>
  5 
  6 static Ipos spline2_proj2(Tv * tv, Spline2 * spline, double t)
  7 {
  8     return (tv_proj2(tv, spline2_eval(spline, t)));
  9 }
 10 
 11 void spline2_draw(Tv * tv, Spline2 * spline)
 12 {
 13     double t1 = 0.0, t2;
 14 
 15     if (spline == NULL)
 16         return;
 17     switch (spline->type)
 18     {
 19         case SPLINE_NATURAL:
 20         case SPLINE_TANGENT:
 21             t2 = spline->n - 1.0;
 22             break;
 23         case SPLINE_PERIODIC:
 24             t2 = spline->n;
 25             break;
 26         default:
 27             return;
 28     }
 29     curve_draw(tv, spline2_proj2, spline, t1, t2);
 30 }
 31 
 32 void spline2_draw_points(Tv * tv, Spline2 * spline)
 33 {
 34     int i, n;
 35     Vec2 p;
 36 
 37     if (spline == NULL)
 38         return;
 39     n = spline->n;
 40     for (i = 0; i < n; i++)
 41     {
 42         p = spline2_eval(spline, (double) i);
 43         tv_bigdot2(tv, p, 2);
 44     }
 45 }
 46 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.