AcGsManager.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //////////////////////////////////////////////////////////////////////////////
  2. //////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Copyright 2015 Autodesk, Inc. All rights reserved.
  5. //
  6. // Use of this software is subject to the terms of the Autodesk license
  7. // agreement provided at the time of installation or download, or which
  8. // otherwise accompanies this software in either electronic or hard copy form.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. #pragma once
  12. class AcDbViewportTableRecord;
  13. class AcGiDrawable;
  14. class AcGsGraphicsKernel;
  15. class AcGsKernelDescriptor;
  16. class AcGsView;
  17. class AcGsModel;
  18. class AcGsDevice;
  19. class AcGsConfig;
  20. struct AcGsClientViewInfo;
  21. #ifndef DRAWBRIDGE_API
  22. #define DRAWBRIDGE_API __declspec(dllimport)
  23. #endif // DRAWBRIDGE_API
  24. class AcGsManager
  25. {
  26. public:
  27. AcGsManager (void) { }
  28. virtual ~AcGsManager (void) { }
  29. virtual AcGsModel *createAutoCADModel (AcGsGraphicsKernel &) = 0;
  30. // creates a view of {vp, DBmodel}
  31. virtual AcGsView *createAutoCADViewport (AcGsGraphicsKernel &, AcDbViewportTableRecord *) = 0;
  32. // creates a view with {Drawable, DBModel} pair selected for viewing, connected to AutoCAD's GUI Device
  33. virtual AcGsView *createAutoCADView (AcGsGraphicsKernel &, AcGiDrawable *) = 0;
  34. virtual AcGsDevice *createAutoCADDevice (AcGsGraphicsKernel &, HWND hWnd) = 0;
  35. virtual AcGsDevice *createAutoCADOffScreenDevice(AcGsGraphicsKernel &) = 0;
  36. virtual void destroyAutoCADModel (AcGsModel *) = 0;
  37. virtual void destroyAutoCADView (AcGsView *) = 0;
  38. virtual void destroyAutoCADDevice (AcGsDevice *) = 0;
  39. virtual AcGsModel *getDBModel (AcGsGraphicsKernel &) = 0;
  40. virtual AcGsDevice *getGUIDevice (AcGsGraphicsKernel &) = 0;
  41. // Global methods
  42. static DRAWBRIDGE_API AcGsGraphicsKernel *acquireGraphicsKernel(const AcGsKernelDescriptor &);
  43. static DRAWBRIDGE_API void releaseGraphicsKernel(AcGsGraphicsKernel *);
  44. static DRAWBRIDGE_API AcGsConfig *getConfig (void);
  45. };
  46. class AcGsManager2 : public AcGsManager
  47. {
  48. public:
  49. /// <summary>
  50. /// Gets an offscreen device for the specificed kernel. An offscreen device is created if
  51. /// none exists and cached for subsequent use. Currently only supports the k3DRapidRTRendering
  52. /// kernel.
  53. /// </summary>
  54. /// <returns>
  55. /// Returns a valid device if successful.
  56. /// </returns>
  57. virtual AcGsDevice *getOffScreenDevice (AcGsGraphicsKernel &) = 0;
  58. /// <summary>
  59. /// Gets an offscreen view for the specificed kernel. The view is connectd to the offscreen device.
  60. /// It is created on demand and cached, however its lifetime is ephemeral and not guaranteed past
  61. /// the next call to this function with different AcGsClientViewInfo parameters. Currently only
  62. /// supports the k3DRapidRTRendering kernel.
  63. /// </summary>
  64. /// <returns>
  65. /// Returns a valid offscreen view if successful.
  66. /// </returns>
  67. virtual AcGsView *getOffScreenView (AcGsGraphicsKernel &, AcGsClientViewInfo &) = 0;
  68. };