DataElementSet.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: UnstructGrid
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2011, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeUnstructGrid/Base.h"
16 #include "CeeUnstructGrid/DataElementSetItem.h"
17 #include "CeeCore/RefCountedObject.h"
18 
19 #include <vector>
20 
21 namespace cee {
22 namespace ug {
23 
24 class DataSourcePrivate;
25 
26 //==================================================================================================
27 //
28 //
29 //
30 //==================================================================================================
31 class CEE_UG_EXPORT DataElementSet : public RefCountedObject
32 {
33 public:
34  DataElementSet(int setId);
35  DataElementSet(const DataElementSet& other, int setId);
36  virtual ~DataElementSet();
37 
38 
39  bool isEqual(const DataElementSet& rhs) const;
40 
41  int id() const;
42 
43  size_t itemCount() const;
44  size_t itemIndex(const DataElementSetItem& item) const;
45  DataElementSetItem item(size_t index) const;
46  void addItem(const DataElementSetItem& item);
47  void addItems(int geometryId, int partId, const std::vector<size_t>& elementIndices);
48 
49  void removeItem(const DataElementSetItem& item);
50  void removeAllItems();
51 
52  std::vector<size_t> elementIndicesForPart(int geometryId, int partId) const;
53 
54  void unionWith(const DataElementSet& other);
55  void intersect(const DataElementSet& other);
56  void subtract(const DataElementSet& other);
57 
58 private:
59  CEE_PRIVATE_F(DataSource);
60  CEE_PRIVATE_F(DataElementSetGenerator);
61  CEE_PRIVATE_F(DataElementSetBuilder);
62  CEE_PRIVATE_IMPL(DataElementSet);
63  CEE_DISALLOW_COPY_AND_ASSIGN(DataElementSet);
64 };
65 
66 } // namespace ug
67 } // namespace cee
The data source of the model. For instance a file interface or custom built by the user...
Definition: DataSource.h:35
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
Helper class for building element sets in an efficient matter.
Definition: DataElementSetBuilder.h:32
Base class for all reference counted objects with built-in support for intrusive reference counting...
Definition: RefCountedObject.h:34
This class identifies an element within an UnstructGrid model and is used as an item in a DataElement...
Definition: DataElementSetItem.h:25
This class is used to generate DataElementSets from the current DataSource of an UnstructGridModel.
Definition: DataElementSetGenerator.h:31
A DataElementSet is a set of unique elements within a DataSource.
Definition: DataElementSet.h:31