00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "builderProperties.h"
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 bool BuilderProperties::
00032 operator < (const BuilderProperties &other) const {
00033 int sv1 = sort_value();
00034 int sv2 = other.sort_value();
00035
00036 if (sv1 != sv2) {
00037 return sv1 < sv2;
00038 }
00039
00040 if (_coplanar_threshold != other._coplanar_threshold) {
00041 return _coplanar_threshold < other._coplanar_threshold;
00042 }
00043
00044 if (_max_tfan_angle != other._max_tfan_angle) {
00045 return _max_tfan_angle < other._max_tfan_angle;
00046 }
00047
00048 if (_min_tfan_tris != other._min_tfan_tris) {
00049 return _min_tfan_tris < other._min_tfan_tris;
00050 }
00051
00052 if (_show_normals) {
00053 if (_normal_scale != other._normal_scale) {
00054 return _normal_scale < other._normal_scale;
00055 }
00056 if (_normal_color != other._normal_color) {
00057 return _normal_color < other._normal_color;
00058 }
00059 }
00060
00061 return false;
00062 }
00063
00064
00065
00066
00067
00068
00069
00070 void BuilderProperties::
00071 output(ostream &out) const {
00072 if (_mesh) {
00073 out << "T-Mesh using Mesher\n";
00074
00075 if (_show_tstrips) {
00076 out << "Color individual tristrips\n";
00077 } else if (_show_qsheets) {
00078 out << "Color individual quadsheets\n";
00079 } else if (_show_quads) {
00080 out << "Color individual quads\n";
00081 }
00082 if (_retesselate_coplanar) {
00083 out << "Retesselate coplanar triangles when needed; threshold = "
00084 << _coplanar_threshold << "\n";
00085 }
00086 }
00087 if (_subdivide_polys) {
00088 out << "Subdivide polygons into tris.\n";
00089 }
00090 if (_consider_fans) {
00091 out << "Look for possible triangle fans with max per-triangle angle of "
00092 << _max_tfan_angle << " degrees.\n";
00093 if (_min_tfan_tris==0) {
00094 out << "Do not create tfans";
00095 } else {
00096 out << "Do not create tfans smaller than " << _min_tfan_tris << " tris";
00097 }
00098 if (_unroll_fans) {
00099 out << "; retesselate to tstrips.\n";
00100 } else {
00101 out << ".\n";
00102 }
00103 }
00104 }
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 int BuilderProperties::
00117 sort_value() const {
00118 return
00119 ((_mesh!=0) << 8) |
00120 ((_show_tstrips!=0) << 7) |
00121 ((_show_qsheets!=0) << 6) |
00122 ((_show_quads!=0) << 5) |
00123 ((_show_normals!=0) << 4) |
00124 ((_retesselate_coplanar!=0) << 3) |
00125 ((_unroll_fans!=0) << 2) |
00126 ((_subdivide_polys!=0) << 1) |
00127 ((_consider_fans!=0) << 0);
00128 }