1 /*! @header QuesaView.h 2 Declares the Quesa view object. 3 */ 4 /* NAME: 5 QuesaView.h 6 7 DESCRIPTION: 8 Quesa public header. 9 10 COPYRIGHT: 11 Copyright (c) 1999-2004, Quesa Developers. All rights reserved. 12 13 For the current release of Quesa, please see: 14 15 <http://www.quesa.org/> 16 17 Redistribution and use in source and binary forms, with or without 18 modification, are permitted provided that the following conditions 19 are met: 20 21 o Redistributions of source code must retain the above copyright 22 notice, this list of conditions and the following disclaimer. 23 24 o Redistributions in binary form must reproduce the above 25 copyright notice, this list of conditions and the following 26 disclaimer in the documentation and/or other materials provided 27 with the distribution. 28 29 o Neither the name of Quesa nor the names of its contributors 30 may be used to endorse or promote products derived from this 31 software without specific prior written permission. 32 33 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 34 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 35 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 36 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 37 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 38 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 39 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 40 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 41 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 42 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 43 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44 ___________________________________________________________________________ 45 */ 46 #ifndef QUESA_VIEW_HDR 47 #define QUESA_VIEW_HDR 48 //============================================================================= 49 // Include files 50 //----------------------------------------------------------------------------- 51 #include "Quesa.h" 52 53 #include "QuesaStyle.h" 54 #include "QuesaSet.h" 55 56 // Disable QD3D header 57 #ifdef __QD3DVIEW__ 58 #error 59 #endif 60 61 #define __QD3DVIEW__ 62 63 64 65 66 67 //============================================================================= 68 // C++ preamble 69 //----------------------------------------------------------------------------- 70 #ifdef __cplusplus 71 extern "C" { 72 #endif 73 74 75 76 77 78 //============================================================================= 79 // Constants 80 //----------------------------------------------------------------------------- 81 /*! 82 * @enum 83 * TQ3ViewStatus 84 * @discussion 85 * View submit loop status. 86 * 87 * @constant kQ3ViewStatusDone Submit loop completed successfully. 88 * @constant kQ3ViewStatusRetraverse Submit loop requires another pass. 89 * @constant kQ3ViewStatusError Submit loop encountered an error. 90 * @constant kQ3ViewStatusCancelled Submit loop was cancelled. 91 */ 92 typedef enum TQ3ViewStatus { 93 kQ3ViewStatusDone = 0, 94 kQ3ViewStatusRetraverse = 1, 95 kQ3ViewStatusError = 2, 96 kQ3ViewStatusCancelled = 3, 97 kQ3ViewStatusSize32 = 0xFFFFFFFF 98 } TQ3ViewStatus; 99 100 101 // Default attribute values 102 #define kQ3ViewDefaultAmbientCoefficient 1.0f 103 #define kQ3ViewDefaultDiffuseColor 1.0f, 1.0f, 1.0f 104 #define kQ3ViewDefaultSpecularColor 0.5f, 0.5f, 0.5f 105 #define kQ3ViewDefaultSpecularControl 4.0f 106 #define kQ3ViewDefaultTransparency 1.0f, 1.0f, 1.0f 107 #define kQ3ViewDefaultHighlightState kQ3Off 108 #define kQ3ViewDefaultHighlightColor 1.0f, 0.0f, 0.0f 109 #define kQ3ViewDefaultSubdivisionMethod kQ3SubdivisionMethodScreenSpace 110 #define kQ3ViewDefaultSubdivisionC1 20.0f 111 #define kQ3ViewDefaultSubdivisionC2 20.0f 112 113 114 115 116 117 //============================================================================= 118 // Types 119 //----------------------------------------------------------------------------- 120 /*! 121 * @typedef 122 * TQ3ViewIdleMethod 123 * @discussion 124 * Application callback for Q3View_SetIdleMethod. 125 * 126 * @param theView The view being submitted to. 127 * @param idlerData The application-specific data passed to Q3View_SetIdleMethod. 128 * @result Success or failure of the callback. 129 */ 130 typedef Q3_CALLBACK_API_C(TQ3Status, TQ3ViewIdleMethod)( 131 TQ3ViewObject theView, 132 const void *idlerData); 133 134 135 /*! 136 * @typedef 137 * TQ3ViewIdleProgressMethod 138 * @discussion 139 * Application callback for Q3View_SetIdleProgressMethod. 140 * 141 * @param theView The view being submitted to. 142 * @param idlerData The application-specific data passed to Q3View_SetIdleProgressMethod. 143 * @param progressCurrent The number of work units completed. 144 * @param progressCompleted The total number of work units which will be completed. 145 * @result Success or failure of the callback. 146 */ 147 typedef Q3_CALLBACK_API_C(TQ3Status, TQ3ViewIdleProgressMethod)( 148 TQ3ViewObject theView, 149 const void *idlerData, 150 TQ3Uns32 progressCurrent, 151 TQ3Uns32 progressCompleted); 152 153 154 /*! 155 * @typedef 156 * TQ3ViewEndFrameMethod 157 * @discussion 158 * Application callback for Q3View_SetEndFrameMethod. 159 * 160 * @param theView The view being submitted to. 161 * @param endFrameData The application-specific data passed to Q3View_SetEndFrameMethod. 162 * @result Success or failure of the callback. 163 */ 164 typedef Q3_CALLBACK_API_C(void, TQ3ViewEndFrameMethod)( 165 TQ3ViewObject theView, 166 void *endFrameData); 167 168 169 170 171 172 //============================================================================= 173 // Function prototypes 174 //----------------------------------------------------------------------------- 175 /*! 176 * @function 177 * Q3View_New 178 * @discussion 179 * Create a new view. 180 * 181 * @result The new view object. 182 */ 183 Q3_EXTERN_API_C ( TQ3ViewObject ) 184 Q3View_New ( 185 void 186 ); 187 188 189 190 /*! 191 * @function 192 * Q3View_NewWithDefaults 193 * @discussion 194 * Create a view with a default camera, light group, renderer, and 195 * draw context for the specified draw context target. 196 * 197 * The draw context type indicates the type of draw context target 198 * to create, and implies the following values for drawContextTarget. 199 * 200 * kQ3DrawContextTypePixmap => A TQ3Pixmap object. 201 * kQ3DrawContextTypeMacintosh => A WindowRef. 202 * kQ3DrawContextTypeCocoa => An NSView. 203 * kQ3DrawContextTypeWin32DC => An HDC. 204 * kQ3DrawContextTypeX11 => A Visual. 205 * kQ3DrawContextTypeBe => A BView. 206 * 207 * The exact contents of the returned view are not defined, however it 208 * should be suitable for interactively rendering objects placed at the 209 * origin and will fill the supplied window. 210 * 211 * <em>This function is not available in QD3D.</em> 212 * 213 * @param drawContextType The type of data referenced by drawContextTarget 214 * @param drawContextTarget The window/etc reference for the draw context. 215 * @result The new view object, or NULL on failure. 216 */ 217 #if QUESA_ALLOW_QD3D_EXTENSIONS 218 219 Q3_EXTERN_API_C ( TQ3ViewObject ) 220 Q3View_NewWithDefaults ( 221 TQ3ObjectType drawContextType, 222 void *drawContextTarget 223 ); 224 225 #endif // QUESA_ALLOW_QD3D_EXTENSIONS 226 227 228 229 /*! 230 * @function 231 * Q3View_Cancel 232 * @discussion 233 * Cancel a submit loop. 234 * 235 * @param view The view being submitted to. 236 * @result Success or failure of the operation. 237 */ 238 Q3_EXTERN_API_C ( TQ3Status ) 239 Q3View_Cancel ( 240 TQ3ViewObject view 241 ); 242 243 244 245 /*! 246 * @function 247 * Q3View_SetRendererByType 248 * @discussion 249 * Set the renderer for a view. 250 * 251 * The renderer is specified by class type, e.g., kQ3RendererTypeInteractive 252 * for the interactive renderer or kQ3RendererTypeWireFrame for the wire-frame 253 * renderer. 254 * 255 * @param view The view to update. 256 * @param theType The type of the renderer to assign to the view. 257 * @result Success or failure of the operation. 258 */ 259 Q3_EXTERN_API_C ( TQ3Status ) 260 Q3View_SetRendererByType ( 261 TQ3ViewObject view, 262 TQ3ObjectType theType 263 ); 264 265 266 267 /*! 268 * @function 269 * Q3View_SetRenderer 270 * @discussion 271 * Set the renderer for a view. 272 * 273 * The reference count of the renderer will be incremented by the view. 274 * 275 * @param view The view to update. 276 * @param renderer The renderer to assign to the view. 277 * @result Success or failure of the operation. 278 */ 279 Q3_EXTERN_API_C ( TQ3Status ) 280 Q3View_SetRenderer ( 281 TQ3ViewObject view, 282 TQ3RendererObject renderer 283 ); 284 285 286 287 /*! 288 * @function 289 * Q3View_GetRenderer 290 * @discussion 291 * Get the renderer from a view. 292 * 293 * The reference count of the renderer is incremented. 294 * 295 * @param view The view to query. 296 * @param renderer Receives the renderer associated with the view. 297 * @result Success or failure of the operation. 298 */ 299 Q3_EXTERN_API_C ( TQ3Status ) 300 Q3View_GetRenderer ( 301 TQ3ViewObject view, 302 TQ3RendererObject *renderer 303 ); 304 305 306 307 /*! 308 * @function 309 * Q3View_StartRendering 310 * @discussion 311 * Start a rendering loop. 312 * 313 * @param view The view to start rendering with. 314 * @result Success or failure of the operation. 315 */ 316 Q3_EXTERN_API_C ( TQ3Status ) 317 Q3View_StartRendering ( 318 TQ3ViewObject view 319 ); 320 321 322 323 /*! 324 * @function 325 * Q3View_EndRendering 326 * @discussion 327 * End a rendering loop. 328 * 329 * @param view The view being rendered to. 330 * @result Result of the rendering pass. 331 * Note that the result is a TQ3ViewStatus, not a TQ3Status. 332 * Be sure to watch for kQ3ViewStatusRetraverse, and repeat 333 * the submit loop in that case. 334 */ 335 Q3_EXTERN_API_C ( TQ3ViewStatus ) 336 Q3View_EndRendering ( 337 TQ3ViewObject view 338 ); 339 340 341 342 /*! 343 * @function 344 * Q3View_Flush 345 * @discussion 346 * Flush the output from within a rendering loop. 347 * 348 * May only be called between a Q3View_StartRendering/Q3View_EndRendering sequence. 349 * May or may not update the draw context - behaviour is renderer-dependent. 350 * 351 * @param view The view to flush. 352 * @result Success or failure of the operation. 353 */ 354 Q3_EXTERN_API_C ( TQ3Status ) 355 Q3View_Flush ( 356 TQ3ViewObject view 357 ); 358 359 360 361 /*! 362 * @function 363 * Q3View_Sync 364 * @discussion 365 * Flush the previous rendering loop to the draw context. 366 * 367 * Blocks until the previous rendering loop has updated the draw context. May only 368 * be called after a call to Q3View_EndRendering. 369 * 370 * @param view The view to sync. 371 * @result Success or failure of the operation. 372 */ 373 Q3_EXTERN_API_C ( TQ3Status ) 374 Q3View_Sync ( 375 TQ3ViewObject view 376 ); 377 378 379 380 /*! 381 * @function 382 * Q3View_StartBoundingBox 383 * @discussion 384 * Start a bounding loop. 385 * 386 * @param view The view to start bounding with. 387 * @param computeBounds The accuracy of the calculated bounds. 388 * @result Success or failure of the operation. 389 */ 390 Q3_EXTERN_API_C ( TQ3Status ) 391 Q3View_StartBoundingBox ( 392 TQ3ViewObject view, 393 TQ3ComputeBounds computeBounds 394 ); 395 396 397 398 /*! 399 * @function 400 * Q3View_EndBoundingBox 401 * @discussion 402 * End a bounding loop. 403 * 404 * @param view The view being bounded to. 405 * @param theBounds Bounding box to set to the computed bounds. 406 * @result Result of the bounding pass. 407 * Note that the result is a TQ3ViewStatus, not a TQ3Status. 408 * Be sure to watch for kQ3ViewStatusRetraverse, and repeat 409 * the submit loop in that case. 410 */ 411 Q3_EXTERN_API_C ( TQ3ViewStatus ) 412 Q3View_EndBoundingBox ( 413 TQ3ViewObject view, 414 TQ3BoundingBox *theBounds 415 ); 416 417 418 419 /*! 420 * @function 421 * Q3View_StartBoundingSphere 422 * @discussion 423 * Start a bounding loop. 424 * 425 * @param view The view to start bounding with. 426 * @param computeBounds The accuracy of the calculated bounds. 427 * @result Success or failure of the operation. 428 */ 429 Q3_EXTERN_API_C ( TQ3Status ) 430 Q3View_StartBoundingSphere ( 431 TQ3ViewObject view, 432 TQ3ComputeBounds computeBounds 433 ); 434 435 436 437 /*! 438 * @function 439 * Q3View_EndBoundingSphere 440 * @discussion 441 * End a bounding loop. 442 * 443 * @param view The view being bounded to. 444 * @param theBounds Bounding sphere to set to the computed bounds. 445 * @result Result of the bounding pass. 446 * Note that the result is a TQ3ViewStatus, not a TQ3Status. 447 * Be sure to watch for kQ3ViewStatusRetraverse, and repeat 448 * the submit loop in that case. 449 */ 450 Q3_EXTERN_API_C ( TQ3ViewStatus ) 451 Q3View_EndBoundingSphere ( 452 TQ3ViewObject view, 453 TQ3BoundingSphere *theBounds 454 ); 455 456 457 458 /*! 459 * @function 460 * Q3View_StartPicking 461 * @discussion 462 * Start a picking loop. 463 * 464 * @param view The view to start picking with. 465 * @param pick The pick object for the pick loop. 466 * @result Success or failure of the operation. 467 */ 468 Q3_EXTERN_API_C ( TQ3Status ) 469 Q3View_StartPicking ( 470 TQ3ViewObject view, 471 TQ3PickObject pick 472 ); 473 474 475 476 /*! 477 * @function 478 * Q3View_EndPicking 479 * @discussion 480 * End a picking loop. 481 * 482 * @param view The view being picked to. 483 * @result Result of the picking pass. 484 * Note that the result is a TQ3ViewStatus, not a TQ3Status. 485 * Be sure to watch for kQ3ViewStatusRetraverse, and repeat 486 * the submit loop in that case. 487 */ 488 Q3_EXTERN_API_C ( TQ3ViewStatus ) 489 Q3View_EndPicking ( 490 TQ3ViewObject view 491 ); 492 493 494 495 /*! 496 * @function 497 * Q3View_GetCamera 498 * @discussion 499 * Get the camera from a view. 500 * 501 * The reference count of the camera is incremented. 502 * 503 * @param view The view to query. 504 * @param camera Receives the camera associated with the view. 505 * @result Success or failure of the operation. 506 */ 507 Q3_EXTERN_API_C ( TQ3Status ) 508 Q3View_GetCamera ( 509 TQ3ViewObject view, 510 TQ3CameraObject *camera 511 ); 512 513 514 515 /*! 516 * @function 517 * Q3View_SetCamera 518 * @discussion 519 * Set the camera for a view. 520 * 521 * The reference count of the camera will be incremented by the view. 522 * 523 * @param view The view to update. 524 * @param camera The camera to assign to the view. 525 * @result Success or failure of the operation. 526 */ 527 Q3_EXTERN_API_C ( TQ3Status ) 528 Q3View_SetCamera ( 529 TQ3ViewObject view, 530 TQ3CameraObject camera 531 ); 532 533 534 535 /*! 536 * @function 537 * Q3View_SetLightGroup 538 * @discussion 539 * Set the light group for a view. 540 * 541 * The reference count of the light group will be incremented by the view. 542 * 543 * @param view The view to update. 544 * @param lightGroup The light group to assign to the view. 545 * @result Success or failure of the operation. 546 */ 547 Q3_EXTERN_API_C ( TQ3Status ) 548 Q3View_SetLightGroup ( 549 TQ3ViewObject view, 550 TQ3GroupObject lightGroup 551 ); 552 553 554 555 /*! 556 * @function 557 * Q3View_GetLightGroup 558 * @discussion 559 * Get the light group from a view. 560 * 561 * The reference count of the light group is incremented. 562 * 563 * @param view The view to query. 564 * @param lightGroup Receives the light group associated with the view. 565 * @result Success or failure of the operation. 566 */ 567 Q3_EXTERN_API_C ( TQ3Status ) 568 Q3View_GetLightGroup ( 569 TQ3ViewObject view, 570 TQ3GroupObject *lightGroup 571 ); 572 573 574 575 /*! 576 * @function 577 * Q3View_AddLight 578 * @discussion 579 * Add a light to a view's light group. 580 * 581 * If the view does not currently posses a light group, a new group 582 * will be created. 583 * 584 * lightData is assumed to point to the appropriate data structure 585 * for lightType. E.g., if lightType is kQ3LightTypeSpot, then 586 * lightData is assumed to be a pointer to a TQ3SpotLightData 587 * structure. 588 * 589 * lightType may also be set to kQ3ShapeTypeLight. In this case 590 * lightData is assumed to point to an existing TQ3LightObject (of 591 * any type) rather than to the data structure for a specific 592 * type of light. 593 * 594 * The reference count of the TQ3LightObject will be unaffected, and 595 * so the caller must dispose of it to release their reference. 596 * 597 * <em>This function is not available in QD3D.</em> 598 * 599 * @param theView The view to add the light to. 600 * @param lightType The type of data referenced by lightData. 601 * @param lightData The data for the light. 602 * @result Success or failure of the operation. 603 */ 604 #if QUESA_ALLOW_QD3D_EXTENSIONS 605 606 Q3_EXTERN_API_C ( TQ3Status ) 607 Q3View_AddLight ( 608 TQ3ViewObject theView, 609 TQ3ObjectType lightType, 610 void *lightData 611 ); 612 613 #endif // QUESA_ALLOW_QD3D_EXTENSIONS 614 615 616 617 /*! 618 * @function 619 * Q3View_SetIdleMethod 620 * @discussion 621 * Set the idle method for view submit operations. 622 * 623 * An idle method can be used to return control to the application 624 * periodically during a submit loop. 625 * 626 * @param view The view to update. 627 * @param idleMethod The view idle callback. 628 * @param idleData Application-specific data for the callback. 629 * @result Success or failure of the operation. 630 */ 631 Q3_EXTERN_API_C ( TQ3Status ) 632 Q3View_SetIdleMethod ( 633 TQ3ViewObject view, 634 TQ3ViewIdleMethod idleMethod, 635 const void *idleData 636 ); 637 638 639 640 /*! 641 * @function 642 * Q3View_SetIdleProgressMethod 643 * @discussion 644 * Set the idle progress method for view submit operations. 645 * 646 * An idle method can be used to return control to the application 647 * periodically during a submit loop. 648 * 649 * The idle progress method allows renderers to pass progress information 650 * to the application, to update the user interface during a render. 651 * 652 * @param view The view to update. 653 * @param idleMethod The view idle callback. 654 * @param idleData Application-specific data for the callback. 655 * @result Success or failure of the operation. 656 */ 657 Q3_EXTERN_API_C ( TQ3Status ) 658 Q3View_SetIdleProgressMethod ( 659 TQ3ViewObject view, 660 TQ3ViewIdleProgressMethod idleMethod, 661 const void *idleData 662 ); 663 664 665 666 /*! 667 * @function 668 * Q3View_SetEndFrameMethod 669 * @discussion 670 * Set the end frame method for view submit operations. 671 * 672 * @param view The view to update. 673 * @param endFrame The view end frame callback. 674 * @param endFrameData Application-specific data for the callback. 675 * @result Success or failure of the operation. 676 */ 677 Q3_EXTERN_API_C ( TQ3Status ) 678 Q3View_SetEndFrameMethod ( 679 TQ3ViewObject view, 680 TQ3ViewEndFrameMethod endFrame, 681 void *endFrameData 682 ); 683 684 685 686 /*! 687 * @function 688 * Q3Push_Submit 689 * @discussion 690 * Submit a push state operator to a view. 691 * 692 * @param view The view to submit the state operator to. 693 * @result Success or failure of the operation. 694 */ 695 Q3_EXTERN_API_C ( TQ3Status ) 696 Q3Push_Submit ( 697 TQ3ViewObject view 698 ); 699 700 701 702 /*! 703 * @function 704 * Q3Pop_Submit 705 * @discussion 706 * Submit a pop state operator to a view. 707 * 708 * @param view The view to submit the state operator to. 709 * @result Success or failure of the operation. 710 */ 711 Q3_EXTERN_API_C ( TQ3Status ) 712 Q3Pop_Submit ( 713 TQ3ViewObject view 714 ); 715 716 717 718 /*! 719 * @function 720 * Q3Push_New 721 * @discussion 722 * Create a push state operator. 723 * 724 * @result The new push state operator. 725 */ 726 Q3_EXTERN_API_C ( TQ3StateOperatorObject ) 727 Q3Push_New ( 728 void 729 ); 730 731 732 733 /*! 734 * @function 735 * Q3Pop_New 736 * @discussion 737 * Create a pop state operator. 738 * 739 * @result The new pop state operator. 740 */ 741 Q3_EXTERN_API_C ( TQ3StateOperatorObject ) 742 Q3Pop_New ( 743 void 744 ); 745 746 747 748 /*! 749 * @function 750 * Q3StateOperator_Submit 751 * @discussion 752 * Submit a state operator to a view. 753 * 754 * @param stateOperator The state operator to submit. 755 * @param view The view to submit the state operator to. 756 * @result Success or failure of the operation. 757 */ 758 Q3_EXTERN_API_C ( TQ3Status ) 759 Q3StateOperator_Submit ( 760 TQ3StateOperatorObject stateOperator, 761 TQ3ViewObject view 762 ); 763 764 765 766 /*! 767 * @function 768 * Q3View_IsBoundingBoxVisible 769 * @discussion 770 * Test a bounding box for visibility. 771 * 772 * The bounding box is compared against the view frustum of the camera 773 * currently associated with the view. 774 * 775 * @param view The view to check the bounding box against. 776 * @param bbox The bounding box to test. 777 * @result True or false as the bounding box is visible. 778 */ 779 Q3_EXTERN_API_C ( TQ3Boolean ) 780 Q3View_IsBoundingBoxVisible ( 781 TQ3ViewObject view, 782 const TQ3BoundingBox *bbox 783 ); 784 785 786 787 /*! 788 * @function 789 * Q3View_AllowAllGroupCulling 790 * @discussion 791 * Set the group culling state of a view. 792 * 793 * If group culling is active, a view will skip groups whose bounding 794 * boxes are not visible. 795 * 796 * @param view The view to update. 797 * @param allowCulling The new group culling state for the view. 798 * @result Success or failure of the operation. 799 */ 800 Q3_EXTERN_API_C ( TQ3Status ) 801 Q3View_AllowAllGroupCulling ( 802 TQ3ViewObject view, 803 TQ3Boolean allowCulling 804 ); 805 806 807 808 /*! 809 * @function 810 * Q3View_TransformLocalToWorld 811 * @discussion 812 * Transforms a point from local to world coordinates. 813 * 814 * May only be called within a view submitting loop. 815 * 816 * <em>This function is not available in QD3D.</em> 817 * 818 * @param theView The view currently being submitted to. 819 * @param localPoint The point to transform, in local coordinates. 820 * @param worldPoint The transformed point, in world coordinates. 821 * @result Success or failure of the operation. 822 */ 823 #if QUESA_ALLOW_QD3D_EXTENSIONS 824 825 Q3_EXTERN_API_C ( TQ3Status ) 826 Q3View_TransformLocalToWorld ( 827 TQ3ViewObject theView, 828 const TQ3Point3D *localPoint, 829 TQ3Point3D *worldPoint 830 ); 831 832 #endif // QUESA_ALLOW_QD3D_EXTENSIONS 833 834 835 836 /*! 837 * @function 838 * Q3View_TransformLocalToWindow 839 * @discussion 840 * Transforms a point from local to window (pixel) coordinates. 841 * 842 * May only be called within a view submitting loop. 843 * 844 * <em>This function is not available in QD3D.</em> 845 * 846 * @param theView The view currently being submitted to. 847 * @param localPoint The point to transform, in local coordinates. 848 * @param windowPoint The transformed point, in window coordinates. 849 * @result Success or failure of the operation. 850 */ 851 #if QUESA_ALLOW_QD3D_EXTENSIONS 852 853 Q3_EXTERN_API_C ( TQ3Status ) 854 Q3View_TransformLocalToWindow ( 855 TQ3ViewObject theView, 856 const TQ3Point3D *localPoint, 857 TQ3Point2D *windowPoint 858 ); 859 860 #endif // QUESA_ALLOW_QD3D_EXTENSIONS 861 862 863 864 /*! 865 * @function 866 * Q3View_TransformWorldToWindow 867 * @discussion 868 * Transforms a point from world to window (pixel) coordinates. 869 * 870 * May only be called within a view submitting loop. 871 * 872 * <em>This function is not available in QD3D.</em> 873 * 874 * @param theView The view currently being submitted to. 875 * @param worldPoint The point to transform, in world coordinates. 876 * @param windowPoint The transformed point, in window coordinates. 877 * @result Success or failure of the operation. 878 */ 879 #if QUESA_ALLOW_QD3D_EXTENSIONS 880 881 Q3_EXTERN_API_C ( TQ3Status ) 882 Q3View_TransformWorldToWindow ( 883 TQ3ViewObject theView, 884 const TQ3Point3D *worldPoint, 885 TQ3Point2D *windowPoint 886 ); 887 888 #endif // QUESA_ALLOW_QD3D_EXTENSIONS 889 890 891 892 /*! 893 * @function 894 * Q3View_SetDrawContext 895 * @discussion 896 * Set the draw context for a view. 897 * 898 * The reference count of the draw context will be incremented by the view. 899 * 900 * @param view The view to update. 901 * @param drawContext The draw context to assign to the view. 902 * @result Success or failure of the operation. 903 */ 904 Q3_EXTERN_API_C ( TQ3Status ) 905 Q3View_SetDrawContext ( 906 TQ3ViewObject view, 907 TQ3DrawContextObject drawContext 908 ); 909 910 911 912 /*! 913 * @function 914 * Q3View_GetDrawContext 915 * @discussion 916 * Get the draw context from a view. 917 * 918 * The reference count of the draw context is incremented. 919 * 920 * @param view The view to query. 921 * @param drawContext Receives the draw context associated with the view. 922 * @result Success or failure of the operation. 923 */ 924 Q3_EXTERN_API_C ( TQ3Status ) 925 Q3View_GetDrawContext ( 926 TQ3ViewObject view, 927 TQ3DrawContextObject *drawContext 928 ); 929 930 931 932 /*! 933 * @function 934 * Q3View_GetLocalToWorldMatrixState 935 * @discussion 936 * Get the local-to-world matrix state from a view. 937 * Must be called within a submitting loop. 938 * 939 * @param view The view to query. 940 * @param matrix Receives the local-to-world matrix. 941 * @result Success or failure of the operation. 942 */ 943 Q3_EXTERN_API_C ( TQ3Status ) 944 Q3View_GetLocalToWorldMatrixState ( 945 TQ3ViewObject view, 946 TQ3Matrix4x4 *matrix 947 ); 948 949 950 951 /*! 952 * @function 953 * Q3View_GetWorldToFrustumMatrixState 954 * @discussion 955 * Get the world-to-frustum matrix state from a view. 956 * 957 * This matrix can be used (via Q3Point3D_Transform) to transform points 958 * from world coordinates to frustum coordinates. Frustum coordinates 959 * specify where a point falls within the viewing frustum. In frustum 960 * space, the viewable area ranges in X from -1 (left) to 1 (right); in 961 * Y from -1 (bottom) to 1 (top), and in Z from 0 (near clipping plane) 962 * to -1 (far clipping plane). 963 * 964 * Note that this matrix cannot sensibly transform a point which is at 965 * or behind the near clipping plane. 966 * 967 * This matrix may be inverted for frustum-to-world transformations. 968 * 969 * This function must be called within a submitting loop. If you need 970 * this matrix when you are not in a submitting loop, use 971 * Q3Camera_GetWorldToFrustum instead. 972 * 973 * @param view The view to query. 974 * @param matrix Receives the local-to-frustum matrix. 975 * @result Success or failure of the operation. 976 */ 977 Q3_EXTERN_API_C ( TQ3Status ) 978 Q3View_GetWorldToFrustumMatrixState ( 979 TQ3ViewObject view, 980 TQ3Matrix4x4 *matrix 981 ); 982 983 984 985 /*! 986 * @function 987 * Q3View_GetFrustumToWindowMatrixState 988 * @discussion 989 * Get the frustum-to-window matrix state from a view. 990 * Must be called within a submitting loop. 991 * 992 * This matrix may be used (via Q3Point3D_Transform) to transform 993 * points from frustum coordinates into window coordinates. See 994 * Q3View_GetWorldToFrustumMatrixState for a description of frustum 995 * coordinates. 996 * 997 * @param view The view to query. 998 * @param matrix Receives the frustum-to-window matrix. 999 * @result Success or failure of the operation. 1000 */ 1001 Q3_EXTERN_API_C ( TQ3Status ) 1002 Q3View_GetFrustumToWindowMatrixState ( 1003 TQ3ViewObject view, 1004 TQ3Matrix4x4 *matrix 1005 ); 1006 1007 1008 1009 /*! 1010 * @function 1011 * Q3View_GetBackfacingStyleState 1012 * @discussion 1013 * Get the current backfacing style state from a view. 1014 * 1015 * @param view The view to query. 1016 * @param backfacingStyle Receives the current backfacing style state. 1017 * @result Success or failure of the operation. 1018 */ 1019 Q3_EXTERN_API_C ( TQ3Status ) 1020 Q3View_GetBackfacingStyleState ( 1021 TQ3ViewObject view, 1022 TQ3BackfacingStyle *backfacingStyle 1023 ); 1024 1025 1026 1027 /*! 1028 * @function 1029 * Q3View_GetInterpolationStyleState 1030 * @discussion 1031 * Get the current interpolation style state from a view. 1032 * 1033 * @param view The view to query. 1034 * @param interpolationType Receives the current interpolation style state. 1035 * @result Success or failure of the operation. 1036 */ 1037 Q3_EXTERN_API_C ( TQ3Status ) 1038 Q3View_GetInterpolationStyleState ( 1039 TQ3ViewObject view, 1040 TQ3InterpolationStyle *interpolationType 1041 ); 1042 1043 1044 1045 /*! 1046 * @function 1047 * Q3View_GetFillStyleState 1048 * @discussion 1049 * Get the current fill style state from a view. 1050 * 1051 * @param view The view to query. 1052 * @param fillStyle Receives the current fill style state. 1053 * @result Success or failure of the operation. 1054 */ 1055 Q3_EXTERN_API_C ( TQ3Status ) 1056 Q3View_GetFillStyleState ( 1057 TQ3ViewObject view, 1058 TQ3FillStyle *fillStyle 1059 ); 1060 1061 1062 1063 /*! 1064 * @function 1065 * Q3View_GetHighlightStyleState 1066 * @discussion 1067 * Get the current highlight style state from a view. 1068 * 1069 * @param view The view to query. 1070 * @param highlightStyle Receives the current highlight style state. 1071 * @result Success or failure of the operation. 1072 */ 1073 Q3_EXTERN_API_C ( TQ3Status ) 1074 Q3View_GetHighlightStyleState ( 1075 TQ3ViewObject view, 1076 TQ3AttributeSet *highlightStyle 1077 ); 1078 1079 1080 1081 /*! 1082 * @function 1083 * Q3View_GetSubdivisionStyleState 1084 * @discussion 1085 * Get the current subdivision style state from a view. 1086 * 1087 * @param view The view to query. 1088 * @param subdivisionStyle Receives the current subdivision style state. 1089 * @result Success or failure of the operation. 1090 */ 1091 Q3_EXTERN_API_C ( TQ3Status ) 1092 Q3View_GetSubdivisionStyleState ( 1093 TQ3ViewObject view, 1094 TQ3SubdivisionStyleData *subdivisionStyle 1095 ); 1096 1097 1098 1099 /*! 1100 * @function 1101 * Q3View_GetOrientationStyleState 1102 * @discussion 1103 * Get the current orientation style state from a view. 1104 * 1105 * @param view The view to query. 1106 * @param fontFacingDirectionStyle Receives the current orientation style state. 1107 * @result Success or failure of the operation. 1108 */ 1109 Q3_EXTERN_API_C ( TQ3Status ) 1110 Q3View_GetOrientationStyleState ( 1111 TQ3ViewObject view, 1112 TQ3OrientationStyle *fontFacingDirectionStyle 1113 ); 1114 1115 1116 1117 /*! 1118 * @function 1119 * Q3View_GetCastShadowsStyleState 1120 * @discussion 1121 * Get the current cast shadows style state from a view. 1122 * 1123 * <em>This function is not available in QD3D.</em> 1124 * 1125 * @param view The view to query. 1126 * @param castShadows Receives the current cast shadows style state. 1127 * @result Success or failure of the operation. 1128 */ 1129 #if QUESA_ALLOW_QD3D_EXTENSIONS 1130 1131 Q3_EXTERN_API_C ( TQ3Status ) 1132 Q3View_GetCastShadowsStyleState ( 1133 TQ3ViewObject view, 1134 TQ3Boolean *castShadows 1135 ); 1136 1137 #endif // QUESA_ALLOW_QD3D_EXTENSIONS 1138 1139 1140 1141 /*! 1142 * @function 1143 * Q3View_GetReceiveShadowsStyleState 1144 * @discussion 1145 * Get the current receive shadows style state from a view. 1146 * 1147 * @param view The view to query. 1148 * @param receiveShadows Receives the current receive shadows style state. 1149 * @result Success or failure of the operation. 1150 */ 1151 Q3_EXTERN_API_C ( TQ3Status ) 1152 Q3View_GetReceiveShadowsStyleState ( 1153 TQ3ViewObject view, 1154 TQ3Boolean *receiveShadows 1155 ); 1156 1157 1158 1159 /*! 1160 * @function 1161 * Q3View_GetPickIDStyleState 1162 * @discussion 1163 * Get the current pick ID style state from a view. 1164 * 1165 * @param view The view to query. 1166 * @param pickIDStyle Receives the current pick ID style state. 1167 * @result Success or failure of the operation. 1168 */ 1169 Q3_EXTERN_API_C ( TQ3Status ) 1170 Q3View_GetPickIDStyleState ( 1171 TQ3ViewObject view, 1172 TQ3Uns32 *pickIDStyle 1173 ); 1174 1175 1176 1177 /*! 1178 * @function 1179 * Q3View_GetPickPartsStyleState 1180 * @discussion 1181 * Get the current pick parts style state from a view. 1182 * 1183 * @param view The view to query. 1184 * @param pickPartsStyle Receives the current pick parts style state. 1185 * @result Success or failure of the operation. 1186 */ 1187 Q3_EXTERN_API_C ( TQ3Status ) 1188 Q3View_GetPickPartsStyleState ( 1189 TQ3ViewObject view, 1190 TQ3PickParts *pickPartsStyle 1191 ); 1192 1193 1194 1195 /*! 1196 * @function 1197 * Q3View_GetAntiAliasStyleState 1198 * @discussion 1199 * Get the current anti-alias style state from a view. 1200 * 1201 * @param view The view to query. 1202 * @param antiAliasData Receives the current anti-alias style state. 1203 * @result Success or failure of the operation. 1204 */ 1205 Q3_EXTERN_API_C ( TQ3Status ) 1206 Q3View_GetAntiAliasStyleState ( 1207 TQ3ViewObject view, 1208 TQ3AntiAliasStyleData *antiAliasData 1209 ); 1210 1211 1212 1213 /*! 1214 * @function 1215 * Q3View_GetFogStyleState 1216 * @discussion 1217 * Get the current fog style associated with a view. 1218 * 1219 * <em>This function is not available in QD3D.</em> 1220 * 1221 * @param theView The view to query. 1222 * @param fogData Receives the current fog style state. 1223 * @result Success or failure of the operation. 1224 */ 1225 #if QUESA_ALLOW_QD3D_EXTENSIONS 1226 1227 Q3_EXTERN_API_C ( TQ3Status ) 1228 Q3View_GetFogStyleState ( 1229 TQ3ViewObject view, 1230 TQ3FogStyleData *fogData 1231 ); 1232 1233 #endif // QUESA_ALLOW_QD3D_EXTENSIONS 1234 1235 1236 1237 /*! 1238 * @function 1239 * Q3View_GetDefaultAttributeSet 1240 * @discussion 1241 * Get the default attribute set from a view. 1242 * 1243 * The reference count of the attribute set is incremented. 1244 * 1245 * @param view The view to query. 1246 * @param attributeSet Receives the default attribute set. 1247 * @result Success or failure of the operation. 1248 */ 1249 Q3_EXTERN_API_C ( TQ3Status ) 1250 Q3View_GetDefaultAttributeSet ( 1251 TQ3ViewObject view, 1252 TQ3AttributeSet *attributeSet 1253 ); 1254 1255 1256 1257 /*! 1258 * @function 1259 * Q3View_SetDefaultAttributeSet 1260 * @discussion 1261 * Set the default attribute set for a view. 1262 * 1263 * The reference count of the attribute set will be incremented by the view. 1264 * 1265 * @param view The view to update. 1266 * @param attributeSet The attribute set to assign to the view. 1267 * @result Success or failure of the operation. 1268 */ 1269 Q3_EXTERN_API_C ( TQ3Status ) 1270 Q3View_SetDefaultAttributeSet ( 1271 TQ3ViewObject view, 1272 TQ3AttributeSet attributeSet 1273 ); 1274 1275 1276 1277 /*! 1278 * @function 1279 * Q3View_GetAttributeSetState 1280 * @discussion 1281 * Get the current attribute state set from a view. 1282 * 1283 * @param view The view to query. 1284 * @param attributeSet Receives the current attribute state set. 1285 * @result Success or failure of the operation. 1286 */ 1287 Q3_EXTERN_API_C ( TQ3Status ) 1288 Q3View_GetAttributeSetState ( 1289 TQ3ViewObject view, 1290 TQ3AttributeSet *attributeSet 1291 ); 1292 1293 1294 1295 /*! 1296 * @function 1297 * Q3View_GetAttributeState 1298 * @discussion 1299 * Get the current state of an attribute from a view. 1300 * 1301 * @param view The view to query. 1302 * @param attributeType The attribute type to query. 1303 * @param data Receives the current value for the specified attribute. 1304 * @result Success or failure of the operation. 1305 */ 1306 Q3_EXTERN_API_C ( TQ3Status ) 1307 Q3View_GetAttributeState ( 1308 TQ3ViewObject view, 1309 TQ3AttributeType attributeType, 1310 void *data 1311 ); 1312 1313 1314 1315 1316 1317 //============================================================================= 1318 // C++ postamble 1319 //----------------------------------------------------------------------------- 1320 #ifdef __cplusplus 1321 } 1322 #endif 1323 1324 #endif 1325 1326 1327