Mac OS 9
QD3DView.h
Go to the documentation of this file.
1 
19 #ifndef __QD3DVIEW__
20 #define __QD3DVIEW__
21 
22 #ifndef __QD3D__
23 #include <QD3D.h>
24 #endif
25 
26 #ifndef __QD3DSTYLE__
27 #include <QD3DStyle.h>
28 #endif
29 
30 #ifndef __QD3DSET__
31 #include <QD3DSet.h>
32 #endif
33 
34 #if PRAGMA_ONCE
35 #pragma once
36 #endif
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
43 #if PRAGMA_IMPORT
44 #pragma import on
45 #endif
46 
47 #if PRAGMA_STRUCT_ALIGN
48 #pragma options align = power
49 #elif PRAGMA_STRUCT_PACKPUSH
50 #pragma pack(push, 2)
51 #elif PRAGMA_STRUCT_PACK
52 #pragma pack(2)
53 #endif
54 
55 #if PRAGMA_ENUM_ALWAYSINT
56 #if defined(__fourbyteints__) && !__fourbyteints__
57 #define __QD3DVIEW__RESTORE_TWOBYTEINTS
58 #pragma fourbyteints on
59 #endif
60 #pragma enumsalwaysint on
61 #elif PRAGMA_ENUM_OPTIONS
62 #pragma option enum =int
63 #elif PRAGMA_ENUM_PACK
64 #if __option(pack_enums)
65 #define __QD3DVIEW__RESTORE_PACKED_ENUMS
66 #pragma options(!pack_enums)
67 #endif
68 #endif
69 
70  /******************************************************************************
71  ** **
72  ** View Type Definitions **
73  ** **
74  *****************************************************************************/
75  enum TQ3ViewStatus
76  {
77  kQ3ViewStatusDone = 0,
78  kQ3ViewStatusRetraverse = 1,
79  kQ3ViewStatusError = 2,
80  kQ3ViewStatusCancelled = 3
81  };
82  typedef enum TQ3ViewStatus TQ3ViewStatus;
83 
84 /******************************************************************************
85  ** **
86  ** Default Attribute Set **
87  ** **
88  *****************************************************************************/
89 #define kQ3ViewDefaultAmbientCoefficient 1.0
90 #define kQ3ViewDefaultDiffuseColor 1.0, 1.0, 1.0
91 #define kQ3ViewDefaultSpecularColor 0.5, 0.5, 0.5
92 #define kQ3ViewDefaultSpecularControl 4.0
93 #define kQ3ViewDefaultTransparency 1.0, 1.0, 1.0
94 #define kQ3ViewDefaultHighlightState kQ3Off
95 #define kQ3ViewDefaultHighlightColor 1.0, 0.0, 0.0
96 #define kQ3ViewDefaultSubdivisionMethod kQ3SubdivisionMethodScreenSpace
97 #define kQ3ViewDefaultSubdivisionC1 20.0
98 #define kQ3ViewDefaultSubdivisionC2 20.0
99 
100 /******************************************************************************
101  ** **
102  ** View Routines **
103  ** **
104  *****************************************************************************/
105 #if CALL_NOT_IN_CARBON
114  TQ3ViewObject
115  Q3View_New(void);
116 
125  TQ3Status
126  Q3View_Cancel(TQ3ViewObject view);
127 
128  /******************************************************************************
129  ** **
130  ** View Rendering routines **
131  ** **
132  *****************************************************************************/
141  TQ3Status
142  Q3View_SetRendererByType(TQ3ViewObject view, TQ3ObjectType theType);
143 
152  TQ3Status
153  Q3View_SetRenderer(TQ3ViewObject view, TQ3RendererObject renderer);
154 
163  TQ3Status
164  Q3View_GetRenderer(TQ3ViewObject view, TQ3RendererObject *renderer);
165 
174  TQ3Status
175  Q3View_StartRendering(TQ3ViewObject view);
176 
185  TQ3ViewStatus
186  Q3View_EndRendering(TQ3ViewObject view);
187 
196  TQ3Status
197  Q3View_Flush(TQ3ViewObject view);
198 
207  TQ3Status
208  Q3View_Sync(TQ3ViewObject view);
209 
210  /******************************************************************************
211  ** **
212  ** View/Bounds/Pick routines **
213  ** **
214  *****************************************************************************/
223  TQ3Status
224  Q3View_StartBoundingBox(TQ3ViewObject view, TQ3ComputeBounds computeBounds);
225 
234  TQ3ViewStatus
235  Q3View_EndBoundingBox(TQ3ViewObject view, TQ3BoundingBox *result);
236 
245  TQ3Status
246  Q3View_StartBoundingSphere(TQ3ViewObject view, TQ3ComputeBounds computeBounds);
247 
256  TQ3ViewStatus
257  Q3View_EndBoundingSphere(TQ3ViewObject view, TQ3BoundingSphere *result);
258 
267  TQ3Status
268  Q3View_StartPicking(TQ3ViewObject view, TQ3PickObject pick);
269 
278  TQ3ViewStatus
279  Q3View_EndPicking(TQ3ViewObject view);
280 
281  /******************************************************************************
282  ** **
283  ** View/Camera routines **
284  ** **
285  *****************************************************************************/
294  TQ3Status
295  Q3View_GetCamera(TQ3ViewObject view, TQ3CameraObject *camera);
296 
305  TQ3Status
306  Q3View_SetCamera(TQ3ViewObject view, TQ3CameraObject camera);
307 
308  /******************************************************************************
309  ** **
310  ** View/Lights routines **
311  ** **
312  *****************************************************************************/
321  TQ3Status
322  Q3View_SetLightGroup(TQ3ViewObject view, TQ3GroupObject lightGroup);
323 
332  TQ3Status
333  Q3View_GetLightGroup(TQ3ViewObject view, TQ3GroupObject *lightGroup);
334 
335 /******************************************************************************
336  ** **
337  ** Idle Method **
338  ** **
339  *****************************************************************************/
380 #endif /* CALL_NOT_IN_CARBON */
381 
382  typedef CALLBACK_API_C(TQ3Status, TQ3ViewIdleMethod)(TQ3ViewObject view,
383  const void *idlerData);
384  typedef CALLBACK_API_C(TQ3Status,
385  TQ3ViewIdleProgressMethod)(TQ3ViewObject view,
386  const void *idlerData,
387  unsigned long current,
388  unsigned long completed);
389 #if CALL_NOT_IN_CARBON
398  TQ3Status
399  Q3View_SetIdleMethod(TQ3ViewObject view, TQ3ViewIdleMethod idleMethod,
400  const void *idleData);
401 
410  TQ3Status
411  Q3View_SetIdleProgressMethod(TQ3ViewObject view,
412  TQ3ViewIdleProgressMethod idleMethod,
413  const void *idleData);
414 
415 /******************************************************************************
416  ** **
417  ** EndFrame Method **
418  ** **
419  *****************************************************************************/
438 #endif /* CALL_NOT_IN_CARBON */
439 
440  typedef CALLBACK_API_C(void, TQ3ViewEndFrameMethod)(TQ3ViewObject view,
441  void *endFrameData);
442 #if CALL_NOT_IN_CARBON
451  TQ3Status
452  Q3View_SetEndFrameMethod(TQ3ViewObject view, TQ3ViewEndFrameMethod endFrame,
453  void *endFrameData);
454 
455  /******************************************************************************
456  ** **
457  ** Push/Pop routines **
458  ** **
459  *****************************************************************************/
468  TQ3Status
469  Q3Push_Submit(TQ3ViewObject view);
470 
479  TQ3Status
480  Q3Pop_Submit(TQ3ViewObject view);
481 
490  TQ3StateOperatorObject
491  Q3Push_New(void);
492 
501  TQ3StateOperatorObject
502  Q3Pop_New(void);
503 
512  TQ3Status
513  Q3StateOperator_Submit(TQ3StateOperatorObject stateOperator,
514  TQ3ViewObject view);
515 
516  /******************************************************************************
517  ** **
518  ** Check if bounding box is visible in the viewing frustum. Transforms **
519  ** the bbox by the current local_to_world transformation matrix and **
520  ** does a clip test to see if it lies in the viewing frustum. **
521  ** This can be used by applications to cull out large chunks of scenes **
522  ** that are not going to be visible. **
523  ** **
524  ** The default implementation is to always return kQ3True. Renderers **
525  ** may override this routine however to do the checking. **
526  ** **
527  *****************************************************************************/
536  TQ3Boolean
537  Q3View_IsBoundingBoxVisible(TQ3ViewObject view, const TQ3BoundingBox *bbox);
538 
539  /******************************************************************************
540  ** **
541  ** Allows display groups to be culled if they are assigned bounding **
542  ** boxes. **
543  ** **
544  *****************************************************************************/
553  TQ3Status
554  Q3View_AllowAllGroupCulling(TQ3ViewObject view, TQ3Boolean allowCulling);
555 
556  /******************************************************************************
557  ** **
558  ** DrawContext routines **
559  ** **
560  *****************************************************************************/
569  TQ3Status
570  Q3View_SetDrawContext(TQ3ViewObject view, TQ3DrawContextObject drawContext);
571 
580  TQ3Status
581  Q3View_GetDrawContext(TQ3ViewObject view, TQ3DrawContextObject *drawContext);
582 
583  /******************************************************************************
584  ** **
585  ** Graphics State routines **
586  ** **
587  ** The graphics state routines can only be called while rendering (ie. in **
588  ** between calls to start and end rendering calls). If they are called **
589  ** outside of a rendering loop, they will return with error. **
590  ** **
591  *****************************************************************************/
592  /******************************************************************************
593  ** **
594  ** Transform routines **
595  ** **
596  *****************************************************************************/
605  TQ3Status
606  Q3View_GetLocalToWorldMatrixState(TQ3ViewObject view, TQ3Matrix4x4 *matrix);
607 
616  TQ3Status
617  Q3View_GetWorldToFrustumMatrixState(TQ3ViewObject view, TQ3Matrix4x4 *matrix);
618 
627  TQ3Status
629 
630  /******************************************************************************
631  ** **
632  ** Style state routines **
633  ** **
634  *****************************************************************************/
643  TQ3Status
644  Q3View_GetBackfacingStyleState(TQ3ViewObject view,
645  TQ3BackfacingStyle *backfacingStyle);
646 
655  TQ3Status
657  TQ3InterpolationStyle *interpolationType);
658 
667  TQ3Status
668  Q3View_GetFillStyleState(TQ3ViewObject view, TQ3FillStyle *fillStyle);
669 
678  TQ3Status
679  Q3View_GetHighlightStyleState(TQ3ViewObject view,
680  TQ3AttributeSet *highlightStyle);
681 
690  TQ3Status
692  TQ3SubdivisionStyleData *subdivisionStyle);
693 
702  TQ3Status
704  TQ3OrientationStyle *fontFacingDirectionStyle);
705 
714  TQ3Status
715  Q3View_GetReceiveShadowsStyleState(TQ3ViewObject view, TQ3Boolean *receives);
716 
725  TQ3Status
726  Q3View_GetPickIDStyleState(TQ3ViewObject view, unsigned long *pickIDStyle);
727 
736  TQ3Status
737  Q3View_GetPickPartsStyleState(TQ3ViewObject view, TQ3PickParts *pickPartsStyle);
738 
747  TQ3Status
748  Q3View_GetAntiAliasStyleState(TQ3ViewObject view,
749  TQ3AntiAliasStyleData *antiAliasData);
750 
751  /******************************************************************************
752  ** **
753  ** Attribute state routines **
754  ** **
755  *****************************************************************************/
764  TQ3Status
765  Q3View_GetDefaultAttributeSet(TQ3ViewObject view,
766  TQ3AttributeSet *attributeSet);
767 
776  TQ3Status
777  Q3View_SetDefaultAttributeSet(TQ3ViewObject view, TQ3AttributeSet attributeSet);
778 
787  TQ3Status
788  Q3View_GetAttributeSetState(TQ3ViewObject view, TQ3AttributeSet *attributeSet);
789 
798  TQ3Status
799  Q3View_GetAttributeState(TQ3ViewObject view, TQ3AttributeType attributeType,
800  void *data);
801 
802 #endif /* CALL_NOT_IN_CARBON */
803 
804 #if PRAGMA_ENUM_ALWAYSINT
805 #pragma enumsalwaysint reset
806 #ifdef __QD3DVIEW__RESTORE_TWOBYTEINTS
807 #pragma fourbyteints off
808 #endif
809 #elif PRAGMA_ENUM_OPTIONS
810 #pragma option enum =reset
811 #elif defined(__QD3DVIEW__RESTORE_PACKED_ENUMS)
812 #pragma options(pack_enums)
813 #endif
814 
815 #if PRAGMA_STRUCT_ALIGN
816 #pragma options align = reset
817 #elif PRAGMA_STRUCT_PACKPUSH
818 #pragma pack(pop)
819 #elif PRAGMA_STRUCT_PACK
820 #pragma pack()
821 #endif
822 
823 #ifdef PRAGMA_IMPORT_OFF
824 #pragma import off
825 #elif PRAGMA_IMPORT
826 #pragma import reset
827 #endif
828 
829 #ifdef __cplusplus
830 }
831 #endif
832 
833 #endif /* __QD3DVIEW__ */
Q3Set types and routines.
Q3Style types and routines.
TQ3BackfacingStyle
Definition: QD3DStyle.h:388
TQ3OrientationStyle
Definition: QD3DStyle.h:565
TQ3FillStyle
Definition: QD3DStyle.h:328
TQ3InterpolationStyle
Definition: QD3DStyle.h:451
TQ3Status Q3View_Sync(TQ3ViewObject view)
TQ3StateOperatorObject Q3Pop_New(void)
TQ3Status Q3View_StartPicking(TQ3ViewObject view, TQ3PickObject pick)
TQ3Status Q3View_StartRendering(TQ3ViewObject view)
TQ3Status Q3View_StartBoundingSphere(TQ3ViewObject view, TQ3ComputeBounds computeBounds)
TQ3Status Q3View_SetEndFrameMethod(TQ3ViewObject view, TQ3ViewEndFrameMethod endFrame, void *endFrameData)
TQ3Status Q3View_GetReceiveShadowsStyleState(TQ3ViewObject view, TQ3Boolean *receives)
typedef CALLBACK_API_C(TQ3Status, TQ3ViewIdleMethod)(TQ3ViewObject view
TQ3Status Q3View_GetPickPartsStyleState(TQ3ViewObject view, TQ3PickParts *pickPartsStyle)
TQ3ViewObject Q3View_New(void)
TQ3Status Q3View_GetRenderer(TQ3ViewObject view, TQ3RendererObject *renderer)
TQ3Status Q3View_GetWorldToFrustumMatrixState(TQ3ViewObject view, TQ3Matrix4x4 *matrix)
TQ3Status Q3View_GetAttributeSetState(TQ3ViewObject view, TQ3AttributeSet *attributeSet)
TQ3Status Q3View_GetLocalToWorldMatrixState(TQ3ViewObject view, TQ3Matrix4x4 *matrix)
TQ3Status Q3View_StartBoundingBox(TQ3ViewObject view, TQ3ComputeBounds computeBounds)
TQ3ViewStatus Q3View_EndBoundingSphere(TQ3ViewObject view, TQ3BoundingSphere *result)
TQ3Boolean Q3View_IsBoundingBoxVisible(TQ3ViewObject view, const TQ3BoundingBox *bbox)
TQ3Status Q3View_SetRendererByType(TQ3ViewObject view, TQ3ObjectType theType)
TQ3Status Q3View_SetDefaultAttributeSet(TQ3ViewObject view, TQ3AttributeSet attributeSet)
TQ3Status Q3View_GetPickIDStyleState(TQ3ViewObject view, unsigned long *pickIDStyle)
TQ3ViewStatus Q3View_EndPicking(TQ3ViewObject view)
TQ3Status Q3View_SetIdleProgressMethod(TQ3ViewObject view, TQ3ViewIdleProgressMethod idleMethod, const void *idleData)
TQ3Status Q3View_Flush(TQ3ViewObject view)
TQ3Status Q3View_GetHighlightStyleState(TQ3ViewObject view, TQ3AttributeSet *highlightStyle)
TQ3Status Q3View_GetAntiAliasStyleState(TQ3ViewObject view, TQ3AntiAliasStyleData *antiAliasData)
TQ3Status Q3View_SetRenderer(TQ3ViewObject view, TQ3RendererObject renderer)
TQ3Status Q3View_SetLightGroup(TQ3ViewObject view, TQ3GroupObject lightGroup)
TQ3ViewStatus Q3View_EndRendering(TQ3ViewObject view)
TQ3Status Q3View_GetDrawContext(TQ3ViewObject view, TQ3DrawContextObject *drawContext)
TQ3Status Q3View_GetCamera(TQ3ViewObject view, TQ3CameraObject *camera)
TQ3Status Q3View_SetDrawContext(TQ3ViewObject view, TQ3DrawContextObject drawContext)
TQ3Status Q3View_GetOrientationStyleState(TQ3ViewObject view, TQ3OrientationStyle *fontFacingDirectionStyle)
TQ3Status Q3View_GetBackfacingStyleState(TQ3ViewObject view, TQ3BackfacingStyle *backfacingStyle)
TQ3Status Q3View_GetSubdivisionStyleState(TQ3ViewObject view, TQ3SubdivisionStyleData *subdivisionStyle)
TQ3Status Q3View_Cancel(TQ3ViewObject view)
TQ3Status Q3Push_Submit(TQ3ViewObject view)
TQ3Status Q3View_GetLightGroup(TQ3ViewObject view, TQ3GroupObject *lightGroup)
TQ3Status Q3View_SetIdleMethod(TQ3ViewObject view, TQ3ViewIdleMethod idleMethod, const void *idleData)
TQ3ViewStatus Q3View_EndBoundingBox(TQ3ViewObject view, TQ3BoundingBox *result)
TQ3Status Q3View_AllowAllGroupCulling(TQ3ViewObject view, TQ3Boolean allowCulling)
TQ3Status Q3View_GetDefaultAttributeSet(TQ3ViewObject view, TQ3AttributeSet *attributeSet)
TQ3Status Q3View_GetFrustumToWindowMatrixState(TQ3ViewObject view, TQ3Matrix4x4 *matrix)
TQ3Status Q3View_SetCamera(TQ3ViewObject view, TQ3CameraObject camera)
TQ3Status Q3View_GetFillStyleState(TQ3ViewObject view, TQ3FillStyle *fillStyle)
TQ3Status Q3View_GetAttributeState(TQ3ViewObject view, TQ3AttributeType attributeType, void *data)
TQ3Status Q3StateOperator_Submit(TQ3StateOperatorObject stateOperator, TQ3ViewObject view)
TQ3Status Q3Pop_Submit(TQ3ViewObject view)
TQ3StateOperatorObject Q3Push_New(void)
TQ3Status Q3View_GetInterpolationStyleState(TQ3ViewObject view, TQ3InterpolationStyle *interpolationType)
Base types for Quickdraw 3D.
TQ3SetObject TQ3AttributeSet
Definition: QD3D.h:197
TQ3ComputeBounds
Definition: QD3D.h:628
long TQ3ObjectType
Definition: QD3D.h:152
TQ3SharedObject TQ3RendererObject
Definition: QD3D.h:181
TQ3ShapeObject TQ3GroupObject
Definition: QD3D.h:210
Definition: QD3DStyle.h:635
Definition: QD3D.h:599
Definition: QD3D.h:606
Definition: QD3D.h:494
Definition: QD3DStyle.h:106