CFx SDK Documentation  2023 SP0
DbRasterImageDef.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 
26 
27 #ifndef __DBRASTERIMAGEDEF_H
28 #define __DBRASTERIMAGEDEF_H
29 
30 #include "TD_PackPush.h"
31 
32 // Forward declarations
33 //
34 
35 class OdDbDictionary;
36 
37 #include "DbObjectReactor.h"
38 #include "DbObject.h"
39 #include "Gi/GiRasterImage.h"
40 #include "Ge/GeVector2d.h"
41 #include "RxObjectImpl.h"
42 
57 {
58 public:
60 
62 
64 
66  bool erasing);
67  virtual void subHandOverTo (
68  OdDbObject* pNewObject);
69  void subClose();
70 
72  OdDbDwgFiler* pFiler);
73 
75  OdDbDwgFiler* pFiler) const;
76 
78  OdDbDxfFiler* pFiler);
79 
81  OdDbDxfFiler* pFiler) const;
82 
89 
100 
114  virtual OdResult load(
115  bool modifyDatabase = true);
116 
126  virtual void unload(
127  bool modifyDatabase = true);
128 
132  virtual bool isLoaded() const;
133 
137  virtual OdGeVector2d size() const;
138 
139 
148 
156 
162  int entityCount(bool* pbLocked = NULL) const;
163 
170  void updateEntities() const;
171 
176 
184 
188  virtual OdGiRasterImagePtr image(bool load = true);
189 
198  virtual void setImage(OdGiRasterImage* pImage, bool modifyDatabase = true);
199 
209 
215 
216  enum
217  {
218  kMaxSuggestNameSize = 2049
219  };
220 
228  static OdString suggestName(const OdDbDictionary* pImageDictionary,
229  const OdString& strFilePath, int nMaxLength = kMaxSuggestNameSize);
230 
235 
243  /* comment this out for a while
244 
245  int colorDepth() const;
246  OdGiSentScanLines* makeScanLines(
247  const OdGiRequestScanLines* pReq,
248  const OdGeMatrix2d& pixToScreen,
249  OdGePoint2dArray* pActiveClipBndy = 0, // Data will be modified!
250  bool draftQuality = false,
251  bool isTransparent = false,
252  const double brightness = 50.0,
253  const double contrast = 50.0,
254  const double fade = 0.0
255  ) const;
256  OdString searchForActivePath();
257  void embed(); // this function is not implemented in ARX
258  bool isEmbedded() const;
259  OdString fileType() const;
260  void setUndoStoreSize(unsigned int maxImages = 10);
261  unsigned int undoStoreSize() const;
262  bool imageModified() const;
263  void setImageModified(bool modified);
264  void loadThumbnail(OdUInt16& maxWidth, OdUInt16& maxHeight,
265  OdUInt8* pPalette = 0, int nPaletteEntries = 0);
266  void unloadThumbnail();
267  void* createThumbnailBitmap(BITMAPINFO*& pBitmapInfo,
268  OdUInt8 brightness = 50, OdUInt8 contrast = 50, OdUInt8 fade = 0);
269  IeFileDesc* fileDescCopy() const;
270  void getScanLines(OdGiBitmap& bitmap,
271  double brightness = 50.0,
272  double contrast = 50.0,
273  double fade = 0.0) const;
274  void openImage(IeImg*& pImage);
275  void closeImage();
276 
277  */
282  static int classVersion();
283 };
284 
285 
286 
287 
305 {
306 public:
308 
310 
312  OdDbDwgFiler* pFiler);
313 
315  OdDbDwgFiler* pFiler) const;
316 
318  OdDbDxfFiler* pFiler);
319 
321  OdDbDxfFiler* pFiler) const;
322 
331  void erased(
332  const OdDbObject* pObject,
333  bool erasing = true);
334 
342  void modified(
343  const OdDbObject* pObject);
344 
346  {
347  kUnload = 1,
348  kErase = 2
349  };
355  static void setEnable(
356  bool enable);
357 
380  virtual bool onDeleteImage(
381  const OdDbRasterImageDef* pImageDef,
382  DeleteImageEvent event,
383  bool cancelAllowed);
384 
388  static int classVersion();
389 };
390 
395 
402 {
403 protected:
405 public:
407 
426  virtual bool onDeleteImage( const OdDbRasterImageDef* pImageDef,
428  bool cancelAllowed ) = 0;
429 };
430 
431 /* comment this for a while */
432 
433 #if 0
439 class TOOLKIT_EXPORT OdDbRasterImageDefFileAccessReactor : public OdDbObjectReactor
440 {
441 protected:
442  OdDbRasterImageDefFileAccessReactor() {}
443 public:
444  ODRX_DECLARE_MEMBERS(OdDbRasterImageDefFileAccessReactor);
445 
452  virtual void onAttach(const OdDbRasterImageDef*, const OdString& pPath) = 0;
453 
460  virtual void onDetach(const OdDbRasterImageDef*, const OdString& pPath) = 0;
461 
471  virtual bool onOpen(const OdDbRasterImageDef*, const OdString& pPath,
472  const OdString& pActivePath, bool& replacePath, OdString& replacementPath) = 0;
473 
483  virtual bool onPathChange(const OdDbRasterImageDef*,
484  const OdString& pPath, const OdString& pActivePath,
485  bool& replacePath, OdString& replacementPath) = 0;
486 
493  virtual void onClose(const OdDbRasterImageDef*, const OdString& pPath) = 0;
494 
502  virtual void onDialog(OdDbRasterImageDef*,
503  const OdString& pCaption, const OdString& pFileExtensions) = 0;
504 };
505 
506 #endif
507 
512 
513 #include "TD_PackPop.h"
514 
515 #endif // __DBRASTERIMAGEDEF_H
516 
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbRasterImageDef > OdDbRasterImageDefPtr
OdSmartPtr< OdDbRasterImageDefReactor > OdDbRasterImageDefReactorPtr
#define NULL
Definition: GsProperties.h:177
OdResult
Definition: OdResult.h:29
OdResult dwgInFields(OdDbDwgFiler *pFiler)
virtual void unload(bool modifyDatabase=true)
virtual void setImage(OdGiRasterImage *pImage, bool modifyDatabase=true)
void dwgOutFields(OdDbDwgFiler *pFiler) const
virtual void setResolutionUnits(enum OdGiRasterImage::Units)
virtual OdGeVector2d resolutionMMPerPixel() const
virtual void subHandOverTo(OdDbObject *pNewObject)
static int classVersion()
virtual OdGiRasterImage::Units resolutionUnits() const
virtual OdGeVector2d size() const
OdGiRasterImage::Units Units
OdString activeFileName() const
static OdDbObjectId createImageDictionary(OdDbDatabase *pDb)
OdResult setSourceFileName(const OdString &pathName)
OdResult setActiveFileName(const OdString &pPathName)
void updateEntities() const
static OdString suggestName(const OdDbDictionary *pImageDictionary, const OdString &strFilePath, int nMaxLength=kMaxSuggestNameSize)
virtual OdGiRasterImagePtr image(bool load=true)
ODDB_DECLARE_MEMBERS(OdDbRasterImageDef)
OdString sourceFileName() const
void dxfOutFields(OdDbDxfFiler *pFiler) const
virtual OdResult setResolutionMMPerPixel(const OdGeVector2d &)
OdResult subErase(bool erasing)
virtual OdResult load(bool modifyDatabase=true)
virtual bool isLoaded() const
int entityCount(bool *pbLocked=NULL) const
OdResult dxfInFields(OdDbDxfFiler *pFiler)
static OdDbObjectId imageDictionary(OdDbDatabase *pDb)
void dxfOutFields(OdDbDxfFiler *pFiler) const
void erased(const OdDbObject *pObject, bool erasing=true)
void dwgOutFields(OdDbDwgFiler *pFiler) const
ODDB_DECLARE_MEMBERS(OdDbRasterImageDefReactor)
void modified(const OdDbObject *pObject)
OdResult dwgInFields(OdDbDwgFiler *pFiler)
virtual bool onDeleteImage(const OdDbRasterImageDef *pImageDef, DeleteImageEvent event, bool cancelAllowed)
OdResult dxfInFields(OdDbDxfFiler *pFiler)
static void setEnable(bool enable)
ODRX_DECLARE_MEMBERS(OdDbRasterImageDefTransReactor)
virtual bool onDeleteImage(const OdDbRasterImageDef *pImageDef, OdDbRasterImageDefReactor::DeleteImageEvent event, bool cancelAllowed)=0
ODRX_DECLARE_MEMBERS(OdGiDrawable)