00001 // Filename: eggVertexPool.I 00002 // Created by: drose (16Jan99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: EggVertexPool::indexing operator 00022 // Access: Public 00023 // Description: Returns the vertex in the pool with the indicated 00024 // index number, or NULL if no vertices have that index 00025 // number. 00026 //////////////////////////////////////////////////////////////////// 00027 INLINE EggVertex *EggVertexPool:: 00028 operator [](int index) const { 00029 return get_vertex(index); 00030 } 00031 00032 //////////////////////////////////////////////////////////////////// 00033 // Function: EggVertexPool::make_new_vertex() 00034 // Access: Public 00035 // Description: Allocates and returns a new vertex from the pool. 00036 // This is one of three ways to add new vertices to a 00037 // vertex pool. 00038 //////////////////////////////////////////////////////////////////// 00039 INLINE EggVertex *EggVertexPool:: 00040 make_new_vertex() { 00041 PT(EggVertex) vertex = new EggVertex; 00042 add_vertex(vertex); 00043 return vertex; 00044 } 00045 00046 //////////////////////////////////////////////////////////////////// 00047 // Function: EggVertexPool::make_new_vertex() 00048 // Access: Public 00049 // Description: Allocates and returns a new vertex from the pool. 00050 // This is one of three ways to add new vertices to a 00051 // vertex pool. 00052 // 00053 // This flavor of make_new_vertex() explicitly sets the 00054 // vertex position as it is allocated. It does not 00055 // attempt to share vertices. 00056 //////////////////////////////////////////////////////////////////// 00057 INLINE EggVertex *EggVertexPool:: 00058 make_new_vertex(double pos) { 00059 EggVertex *vertex = make_new_vertex(); 00060 vertex->set_pos(pos); 00061 return vertex; 00062 } 00063 00064 //////////////////////////////////////////////////////////////////// 00065 // Function: EggVertexPool::make_new_vertex() 00066 // Access: Public 00067 // Description: Allocates and returns a new vertex from the pool. 00068 // This is one of three ways to add new vertices to a 00069 // vertex pool. 00070 // 00071 // This flavor of make_new_vertex() explicitly sets the 00072 // vertex position as it is allocated. It does not 00073 // attempt to share vertices. 00074 //////////////////////////////////////////////////////////////////// 00075 INLINE EggVertex *EggVertexPool:: 00076 make_new_vertex(const LPoint2d &pos) { 00077 EggVertex *vertex = make_new_vertex(); 00078 vertex->set_pos(pos); 00079 return vertex; 00080 } 00081 00082 //////////////////////////////////////////////////////////////////// 00083 // Function: EggVertexPool::make_new_vertex() 00084 // Access: Public 00085 // Description: Allocates and returns a new vertex from the pool. 00086 // This is one of three ways to add new vertices to a 00087 // vertex pool. 00088 // 00089 // This flavor of make_new_vertex() explicitly sets the 00090 // vertex position as it is allocated. It does not 00091 // attempt to share vertices. 00092 //////////////////////////////////////////////////////////////////// 00093 INLINE EggVertex *EggVertexPool:: 00094 make_new_vertex(const LPoint3d &pos) { 00095 EggVertex *vertex = make_new_vertex(); 00096 vertex->set_pos(pos); 00097 return vertex; 00098 } 00099 00100 //////////////////////////////////////////////////////////////////// 00101 // Function: EggVertexPool::make_new_vertex() 00102 // Access: Public 00103 // Description: Allocates and returns a new vertex from the pool. 00104 // This is one of three ways to add new vertices to a 00105 // vertex pool. 00106 // 00107 // This flavor of make_new_vertex() explicitly sets the 00108 // vertex position as it is allocated. It does not 00109 // attempt to share vertices. 00110 //////////////////////////////////////////////////////////////////// 00111 INLINE EggVertex *EggVertexPool:: 00112 make_new_vertex(const LPoint4d &pos) { 00113 EggVertex *vertex = make_new_vertex(); 00114 vertex->set_pos(pos); 00115 return vertex; 00116 }