IRasterAttachment.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 #include <DgnPlatform/Handler.h>
12 #include <DgnPlatform/image.h>
17 #include <Bentley/RefCounted.h>
18 
19 DGNPLATFORM_TYPEDEFS (RasterClip)
20 DGNPLATFORM_TYPEDEFS (RasterClipCollection)
21 DGNPLATFORM_TYPEDEFS (RasterClipProperties)
22 DGNPLATFORM_TYPEDEFS (RasterMaskReference)
23 DGNPLATFORM_TYPEDEFS (RasterMaskReferenceCollection)
24 DGNPLATFORM_TYPEDEFS (RasterLayerDisplayOverride)
25 DGNPLATFORM_TYPEDEFS (RasterLayerDisplayOvrCollection)
26 DGNPLATFORM_TYPEDEFS (RasterTransparentColorsCollection)
27 
28 
29 
31 
34 
38 typedef RefCountedPtr<RasterMaskReference> RasterMaskReferencePtr;
39 typedef RefCountedPtr<RasterLayerDisplayOverride> RasterLayerDisplayOvrPtr;
41 
42 
44  {
48  };
49 
51  {
56  };
57 
59  {
63  };
64 
65 
67  {
70  };
71 
73  {
76  };
77 
78 
79 /*=================================================================================**/
84 struct RasterClip : public RefCountedBase
85  {
86 
87 public:
89  DGNPLATFORM_EXPORT static RasterClipPtr Create ();
90 
94  DGNPLATFORM_EXPORT static RasterClipPtr Create (ElementHandleCR clipEh);
95 
100  DGNPLATFORM_EXPORT static RasterClipPtr Create (DPoint3dCP points, size_t numVerts, DgnModelRefR modelRef);
101 
103  DGNPLATFORM_EXPORT RasterClipPtr Clone() const;
104 
106  DGNPLATFORM_EXPORT ElementHandleCR GetClipElement() const;
107 
110  DGNPLATFORM_EXPORT void SetClipElement(ElementHandleCR clipEh);
111 
113  DGNPLATFORM_EXPORT bool IsValid() const;
114 
116  DGNPLATFORM_EXPORT void Invalidate();
117 
120  DGNPLATFORM_EXPORT bvector<DPoint3d> const& ComputeStrokePoints(bvector<DPoint3d>& strokePts) const;
121 
124  DGNPLATFORM_EXPORT bool IsEqual (RasterClipCR clip) const;
125 
126  };
127 
128 typedef bvector<RasterClipPtr> RasterClipVector;
129 /*=================================================================================**/
135 {
136 public:
137 
140 };
141 
142 /*=================================================================================**/
148  {
149 public:
150 
153 
156 
158  DGNPLATFORM_EXPORT bool HasBoundary() const;
159 
161  DGNPLATFORM_EXPORT RasterClipCR GetBoundary() const;
162 
164  DGNPLATFORM_EXPORT RasterClipR GetBoundaryR();
165 
169  DGNPLATFORM_EXPORT void SetBoundary(RasterClipPtr& boundaryP);
170 
172  DGNPLATFORM_EXPORT RasterClipCollectionCR GetMaskCollection() const;
173 
175  DGNPLATFORM_EXPORT RasterClipCollectionR GetMaskCollectionR();
176 
180  DGNPLATFORM_EXPORT void SetMaskCollection(RasterClipCollectionPtr& clipMasksP);
181 
182  };
183 
184 
185 /*=================================================================================**/
191  {
192  public:
193  typedef _RasterTransparentColorDef RasterTransparentColorDef;
194  typedef _RGBTransparentColorDef RasterRGBTransparentColorDef;
195 
196  typedef union transparentColors
197  {
201 
202  public:
203 
206 
212 
215 
218  DGNPLATFORM_EXPORT void Init(TransparentColorType colorType);
219 
224  DGNPLATFORM_EXPORT void Init(TransparentColorType colorType,long count,RasterTransparentColorsUnion const & transparentColor);
225 
227  DGNPLATFORM_EXPORT TransparentColorType GetColorType() const;
228 
231  DGNPLATFORM_EXPORT void SetColorType(TransparentColorType colorType);
232 
233 
235  DGNPLATFORM_EXPORT long GetCount() const;
236 
239  DGNPLATFORM_EXPORT void SetCount(long count);
240 
241  DGNPLATFORM_EXPORT size_t GetMaxRgbTransparentColor() const;
242 
245  DGNPLATFORM_EXPORT RasterRGBTransparentColorDef const& GetRgbTransparentColor(unsigned long index) const;
246 
250  DGNPLATFORM_EXPORT void SetRgbTransparentColor(unsigned long index,RasterRGBTransparentColorDef& value);
251 
256  DGNPLATFORM_EXPORT void AddRgbTransparentColor(const RgbColorDef & colorMin, const RgbColorDef & colorMax,UInt8 transparency);
257 
259  DGNPLATFORM_EXPORT size_t GetMaxTransparentColor() const;
260 
263  DGNPLATFORM_EXPORT RasterTransparentColorDef const& GetTransparentColor(unsigned long index) const;
264 
268  DGNPLATFORM_EXPORT void SetTransparentColor(unsigned long index,RasterTransparentColorDef& value);
269 
273  DGNPLATFORM_EXPORT void AddTransparentColor(UInt8 index,UInt8 transparency);
274 
276  DGNPLATFORM_EXPORT RasterTransparentColorsUnion const& GetTransparentColor() const;
277 
280  DGNPLATFORM_EXPORT bool IsEqual(RasterTransparentColorsCollectionCR transColors) const;
281  };
282 
283 
284 /*=================================================================================**/
290 {
291 private:
292  virtual void MakeClassAbstract() = 0;
293 public:
294 public:
295 
299  DGNPLATFORM_EXPORT static bool IsValidTransform(TransformCR matrix);
300 
304  DGNPLATFORM_EXPORT static bool IsTransform3D (TransformCR matrix);
305 
311  DGNPLATFORM_EXPORT static StatusInt ColorIndexFromRgbInModel (UInt32& index, DgnModelRefR modelRef, RgbColorDef const& rgbColor);
312 
318  DGNPLATFORM_EXPORT static StatusInt RgbFromColorIndexInModel (RgbColorDef& color, DgnModelRefR modelRef, UInt32 rawIndex);
319 
323  DGNPLATFORM_EXPORT static WString GetSearchPath (DgnModelRefP modelRef);
324 
326  DGNPLATFORM_EXPORT DgnDocumentMonikerPtr GetAttachMoniker (ElementHandleCR eh) const;
327 
331  DGNPLATFORM_EXPORT WString GetAttachDescription(ElementHandleCR eh) const;
332 
336  DGNPLATFORM_EXPORT WString GetLogicalName(ElementHandleCR eh) const;
337 
341  DGNPLATFORM_EXPORT bool GetSnappableState(ElementHandleCR eh) const;
342 
346  DGNPLATFORM_EXPORT bool GetLockedState(ElementHandleCR eh) const;
347 
351  DGNPLATFORM_EXPORT bool GetViewIndependentState(ElementHandleCR eh) const;
352 
356  DGNPLATFORM_EXPORT bool GetOpenReadWrite(ElementHandleCR eh) const;
357 
361  DGNPLATFORM_EXPORT GeoreferencePriority GetGeoreferencePriority(ElementHandleCR eh) const;
362 
366  DGNPLATFORM_EXPORT bool GetGCSInheritedFromModelState(ElementHandleCR eh) const;
367 
372  DGNPLATFORM_EXPORT BentleyStatus GetTransform(ElementHandleCR eh, TransformR matrix) const;
373 
377  DGNPLATFORM_EXPORT UInt32 GetPageNumber(ElementHandleCR eh) const;
378 
384  DGNPLATFORM_EXPORT ImageColorMode GetColorMode(ElementHandleCR eh) const;
385 
389  DGNPLATFORM_EXPORT DPoint2d GetExtent(ElementHandleCR eh) const;
390 
394  DGNPLATFORM_EXPORT DPoint2d GetScanningResolution(ElementHandleCR eh) const;
395 
400  DGNPLATFORM_EXPORT bool GetViewState(ElementHandleCR eh,int viewNumber) const;
401 
405  DGNPLATFORM_EXPORT bool GetInvertState(ElementHandleCR eh) const;
406 
410  DGNPLATFORM_EXPORT bool GetPrintState(ElementHandleCR eh) const;
411 
415  DGNPLATFORM_EXPORT bool GetClipState(ElementHandleCR eh) const;
416 
420  DGNPLATFORM_EXPORT bool GetTransparencyState(ElementHandleCR eh) const;
421 
426  DGNPLATFORM_EXPORT bool GetBinaryPrintInvertState(ElementHandleCR eh) const;
427 
431  DGNPLATFORM_EXPORT RasterDisplayPriorityPlane GetDisplayPriorityPlane(ElementHandleCR eh) const;
432 
440  DGNPLATFORM_EXPORT long GetLayer(ElementHandleCR eh) const;
441 
445  DGNPLATFORM_EXPORT double GetViewGamma(ElementHandleCR eh) const;
446 
450  DGNPLATFORM_EXPORT double GetPrintGamma(ElementHandleCR eh) const;
451 
456  DGNPLATFORM_EXPORT UInt32 GetTintColor(ElementHandleCR eh) const;
457 
462  DGNPLATFORM_EXPORT UInt32 GetForegroundColor(ElementHandleCR eh) const;
463 
468  DGNPLATFORM_EXPORT UInt32 GetBackgroundColor(ElementHandleCR eh) const;
469 
473  DGNPLATFORM_EXPORT char GetContrast(ElementHandleCR eh) const; // CHAR_OK
474 
478  DGNPLATFORM_EXPORT char GetBrightness(ElementHandleCR eh) const; // CHAR_OK
479 
483  DGNPLATFORM_EXPORT UInt8 GetImageTransparencyLevel(ElementHandleCR eh) const;
484 
489 
494  DGNPLATFORM_EXPORT UnitDefinitionCR GetGeotiffUnit(ElementHandleCR eh, UnitDefinitionR GeotiffUnit) const;
495 
499  DGNPLATFORM_EXPORT double GetGeotiffDefaultUnitFactor(ElementHandleCR eh) const;
500 
504  DGNPLATFORM_EXPORT bool GetGeotiffUnitUseUOR(ElementHandleCR eh) const;
505 
509  DGNPLATFORM_EXPORT GeotiffUnitPriority GetGeotiffUnitPriority(ElementHandleCR eh) const;
510 
516  DGNPLATFORM_EXPORT UnitDefinitionCR GetWorldFileUnit(ElementHandleCR eh, UnitDefinitionR WorldFileUnit) const;
517 
521  DGNPLATFORM_EXPORT double GetWorldFileDefaultUnitFactor(ElementHandleCR eh) const;
522 
526  DGNPLATFORM_EXPORT ElementHandle GetGeocoding(ElementHandleCR eh) const;
527 
531  DGNPLATFORM_EXPORT RasterClipPropertiesPtr GetClipProperties(ElementHandleCR eh) const;
532 
533 }; //IRasterAttachmentQuery
534 
535 /*=================================================================================**/
541 {
542 private:
543  virtual void MakeClassAbstract() = 0;
544 public:
545 public:
546 
555  DGNPLATFORM_EXPORT static BentleyStatus CreateRasterAttachment (EditElementHandleR eeh, ElementHandleCP templateEh, DgnDocumentMonikerCR moniker,
556  TransformCR matrix, DPoint2dCR extentInUOR, DgnModelRefR modelRef);
557 
562  DGNPLATFORM_EXPORT bool SetAttachMoniker (EditElementHandleR eeh, DgnDocumentMonikerCR moniker);
563 
565  DGNPLATFORM_EXPORT static bool SetAttachMoniker0 (EditElementHandleR eeh, DgnDocumentMonikerCR moniker);
566 
571  DGNPLATFORM_EXPORT bool SetAttachDescription(EditElementHandleR eeh,WCharCP description);
572 
577  DGNPLATFORM_EXPORT bool SetLogicalName(EditElementHandleR eeh,WCharCP logicalName);
578 
583  DGNPLATFORM_EXPORT bool SetSnappableState(EditElementHandleR eeh, bool state);
584 
589  DGNPLATFORM_EXPORT bool SetLockedState(EditElementHandleR eeh, bool state);
590 
595  DGNPLATFORM_EXPORT bool SetViewIndependentState(EditElementHandleR eeh, bool state);
596 
601  DGNPLATFORM_EXPORT bool SetOpenReadWrite(EditElementHandleR eeh, bool isWritable);
602 
607  DGNPLATFORM_EXPORT bool SetGeoreferencePriority(EditElementHandleR eeh, GeoreferencePriority priority);
608 
613  DGNPLATFORM_EXPORT bool SetGCSInheritedFromModelState(EditElementHandleR eeh, bool state);
614 
620  DGNPLATFORM_EXPORT bool SetTransform(EditElementHandleR eeh, TransformCR matrix);
621 
626  DGNPLATFORM_EXPORT bool SetPageNumber(EditElementHandleR eeh,UInt32 page);
627 
633  DGNPLATFORM_EXPORT bool SetColorMode(EditElementHandleR eeh,ImageColorMode colorMode);
634 
639  DGNPLATFORM_EXPORT bool SetScanningResolution(EditElementHandleR eeh,DPoint2dCR scanningResolutionDPI);
640 
646  DGNPLATFORM_EXPORT bool SetViewState(EditElementHandleR eeh,int viewNumber,bool state);
647 
652  DGNPLATFORM_EXPORT bool SetInvertState(EditElementHandleR eeh, bool state);
653 
658  DGNPLATFORM_EXPORT bool SetPrintState(EditElementHandleR eeh, bool state);
659 
664  DGNPLATFORM_EXPORT bool SetClipState(EditElementHandleR eeh, bool state);
665 
670  DGNPLATFORM_EXPORT bool SetTransparencyState(EditElementHandleR eeh, bool state);
671 
677  DGNPLATFORM_EXPORT bool SetBinaryPrintInvertState(EditElementHandleR eeh, bool state);
678 
683  DGNPLATFORM_EXPORT bool SetDisplayPriorityPlane(EditElementHandleR eeh, RasterDisplayPriorityPlane plane);
684 
693  DGNPLATFORM_EXPORT bool SetLayer(EditElementHandleR eeh, long layer);
694 
699  DGNPLATFORM_EXPORT bool SetViewGamma(EditElementHandleR eeh, double gamma);
700 
705  DGNPLATFORM_EXPORT bool SetPrintGamma(EditElementHandleR eeh, double gamma);
706 
713  DGNPLATFORM_EXPORT bool SetTintColor(EditElementHandleR eeh, UInt32 rawColorIndex);
714 
721  DGNPLATFORM_EXPORT bool SetForegroundColor(EditElementHandleR eeh, UInt32 rawColorIndex);
722 
729  DGNPLATFORM_EXPORT bool SetBackgroundColor(EditElementHandleR eeh, UInt32 rawColorIndex);
730 
735  DGNPLATFORM_EXPORT bool SetContrast(EditElementHandleR eeh, char contrast); // CHAR_OK
736 
741  DGNPLATFORM_EXPORT bool SetBrightness(EditElementHandleR eeh, char brightness); // CHAR_OK
742 
747  DGNPLATFORM_EXPORT bool SetImageTransparencyLevel(EditElementHandleR eeh,UInt8 transparency);
748 
753  DGNPLATFORM_EXPORT bool SetTransparentColors(EditElementHandleR eeh,RasterTransparentColorsCollectionCR rasterTransparentColors);
754 
759  DGNPLATFORM_EXPORT bool SetGeotiffUnit(EditElementHandleR eeh, UnitDefinitionCR GeotiffUnit);
760 
765  DGNPLATFORM_EXPORT bool SetGeotiffDefaultUnitFactor(EditElementHandleR eeh, double factor);
766 
771  DGNPLATFORM_EXPORT bool SetGeotiffUnitUseUOR(EditElementHandleR eeh,bool useUOR);
772 
777  DGNPLATFORM_EXPORT bool SetGeotiffUnitPriority(EditElementHandleR eeh,GeotiffUnitPriority priority);
778 
784  DGNPLATFORM_EXPORT bool SetWorldFileUnit(EditElementHandleR eeh, UnitDefinitionCR WorldFileUnit);
785 
790  DGNPLATFORM_EXPORT bool SetWorldFileDefaultUnitFactor(EditElementHandleR eeh, double factor);
791 
796  DGNPLATFORM_EXPORT bool SetGeocoding(EditElementHandleR eeh, ElementHandleCR geocoding);
797 
802  DGNPLATFORM_EXPORT bool SetClipProperties(EditElementHandleR eeh, RasterClipPropertiesCR clipProperties);
803 
804 }; //IRasterAttachmentEdit
805 
807 
809 
Priority to PCS defined units.
Definition: IRasterAttachment.h:60
TransparentColorType
Definition: IRasterAttachment.h:66
Provides methods for inspecting current clips set on a raster attachment.
Definition: IRasterAttachment.h:147
Priority is unknown to this version.
Definition: IRasterAttachment.h:62
struct DgnPlatform::DgnDocumentMoniker const & DgnDocumentMonikerCR
Definition: DgnPlatform.h:197
Raster is on back plane.
Definition: IRasterAttachment.h:45
GeotiffUnitPriority
Definition: IRasterAttachment.h:58
_RGBTransparentColorDef RasterRGBTransparentColorDef
Definition: IRasterAttachment.h:194
A readonly "handle" to an element.
Definition: ElementHandle.h:113
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
struct DPoint3d const * DPoint3dCP
Definition: msgeomstructs_typedefs.h:79
#define MAX_CONTTONE_TRANSPARENTCOLOR
Definition: rastref.h:32
Priority to PCS Linear Units.
Definition: IRasterAttachment.h:61
A writeable "handle" to an MSElement.
Definition: ElementHandle.h:470
RasterDisplayPriorityPlane
Definition: IRasterAttachment.h:43
size_type count(const key_type &__x) const
Definition: stdcxx/bstdmap.h:277
uint8_t UInt8
Definition: Bentley.r.h:116
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
wchar_t const * WCharCP
Definition: Bentley.h:224
uint32_t UInt32
Definition: Bentley.r.h:128
no geocoding element for this raster
Definition: IRasterAttachment.h:74
Raster is on design plane and use raster attachment element display priority.
Definition: IRasterAttachment.h:46
Use for indexed transparency setting.
Definition: IRasterAttachment.h:68
Provides a ref counted container that store a collection of clips set on a raster attachment...
Definition: IRasterAttachment.h:134
Provides methods for inspecting and editing the current raster attachment properties of an element...
Definition: IRasterAttachment.h:540
#define CLRPUBLIC
Definition: DgnPlatform/ExportMacros.h:12
BentleyStatus
Definition: Bentley.h:208
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
default value - Use value define by application preference
Definition: IRasterAttachment.h:52
Provides methods for inspecting the current raster attachment properties of an element.
Definition: IRasterAttachment.h:289
#define DGNPLATFORM_TYPEDEFS(_name_)
Definition: DgnPlatform.h:73
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
Raster reference element geoReference has priority.
Definition: IRasterAttachment.h:53
struct DgnPlatform::ElementHandle const * ElementHandleCP
Definition: DgnPlatform.h:260
struct DPoint2d const & DPoint2dCR
Definition: msgeomstructs_typedefs.h:78
DgnGCS element - see DgnGCS class.
Definition: IRasterAttachment.h:75
Provides methods for inspecting the transparent colors set on a raster attachment.
Definition: IRasterAttachment.h:190
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
Raster file georeference has priority if available.
Definition: IRasterAttachment.h:54
#define MAX_RGB_TRANSPARENTCOLOR
Definition: rastref.h:31
struct Transform const & TransformCR
Definition: msgeomstructs_typedefs.h:134
int StatusInt
Definition: Bentley.h:222
3x4 matrix for defining coordinate frames and affine transformations.
Definition: transform.h:22
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
_RasterTransparentColorDef RasterTransparentColorDef
Definition: IRasterAttachment.h:193
Raster is on front plane.
Definition: IRasterAttachment.h:47
ImageColorMode
Definition: DgnPlatform.r.h:1911
Provides methods for inspecting a raster clip.
Definition: IRasterAttachment.h:84
GeoreferencePriority
Definition: IRasterAttachment.h:50
struct DgnPlatform::ElementHandle const & ElementHandleCR
Definition: DgnPlatform.h:260
Sister file georeference has priority if available.
Definition: IRasterAttachment.h:55
Definition: DgnPlatform.r.h:339
bvector< RasterClipPtr > RasterClipVector
Definition: IRasterAttachment.h:128
Use for RGB color cube transparency setting.
Definition: IRasterAttachment.h:69
2d point coordinates.
Definition: dpoint2d.h:23
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
GeoCodingType
Definition: IRasterAttachment.h:72

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.