home *** CD-ROM | disk | FTP | other *** search
/ Altsys Virtuoso 2.0K / virtuoso_20k.iso / DemoApps / Graphics / 2D_3D / Tester3D / Source / View3D.h < prev    next >
Encoding:
Text File  |  1990-07-04  |  2.7 KB  |  117 lines

  1. /* View3D.h */
  2.  
  3. #import <objc/Object.h>
  4. #import "3D.h"
  5.  
  6. @interface View3D:Object
  7. {
  8.     id transformation;
  9.     id subviews;
  10.     id superview;
  11. }
  12.  
  13.     /*
  14.         tranformation 
  15.             is a Transformation3D object, used on all drawing that is done by     
  16.             this view3D or any of it's subviews.
  17.         subviews
  18.             is a List object which contains all the View3D's subviews 
  19.         superview 
  20.             should be a View3D or a Context3D. All View3D's must have a superview
  21.             to function properly 
  22.     */
  23.     
  24.  
  25. + new;
  26.  
  27.     /*    
  28.         sets up a new View3D object with the instance variables initialized
  29.         to the following:
  30.             transformation is nil
  31.             subviews is an empty list
  32.             superview is nil
  33.     */
  34.             
  35.     
  36. - moveto:(vector3D *)where;
  37.  
  38.     /* 
  39.         moveto: sends [transformation operateOn:where] and then 
  40.         [superview moveto:where] 
  41.     */
  42.  
  43. - lineto:(vector3D *)where;
  44.  
  45.     /* 
  46.         lineto: sends [transformation operateOn:where] and then 
  47.         [superview lineto:where] 
  48.     */
  49.  
  50. - polygon:(vector3D *)vertices howMany:(int)count;
  51.  
  52.     /*    
  53.         polygon:howMany: sends [transformation OperateOn:vertices     
  54.         howMany:count]
  55.         and then [superview polygon:vertices:count] 
  56.     */
  57.     
  58. - superview;
  59.  
  60.     /* Returns the View3D's superview */
  61.     
  62. - setSuperView:aView3D;
  63.     
  64.     /* 
  65.         Should only be sent by another View3D or a Context3D to let the receiver
  66.         know
  67.         that its superview has been changed. Any calls to addSubView should
  68.         automatically send this message to the subView being added. aView3D
  69.         should be either a View3D or a Context3D.
  70.         (see addSubView: below)
  71.     */
  72.     
  73. - addSubView:aView3D;
  74.     
  75.     /* 
  76.         This is the way to add View3Ds into a View3D heirarchy. It Will
  77.         send the setSuperView: message to aView3D with self as an argument,
  78.         and will add aView3D into subviews automatically.
  79.         (see setSuperView: above)
  80.     */
  81.  
  82. - render;
  83.  
  84.     /*
  85.         This replaces the DrawSelf method of the View class. It should send
  86.         itself moveto:, lineto: and polygon:howMany: messages. The vector3Ds
  87.         sent along as arguments must be disposable, or assigned their original
  88.         values each time the render message is sent, since they will be modified
  89.         as they are passed up the View3D heirarchy to be displayed by the
  90.         Context3D at the top.
  91.         It will usually be called by it's superview when the
  92.         Context3D at the top of the heirarchy is sent a drawSelf:: message.
  93.         It shouldn't be called directly, only through calls to display.
  94.     */
  95.     
  96. - display;
  97.  
  98.     /* This sends itself render then sends display to each subview */
  99.     
  100. - transformation;
  101.     
  102.     /* returns the View3D's transformation instance variable */
  103.     
  104. - setTransformation:anObject;
  105.  
  106.     /* 
  107.         sets transformation = anObject. The object must respond to operateOn
  108.         and operateOn:howMany messages or else an error will be generated when
  109.         the View3D is sent any moveto: lineto: or polygon:howMany: messages
  110.     */
  111.         
  112. - subviews;
  113.  
  114.     /* returns the subviews list */
  115.     
  116. @end
  117.