Panda3D

geomTransformer.I

00001 // Filename: geomTransformer.I
00002 // Created by:  drose (14Mar02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: GeomTransformer::get_max_collect_vertices
00018 //       Access: Public
00019 //  Description: Returns the maximum number of vertices that may be
00020 //               put into a single GeomVertexData as a result of
00021 //               collecting multiple objects in collect_vertex_data().
00022 ////////////////////////////////////////////////////////////////////
00023 INLINE int GeomTransformer::
00024 get_max_collect_vertices() const {
00025   return _max_collect_vertices;
00026 }
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //     Function: GeomTransformer::set_max_collect_vertices
00030 //       Access: Public
00031 //  Description: Specifies the maximum number of vertices that may be
00032 //               put into a single GeomVertexData as a result of
00033 //               collecting multiple objects in collect_vertex_data().
00034 ////////////////////////////////////////////////////////////////////
00035 INLINE void GeomTransformer::
00036 set_max_collect_vertices(int max_collect_vertices) {
00037   _max_collect_vertices = max_collect_vertices;
00038 }
00039 
00040 ////////////////////////////////////////////////////////////////////
00041 //     Function: GeomTransformer::SourceVertices::Ordering Operator
00042 //       Access: Public
00043 //  Description:
00044 ////////////////////////////////////////////////////////////////////
00045 INLINE bool GeomTransformer::SourceVertices::
00046 operator < (const GeomTransformer::SourceVertices &other) const {
00047   if (_vertex_data != other._vertex_data) {
00048     return _vertex_data < other._vertex_data;
00049   }
00050   return (_mat.compare_to(other._mat) < 0);
00051 }
00052 
00053 ////////////////////////////////////////////////////////////////////
00054 //     Function: GeomTransformer::SourceTexCoords::Ordering Operator
00055 //       Access: Public
00056 //  Description:
00057 ////////////////////////////////////////////////////////////////////
00058 INLINE bool GeomTransformer::SourceTexCoords::
00059 operator < (const GeomTransformer::SourceTexCoords &other) const {
00060   if (_vertex_data != other._vertex_data) {
00061     return _vertex_data < other._vertex_data;
00062   }
00063   if (_from != other._from) {
00064     return _from < other._from;
00065   }
00066   if (_to != other._to) {
00067     return _to < other._to;
00068   }
00069   return (_mat.compare_to(other._mat) < 0);
00070 }
00071 
00072 ////////////////////////////////////////////////////////////////////
00073 //     Function: GeomTransformer::SourceColors::Ordering Operator
00074 //       Access: Public
00075 //  Description:
00076 ////////////////////////////////////////////////////////////////////
00077 INLINE bool GeomTransformer::SourceColors::
00078 operator < (const GeomTransformer::SourceColors &other) const {
00079   if (_vertex_data != other._vertex_data) {
00080     return _vertex_data < other._vertex_data;
00081   }
00082   return (_color.compare_to(other._color) < 0);
00083 }
00084 
00085 ////////////////////////////////////////////////////////////////////
00086 //     Function: GeomTransformer::SourceTextureColors::Ordering Operator
00087 //       Access: Public
00088 //  Description:
00089 ////////////////////////////////////////////////////////////////////
00090 INLINE bool GeomTransformer::SourceTextureColors::
00091 operator < (const GeomTransformer::SourceTextureColors &other) const {
00092   if (_vertex_data != other._vertex_data) {
00093     return _vertex_data < other._vertex_data;
00094   }
00095   if (_tex != other._tex) {
00096     return _tex < other._tex;
00097   }
00098   if (_ts != other._ts) {
00099     return _ts < other._ts;
00100   }
00101   if (_tma != other._tma) {
00102     return _tma < other._tma;
00103   }
00104   if (_keep_vertex_color != other._keep_vertex_color) {
00105     return (int)_keep_vertex_color < (int)other._keep_vertex_color;
00106   }
00107   return (_base_color.compare_to(other._base_color) < 0);
00108 }
00109 
00110 ////////////////////////////////////////////////////////////////////
00111 //     Function: GeomTransformer::SourceFormat::Ordering Operator
00112 //       Access: Public
00113 //  Description:
00114 ////////////////////////////////////////////////////////////////////
00115 INLINE bool GeomTransformer::SourceFormat::
00116 operator < (const GeomTransformer::SourceFormat &other) const {
00117   if (_format != other._format) {
00118     return _format < other._format;
00119   }
00120   return _vertex_data < other._vertex_data;
00121 }
00122 
00123 ////////////////////////////////////////////////////////////////////
00124 //     Function: GeomTransformer::NewCollectedKey::Ordering Operator
00125 //       Access: Public
00126 //  Description:
00127 ////////////////////////////////////////////////////////////////////
00128 INLINE bool GeomTransformer::NewCollectedKey::
00129 operator < (const GeomTransformer::NewCollectedKey &other) const {
00130   if (_format != other._format) {
00131     return _format < other._format;
00132   }
00133   if (_usage_hint != other._usage_hint) {
00134     return (int)_usage_hint < (int)other._usage_hint;
00135   }
00136   if (_animation_type != other._animation_type) {
00137     return (int)_animation_type < (int)other._animation_type;
00138   }
00139   return _name < other._name;
00140 }
00141 
00142 ////////////////////////////////////////////////////////////////////
00143 //     Function: GeomTransformer::VertexDataAssoc::Constructor
00144 //       Access: Public
00145 //  Description:
00146 ////////////////////////////////////////////////////////////////////
00147 INLINE GeomTransformer::VertexDataAssoc::
00148 VertexDataAssoc() {
00149   _might_have_unused = false;
00150 }
00151 
00152 
 All Classes Functions Variables Enumerations