00001 // Filename: nurbsVertex.I 00002 // Created by: drose (04Dec02) 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: NurbsVertex::Constructor 00022 // Access: Public 00023 // Description: 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE NurbsVertex:: 00026 NurbsVertex() { 00027 } 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Function: NurbsVertex::Copy Constructor 00031 // Access: Public 00032 // Description: 00033 //////////////////////////////////////////////////////////////////// 00034 INLINE NurbsVertex:: 00035 NurbsVertex(const NurbsVertex ©) : 00036 _vertex(copy._vertex), 00037 _space(copy._space), 00038 _space_path(copy._space_path) 00039 { 00040 } 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: NurbsVertex::Copy Assignment Operator 00044 // Access: Public 00045 // Description: 00046 //////////////////////////////////////////////////////////////////// 00047 INLINE void NurbsVertex:: 00048 operator = (const NurbsVertex ©) { 00049 _vertex = copy._vertex; 00050 _space = copy._space; 00051 _space_path = copy._space_path; 00052 } 00053 00054 //////////////////////////////////////////////////////////////////// 00055 // Function: NurbsVertex::Destructor 00056 // Access: Public 00057 // Description: 00058 //////////////////////////////////////////////////////////////////// 00059 INLINE NurbsVertex:: 00060 ~NurbsVertex() { 00061 } 00062 00063 //////////////////////////////////////////////////////////////////// 00064 // Function: NurbsVertex::set_vertex 00065 // Access: Public 00066 // Description: 00067 //////////////////////////////////////////////////////////////////// 00068 INLINE void NurbsVertex:: 00069 set_vertex(const LVecBase4f &vertex) { 00070 _vertex = vertex; 00071 } 00072 00073 //////////////////////////////////////////////////////////////////// 00074 // Function: NurbsVertex::get_vertex 00075 // Access: Public 00076 // Description: 00077 //////////////////////////////////////////////////////////////////// 00078 INLINE const LVecBase4f &NurbsVertex:: 00079 get_vertex() const { 00080 return _vertex; 00081 } 00082 00083 //////////////////////////////////////////////////////////////////// 00084 // Function: NurbsVertex::set_space 00085 // Access: Public 00086 // Description: Sets the space of this vertex as a fixed NodePath. 00087 //////////////////////////////////////////////////////////////////// 00088 INLINE void NurbsVertex:: 00089 set_space(const NodePath &space) { 00090 _space = space; 00091 _space_path = string(); 00092 } 00093 00094 //////////////////////////////////////////////////////////////////// 00095 // Function: NurbsVertex::set_space 00096 // Access: Public 00097 // Description: Sets the space of this vertex as a relative path from 00098 // the rel_to node. 00099 //////////////////////////////////////////////////////////////////// 00100 INLINE void NurbsVertex:: 00101 set_space(const string &space) { 00102 _space = NodePath(); 00103 _space_path = space; 00104 } 00105 00106 //////////////////////////////////////////////////////////////////// 00107 // Function: NurbsVertex::get_space 00108 // Access: Public 00109 // Description: 00110 //////////////////////////////////////////////////////////////////// 00111 INLINE NodePath NurbsVertex:: 00112 get_space(const NodePath &rel_to) const { 00113 if (_space_path.empty()) { 00114 return _space; 00115 } else { 00116 return rel_to.find(_space_path); 00117 } 00118 }