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