home *** CD-ROM | disk | FTP | other *** search
/ Ray Dream Studio 5 / Ray Dream.iso / pc / DreamSDK / Windows / SAMPLES / PRIMITIV / STAR / COMSTAR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-11  |  2.9 KB  |  84 lines

  1. // Copyright (c)1995 Ray Dream, Inc. All Rights Reserved.
  2. /* $Id: COMStar.h 1.5 1997/06/20 22:34:25 damien Exp $ */
  3.  
  4. //
  5. // COM Example of a Geometric Primitive based on Facets
  6. //
  7.  
  8. #ifndef __COMSTAR__
  9. #define __COMSTAR__  
  10.  
  11. #ifndef __I3DEXPRM__
  12. #include "I3DExPrm.h"
  13. #endif
  14.                   
  15. #ifndef __STARDLL__
  16. #include "STARDLL.h"
  17. #endif
  18.  
  19. // Component Object Model Definition :
  20.                     
  21. // define the Facets CLSID
  22. // C84E1240-8478-101C-8BFC-F629D50D262B // to put in the regestry database with the pathname of the dll
  23. DEFINE_GUID(CLSID_Facets, 0xC84E1240L, 0x8478, 0x101C, 0x8B, 0xFC, 0xF6, 0x29, 0xD5, 0x0D, 0x26, 0x2B);
  24.  
  25.  
  26. // 3D Star Data definition
  27. typedef struct StarData
  28. {
  29.   short fNbBranches;  // Number of branches of the 3D Star (from 2 to 20)
  30. } StarData;
  31.  
  32.  
  33. // 3D Star Object definition : 
  34. // Facets Object :
  35. #undef INTERFACE
  36. #define INTERFACE Facets
  37. class Facets : public I3DExGeometricPrimitive, public I3DExDataExchanger {
  38. public :  
  39.   Facets();
  40.   ~Facets();
  41.   
  42.   // IUnknown Interface :
  43.   STDMETHODIMP         QueryInterface(THIS_ REFIID riid, LPVOID FAR* ppvObj);
  44.   STDMETHODIMP_(ULONG) AddRef(THIS);
  45.   STDMETHODIMP_(ULONG) Release(THIS);
  46.   
  47.   // I3DExtension method :
  48.   STDMETHODIMP_(I3DExtension*) Clone(THIS);
  49.   STDMETHODIMP                 ShellUtilitiesInit(THIS_ IShUtilities* shellUtilities);  
  50.   
  51.   // I3DExDataExchanger methods :
  52.   STDMETHODIMP_(ExtensionDataMap*) GetExtensionDataMap(THIS);
  53.   STDMETHODIMP_(void*)            GetExtensionDataBuffer(THIS);
  54.   STDMETHODIMP                     ExtensionDataChanged(THIS);
  55.   STDMETHODIMP                     HandleEvent(THIS_ ULONG sourceID);
  56.   STDMETHODIMP_(short)            GetResID(THIS);
  57.   
  58.   // I3DExGeometricPrimitiv methods
  59.   // Geometric Calls
  60.   STDMETHODIMP           GetBBox(THIS_ BOX3D* bbox);
  61.   STDMETHODIMP           EnumPatches(THIS_ EnumPatchesCallback callback, void* privData);
  62.   STDMETHODIMP           EnumFacets(THIS_ EnumFacetsCallback callback, void* privData,NUM3D fidelity);
  63.     STDMETHODIMP           GetNbrLOD(short &nbrLod);
  64.     STDMETHODIMP           GetLOD(short lodIndex, NUM3D &lod);
  65.     STDMETHODIMP           MakeFacetMesh(THIS_ short index, FacetMesh &amesh);
  66.     STDMETHODIMP           MakeFacetMesh(THIS_ NUM3D lod,FacetMesh &amesh);
  67.   // Shading Calls
  68.   STDMETHODIMP_(ULONG) GetUVSpaceCount(THIS);
  69.   STDMETHODIMP         GetUVSpace(THIS_ ULONG uvSpaceID, UVSpaceInfo* uvSpaceInfo);
  70.   STDMETHODIMP         UV2XYZ(THIS_ VECTOR2D* uv, ULONG uvSpaceID, VECTOR3D* resultPosition, BOOLEAN* inUVSpace);
  71.   // Ray tracing Calls
  72.   STDMETHODIMP RayHit(THIS_ BOOLEAN* didHit, Ray3D* aR, RayHitParameters* RayHitParams, RayHit3D* hit);
  73.   STDMETHODIMP GetRayHitDetails(THIS_ RayHit3D* hit);
  74.   STDMETHODIMP RayAllHits(THIS_ Ray3D* aR, NUM3D tmin, NUM3D tmax, RayHit3D* hit, RayHitCallback callback, void* privData);
  75.   
  76. private :
  77.   ULONG      fCRef;      // reference Counter
  78.   StarData   fData;      // 3D Star Data
  79.   };
  80.  
  81.  
  82. #endif // __FACETS__
  83.  
  84.