imgvars.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. #ifndef __IMGVARS_H
  13. #define __IMGVARS_H
  14. #include "dbmain.h"
  15. #include "imgdef.h"
  16. #pragma pack (push, 8)
  17. // Opaque types
  18. //
  19. class AcDbImpRasterVariables;
  20. // Silence compiler
  21. //
  22. #pragma warning( disable : 4275 )
  23. #ifdef ISMDLLACCESS
  24. #undef ISMDLLACCESS
  25. #endif
  26. #ifdef ISMDLLACCESSDATA
  27. #undef ISMDLLACCESSDATA
  28. #endif
  29. #ifdef ISM_OBJ // For DwgUnplugged ISMobj.arx:
  30. // Classes to be exported have to have ISMDLLACCESS definition in its header.
  31. // Example: class ISMDLLACCESS AcDbImpRasterImageDef
  32. #define ISMDLLACCESS __declspec(dllexport)
  33. #define ISMDLLACCESSDATA
  34. #else
  35. #define ISMDLLACCESS
  36. #define ISMDLLACCESSDATA __declspec(dllimport)
  37. #endif
  38. class ISMDLLACCESS AcDbRasterVariables : public AcDbObject
  39. {
  40. public:
  41. static ClassVersion classVersion();
  42. ACRX_DECLARE_MEMBERS(AcDbRasterVariables);
  43. // Enums, for the allowable variable values
  44. enum FrameSettings {
  45. kImageFrameInvalid = -1,
  46. kImageFrameOff = 0,
  47. kImageFrameAbove = 1,
  48. kImageFrameBelow = 2,
  49. kImageFrameOnNoPlot = 3
  50. };
  51. enum ImageQuality {
  52. kImageQualityInvalid = -1,
  53. kImageQualityDraft = 0,
  54. kImageQualityHigh = 1
  55. };
  56. static AcDbRasterVariables* create();
  57. AcDbRasterVariables();
  58. virtual ~AcDbRasterVariables();
  59. virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);
  60. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;
  61. virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer);
  62. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;
  63. virtual FrameSettings imageFrame() const;
  64. virtual Acad::ErrorStatus setImageFrame( FrameSettings value );
  65. virtual ImageQuality imageQuality() const;
  66. virtual Acad::ErrorStatus setImageQuality( ImageQuality value );
  67. virtual AcDbRasterImageDef::Units userScale() const;
  68. virtual Acad::ErrorStatus setUserScale(
  69. AcDbRasterImageDef::Units units );
  70. static AcDbRasterVariables* openRasterVariables(
  71. AcDb::OpenMode mode,
  72. AcDbDatabase* pDatabase = 0
  73. );
  74. private:
  75. // These are here because otherwise dllexport tries to export the
  76. // private methods of AcDbObject. They're private in AcDbObject
  77. // because vc5 does not properly support array new and delete.
  78. // It tends to call the wrong delete operator and to not call
  79. // the dtors on all elements in the array. So we make them
  80. // private in order to prevent usage of them.
  81. //
  82. #ifdef MEM_DEBUG
  83. #undef new
  84. #undef delete
  85. #endif
  86. void *operator new[](size_t) throw() { return 0;}
  87. void operator delete[](void *) {};
  88. void *operator new[](size_t, const char *, int) throw() { return 0;}
  89. #ifdef MEM_DEBUG
  90. #define new DEBUG_NEW
  91. #define delete DEBUG_DELETE
  92. #endif
  93. // Data members
  94. //
  95. AcDbImpRasterVariables* mpImp;
  96. static ClassVersion mVersion;
  97. };
  98. inline ClassVersion
  99. AcDbRasterVariables::classVersion()
  100. { return mVersion; }
  101. #pragma warning( default : 4275 )
  102. #pragma pack (pop)
  103. #endif // __IMGVARS_H