home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / Developer University / DU Projects / Graphics3D / Sources / Part.cpp < prev    next >
Encoding:
Text File  |  1996-12-11  |  2.6 KB  |  98 lines  |  [TEXT/CWIE]

  1. //========================================================================================
  2. //    Release Version:    $ ODF 3 $
  3. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  4.  
  5. //================================================================================
  6. #include "Graphics3D.hpp"
  7.  
  8. #ifndef PART_H
  9. #include "Part.h"
  10. #endif
  11.  
  12. #ifndef CONTENT_H
  13. #include "Content.h"
  14. #endif
  15.  
  16. #ifndef BINDING_K
  17. #include "Binding.k"
  18. #endif
  19.  
  20. #ifndef FRAME_H
  21. #include "Frame.h"
  22. #endif
  23.  
  24. #ifndef SELECTION_H
  25. #include "Selection.h"
  26. #endif
  27.  
  28. #ifndef DEFINES_K
  29. #include "Defines.k"        // command numbers
  30. #endif
  31.  
  32. // ----- Framework Layer -----
  33. #ifndef FWPRESEN_H
  34. #include "FWPresen.h"        // FW_CPresentation
  35. #endif
  36.  
  37. #ifndef FWABOUT_H
  38. #include "FWAbout.h"        //::FW_About()
  39. #endif
  40.  
  41. //==============================================================================
  42. #ifdef FW_BUILD_MAC
  43. #pragma segment Graphics3D
  44. #endif
  45.  
  46. FW_DEFINE_AUTO(CGraphics3DPart)
  47.  
  48. //==============================================================================
  49. CGraphics3DPart::CGraphics3DPart(ODPart* odPart)
  50.   :    FW_CPart(odPart, FW_gInstance, kPartInfoID),
  51.     fPresentation(NULL),
  52.     fPartContent(NULL)
  53. {
  54. }
  55.  
  56. //--------------------------------------------------------------------------------
  57. CGraphics3DPart::~CGraphics3DPart()
  58. {
  59. }
  60.  
  61. //--------------------------------------------------------------------------------
  62. void 
  63. CGraphics3DPart::Initialize(Environment* ev, ODStorageUnit* storageUnit, 
  64.                                             FW_Boolean fromStorage)    // Override
  65. {
  66.     FW_CPart::Initialize(ev, storageUnit, fromStorage);
  67.     CGraphics3DSelection* selection = FW_NEW(CGraphics3DSelection, (ev, fPartContent));
  68.     const ODType kMainPresentation = "Apple:Presentation:Graphics3D";
  69.     const FW_Boolean kDefaultPresentation = true;
  70.     fPresentation = RegisterPresentation(ev, kMainPresentation, 
  71.                                             kDefaultPresentation, selection);
  72. }
  73.  
  74. //--------------------------------------------------------------------------------
  75. FW_Handled CGraphics3DPart::DoAbout(Environment* ev)
  76. {
  77.     ::FW_About(ev, this, kAbout);
  78.     
  79.     return FW_kHandled;
  80. }
  81.  
  82. //--------------------------------------------------------------------------------
  83. FW_CFrame* 
  84. CGraphics3DPart::NewFrame(Environment* ev, ODFrame* odFrame,
  85.                         FW_CPresentation* presentation, FW_Boolean fromStorage)    // Override
  86. {
  87.     FW_UNUSED(fromStorage);
  88.     return FW_NEW(CGraphics3DFrame, (ev, odFrame, presentation, fPartContent));
  89. }
  90.  
  91. //------------------------------------------------------------------------------
  92. FW_CContent* 
  93. CGraphics3DPart::NewPartContent(Environment* ev)
  94. {
  95.     fPartContent = FW_NEW(CGraphics3DContent, (ev, this));
  96.     return fPartContent;
  97. }
  98.