HitItem.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 "CeeCore/Vec3d.h"
17 
18 namespace cee {
19 namespace ug {
20 
21 //==================================================================================================
22 //
23 //
24 //
25 //==================================================================================================
26 class CEE_UG_EXPORT HitItem
27 {
28 public:
30  enum ItemType
31  {
32  PART,
35  ISOVOLUME
36  };
37 
38 public:
39  HitItem();
40  HitItem(const HitItem& other);
41  ~HitItem();
42 
43  HitItem& operator=(const HitItem& other);
44 
45  ItemType itemType() const;
46  void setItemType(ItemType itemType);
47 
48  int itemId() const;
49  void setItemId(int itemId);
50 
51  size_t itemIndex() const;
52  void setItemIndex(size_t itemIndex);
53 
54  int stateId() const;
55  void setStateId(int stateId);
56 
57  size_t frameIndex() const;
58  void setFrameIndex(size_t frameIndex);
59 
60  size_t geometryIndex() const;
61  void setGeometryIndex(size_t geometryIndex);
62 
63  int partId() const;
64  void setPartId(int partId);
65 
66  size_t elementIndex() const;
67  void setElementIndex(size_t elementIndex);
68 
69  size_t nodeIndex() const;
70  void setNodeIndex(size_t nodeIndex);
71 
72  size_t elementLocalNodeIndex() const;
73  void setElementLocalNodeIndex(size_t localNodeIndex);
74 
75  size_t elementLocalSurfaceIndex() const;
76  void setElementLocalSurfaceIndex(size_t surfaceIndex);
77 
78  size_t edgeNodeStartIndex() const;
79  void setEdgeNodeStartIndex(size_t nodeIndex);
80 
81  size_t edgeNodeEndIndex() const;
82  void setEdgeNodeEndIndex(size_t nodeIndex);
83 
84  Vec3d intersectionPoint() const;
85  void setIntersectionPoint(const Vec3d& intersectionPoint);
86 
87  Vec3d intersectionPointNormal() const;
88  void setIntersectionPointNormal(const Vec3d& intersectionPointNormal);
89 
90  size_t triangleIndex() const;
91  void setTriangleIndex(size_t triangleIndex);
92 
93  double distanceAlongRay() const;
94  void setDistanceAlongRay(double distance);
95 
96 private:
97  ItemType m_itemType;
98  int m_stateId;
99  size_t m_frameIndex;
100  size_t m_geometryIndex;
101  int m_partId;
102  int m_itemId;
103  size_t m_itemIndex;
104  size_t m_elementIndex;
105  size_t m_nodeIndex; // nearest node zero based index
106  size_t m_elementLocalNodeIndex;
107  size_t m_elementLocalSurfaceIndex;
108  size_t m_edgeNodeStartIndex;
109  size_t m_edgeNodeEndIndex;
110  Vec3d m_intersectionPoint;
111  Vec3d m_intersectionPointNormal;
112  size_t m_triangleIndex; // Index of the triangle hit in the display model
113  double m_distanceAlongRay;
114 };
115 
116 
117 } // namespace ug
118 } // namespace cee
The hit item is a Cutting plane.
Definition: HitItem.h:33
The hit item is a Part.
Definition: HitItem.h:32
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
ItemType
Item types for hit items.
Definition: HitItem.h:30
The hit item is an Isosurface.
Definition: HitItem.h:34
Vector class for a 3D double vector.
Definition: Vec3d.h:26
Small class containing the data for a hit of an intersection between a ray and a part in an UnstructG...
Definition: HitItem.h:26