Panda3D
geomTransformer.I
1 // Filename: geomTransformer.I
2 // Created by: drose (14Mar02)
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: GeomTransformer::get_max_collect_vertices
18 // Access: Public
19 // Description: Returns the maximum number of vertices that may be
20 // put into a single GeomVertexData as a result of
21 // collecting multiple objects in collect_vertex_data().
22 ////////////////////////////////////////////////////////////////////
23 INLINE int GeomTransformer::
25  return _max_collect_vertices;
26 }
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: GeomTransformer::set_max_collect_vertices
30 // Access: Public
31 // Description: Specifies the maximum number of vertices that may be
32 // put into a single GeomVertexData as a result of
33 // collecting multiple objects in collect_vertex_data().
34 ////////////////////////////////////////////////////////////////////
35 INLINE void GeomTransformer::
36 set_max_collect_vertices(int max_collect_vertices) {
37  _max_collect_vertices = max_collect_vertices;
38 }
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function: GeomTransformer::SourceVertices::Ordering Operator
42 // Access: Public
43 // Description:
44 ////////////////////////////////////////////////////////////////////
45 INLINE bool GeomTransformer::SourceVertices::
46 operator < (const GeomTransformer::SourceVertices &other) const {
47  if (_vertex_data != other._vertex_data) {
48  return _vertex_data < other._vertex_data;
49  }
50  return (_mat.compare_to(other._mat) < 0);
51 }
52 
53 ////////////////////////////////////////////////////////////////////
54 // Function: GeomTransformer::SourceTexCoords::Ordering Operator
55 // Access: Public
56 // Description:
57 ////////////////////////////////////////////////////////////////////
58 INLINE bool GeomTransformer::SourceTexCoords::
59 operator < (const GeomTransformer::SourceTexCoords &other) const {
60  if (_vertex_data != other._vertex_data) {
61  return _vertex_data < other._vertex_data;
62  }
63  if (_from != other._from) {
64  return _from < other._from;
65  }
66  if (_to != other._to) {
67  return _to < other._to;
68  }
69  return (_mat.compare_to(other._mat) < 0);
70 }
71 
72 ////////////////////////////////////////////////////////////////////
73 // Function: GeomTransformer::SourceColors::Ordering Operator
74 // Access: Public
75 // Description:
76 ////////////////////////////////////////////////////////////////////
77 INLINE bool GeomTransformer::SourceColors::
78 operator < (const GeomTransformer::SourceColors &other) const {
79  if (_vertex_data != other._vertex_data) {
80  return _vertex_data < other._vertex_data;
81  }
82  return (_color.compare_to(other._color) < 0);
83 }
84 
85 ////////////////////////////////////////////////////////////////////
86 // Function: GeomTransformer::SourceTextureColors::Ordering Operator
87 // Access: Public
88 // Description:
89 ////////////////////////////////////////////////////////////////////
90 INLINE bool GeomTransformer::SourceTextureColors::
91 operator < (const GeomTransformer::SourceTextureColors &other) const {
92  if (_vertex_data != other._vertex_data) {
93  return _vertex_data < other._vertex_data;
94  }
95  if (_tex != other._tex) {
96  return _tex < other._tex;
97  }
98  if (_ts != other._ts) {
99  return _ts < other._ts;
100  }
101  if (_tma != other._tma) {
102  return _tma < other._tma;
103  }
104  if (_keep_vertex_color != other._keep_vertex_color) {
105  return (int)_keep_vertex_color < (int)other._keep_vertex_color;
106  }
107  return (_base_color.compare_to(other._base_color) < 0);
108 }
109 
110 ////////////////////////////////////////////////////////////////////
111 // Function: GeomTransformer::SourceFormat::Ordering Operator
112 // Access: Public
113 // Description:
114 ////////////////////////////////////////////////////////////////////
115 INLINE bool GeomTransformer::SourceFormat::
116 operator < (const GeomTransformer::SourceFormat &other) const {
117  if (_format != other._format) {
118  return _format < other._format;
119  }
120  return _vertex_data < other._vertex_data;
121 }
122 
123 ////////////////////////////////////////////////////////////////////
124 // Function: GeomTransformer::NewCollectedKey::Ordering Operator
125 // Access: Public
126 // Description:
127 ////////////////////////////////////////////////////////////////////
128 INLINE bool GeomTransformer::NewCollectedKey::
129 operator < (const GeomTransformer::NewCollectedKey &other) const {
130  if (_format != other._format) {
131  return _format < other._format;
132  }
133  if (_usage_hint != other._usage_hint) {
134  return (int)_usage_hint < (int)other._usage_hint;
135  }
136  if (_animation_type != other._animation_type) {
137  return (int)_animation_type < (int)other._animation_type;
138  }
139  return _name < other._name;
140 }
141 
142 ////////////////////////////////////////////////////////////////////
143 // Function: GeomTransformer::VertexDataAssoc::Constructor
144 // Access: Public
145 // Description:
146 ////////////////////////////////////////////////////////////////////
147 INLINE GeomTransformer::VertexDataAssoc::
148 VertexDataAssoc() {
149  _might_have_unused = false;
150 }
151 
152 
void set_max_collect_vertices(int max_collect_vertices)
Specifies the maximum number of vertices that may be put into a single GeomVertexData as a result of ...
int get_max_collect_vertices() const
Returns the maximum number of vertices that may be put into a single GeomVertexData as a result of co...