DgnPlatform/ViewGroup.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.h"
11 #include <Bentley/WString.h>
12 #include "ViewInfo.h"
13 #include <Bentley/bvector.h>
14 
16 
17 /*=================================================================================**/
45 
48 
50 
52 
54 
56 {
57  VG_Success = 0,
75 };
76 
78 
80 {
81  SourceType = -1,
82  MakeTransient = 0,
83  MakePermanent = 1,
84 };
85 
86 //=======================================================================================
106 //=======================================================================================
108 {
109 friend struct DgnFile;
110 friend struct ViewGroup;
111 friend struct DgnDbG05FileIO;
112 friend struct DgnDbG06FileIO;
113 friend struct IModel02FileIO;
114 
115 private:
116  virtual void MakeClassAbstract() = 0;
117 public:
118 public:
121 
124 
127 
132  DGNPLATFORM_EXPORT ViewGroupPtr FindByName (WCharCP name) const;
133 
137  DGNPLATFORM_EXPORT ViewGroupPtr FindByElementId (ElementId elementID) const;
138 
147  DGNPLATFORM_EXPORT ViewGroupPtr FindByModelId (ModelId modelID, bool allViewsMatch, int thisViewMatches) const;
148 
149 
150 
152  DGNPLATFORM_EXPORT ViewGroupStatus SaveChanges () const;
153 
156  DGNPLATFORM_EXPORT bool NameUnused (WCharCP name) const;
157 
159  DGNPLATFORM_EXPORT UInt32 Size () const;
160 
166 
171  DGNPLATFORM_EXPORT ViewGroupStatus Delete (ViewGroupP viewGroup);
172 
182  DGNPLATFORM_EXPORT ViewGroupPtr FindLastModifiedMatchingModel (ElementId preferredElementID, ModelId modelID, bool allViewsMatch, int thisViewMatches) const;
183 
187  DGNPLATFORM_EXPORT ViewGroupCP GetActiveCP () const;
188 
192  DGNPLATFORM_EXPORT ViewGroupP GetActiveP () const;
193 
201  DGNPLATFORM_EXPORT ViewGroupStatus MakeActive (ViewGroupP newActive, bool deferInitialUpdate);
202 
207  DGNPLATFORM_EXPORT ViewInfoCP GetActiveViewInfoCP (UInt32 viewNumber) const;
208 
213  DGNPLATFORM_EXPORT ViewInfoP GetActiveViewInfoP (UInt32 viewNumber) const;
214 
219  DGNPLATFORM_EXPORT ViewPortInfoP GetActiveViewPortInfoP (UInt32 viewNumber) const;
220 
225  DGNPLATFORM_EXPORT ViewPortInfoCP GetActiveViewPortInfoCP (UInt32 viewNumber) const;
226 
228  DGNPLATFORM_EXPORT DgnFileP GetDgnFileP () const;
229 
236  DGNPLATFORM_EXPORT ViewGroupStatus GetUniqueNameFromBase (WStringR uniqueName, WCharCP baseName, DgnModelP model, bool transient) const;
237 
238 
239 };
240 
241 //=======================================================================================
247 //=======================================================================================
249 {
250 private:
251  virtual void MakeClassAbstract() = 0;
252 public:
253 public:
261  DGNPLATFORM_EXPORT static ViewGroupCopyOptionsPtr CreateOptions();
262 
265 
266  DGNPLATFORM_EXPORT void SetCopyType (ViewGroupCopyTypeOption);
267  DGNPLATFORM_EXPORT void SetCopyViewClip ();
268  DGNPLATFORM_EXPORT void SetCopyViewLevels ();
269  DGNPLATFORM_EXPORT void SetCopyViewACS ();
270  DGNPLATFORM_EXPORT void SetDoNotAddToCollection ();
271  DGNPLATFORM_EXPORT void SetNewName (WCharCP);
272  DGNPLATFORM_EXPORT void SetNewDescription (WCharCP);
273 
274 
275 };
276 
277 //=======================================================================================
293 //=======================================================================================
295 {
296 private:
297  virtual void MakeClassAbstract() = 0;
298 public:
299 
300 public:
302  DGNPLATFORM_EXPORT WStringCR GetName () const;
303 
305  DGNPLATFORM_EXPORT WStringCR GetDescription () const;
306 
309  DGNPLATFORM_EXPORT UInt32 GetUIDisplayOrder () const;
310 
312  DGNPLATFORM_EXPORT ElementId GetElementId () const;
313 
315  DGNPLATFORM_EXPORT ElementRefP GetElementRef () const;
316 
318  DGNPLATFORM_EXPORT DgnFileP GetDgnFileP () const;
319 
324 
327  DGNPLATFORM_EXPORT void SetDescription (WCharCP description);
328 
331  DGNPLATFORM_EXPORT void SetUIDisplayOrder (UInt32 value);
332 
334  DGNPLATFORM_EXPORT bool IsTransient () const;
335 
338  DGNPLATFORM_EXPORT void SetTransient (bool transient);
339 
342  DGNPLATFORM_EXPORT ViewInfoR GetViewInfoR (UInt32 viewNumber);
343 
346  DGNPLATFORM_EXPORT ViewInfoCR GetViewInfo (UInt32 viewNumber) const;
347 
350  DGNPLATFORM_EXPORT ViewPortInfoR GetViewPortInfoR (UInt32 viewNumber);
351 
354  DGNPLATFORM_EXPORT ViewPortInfoCR GetViewPortInfo (UInt32 viewNumber) const;
355 
360  DGNPLATFORM_EXPORT void SetViewInfo (ViewInfoR viewInfo, UInt32 viewNumber);
361 
365  DGNPLATFORM_EXPORT void SetViewPortInfo (ViewPortInfoR viewPortInfo, UInt32 viewNumber);
366 
372  DGNPLATFORM_EXPORT bool MatchesModel (ModelId modelID, bool allViewsMatch, int thisViewMatches);
373 
379  DGNPLATFORM_EXPORT void SynchViewDisplay (UInt32 viewNumber, bool levelsChanged, bool undoable, bool synchViewTitle) const;
380 
381 
385  DGNPLATFORM_EXPORT void EnsureLevelMaskCoverage (DgnModelRefP modelRef, bool fromExchange);
386 
390  DGNPLATFORM_EXPORT void ResetEffectiveLevelMasks ();
391 
397  DGNPLATFORM_EXPORT void ResetEffectiveLevelMasksForModel (DgnModelRefP modelRef, bool includeChildModelRefs);
398 
403  DGNPLATFORM_EXPORT void ResetEffectiveLevelMasksForChildren (DgnModelRefP modelRef);
404 
405 
408  DGNPLATFORM_EXPORT ViewGroupStatus SaveChanges () const;
409 
410 
413  DGNPLATFORM_EXPORT ViewGroupStatus WriteImmediatelyToFile () const;
414 
416  DGNPLATFORM_EXPORT DgnModelP GetFirstRootModelP () const;
417 
421  DGNPLATFORM_EXPORT void GetZOrder (byte* zOrder, size_t numEntries) const;
422 
426  DGNPLATFORM_EXPORT void SetZOrder (byte* zOrder, size_t numEntries);
427 
428 
431  DGNPLATFORM_EXPORT bool AllViewsOneModel (ModelId& onlyModel) const;
432 
434  DGNPLATFORM_EXPORT LevelId GetActiveLevel () const;
435 
438  DGNPLATFORM_EXPORT void SetActiveLevel (LevelId activeLevel);
439 
441  DGNPLATFORM_EXPORT UInt32 GetActiveColor () const;
442 
445  DGNPLATFORM_EXPORT void SetActiveColor (UInt32 activeColor);
446 
448  DGNPLATFORM_EXPORT UInt32 GetActiveWeight () const;
451  DGNPLATFORM_EXPORT void SetActiveWeight (UInt32 activeWeight);
452 
454  DGNPLATFORM_EXPORT Int32 GetActiveStyle () const;
455 
458  DGNPLATFORM_EXPORT void SetActiveStyle (Int32 activeStyle);
459 
463  DGNPLATFORM_EXPORT ViewGroupStatus From (ViewGroupCR source, ViewGroupCopyOptions const& copyOptions);
464 
473  DGNPLATFORM_EXPORT static ViewGroupStatus Create (ViewGroupPtr& createdViewGroup, DgnModelR rootModel, bool transient, WCharCP name, bool addToCollection);
474 
484  DGNPLATFORM_EXPORT static ViewGroupStatus Create (ViewGroupPtr& createdViewGroup, ModelId rootModelId, DgnFileR dgnFile, bool transient, WCharCP name, bool addToCollection);
485 
496  DGNPLATFORM_EXPORT static ViewGroupStatus Copy (ViewGroupPtr& copiedViewGroup, DgnModelR rootModel, DgnModelRefR sourceModel, ViewGroupCopyOptions const& copyOptions);
497 
504  DGNPLATFORM_EXPORT static ViewGroupStatus Copy (ViewGroupPtr& copiedViewGroup, DgnModelR rootModel, ViewGroupCR source, ViewGroupCopyOptions const& copyOptions);
505 
510  DGNPLATFORM_EXPORT static ViewGroupStatus FindActiveViewGroup (ViewGroupPtr& activeViewGroup, DgnFileR dgnFile);
511 
515  DGNPLATFORM_EXPORT ViewGroupStatus FindFirstOpenView (int& viewNumber);
516 
517 };
520 
An error occurred when trying to create the data structure that persists the ViewGroup.
Definition: DgnPlatform/ViewGroup.h:64
The ViewGroup is not yet associated with a DgnFile.
Definition: DgnPlatform/ViewGroup.h:62
An element was added to the file.
SourceType
Type of Sources.
Definition: Provenance.h:60
The ViewGroup's persistent representation cannot be deleted from the DgnFile. Perhaps the file is rea...
Definition: DgnPlatform/ViewGroup.h:67
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
bvector< ViewGroupPtr >::const_iterator const_iterator
Definition: DgnPlatform/ViewGroup.h:119
The viewport is resized to match the exact size specifed in viewPortInfo.
The name specified is too short.
Definition: DgnPlatform/ViewGroup.h:58
UInt32 LevelId
Definition: DgnPlatformBaseType.r.h:85
struct Bentley::WString const & WStringCR
Definition: Bentley.h:239
iterator begin()
Definition: stdcxx/bstdmap.h:178
Attempt to add a ViewGroup to a ViewGroupCollection from a different DgnFile failed.
Definition: DgnPlatform/ViewGroup.h:63
struct DgnPlatform::ViewGroup const * ViewGroupCP
Definition: DgnPlatform.h:473
iterator end()
Definition: stdcxx/bstdmap.h:186
struct DgnPlatform::ViewGroup const & ViewGroupCR
Definition: DgnPlatform.h:473
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
Definition: DgnPlatformErrors.r.h:45
A DgnFile is an in-memory representation of a physical file, regardless of its format.
Definition: DgnFile.h:308
wchar_t const * WCharCP
Definition: Bentley.h:224
The name specified is not unique with the DgnFile.
Definition: DgnPlatform/ViewGroup.h:60
uint32_t UInt32
Definition: Bentley.r.h:128
The name specified is too long.
Definition: DgnPlatform/ViewGroup.h:59
BC__RW::__rw_debug_iter< bvector, const_pointer, pointer > const_iterator
Definition: stdcxx/bvector.h:115
The copied ViewGroup should be marked as permanent.
struct DgnPlatform::ViewPortInfo const * ViewPortInfoCP
Definition: DgnPlatform.h:479
struct DgnPlatform::ViewInfo const & ViewInfoCR
Definition: DgnPlatform.h:478
The name contains an illegal character.
Definition: DgnPlatform/ViewGroup.h:61
ViewGroupStatus
Possible status values returned from ViewGroup and ViewGroupCollection methods.
Definition: DgnPlatform/ViewGroup.h:55
Cannot delete the active ViewGroup because there is no other ViewGroup eligible to be activated...
Definition: DgnPlatform/ViewGroup.h:70
An error occurred when trying to write the persistent data to the DgnFile. Perhaps the file is readon...
Definition: DgnPlatform/ViewGroup.h:65
A DgnModel represents a DgnModel in memory.
Definition: DgnModel.h:236
The viewgroup does not contain an open view.
Definition: DgnPlatform/ViewGroup.h:74
Each DgnFile has one associated ViewGroupCollection.
Definition: DgnPlatform/ViewGroup.h:107
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
int32_t Int32
Definition: Bentley.r.h:119
An argument to the method was invalid.
Definition: DgnPlatform/ViewGroup.h:72
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
The method succeeded.
Definition: DgnPlatform/ViewGroup.h:57
Base class to make a class non-copyable.
Definition: NonCopyableClass.h:23
The host rejected the request to activate the ViewGroup.
Definition: DgnPlatform/ViewGroup.h:69
struct DgnPlatform::ViewPortInfo const & ViewPortInfoCR
Definition: DgnPlatform.h:479
Interface that provides direct and efficient access to element data.
Definition: ElementRefBase.h:120
unsigned char byte
Definition: Bentley.r.h:144
Int32 ModelId
Definition: DgnPlatformBaseType.r.h:84
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
The ViewPortInfo class holds information about the positioning of a window that displays a view on th...
Definition: ViewInfo.h:496
ViewGroups contain information about the contents, positioning, and ordering of a user-specified coll...
Definition: DgnPlatform/ViewGroup.h:294
Cannot set the ElementId because the view group is already persistent.
Definition: DgnPlatform/ViewGroup.h:71
The file does not contain a viewgroup.
Definition: DgnPlatform/ViewGroup.h:73
The copied ViewGroup should be marked transient.
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
UInt64 ElementId
Definition: DgnPlatformBaseType.r.h:83
The ViewGroupCopyOptions class holds information about how a caller to ViewGroup::From and ViewGroup:...
Definition: DgnPlatform/ViewGroup.h:248
ViewGroups marked as transient cannot be saved to the DgnFile.
Definition: DgnPlatform/ViewGroup.h:66
const_iterator iterator
only const iteration is possible
Definition: DgnPlatform/ViewGroup.h:120
struct DgnPlatform::ViewGroupCopyOptions const & ViewGroupCopyOptionsCR
Definition: DgnPlatform.h:475
RefCountedPtr< ViewGroupCopyOptions > ViewGroupCopyOptionsPtr
A reference counted pointer to a ViewGroupCopyOptions.
Definition: DgnPlatform/ViewGroup.h:51
ViewGroupCopyTypeOption
Options for Copying ViewGroups.
Definition: DgnPlatform/ViewGroup.h:79
RefCountedPtr< ViewGroup > ViewGroupPtr
A reference counted pointer to a ViewGroup.
Definition: DgnPlatform/ViewGroup.h:47
This is what the parameters to the camera methods, and the values stored by ViewInfo mean...
Definition: ViewInfo.h:213
struct DgnPlatform::ViewInfo const * ViewInfoCP
Definition: DgnPlatform.h:478
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
A ViewGroup was specified that is not in the ViewGroupCollection.
Definition: DgnPlatform/ViewGroup.h:68

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