DgnModelRefCollections.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 
12 #include "BentleyDgn.h"
13 
15 
16 
17 //=======================================================================================
21 //===============+===============+===============+===============+===============+=======
23 {
24 public:
26  DGNPLATFORM_EXPORT static ReachableModelRefOptionsPtr CreateOptions();
27 
30 
32  DGNPLATFORM_EXPORT void ExcludeRootModelRef();
33 
35  DGNPLATFORM_EXPORT void ExcludeInterFileRefs();
36 
38  DGNPLATFORM_EXPORT void ExcludeIntraFileRefs();
39 
41  DGNPLATFORM_EXPORT void ExcludeEmbeddedFileRefs();
42 
44  DGNPLATFORM_EXPORT void ExcludeNonEmbeddedFileRefs();
45 
47  DGNPLATFORM_EXPORT void ExcludeNestedAttachments();
48 
50  DGNPLATFORM_EXPORT void ExcludeRedundantAttachments();
51 
53  DGNPLATFORM_EXPORT void ExcludeUndisplayedAttachments();
54 };
55 
56 //=======================================================================================
60 //===============+===============+===============+===============+===============+=======
61 struct ReachableModelRefIterator : RefCountedBase, std::iterator<std::forward_iterator_tag, DgnModelRefP const>
62 {
63 private:
64  virtual void MakeClassAbstract() = 0;
65 public:
66 public:
67  DGNPLATFORM_EXPORT bool IsDifferent(ReachableModelRefIterator const& rhs) const;
68  DGNPLATFORM_EXPORT void MoveToNext ();
69  DGNPLATFORM_EXPORT DgnModelRefP const& GetCurrent () const;
70 };
71 
72 //=======================================================================================
78 //===============+===============+===============+===============+===============+=======
80 {
81 private:
82  friend struct DgnModelRef;
84  DgnModelRefR m_modelRef;
86  bvector<DgnModelRefP> m_modelRefArray;
87 
88  bool IsModelRefExcluded (bool& excludeChildren, DgnModelRefR modelRef, bool isRoot);
89  void BuildDgnModelRefArray (DgnModelRefR modelRef, bool isRoot);
90 
91 public:
93 
94 public:
97 
98 public:
99  DGNPLATFORM_EXPORT bool empty() const;
102 };
103 
104 //=======================================================================================
108 //===============+===============+===============+===============+===============+=======
110 {
111 public:
112  DGNPLATFORM_EXPORT static ReachableElementOptionsPtr CreateOptions();
114 
116  DGNPLATFORM_EXPORT void ExcludeControlSection();
117 
119  DGNPLATFORM_EXPORT void ExcludeGraphicsSection();
120 
122  DGNPLATFORM_EXPORT ReachableModelRefOptionsR GetModelRefOptions();
123 };
124 
125 //=======================================================================================
129 //===============+===============+===============+===============+===============+=======
130 struct ReachableElementIterator : RefCountedBase, std::iterator<std::forward_iterator_tag, ElementHandle const>
131 {
132 private:
133  virtual void MakeClassAbstract() = 0;
134 public:
135 public:
136  DGNPLATFORM_EXPORT bool IsDifferent(ReachableElementIterator const& rhs) const;
137  DGNPLATFORM_EXPORT void MoveToNext ();
138  DGNPLATFORM_EXPORT ElementHandleCR GetCurrent () const;
139  DGNPLATFORM_EXPORT bool IsAtEnd () const;
140 };
141 
142 //=======================================================================================
148 //===============+===============+===============+===============+===============+=======
150 {
151 private:
152  friend struct DgnModelRef;
153 
154  ReachableModelRefCollection m_modelRefs;
155  ReachableElementOptionsPtr m_options;
156 
158 
159 public:
162 
165 
166 };
167 
169 
bool empty() const
Definition: stdcxx/bstdmap.h:210
struct DgnPlatform::ReachableModelRefOptions const & ReachableModelRefOptionsCR
Definition: DgnModelRef.h:14
Iterator to be used with ReachableModelRefCollection.
Definition: DgnModelRefCollections.h:61
VirtualCollectionIterator< ReachableModelRefIterator > const_iterator
Definition: DgnModelRefCollections.h:95
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
iterator begin()
Definition: stdcxx/bstdmap.h:178
iterator end()
Definition: stdcxx/bstdmap.h:186
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
A collection that allows code to iterate through the set of persistent elements in a model and all th...
Definition: DgnModelRefCollections.h:149
A collection that allows code to iterate through the set of ModelRefs attached to a supplied root mod...
Definition: DgnModelRefCollections.h:79
const_iterator iterator
only const iteration is possible
Definition: DgnModelRefCollections.h:161
Holds a set of options used to specify a set of ModelRefs to be iterated.
Definition: DgnModelRefCollections.h:22
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
struct DgnPlatform::ReachableElementOptions const & ReachableElementOptionsCR
Definition: DgnModelRef.h:15
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
This template is used by iterators that hide their implementation from the published API...
Definition: VirtualCollectionIterator.h:33
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
Iterator to be used with ReachableElementCollection.
Definition: DgnModelRefCollections.h:130
VirtualCollectionIterator< ReachableElementIterator > const_iterator
Definition: DgnModelRefCollections.h:160
struct DgnPlatform::ElementHandle const & ElementHandleCR
Definition: DgnPlatform.h:260
Holds a set of options used to specify a set of elements to be iterated.
Definition: DgnModelRefCollections.h:109
const_iterator iterator
only const iteration is possible
Definition: DgnModelRefCollections.h:96

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