Panda3D

Loading...
Searching...
No Matches
nurbsVertex.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file nurbsVertex.I
10 * @author drose
11 * @date 2002-12-04
12 */
13
14/**
15 *
16 */
17INLINE NurbsVertex::
18NurbsVertex() {
19 _vertex.set(0, 0, 0, 1);
20}
21
22/**
23 *
24 */
25INLINE NurbsVertex::
26NurbsVertex(const NurbsVertex &copy) :
27 _vertex(copy._vertex),
28 _space(copy._space),
29 _space_path(copy._space_path)
30{
31}
32
33/**
34 *
35 */
36INLINE void NurbsVertex::
37operator = (const NurbsVertex &copy) {
38 _vertex = copy._vertex;
39 _space = copy._space;
40 _space_path = copy._space_path;
41}
42
43/**
44 *
45 */
46INLINE NurbsVertex::
47~NurbsVertex() {
48}
49
50/**
51 *
52 */
53INLINE void NurbsVertex::
54set_vertex(const LVecBase4 &vertex) {
55 _vertex = vertex;
56}
57
58/**
59 *
60 */
61INLINE const LVecBase4 &NurbsVertex::
62get_vertex() const {
63 return _vertex;
64}
65
66/**
67 * Sets the space of this vertex as a fixed NodePath.
68 */
69INLINE void NurbsVertex::
70 set_space(const NodePath &space) {
71 _space = space;
72 _space_path = std::string();
73}
74
75/**
76 * Sets the space of this vertex as a relative path from the rel_to node.
77 */
78INLINE void NurbsVertex::
79 set_space(const std::string &space) {
80 _space = NodePath();
81 _space_path = space;
82}
83
84/**
85 *
86 */
87INLINE NodePath NurbsVertex::
88get_space(const NodePath &rel_to) const {
89 if (_space_path.empty()) {
90 return _space;
91 } else {
92 return rel_to.find(_space_path);
93 }
94}
NodePath
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition nodePath.h:159
NodePath::find
NodePath find(const std::string &path) const
Searches for a node below the referenced node that matches the indicated string.
Definition nodePath.cxx:315
NurbsVertex
This represents a single control vertex in a NurbsEvaluator.
Definition nurbsVertex.h:32
NurbsVertex::set_space
void set_space(const NodePath &space)
Sets the space of this vertex as a fixed NodePath.
Definition nurbsVertex.I:70