IconElementHandler.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 
11 
12 #define XATTRIBUTEID_IconElementHandlerXAttrId 22878
13 
14 
15 DGNPLATFORM_TYPEDEFS (IconData);
16 DGNPLATFORM_TYPEDEFS (IconGeometry);
17 
18 
20 
21 enum class IconSource
22  {
23  IcoFile = 1,
24  ResourceFile = 2,
25  DllFile = 3,
26  };
27 
28 
31 
32 
35 
36 /*=================================================================================**/
41 struct IconData : public RefCountedBase
42 {
43 public:
44 
45 DGNPLATFORM_EXPORT static IconDataPtr CreateFromIcoFile (WCharCP fileName);
46 DGNPLATFORM_EXPORT static IconDataPtr CreateFromResource (RscFileHandle handle, WCharCP alias);
47 DGNPLATFORM_EXPORT static IconDataPtr CreateFromData (const byte* data, size_t dataSize);
48 DGNPLATFORM_EXPORT void Serialize (DataExternalizer& externalizer) const;
49 DGNPLATFORM_EXPORT double GetAspectRatio () const;
50 
51 };
52 
53 struct IconElementHandler;
54 
55 /*=================================================================================**/
63 /*=================================================================================**/
68 {
69 bool m_drawBoundary; // whether user wants boundary or not
70 bool m_reserved[7]; // alignment, reserved for later use.
71 DPoint3d m_origin; // origin, in UORS.
72 DPoint3d m_vectorX; // vectorX and vectorY are vectors in the x and y direction of the icon.
73 DPoint3d m_vectorY; // They establish both the scale and the rotation matrix.
74 double m_reserved1[4]; // More future stuff.
75 
76 // get the boundary points in UORs.
77 DGNPLATFORM_EXPORT IconGeometry (bool drawBoundary, DPoint3dCR origin, DPoint3dCR vectorX, DPoint3dCR vectorY);
78 void GetBoundaryPoints (double& extentX, DPoint3d points[5], double zValue) const;
79 };
80 
81 /*=================================================================================**/
86 {
89 
90 public:
91 
93 static DGNPLATFORM_EXPORT BentleyStatus CreateElement (EditElementHandleR eeh, ElementHandleP templateEh, IconDataCR iconData, IconGeometryR geometry, DgnModelR model);
94 
95 }; // IconElementHandler
96 
98 
100 
IconSource
Definition: IconElementHandler.h:21
bool m_drawBoundary
Definition: IconElementHandler.h:69
A readonly "handle" to an element.
Definition: ElementHandle.h:113
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
UInt32 RscFileHandle
Definition: DgnPlatform/LineStyle.h:12
#define ELEMENTHANDLER_DECLARE_MEMBERS(__classname__, __exporter__)
Definition: Handler.h:86
A writeable "handle" to an MSElement.
Definition: ElementHandle.h:470
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
wchar_t const * WCharCP
Definition: Bentley.h:224
A DgnModel represents a DgnModel in memory.
Definition: DgnModel.h:236
3d point coordinates.
Definition: dpoint3d.h:19
BentleyStatus
Definition: Bentley.h:208
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
unsigned char byte
Definition: Bentley.r.h:144
The default type handler for the EXTENDED_ELM type that corresponds to the ExtendedElm structure...
Definition: ExtendedElementHandler.h:25
#define DEFINE_T_SUPER(B)
Definition: Bentley.h:167
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
DPoint3d m_vectorY
Definition: IconElementHandler.h:73
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
DGNPLATFORM_TYPEDEFS(IconData)
Represents the multi-resolution contents of an ico file in memory.
Definition: IconElementHandler.h:41
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
Definition: IconElementHandler.h:67
RefCountedPtr< struct IconData > IconDataPtr
A reference counted pointer to an IconData instance.
Definition: IconElementHandler.h:34
DPoint3d m_origin
Definition: IconElementHandler.h:71
DPoint3d m_vectorX
Definition: IconElementHandler.h:72
Definition: IconElementHandler.h:85

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