Selection.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: App
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 "CeeApp/Base.h"
16 #include "CeeCore/Base.h"
17 #include "CeeCore/Vec3d.h"
18 #include "CeeCore/RefCountedObject.h"
19 
20 #include <map>
21 
22 namespace cee {
23 namespace ug {
24  class HitItem;
25 }
26 }
27 
28 namespace cee {
29 namespace app {
30 
31 
32 
33 //==================================================================================================
34 //
35 // Class for selection management
36 //
37 //==================================================================================================
38 class CEE_APP_EXPORT Selection : public RefCountedObject
39 {
40 
41 public:
42 
43  enum ItemType
44  {
50  COORDINATE
51  };
52 
53  Selection();
54 
55  size_t count();
56 
57  void set(size_t index, const cee::ug::HitItem& item);
58  cee::ug::HitItem get(size_t index);
59 
60  size_t add(const cee::ug::HitItem& hitItem);
61 
62  size_t addNode(size_t index);
63  size_t addElement(size_t index);
64  size_t addElementNode(size_t elementIndex, size_t localNodeIndex);
65  size_t addElementSurface(size_t elementIndex, size_t surfaceIndex);
66  size_t addCoordinate(const cee::Vec3d& coordinate);
67 
68  void remove(size_t index);
69  void removeAll();
70 
71  void setItemType(ItemType selectionType);
72  ItemType itemType() const;
73 
74  bool isMultiSelectionEnabled() const;
75  void enableMultiSelection(bool enable);
76 
77  const int initialGeometryId(size_t index) const;
78 
79 private:
80  virtual ~Selection();
81 
82  CEE_PRIVATE_IMPL(Selection);
83  CEE_DISALLOW_COPY_AND_ASSIGN(Selection);
84 
85 };
86 
87 } // namespace cee
88 } // namespace app
Element selection.
Definition: Selection.h:46
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
Class to manage a list of selected HitItems. Selected items are per view.
Definition: Selection.h:38
ItemType
List of selection item types.
Definition: Selection.h:43
Base class for all reference counted objects with built-in support for intrusive reference counting...
Definition: RefCountedObject.h:34
None.
Definition: Selection.h:45
Node selection.
Definition: Selection.h:47
Element node selection.
Definition: Selection.h:48
Vector class for a 3D double vector.
Definition: Vec3d.h:26
Element surface selection.
Definition: Selection.h:49
Small class containing the data for a hit of an intersection between a ray and a part in an UnstructG...
Definition: HitItem.h:26