home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / Windows / Interfaces / QD3DGroup.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-03  |  9.3 KB  |  291 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **                                                                             **
  4.  **     Module:        QD3DGroup.h                                                 **
  5.  **                                                                             **
  6.  **                                                                             **
  7.  **     Purpose:                                                             **
  8.  **                                                                             **
  9.  **                                                                             **
  10.  **     Copyright (C) 1992-1995 Apple Computer, Inc.  All rights reserved.     **
  11.  **                                                                             **
  12.  **                                                                             **
  13.  *****************************************************************************/
  14. #ifndef QD3DGroup_h
  15. #define QD3DGroup_h
  16.  
  17. #if PRAGMA_ONCE
  18.     #pragma once
  19. #endif
  20.  
  21. #if defined(THINK_C) || defined(__SC__)
  22.     #pragma options(!pack_enums, !align_arrays)
  23.     #pragma SC options align=power
  24. #elif defined(__MWERKS__)
  25.     #pragma enumsalwaysint on
  26.     #pragma align_array_members off
  27.     #pragma options align=native
  28. #elif defined(__PPCC__)
  29.     #pragma options align=power
  30. #elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
  31.     #pragma options enum=int
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif /*  __cplusplus  */
  37.  
  38.  
  39. /******************************************************************************
  40.  **                                                                             **
  41.  **                            Group Typedefs                                     **
  42.  **                                                                             **
  43.  *****************************************************************************/
  44.  
  45. /*
  46.  * These flags affect how a group is traversed
  47.  * They apply to when a group is "drawn", "picked", "bounded", "written"
  48.  */
  49. typedef enum TQ3DisplayGroupStateMasks {
  50.     kQ3DisplayGroupStateNone                    = 0,
  51.     kQ3DisplayGroupStateMaskIsDrawn                = 1 << 0,
  52.     kQ3DisplayGroupStateMaskIsInline            = 1 << 1,
  53.     kQ3DisplayGroupStateMaskUseBoundingBox        = 1 << 2,
  54.     kQ3DisplayGroupStateMaskUseBoundingSphere    = 1 << 3,
  55.     kQ3DisplayGroupStateMaskIsPicked            = 1 << 4,
  56.     kQ3DisplayGroupStateMaskIsWritten            = 1 << 5
  57. } TQ3DisplayGroupStateMasks;
  58.  
  59. typedef unsigned long TQ3DisplayGroupState;
  60.  
  61. /******************************************************************************
  62.  **                                                                             **
  63.  **                    Group Routines (apply to all groups)                     **
  64.  **                                                                             **
  65.  *****************************************************************************/
  66.  
  67. QD3D_EXPORT TQ3GroupObject Q3Group_New(        /* May contain any shared object */
  68.     void);
  69.     
  70. QD3D_EXPORT TQ3ObjectType Q3Group_GetType(
  71.     TQ3GroupObject            group);
  72.  
  73. QD3D_EXPORT TQ3GroupPosition Q3Group_AddObject(
  74.     TQ3GroupObject            group,
  75.     TQ3Object                object);
  76.     
  77. QD3D_EXPORT TQ3GroupPosition Q3Group_AddObjectBefore(
  78.     TQ3GroupObject            group,
  79.     TQ3GroupPosition        position,
  80.     TQ3Object                object);
  81.  
  82. QD3D_EXPORT TQ3GroupPosition Q3Group_AddObjectAfter(
  83.     TQ3GroupObject            group,
  84.     TQ3GroupPosition        position,
  85.     TQ3Object                object);
  86.  
  87. QD3D_EXPORT TQ3Status Q3Group_GetPositionObject(
  88.     TQ3GroupObject            group,
  89.     TQ3GroupPosition        position,    
  90.     TQ3Object                *object);        
  91.  
  92. QD3D_EXPORT TQ3Status Q3Group_SetPositionObject(
  93.     TQ3GroupObject            group,
  94.     TQ3GroupPosition        position,
  95.     TQ3Object                object);
  96.  
  97. QD3D_EXPORT TQ3Object Q3Group_RemovePosition(
  98.     TQ3GroupObject            group,
  99.     TQ3GroupPosition        position);
  100.  
  101. QD3D_EXPORT TQ3Status Q3Group_GetFirstPosition(        
  102.     TQ3GroupObject            group,
  103.     TQ3GroupPosition        *position);
  104.  
  105. QD3D_EXPORT TQ3Status Q3Group_GetLastPosition(        
  106.     TQ3GroupObject            group,
  107.     TQ3GroupPosition        *position);
  108.  
  109. QD3D_EXPORT TQ3Status Q3Group_GetNextPosition(        
  110.     TQ3GroupObject            group,
  111.     TQ3GroupPosition        *position);
  112.  
  113. QD3D_EXPORT TQ3Status Q3Group_GetPreviousPosition(        
  114.     TQ3GroupObject            group,
  115.     TQ3GroupPosition        *position);
  116.  
  117. QD3D_EXPORT TQ3Status Q3Group_CountObjects(
  118.     TQ3GroupObject            group,
  119.     unsigned long            *nObjects);
  120.  
  121. QD3D_EXPORT TQ3Status Q3Group_EmptyObjects(
  122.     TQ3GroupObject            group);
  123.     
  124. /*
  125.  *     Typed Access
  126.  */
  127. QD3D_EXPORT TQ3Status Q3Group_GetFirstPositionOfType(        
  128.     TQ3GroupObject            group,
  129.     TQ3ObjectType            isType,
  130.     TQ3GroupPosition        *position);
  131.  
  132. QD3D_EXPORT TQ3Status Q3Group_GetLastPositionOfType(        
  133.     TQ3GroupObject            group,
  134.     TQ3ObjectType            isType,
  135.     TQ3GroupPosition        *position);
  136.  
  137. QD3D_EXPORT TQ3Status Q3Group_GetNextPositionOfType(        
  138.     TQ3GroupObject            group,
  139.     TQ3ObjectType            isType,
  140.     TQ3GroupPosition        *position);
  141.  
  142. QD3D_EXPORT TQ3Status Q3Group_GetPreviousPositionOfType(        
  143.     TQ3GroupObject            group,
  144.     TQ3ObjectType            isType,
  145.     TQ3GroupPosition        *position);
  146.  
  147. QD3D_EXPORT TQ3Status Q3Group_CountObjectsOfType(
  148.     TQ3GroupObject            group,
  149.     TQ3ObjectType            isType,
  150.     unsigned long            *nObjects);
  151.  
  152. QD3D_EXPORT TQ3Status Q3Group_EmptyObjectsOfType(
  153.     TQ3GroupObject            group,
  154.     TQ3ObjectType            isType);
  155.  
  156. /*
  157.  *    Determine position of objects in a group
  158.  */
  159. QD3D_EXPORT TQ3Status Q3Group_GetFirstObjectPosition(
  160.     TQ3GroupObject            group,
  161.     TQ3Object                object,
  162.     TQ3GroupPosition        *position);
  163.     
  164. QD3D_EXPORT TQ3Status Q3Group_GetLastObjectPosition(
  165.     TQ3GroupObject            group,
  166.     TQ3Object                object,
  167.     TQ3GroupPosition        *position);
  168.  
  169. QD3D_EXPORT TQ3Status Q3Group_GetNextObjectPosition(
  170.     TQ3GroupObject            group,
  171.     TQ3Object                object,
  172.     TQ3GroupPosition        *position);
  173.     
  174. QD3D_EXPORT TQ3Status Q3Group_GetPreviousObjectPosition(
  175.     TQ3GroupObject            group,
  176.     TQ3Object                object,
  177.     TQ3GroupPosition        *position);
  178.     
  179.  
  180. /******************************************************************************
  181.  **                                                                             **
  182.  **                            Group Subclasses                                 **
  183.  **                                                                             **
  184.  *****************************************************************************/
  185.  
  186. QD3D_EXPORT TQ3GroupObject Q3LightGroup_New(        /* Must contain only lights */
  187.     void);
  188.  
  189. QD3D_EXPORT TQ3GroupObject Q3InfoGroup_New(            /* Must contain only strings */
  190.     void);
  191.  
  192. #if defined(ESCHER_VER_15) && ESCHER_VER_15
  193.     
  194. QD3D_EXPORT TQ3GroupObject Q3GuideGroup_New(        /* Must contain only guides */
  195.     void);
  196.  
  197. #endif  /*  ESCHER_VER_15  */
  198.  
  199. /******************************************************************************
  200.  **                                                                             **
  201.  **                        Display Group Routines                                 **
  202.  **                                                                             **
  203.  *****************************************************************************/
  204.  
  205. QD3D_EXPORT TQ3GroupObject Q3DisplayGroup_New(    /* May contain only drawables */
  206.     void);
  207.     
  208. QD3D_EXPORT TQ3ObjectType Q3DisplayGroup_GetType(
  209.     TQ3GroupObject            group);
  210.  
  211. QD3D_EXPORT TQ3Status Q3DisplayGroup_GetState(
  212.     TQ3GroupObject            group,
  213.     TQ3DisplayGroupState    *state);
  214.     
  215. QD3D_EXPORT TQ3Status Q3DisplayGroup_SetState(
  216.     TQ3GroupObject            group,
  217.     TQ3DisplayGroupState    state);
  218.  
  219. QD3D_EXPORT TQ3Status Q3DisplayGroup_Submit(
  220.     TQ3GroupObject            group, 
  221.     TQ3ViewObject            view);
  222.  
  223. /******************************************************************************
  224.  **                                                                             **
  225.  **        Ordered Display Group                                                  **
  226.  **                                                                             **
  227.  **        Ordered display groups keep objects in order by the type of object:     **
  228.  **                                                                             **
  229.  **        1    kQ3ShapeTypeTransform                                             **
  230.  **        2    kQ3ShapeTypeStyle                                                  **
  231.  **        3    kQ3SetTypeAttribute                                                  **
  232.  **        4    kQ3ShapeTypeShader                                                  **
  233.  **        5    kQ3ShapeTypeCamera                                                  **
  234.  **        6    kQ3ShapeTypeLight                                                  **
  235.  **        7    kQ3ShapeTypeGeometry                                             **
  236.  **        8    kQ3ShapeTypeGroup                                                 **            
  237.  **        9    kQ3ShapeTypeUnknown                                                 **
  238.  **                                                                             **
  239.  **        Within a type, you are responsible for keeping things in order.         **
  240.  **                                                                             **
  241.  **        You may access and/or manipulate the group using the above types      **
  242.  **        (fast), or you may use any parent or leaf class types (slower).         **
  243.  **                                                                             **
  244.  **        Additional types will be added as functionality grows.                 **
  245.  **                                                                             **
  246.  **        The group calls which access by type are much faster for ordered     ** 
  247.  **        display group for the types above.                                     **
  248.  **                                                                             **
  249.  **        N.B. In QuickDraw 3D 1.0 Lights and Cameras are a no-op when drawn.     **
  250.  **                                                                             **
  251.  *****************************************************************************/
  252.  
  253. QD3D_EXPORT TQ3GroupObject Q3OrderedDisplayGroup_New(
  254.     void);
  255.  
  256. /******************************************************************************
  257.  **                                                                             **
  258.  **        IO Proxy Display Group                                                  **
  259.  **                                                                             **
  260.  **        IO Proxy display groups are used to place more than one              **
  261.  **        representation of an object in a metafile. For example, if you know     **
  262.  **        another program does not understand NURBPatches but does understand  **
  263.  **        Meshes, you may place a mesh and a NURB Patch in an IO Proxy Group,  **
  264.  **        and the reading program will select the desired representation.         **
  265.  **                                                                             **
  266.  **        Objects in an IO Proxy Display Group are placed in their preferencial**
  267.  **        order, with the FIRST object being the MOST preferred, the LAST      **
  268.  **        object the least preferred.                                             **
  269.  **                                                                             **
  270.  **        The behavior of an IO Proxy Display Group is that when drawn/picked/ **
  271.  **        bounded, the first object in the group that is not "Unknown" is used,**
  272.  **        and the other objects ignored.                                         **
  273.  **                                                                             **
  274.  *****************************************************************************/
  275.  
  276. QD3D_EXPORT TQ3GroupObject Q3IOProxyDisplayGroup_New(
  277.     void);
  278.  
  279. #ifdef __cplusplus
  280. }
  281.  
  282. #if defined(__MWERKS__)
  283.     #pragma enumsalwaysint reset
  284. #elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
  285.     #pragma options enum=reset
  286. #endif
  287.  
  288. #endif /*  __cplusplus  */
  289.  
  290. #endif /*  QD3DGroup_h  */
  291.