HWindowInfoOOC.h
1 // Copyright (c) Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 #pragma once
11 
12 
13 #ifdef HMFC_STATIC_LIB
14 # error "Code cannot be statically linked."
15 #endif
16 
17 
18 #ifdef H_PACK_8
19 # pragma pack(push)
20 # pragma pack(8)
21 #endif
22 
23 
24 #include "HBaseView.h"
25 #include "PointCloudAPI.h"
26 
27 
31 private:
32  enum Type { INVALID, RECTANGLE, TRIANGLE };
33 
34 public:
38  : type(INVALID)
39  {}
40 
47  static HWindowInfoOOC Rectangle (HBaseView & view, ooc::Point const & window_min, ooc::Point const & window_max);
48 
56  static HWindowInfoOOC Triangle (HBaseView & view, ooc::Point const & p1, ooc::Point const & p2, ooc::Point const & p3);
57 
62  bool RejectBounding (ooc::Point const (&world_bounds)[8]) const;
63 
68  bool AcceptPoint (ooc::Point const & world_point) const;
69 
70 private:
71  HWindowInfoOOC (HBaseView & view, Type type);
72 
73  bool RectangleAcceptPoint (ooc::Point const & world_point) const;
74  bool TriangleAcceptPoint (ooc::Point const & world_point) const;
75 
76 private:
77  Type type;
78  float world_to_window[16];
79  ooc::Point window_min;
80  ooc::Point window_max;
81 
82  struct {
83  ooc::Point p3;
84  float inverse_denom;
85  float alpha_1;
86  float alpha_2;
87  float beta_1;
88  float beta_2;
89  } barycentric_info;
90 };
91 
92 
93 
static HWindowInfoOOC Rectangle(HBaseView &view, ooc::Point const &window_min, ooc::Point const &window_max)
static HWindowInfoOOC Triangle(HBaseView &view, ooc::Point const &p1, ooc::Point const &p2, ooc::Point const &p3)
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:332
Definition: HWindowInfoOOC.h:30
HWindowInfoOOC()
Definition: HWindowInfoOOC.h:37
bool AcceptPoint(ooc::Point const &world_point) const
bool RejectBounding(ooc::Point const (&world_bounds)[8]) const