DisplayFilterManager.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 #define HandlerId_DisplayFilter 22809
12 
13 /*=================================================================================**/
19  {
21  DisplayFilterHandlerMinorId_ViewXFlag = 1, // Uses base handler - but reserve this minorId for use as XAttributeId...
22  DisplayFilterHandlerMinorId_ViewXInteger = 2, // Uses base handler - but reserve this minorId for use as XAttributeId...
23 
24  }; // DisplayFilterHandler_SubTypes
25 
27  {
41 
43  };
44 
45 
46 //=======================================================================================
49 //=======================================================================================
51  {
54  DisplayFilterHandlerId () : HandlerId(INVALID_ID, 0) { };
56  };
57 
58 
59 /*=================================================================================**/
64  {
65 protected:
66  virtual bool _DoConditionalDraw (ViewContextR viewContext, ElementHandleCP element, void const* data, size_t dataSize) const = 0;
67  virtual StatusInt _OnTransform (TransformInfoCR transform, void* pData, size_t dataSize) const { return SUCCESS; }
68  virtual bool _IsEqual (void const* data, void const* rhsData, size_t dataSize, double distanceTolerance) const {return 0 == memcmp (data, rhsData, dataSize);}
69  virtual WString _GetDumpString (void const* data, size_t dataSize, DgnModelP) const { return WString ("DisplayFilterHandler"); }
70 
71  virtual void _DoClone (void* data, size_t dataSize, ElementCopyContextR context) const { BeAssert(false && "this function is deprecated"); }
72  virtual void _ProcessProperties(void* data, size_t dataSize, PropertyContextR context) const { }
73 
74 public:
75  DGNPLATFORM_EXPORT bool DoConditionalDraw (ViewContextR viewContext, ElementHandleCP element, void const* data, size_t dataSize) const;
76  DGNPLATFORM_EXPORT StatusInt OnTransform (TransformInfoCR transform, void* pData, size_t dataSize) const;
77  DGNPLATFORM_EXPORT bool IsEqual (void const* data, void const* rhsData, size_t dataSize, double distanceTolerance);
78  DGNPLATFORM_EXPORT WString GetDumpString (void const* data, size_t dataSize, DgnModelP dgnModel) const;
79  DGNPLATFORM_EXPORT void ProcessProperties(void* data, size_t dataSize, PropertyContextR context) const;
80 
81  }; // DisplayFilterHandler
82 
83 typedef bmap <DisplayFilterHandlerId, DisplayFilterHandlerP> T_DisplayFilterHandlerMap;
84 typedef bmap <DisplayFilterOpCode, DisplayFilterHandlerP> T_DisplayFilterOperatorHandlerMap;
85 
86 /*=================================================================================**/
93  {
94 private:
95  T_DisplayFilterHandlerMap m_handlerMap;
96  T_DisplayFilterOperatorHandlerMap m_operatorHandlerMap;
97 
98 public:
99 
100  /*---------------------------------------------------------------------------------**/
105 
106  /*---------------------------------------------------------------------------------**/
110  DGNPLATFORM_EXPORT void RegisterHandler (DisplayFilterHandlerId id, DisplayFilterHandlerR handler);
112 
113 
114  DGNPLATFORM_EXPORT void RegisterOperatorHandler (DisplayFilterOpCode opCode, DisplayFilterHandlerR handler);
116 
117 
118  }; // DisplayFilterHandlerManager
119 
120 
121 /*=================================================================================**/
126  {
127 private:
128  typedef bvector<struct DisplayFilterState*> T_States;
129 
130  T_States m_states;
131 
132 public:
135  DGNPLATFORM_EXPORT bool Matches (ViewContextR viewContext, ElementHandleCP element) const;
136  DGNPLATFORM_EXPORT void PushState (DisplayFilterHandlerId filterId, void const* data, size_t dataSize, bool state);
137  bool IsEmpty() { return m_states.empty(); }
138  bool Clear () { m_states.clear(); }
139  bool operator < (DisplayFilterKey const& rhs);
140 
141  }; // DisplayFilterKey
142 
143 
145 
static DGNPLATFORM_EXPORT DisplayFilterKeyPtr Create()
Definition: DisplayFilterManager.h:133
DisplayFilterHandler_MinorId
Definition: DisplayFilterManager.h:18
Definition: ViewContext.h:358
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
DisplayFilterHandlerId()
Constructor for DisplayFilterHandlerId.
Definition: DisplayFilterManager.h:54
Class for enumerating the common properties of elements such as color and level and changing those pr...
Definition: PropertyContext.h:597
Definition: DisplayFilterManager.h:36
uint16_t UInt16
Definition: Bentley.r.h:118
Definition: DisplayFilterManager.h:20
bool Clear()
Definition: DisplayFilterManager.h:138
Definition: DisplayFilterManager.h:33
Definition: DisplayFilterManager.h:35
virtual WString _GetDumpString(void const *data, size_t dataSize, DgnModelP) const
Definition: DisplayFilterManager.h:69
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
bool operator<(const basic_string< _CharT, _Traits, _Allocator > &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
Definition: basic_string.h:1326
bool IsEmpty()
Definition: DisplayFilterManager.h:137
struct DgnPlatform::TransformInfo const & TransformInfoCR
Definition: DgnPlatform.h:464
Definition: DisplayFilterManager.h:28
A DgnModel represents a DgnModel in memory.
Definition: DgnModel.h:236
Definition: DisplayFilterManager.h:32
virtual bool _IsEqual(void const *data, void const *rhsData, size_t dataSize, double distanceTolerance) const
Definition: DisplayFilterManager.h:68
virtual StatusInt _OnTransform(TransformInfoCR transform, void *pData, size_t dataSize) const
Definition: DisplayFilterManager.h:67
Definition: DisplayFilterManager.h:29
bmap< DisplayFilterOpCode, DisplayFilterHandlerP > T_DisplayFilterOperatorHandlerMap
Definition: DisplayFilterManager.h:84
IManager * GetManager()
Return a pointer to the one and only relationship manager.
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
struct DgnPlatform::ElementHandle const * ElementHandleCP
Definition: DgnPlatform.h:260
Definition: DisplayFilterManager.h:125
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
Definition: DisplayFilterManager.h:63
Use the ElementCopyContext class to copy elements.
Definition: ElementCopyContext.h:241
Definition: DisplayFilterManager.h:42
int StatusInt
Definition: Bentley.h:222
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
A two-part ID used by DisplayFilter Handlers.
Definition: DisplayFilterManager.h:50
Definition: DisplayFilterManager.h:92
Definition: Bentley.h:210
Definition: DisplayFilterManager.h:31
Definition: DisplayFilterManager.h:37
#define BeAssert(_Expression)
BeAssert performs the same function as the standard assert, plus it prevents the most common cases of...
Definition: BeAssert.h:56
bmap< DisplayFilterHandlerId, DisplayFilterHandlerP > T_DisplayFilterHandlerMap
Definition: DisplayFilterManager.h:83
virtual void _ProcessProperties(void *data, size_t dataSize, PropertyContextR context) const
Definition: DisplayFilterManager.h:72
Definition: DisplayFilterManager.h:34
virtual void _DoClone(void *data, size_t dataSize, ElementCopyContextR context) const
Definition: DisplayFilterManager.h:71
DisplayFilterOpCode
Definition: DisplayFilterManager.h:26
DisplayFilterHandlerId(DisplayFilterHandler_MinorId minorId)
Definition: DisplayFilterManager.h:55
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
Definition: DisplayFilterManager.h:30
A two-part identifier, consisting of a major ID and a minor ID.
Definition: DgnCore.h:21
#define HandlerId_DisplayFilter
Definition: DisplayFilterManager.h:11

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