home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / MacOS / QuickDraw™ 3D 1.0.6F4 SDK / Samples / SampleCode / CustomAttribute / CustomAttribute_Lib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-02  |  2.0 KB  |  113 lines  |  [TEXT/CWIE]

  1. #ifndef __CUSTOMATTRIBUTE_LIB__
  2. #define __CUSTOMATTRIBUTE_LIB__
  3.  
  4. #ifndef QD3D_h
  5. #include "QD3D.h"
  6. #endif
  7.  
  8. #ifndef QD3DPick_h
  9. #include "QD3DPick.h"
  10. #endif
  11.  
  12. #ifndef _STRING
  13. #include <string.h>
  14. #endif
  15.  
  16. /* Here we define the new types */
  17.  
  18. #define kElementTypeName                'name'
  19. #define kElementTypeScale                'scle'
  20. #define kElementTypeUpVector            'upvt'
  21. #define kElementTypeForwardDirection    'fwrd'
  22. #define kElementTypeW3Anchor            'w3nr'
  23. #define kElementTypeW3Inline            'w3nl'
  24.  
  25. typedef enum W3AnchorOptions {
  26.     kW3AnchorOptionNone            =  0,
  27.     kW3AnchorOptionUseMap        =  1
  28. } W3AnchorOptions;
  29.  
  30. typedef struct W3AnchorData {
  31.     char                *url;
  32.     TQ3StringObject        description;
  33.     W3AnchorOptions    options;
  34. } W3AnchorData;
  35.  
  36. typedef struct W3InlineData {
  37.     char                *url;
  38. } W3InlineData;
  39.  
  40. /*
  41.  *    Call this to register all the custom attributes
  42.  *    
  43.  *    One call does it all
  44.  */
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif    /* __cplusplus */
  48.  
  49. void RegisterAllCustomAttributes(void);
  50.  
  51. void UnregisterAllCustomAttributes(void);
  52.  
  53. /*
  54.  *    Convenience routines for setting elements
  55.  *    
  56.  */
  57.  
  58. TQ3Status SetName(
  59.     TQ3Object    object,
  60.     char        *name);
  61.  
  62. TQ3Status SetScale(
  63.     TQ3Object    object,
  64.     double        scale);
  65.  
  66. TQ3Status SetUpVector(
  67.     TQ3Object    object,
  68.     TQ3Vector3D    *upVector);
  69.  
  70. TQ3Status SetForwardDirection(
  71.     TQ3Object    object,
  72.     TQ3Vector3D    *forwardDirection);
  73.  
  74. TQ3Status SetW3Anchor(
  75.     TQ3Object            object,
  76.     char                *url,
  77.     char                *description,
  78.     W3AnchorOptions options);
  79.     
  80. TQ3Status SetW3Inline(
  81.     TQ3Object    object,
  82.     char        *url);
  83.     
  84. TQ3Boolean W3Anchor_GetFromObject(
  85.     TQ3Object object,
  86.     W3AnchorData *data);
  87.  
  88. TQ3Boolean W3Anchor_GetFromHitData(
  89.     const TQ3HitData *hitData, 
  90.     W3AnchorData *data);
  91.     
  92. void W3Anchor_Empty (
  93.     W3AnchorData *URLData);
  94.  
  95.  
  96. #ifdef __cplusplus
  97. }
  98. #endif  /*  __cplusplus  */
  99.  
  100. /*
  101.  *    Note
  102.  *    
  103.  *    kElementNameWWWAnchor is obsolete and has been replaced by kElementW3Anchor.
  104.  */
  105. #define kElementTypeWWWAnchor    ((TQ3ElementType) Q3_OBJECT_TYPE('w','w','w','a'))
  106. #define kElementNameWWWAnchor    "WWWAnchor"
  107.  
  108. typedef struct WWWAnchorData {
  109.     char    *url;
  110. } WWWAnchorData;
  111.  
  112. #endif
  113.