00001 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc. 00002 // 00003 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., 00004 // and considered a trade secret as defined under civil and criminal statutes. 00005 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of 00006 // unauthorized use or misappropriation of its trade secrets. Use of this information 00007 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under 00008 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use. 00009 00010 #pragma once 00011 00012 00013 #ifdef HMFC_STATIC_LIB 00014 # error "Code cannot be statically linked." 00015 #endif 00016 00017 00018 #ifdef H_PACK_8 00019 # pragma pack(push) 00020 # pragma pack(8) 00021 #endif 00022 00023 00024 #include "HBaseView.h" 00025 #include "PointCloudAPI.h" 00026 00027 00030 class HWindowInfoOOC { 00031 private: 00032 enum Type { INVALID, RECTANGLE, TRIANGLE }; 00033 00034 public: 00037 HWindowInfoOOC () 00038 : type(INVALID) 00039 {} 00040 00047 static HWindowInfoOOC Rectangle (HBaseView & view, ooc::Point const & window_min, ooc::Point const & window_max); 00048 00056 static HWindowInfoOOC Triangle (HBaseView & view, ooc::Point const & p1, ooc::Point const & p2, ooc::Point const & p3); 00057 00062 bool RejectBounding (ooc::Point const (&world_bounds)[8]) const; 00063 00068 bool AcceptPoint (ooc::Point const & world_point) const; 00069 00070 private: 00071 HWindowInfoOOC (HBaseView & view, Type type); 00072 00073 bool RectangleAcceptPoint (ooc::Point const & world_point) const; 00074 bool TriangleAcceptPoint (ooc::Point const & world_point) const; 00075 00076 private: 00077 Type type; 00078 float world_to_window[16]; 00079 ooc::Point window_min; 00080 ooc::Point window_max; 00081 00082 struct { 00083 ooc::Point p3; 00084 float inverse_denom; 00085 float alpha_1; 00086 float alpha_2; 00087 float beta_1; 00088 float beta_2; 00089 } barycentric_info; 00090 }; 00091 00092 00093