Panda3D

Loading...
Searching...
No Matches
triangulator3.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 triangulator3.I
10 * @author drose
11 * @date 2013-01-03
12 */
13
14/**
15 * Adds a new vertex to the vertex pool. Returns the vertex index number.
16 */
17INLINE int Triangulator3::
18 add_vertex(double x, double y, double z) {
19 return add_vertex(LPoint3d(x, y, z));
20}
21
22/**
23 * Returns the number of vertices in the pool. Note that the Triangulator
24 * might append new vertices, in addition to those added by the user, if any
25 * of the polygon is self-intersecting, or if any of the holes intersect some
26 * part of the polygon edges.
27 */
28INLINE int Triangulator3::
29 get_num_vertices() const {
30 return _vertices3.size();
31}
32
33/**
34 * Returns the nth vertex.
35 */
36INLINE const LPoint3d &Triangulator3::
37 get_vertex(int n) const {
38 nassertr(n >= 0 && n < (int)_vertices3.size(), LPoint3d::zero());
39 return _vertices3[n];
40}
41
42/**
43 * Returns the plane of the polygon. This is only available after calling
44 * triangulate().
45 */
46INLINE const LPlaned &Triangulator3::
47 get_plane() const {
48 return _plane;
49}
Triangulator3::get_vertex
get_vertex
Returns the nth vertex.
Definition triangulator3.h:38
Triangulator3::get_num_vertices
get_num_vertices
Returns the number of vertices in the pool.
Definition triangulator3.h:38
Triangulator3::add_vertex
int add_vertex(const LPoint3d &point)
Adds a new vertex to the vertex pool.
Definition triangulator3.cxx:39
Triangulator3::get_plane
get_plane
Returns the plane of the polygon.
Definition triangulator3.h:44