IRedraw.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 
13 /*=================================================================================**/
18  {
20  virtual void _OnRedrawInit (ViewContextR) = 0;
21 
25  virtual StatusInt _OnRedrawOperation (EditElementHandleR, ViewContextR, bool* canUseCached) = 0;
26 
28  virtual void _OnResymbolize (ViewContextR) = 0;
29 
31  virtual void _OnRedrawFinish (ViewContextR) = 0;
32 
34  virtual StatusInt _OnRedrawComplete (ViewContextR) = 0;
35  };
36 
37 /*=================================================================================**/
42  {
43  virtual bool _WasAborted () const = 0;
44  virtual bool _CheckRedrawAbort (ViewContextR) = 0;
45  };
46 
47 /*=================================================================================**/
58  {
59 private:
60  bool m_ignoreHilite;
61  bool m_otherAttachments;
62  int m_numViewports;
63  ViewportP m_viewports [MAX_VIEWS];
64  DgnDrawMode m_drawMode;
65  DrawPurpose m_purpose;
66  IRedrawOperation* m_redrawOp;
67  ClipVectorCP m_clip;
68  TransformCP m_trans;
69  IRedrawAbort* m_abort;
70  int m_resrved[8];
71 
72 public:
75  {
76  m_otherAttachments = false;
77  m_ignoreHilite = false;
78  m_numViewports = 0;
79  m_drawMode = DRAW_MODE_Normal;
80  m_purpose = DrawPurpose::NotSpecified;
81  m_redrawOp = NULL;
82  m_clip = NULL;
83  m_trans = NULL;
84  m_abort = NULL;
85  memset (&m_resrved, 0, sizeof (m_resrved));
86  }
87 
89  RedrawElems (ViewportP vp, DgnDrawMode drawMode, DrawPurpose purpose,
90  bool otherAttachments = false,
92  IRedrawAbort* abort=NULL)
93  {
94  SetViewport (vp);
95  m_otherAttachments = otherAttachments;
96  m_ignoreHilite = false;
97  m_drawMode = drawMode;
98  m_purpose = purpose;
99  m_redrawOp = op;
100  m_clip = clip;
101  m_trans = trans;
102  m_abort = abort;
103  memset (&m_resrved, 0, sizeof (m_resrved));
104  }
105 
109  void SetSearchDgnAttachments (bool other) { m_otherAttachments = other; }
110 
111 #pragma warning (disable:4459)
112  void SetIgnoreHilite (bool ignore) { m_ignoreHilite = ignore; }
113 #pragma warning (default:4459)
114  void SetDrawMode (DgnDrawMode mode) { m_drawMode = mode; }
115  void SetDrawPurpose (DrawPurpose purpose) { m_purpose = purpose; }
116  void SetRedrawOp (IRedrawOperation* op) { m_redrawOp = op; }
117  void SetClipVector (ClipVectorCP clip) { m_clip = clip; }
118  void SetTransform (TransformCP trans) { m_trans = trans; }
119  void SetAbort (IRedrawAbort* abort) { m_abort = abort; }
120 
121  DGNVIEW_EXPORT void SetViewport (ViewportP);
122  DGNVIEW_EXPORT void SetOneView (IndexedViewSetR, int view);
123  DGNVIEW_EXPORT void SetViews (IndexedViewSetR, int viewMask);
124  DGNVIEW_EXPORT void SetDynamicsViews (IndexedViewSetR, ViewportP cursorView);
125  DGNVIEW_EXPORT void AddViewport (ViewportP);
126 
127  DGNVIEW_EXPORT void DoRedraw (IElementSetP);
128  DGNVIEW_EXPORT void DoRedraw (ElementHandleR);
129  DGNVIEW_EXPORT void DoRedraw (ElementRefP, DgnModelRefP = NULL);
130  DGNVIEW_EXPORT void DoRedraw (MSElementDescrCP, DgnModelRefP = NULL);
131  DGNVIEW_EXPORT void DoRedraw (IViewTransientsR, bool isPreUpdate);
132  };
133 
RedrawElems()
Create a RedrawElems instance with default values.
Definition: IRedraw.h:74
Definition: IViewManager.h:193
A readonly "handle" to an element.
Definition: ElementHandle.h:113
Definition: ViewContext.h:358
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
void SetAbort(IRedrawAbort *abort)
Supply an optional class to handle CheckStop/abort processing.
Definition: IRedraw.h:119
Definition: IRedraw.h:41
struct DgnPlatform::ClipVector const * ClipVectorCP
Definition: DgnPlatform.h:178
DrawPurpose
Definition: DgnPlatform.h:1548
A writeable "handle" to an MSElement.
Definition: ElementHandle.h:470
#define NULL
Definition: Bentley.h:157
Definition: IViewTransients.h:15
void SetSearchDgnAttachments(bool other)
When drawing an element, or list of elements to a Viewport, sometimes it is desirable to also search ...
Definition: IRedraw.h:109
struct DgnPlatform::MSElementDescr const * MSElementDescrCP
Definition: DgnPlatform.h:390
This interface provides a transparent way to provide access to a collection of ElemHandles.
Definition: ElementHandle.h:726
void SetDrawPurpose(DrawPurpose purpose)
Set DrawPurpose appropriate to display reason.
Definition: IRedraw.h:115
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
struct Transform const * TransformCP
Definition: msgeomstructs_typedefs.h:134
Class for displaying temporary graphics such as in a DgnTool's _OnDynamicFrame method.
Definition: IRedraw.h:57
void SetDrawMode(DgnDrawMode mode)
Set DgnDrawMode to use for display. Use DRAW_MODE_TempDraw for dynamics.
Definition: IRedraw.h:114
void SetIgnoreHilite(bool ignore)
Set to ignore locate/selection set hilite symbology when drawing a persistent element.
Definition: IRedraw.h:112
Definition: DgnPlatform.h:1538
Interface that provides direct and efficient access to element data.
Definition: ElementRefBase.h:120
Definition: DgnPlatform.h:794
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
int StatusInt
Definition: Bentley.h:222
void SetClipVector(ClipVectorCP clip)
Supply an optional ClipVector to push before displaying elements.
Definition: IRedraw.h:117
DgnDrawMode
Draw modes for displaying information in viewports.
Definition: DgnPlatform.h:1536
void SetTransform(TransformCP trans)
Supply an optional transform to push before displaying elements.
Definition: IRedraw.h:118
void SetRedrawOp(IRedrawOperation *op)
Supply an optional class for element resymbolization and subsitution events.
Definition: IRedraw.h:116
RedrawElems(ViewportP vp, DgnDrawMode drawMode, DrawPurpose purpose, bool otherAttachments=false, IRedrawOperation *op=NULL, ClipVectorCP clip=NULL, TransformCP trans=NULL, IRedrawAbort *abort=NULL)
Create a RedrawElems instance to draw to the supplied viewport with the specified options...
Definition: IRedraw.h:89
Definition: DgnViewport.h:186

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