Panda3D
 All Classes Functions Variables Enumerations
triangulator3.I
1 // Filename: triangulator3.I
2 // Created by: drose (03Jan13)
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: Triangulator3::add_vertex
18 // Access: Published
19 // Description: Adds a new vertex to the vertex pool. Returns the
20 // vertex index number.
21 ////////////////////////////////////////////////////////////////////
22 INLINE int Triangulator3::
23 add_vertex(double x, double y, double z) {
24  return add_vertex(LPoint3d(x, y, z));
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: Triangulator3::get_num_vertices
29 // Access: Published
30 // Description: Returns the number of vertices in the pool. Note
31 // that the Triangulator might append new vertices, in
32 // addition to those added by the user, if any of the
33 // polygon is self-intersecting, or if any of the holes
34 // intersect some part of the polygon edges.
35 ////////////////////////////////////////////////////////////////////
36 INLINE int Triangulator3::
38  return _vertices3.size();
39 }
40 
41 ////////////////////////////////////////////////////////////////////
42 // Function: Triangulator3::get_vertex
43 // Access: Published
44 // Description: Returns the nth vertex.
45 ////////////////////////////////////////////////////////////////////
46 INLINE const LPoint3d &Triangulator3::
47 get_vertex(int n) const {
48  nassertr(n >= 0 && n < (int)_vertices3.size(), LPoint3d::zero());
49  return _vertices3[n];
50 }
51 
52 ////////////////////////////////////////////////////////////////////
53 // Function: Triangulator3::get_plane
54 // Access: Published
55 // Description: Returns the plane of the polygon. This is only
56 // available after calling triangulate().
57 ////////////////////////////////////////////////////////////////////
58 INLINE const LPlaned &Triangulator3::
59 get_plane() const {
60  return _plane;
61 }
int add_vertex(const LPoint3d &point)
Adds a new vertex to the vertex pool.
const LPoint3d & get_vertex(int n) const
Returns the nth vertex.
Definition: triangulator3.I:47
static const LPoint3d & zero()
Returns a zero-length point.
Definition: lpoint3.h:690
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:531
int get_num_vertices() const
Returns the number of vertices in the pool.
Definition: triangulator3.I:37
const LPlaned & get_plane() const
Returns the plane of the polygon.
Definition: triangulator3.I:59