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 00028 class HWindowInfoOOC { 00029 private: 00030 enum Type { INVALID, RECTANGLE, TRIANGLE }; 00031 00032 public: 00033 HWindowInfoOOC () 00034 : type(INVALID) 00035 {} 00036 00037 static HWindowInfoOOC Rectangle (HBaseView & view, ooc::Point const & window_min, ooc::Point const & window_max); 00038 static HWindowInfoOOC Triangle (HBaseView & view, ooc::Point const & p1, ooc::Point const & p2, ooc::Point const & p3); 00039 00040 bool RejectBounding (ooc::Point const (&world_bounds)[8]) const; 00041 bool AcceptPoint (ooc::Point const & world_point) const; 00042 00043 private: 00044 HWindowInfoOOC (HBaseView & view, Type type); 00045 00046 bool RectangleAcceptPoint (ooc::Point const & world_point) const; 00047 bool TriangleAcceptPoint (ooc::Point const & world_point) const; 00048 00049 private: 00050 Type type; 00051 float world_to_window[16]; 00052 ooc::Point window_min; 00053 ooc::Point window_max; 00054 00055 struct { 00056 ooc::Point p3; 00057 float inverse_denom; 00058 float alpha_1; 00059 float alpha_2; 00060 float beta_1; 00061 float beta_2; 00062 } barycentric_info; 00063 }; 00064 00065 00066