OpenLexocad  27.0
RayHit.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Topo/Shape.h>
4 #include <Topo/topo_defines.h>
5 
6 namespace App
7 {
8 class Element;
9 }
10 
11 namespace Topo
12 {
14 {
15 public:
16  enum class HitType
17  {
18  HIT_NONE,
19  HIT_VERTEX,
20  HIT_EDGE,
21  HIT_FACE,
22  HIT_ELSE
23  };
24 
25 
26  RayHit() : hit_element(0), hit_item(nullptr), hit_param(0.), hit_type(), hit_item_idx(-1){};
27 
28  RayHit(App::Element* e, pConstTopologicalItem item, double param, Topo::RayHit::HitType h_type, int idx)
29  : hit_element(e), hit_item(item), hit_param(param), hit_type(h_type), hit_item_idx(idx){};
30 
31  App::Element* getHitElement() { return hit_element; };
32  pConstTopologicalItem getHitItem() { return hit_item; };
33  double getHitParam() { return hit_param; };
34  RayHit::HitType getHitType() { return hit_type; };
35  int getHitItemIdx() { return hit_item_idx; };
36 
37 private:
38  App::Element* hit_element;
39  pConstTopologicalItem hit_item;
40  int hit_item_idx;
41  double hit_param;
43 };
44 
45 typedef std::vector<RayHit> RayHitVector;
46 } // namespace Topo
pConstTopologicalItem getHitItem()
Definition: RayHit.h:32
#define TOPO_EXPORT
Definition: topo_defines.h:8
std::shared_ptr< Topo::TopologicalItem const > pConstTopologicalItem
Definition: Shape.h:90
RayHit::HitType getHitType()
Definition: RayHit.h:34
Definition: RayHit.h:13
std::vector< RayHit > RayHitVector
Definition: RayHit.h:45
double getHitParam()
Definition: RayHit.h:33
HitType
Definition: RayHit.h:16
Definition: Variant.h:70
App::Element * getHitElement()
Definition: RayHit.h:31
RayHit(App::Element *e, pConstTopologicalItem item, double param, Topo::RayHit::HitType h_type, int idx)
Definition: RayHit.h:28
RayHit()
Definition: RayHit.h:26
int getHitItemIdx()
Definition: RayHit.h:35