00001 // Filename: findApproxLevelEntry.I 00002 // Created by: drose (13Mar02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: FindApproxLevelEntry::Constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE FindApproxLevelEntry:: 00026 FindApproxLevelEntry(const WorkingNodePath &node_path, FindApproxPath &approx_path) : 00027 _node_path(node_path), 00028 _approx_path(approx_path) 00029 { 00030 _i = 0; 00031 nassertv(_node_path.is_valid()); 00032 } 00033 00034 //////////////////////////////////////////////////////////////////// 00035 // Function: FindApproxLevelEntry::Copy Constructor 00036 // Access: Public 00037 // Description: 00038 //////////////////////////////////////////////////////////////////// 00039 INLINE FindApproxLevelEntry:: 00040 FindApproxLevelEntry(const FindApproxLevelEntry ©, int increment) : 00041 _node_path(copy._node_path), 00042 _i(copy._i + increment), 00043 _approx_path(copy._approx_path) 00044 { 00045 nassertv(_node_path.is_valid()); 00046 } 00047 00048 //////////////////////////////////////////////////////////////////// 00049 // Function: FindApproxLevelEntry::Copy Assignment Operator 00050 // Access: Public 00051 // Description: 00052 //////////////////////////////////////////////////////////////////// 00053 INLINE void FindApproxLevelEntry:: 00054 operator = (const FindApproxLevelEntry ©) { 00055 _node_path = copy._node_path; 00056 _i = copy._i; 00057 nassertv(&_approx_path == ©._approx_path); 00058 nassertv(_node_path.is_valid()); 00059 } 00060 00061 00062 //////////////////////////////////////////////////////////////////// 00063 // Function: FindApproxLevelEntry::next_is_stashed 00064 // Access: Public 00065 // Description: Returns true if the next node matched by this entry 00066 // must be a stashed node, false otherwise. 00067 //////////////////////////////////////////////////////////////////// 00068 INLINE bool FindApproxLevelEntry:: 00069 next_is_stashed(int increment) const { 00070 return _approx_path.matches_stashed(_i + increment); 00071 } 00072 00073 //////////////////////////////////////////////////////////////////// 00074 // Function: FindApproxLevelEntry::is_solution 00075 // Access: Public 00076 // Description: Returns true if this entry represents a solution to 00077 // the search; i.e. all the components of the path have 00078 // been successfully matched. 00079 //////////////////////////////////////////////////////////////////// 00080 INLINE bool FindApproxLevelEntry:: 00081 is_solution(int increment) const { 00082 return (_i + increment >= _approx_path.get_num_components()); 00083 }