Panda3D
 All Classes Functions Variables Enumerations
nurbsVertex.I
00001 // Filename: nurbsVertex.I
00002 // Created by:  drose (04Dec02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: NurbsVertex::Constructor
00018 //       Access: Public
00019 //  Description:
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE NurbsVertex::
00022 NurbsVertex() {
00023 }
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //     Function: NurbsVertex::Copy Constructor
00027 //       Access: Public
00028 //  Description:
00029 ////////////////////////////////////////////////////////////////////
00030 INLINE NurbsVertex::
00031 NurbsVertex(const NurbsVertex &copy) :
00032   _vertex(copy._vertex),
00033   _space(copy._space),
00034   _space_path(copy._space_path)
00035 {
00036 }
00037 
00038 ////////////////////////////////////////////////////////////////////
00039 //     Function: NurbsVertex::Copy Assignment Operator
00040 //       Access: Public
00041 //  Description:
00042 ////////////////////////////////////////////////////////////////////
00043 INLINE void NurbsVertex::
00044 operator = (const NurbsVertex &copy) {
00045   _vertex = copy._vertex;
00046   _space = copy._space;
00047   _space_path = copy._space_path;
00048 }
00049 
00050 ////////////////////////////////////////////////////////////////////
00051 //     Function: NurbsVertex::Destructor
00052 //       Access: Public
00053 //  Description:
00054 ////////////////////////////////////////////////////////////////////
00055 INLINE NurbsVertex::
00056 ~NurbsVertex() {
00057 }
00058 
00059 ////////////////////////////////////////////////////////////////////
00060 //     Function: NurbsVertex::set_vertex
00061 //       Access: Public
00062 //  Description:
00063 ////////////////////////////////////////////////////////////////////
00064 INLINE void NurbsVertex::
00065 set_vertex(const LVecBase4 &vertex) {
00066   _vertex = vertex;
00067 }
00068 
00069 ////////////////////////////////////////////////////////////////////
00070 //     Function: NurbsVertex::get_vertex
00071 //       Access: Public
00072 //  Description:
00073 ////////////////////////////////////////////////////////////////////
00074 INLINE const LVecBase4 &NurbsVertex::
00075 get_vertex() const {
00076   return _vertex;
00077 }
00078 
00079 ////////////////////////////////////////////////////////////////////
00080 //     Function: NurbsVertex::set_space
00081 //       Access: Public
00082 //  Description: Sets the space of this vertex as a fixed NodePath.
00083 ////////////////////////////////////////////////////////////////////
00084 INLINE void NurbsVertex::
00085 set_space(const NodePath &space) {
00086   _space = space;
00087   _space_path = string();
00088 }
00089 
00090 ////////////////////////////////////////////////////////////////////
00091 //     Function: NurbsVertex::set_space
00092 //       Access: Public
00093 //  Description: Sets the space of this vertex as a relative path from
00094 //               the rel_to node.
00095 ////////////////////////////////////////////////////////////////////
00096 INLINE void NurbsVertex::
00097 set_space(const string &space) {
00098   _space = NodePath();
00099   _space_path = space;
00100 }
00101 
00102 ////////////////////////////////////////////////////////////////////
00103 //     Function: NurbsVertex::get_space
00104 //       Access: Public
00105 //  Description:
00106 ////////////////////////////////////////////////////////////////////
00107 INLINE NodePath NurbsVertex::
00108 get_space(const NodePath &rel_to) const {
00109   if (_space_path.empty()) {
00110     return _space;
00111   } else {
00112     return rel_to.find(_space_path);
00113   }
00114 }
 All Classes Functions Variables Enumerations