Panda3D
 All Classes Functions Variables Enumerations
nurbsVertex.I
1 // Filename: nurbsVertex.I
2 // Created by: drose (04Dec02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: NurbsVertex::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE NurbsVertex::
22 NurbsVertex() {
23 }
24 
25 ////////////////////////////////////////////////////////////////////
26 // Function: NurbsVertex::Copy Constructor
27 // Access: Public
28 // Description:
29 ////////////////////////////////////////////////////////////////////
30 INLINE NurbsVertex::
31 NurbsVertex(const NurbsVertex &copy) :
32  _vertex(copy._vertex),
33  _space(copy._space),
34  _space_path(copy._space_path)
35 {
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: NurbsVertex::Copy Assignment Operator
40 // Access: Public
41 // Description:
42 ////////////////////////////////////////////////////////////////////
43 INLINE void NurbsVertex::
44 operator = (const NurbsVertex &copy) {
45  _vertex = copy._vertex;
46  _space = copy._space;
47  _space_path = copy._space_path;
48 }
49 
50 ////////////////////////////////////////////////////////////////////
51 // Function: NurbsVertex::Destructor
52 // Access: Public
53 // Description:
54 ////////////////////////////////////////////////////////////////////
55 INLINE NurbsVertex::
56 ~NurbsVertex() {
57 }
58 
59 ////////////////////////////////////////////////////////////////////
60 // Function: NurbsVertex::set_vertex
61 // Access: Public
62 // Description:
63 ////////////////////////////////////////////////////////////////////
64 INLINE void NurbsVertex::
65 set_vertex(const LVecBase4 &vertex) {
66  _vertex = vertex;
67 }
68 
69 ////////////////////////////////////////////////////////////////////
70 // Function: NurbsVertex::get_vertex
71 // Access: Public
72 // Description:
73 ////////////////////////////////////////////////////////////////////
74 INLINE const LVecBase4 &NurbsVertex::
75 get_vertex() const {
76  return _vertex;
77 }
78 
79 ////////////////////////////////////////////////////////////////////
80 // Function: NurbsVertex::set_space
81 // Access: Public
82 // Description: Sets the space of this vertex as a fixed NodePath.
83 ////////////////////////////////////////////////////////////////////
84 INLINE void NurbsVertex::
85 set_space(const NodePath &space) {
86  _space = space;
87  _space_path = string();
88 }
89 
90 ////////////////////////////////////////////////////////////////////
91 // Function: NurbsVertex::set_space
92 // Access: Public
93 // Description: Sets the space of this vertex as a relative path from
94 // the rel_to node.
95 ////////////////////////////////////////////////////////////////////
96 INLINE void NurbsVertex::
97 set_space(const string &space) {
98  _space = NodePath();
99  _space_path = space;
100 }
101 
102 ////////////////////////////////////////////////////////////////////
103 // Function: NurbsVertex::get_space
104 // Access: Public
105 // Description:
106 ////////////////////////////////////////////////////////////////////
107 INLINE NodePath NurbsVertex::
108 get_space(const NodePath &rel_to) const {
109  if (_space_path.empty()) {
110  return _space;
111  } else {
112  return rel_to.find(_space_path);
113  }
114 }
NodePath find(const string &path) const
Searches for a node below the referenced node that matches the indicated string.
Definition: nodePath.cxx:434
This represents a single control vertex in a NurbsEvaluator.
Definition: nurbsVertex.h:36
void set_space(const NodePath &space)
Sets the space of this vertex as a fixed NodePath.
Definition: nurbsVertex.I:85
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165