acgidrawstream.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. //
  12. // This API extends AcGi to support stream draw functionality
  13. //
  14. #pragma once
  15. #pragma pack(push, 8)
  16. class AcGiDrawStreamImp;
  17. typedef bool (*GraphicsUpdateProc)(const AcArray<AcGiDrawable*>& drawableArray);
  18. ///////////////////////////////////////////////////////////////////////////////
  19. // class AcGiDrawStream
  20. //
  21. class ACDB_PORT AcGiDrawStream : public AcGiDrawable
  22. {
  23. friend class AcGiDrawStreamImp;
  24. public:
  25. ACRX_DECLARE_MEMBERS(AcGiDrawStream);
  26. static bool build(const AcArray<AcGiDrawStream*>& streamArray, GraphicsUpdateProc lpFunc);
  27. AcGiDrawStream();
  28. AcGiDrawStream(const AcGiDrawable* pOwner);
  29. ~AcGiDrawStream();
  30. AcGiDrawable* getOwner() const;
  31. void setOwner(const AcGiDrawable* pOwner);
  32. bool isValid() const;
  33. bool serializeOut(IAcWriteStream* pOutput) const;
  34. bool serializeIn(IAcReadStream* pInput, AcDbDatabase* pDb = NULL);
  35. // Overridden methods from AcGiDrawable
  36. virtual Adesk::Boolean isPersistent() const ADESK_OVERRIDE;
  37. virtual AcDbObjectId id() const ADESK_OVERRIDE;
  38. virtual AcGiDrawable::DrawableType drawableType() const ADESK_OVERRIDE;
  39. virtual bool bounds(AcDbExtents& bounds) const ADESK_OVERRIDE;
  40. virtual void setDrawStream(AcGiDrawStream* pStream) ADESK_OVERRIDE;
  41. virtual AcGiDrawStream* drawStream() const ADESK_OVERRIDE;
  42. protected:
  43. // Overridden methods from AcGiDrawable
  44. virtual Adesk::UInt32 subSetAttributes(AcGiDrawableTraits* pTraits) ADESK_OVERRIDE;
  45. virtual Adesk::Boolean subWorldDraw(AcGiWorldDraw* pWd) ADESK_OVERRIDE;
  46. virtual void subViewportDraw(AcGiViewportDraw* pVd) ADESK_OVERRIDE;
  47. virtual Adesk::UInt32 subViewportDrawLogicalFlags(AcGiViewportDraw* pVd) ADESK_OVERRIDE;
  48. protected:
  49. AcGiDrawStreamImp* m_pImp;
  50. };
  51. #pragma pack(pop)