Panda3D
|
A reference to an EggNurbsSurface in the egg file, and its parameters as set by the user input file and as computed in relation to the other surfaces. More...
#include "qtessSurface.h"
Public Member Functions | |
QtessSurface (EggNurbsSurface *egg_surface) | |
double | count_patches () const |
Returns the number of patches the NURBS contains. | |
int | count_tris () const |
Returns the number of triangles that will be generated by the current tesselation parameters. | |
const string & | get_name () const |
double | get_score (double ratio) |
Computes the curvature/stretch score for the surface, if it has not been already computed, and returns the net surface score. | |
bool | is_valid () const |
Returns true if the defined surface is valid, false otherwise. | |
void | omit () |
Sets up the surface to omit itself from the output. | |
void | set_importance (double importance2) |
Sets the importance of the surface, as a ratio in proportion to the square of its size. | |
void | set_match_u (QtessSurface **match_u, bool match_u_to_u) |
Indicates the surface to which this surface must match in its U direction. | |
void | set_match_v (QtessSurface **match_v, bool match_v_to_v) |
Indicates the surface to which this surface must match in its V direction. | |
void | set_min_u (int min_u) |
Specifies the absolute minimum number of segments allowed in the U direction. | |
void | set_min_v (int min_v) |
Specifies the absolute minimum number of segments allowed in the V direction. | |
int | tesselate () |
Applies the appropriate tesselation to the surface, and replaces its node in the tree with an EggGroup containing both the new vertex pool and all of the polygons. | |
void | tesselate_auto (int u, int v, double ratio) |
Sets the surface up to tesselate itself by automatically determining the best place to put the indicated u x v isoparams. | |
void | tesselate_per_isoparam (double pi, bool autoplace, double ratio) |
Sets the surface up to tesselate itself to a uniform amount per isoparam. | |
void | tesselate_per_score (double pi, bool autoplace, double ratio) |
Sets the surface up to tesselate itself according to its computed curvature score in both dimensions. | |
void | tesselate_specific (const pvector< double > &u_list, const pvector< double > &v_list) |
Sets the surface up to tesselate itself at specific isoparams only. | |
void | tesselate_uv (int u, int v, bool autoplace, double ratio) |
Sets the surface up to tesselate itself uniformly at u x v, or if autoplace is true, automatically with u x v quads. | |
int | write_qtess_parameter (ostream &out) |
Writes a line to the given output file telling qtess how this surface should be tesselated uniformly. |
A reference to an EggNurbsSurface in the egg file, and its parameters as set by the user input file and as computed in relation to the other surfaces.
Definition at line 34 of file qtessSurface.h.
double QtessSurface::count_patches | ( | ) | const [inline] |
Returns the number of patches the NURBS contains.
Each patch is a square area bounded by isoparams. This actually scales by the importance of the surface, if it is not 1.
Definition at line 121 of file qtessSurface.I.
Referenced by QtessInputEntry::match().
int QtessSurface::count_tris | ( | ) | const [inline] |
Returns the number of triangles that will be generated by the current tesselation parameters.
Definition at line 132 of file qtessSurface.I.
Referenced by QtessInputEntry::count_tris(), and write_qtess_parameter().
double QtessSurface::get_score | ( | double | ratio | ) |
Computes the curvature/stretch score for the surface, if it has not been already computed, and returns the net surface score.
This is used both for automatically distributing isoparams among the surfaces by curvature, as well as for automatically placing the isoparams within each surface by curvature.
Definition at line 95 of file qtessSurface.cxx.
Referenced by QtessInputEntry::match(), tesselate_auto(), and tesselate_per_score().
bool QtessSurface::is_valid | ( | ) | const [inline] |
Returns true if the defined surface is valid, false otherwise.
Definition at line 33 of file qtessSurface.I.
void QtessSurface::omit | ( | ) |
Sets up the surface to omit itself from the output.
Definition at line 175 of file qtessSurface.cxx.
Referenced by QtessInputEntry::count_tris(), tesselate_auto(), tesselate_per_isoparam(), and tesselate_per_score().
void QtessSurface::set_importance | ( | double | importance2 | ) | [inline] |
Sets the importance of the surface, as a ratio in proportion to the square of its size.
Definition at line 44 of file qtessSurface.I.
Referenced by QtessInputEntry::match().
void QtessSurface::set_match_u | ( | QtessSurface ** | match_u, |
bool | match_u_to_u | ||
) | [inline] |
Indicates the surface to which this surface must match in its U direction.
If u_to_u is true, it matches to the other surface's U direction; otherwise, it matches to the other surface's V direction.
Note that the surface pointer is an indirect pointer. The value passed in is the address of the pointer to the actual surface (which may or may not be filled in yet). The actual pointer may be filled in later.
Definition at line 64 of file qtessSurface.I.
Referenced by QtessInputEntry::match().
void QtessSurface::set_match_v | ( | QtessSurface ** | match_v, |
bool | match_v_to_v | ||
) | [inline] |
Indicates the surface to which this surface must match in its V direction.
If v_to_v is true, it matches to the other surface's V direction; otherwise, it matches to the other surface's U direction.
Note that the surface pointer is an indirect pointer. The value passed in is the address of the pointer to the actual surface (which may or may not be filled in yet). The actual pointer may be filled in later.
Definition at line 84 of file qtessSurface.I.
Referenced by QtessInputEntry::match().
void QtessSurface::set_min_u | ( | int | min_u | ) | [inline] |
Specifies the absolute minimum number of segments allowed in the U direction.
Definition at line 96 of file qtessSurface.I.
Referenced by QtessInputEntry::match().
void QtessSurface::set_min_v | ( | int | min_v | ) | [inline] |
Specifies the absolute minimum number of segments allowed in the V direction.
Definition at line 107 of file qtessSurface.I.
Referenced by QtessInputEntry::match().
int QtessSurface::tesselate | ( | ) |
Applies the appropriate tesselation to the surface, and replaces its node in the tree with an EggGroup containing both the new vertex pool and all of the polygons.
Definition at line 122 of file qtessSurface.cxx.
References EggGroupNode::add_child().
void QtessSurface::tesselate_auto | ( | int | u, |
int | v, | ||
double | ratio | ||
) |
Sets the surface up to tesselate itself by automatically determining the best place to put the indicated u x v isoparams.
Definition at line 266 of file qtessSurface.cxx.
References get_score(), and omit().
Referenced by tesselate_per_isoparam(), tesselate_per_score(), and tesselate_uv().
void QtessSurface::tesselate_per_isoparam | ( | double | pi, |
bool | autoplace, | ||
double | ratio | ||
) |
Sets the surface up to tesselate itself to a uniform amount per isoparam.
Definition at line 220 of file qtessSurface.cxx.
References omit(), and tesselate_auto().
Referenced by QtessInputEntry::count_tris().
void QtessSurface::tesselate_per_score | ( | double | pi, |
bool | autoplace, | ||
double | ratio | ||
) |
Sets the surface up to tesselate itself according to its computed curvature score in both dimensions.
Definition at line 243 of file qtessSurface.cxx.
References get_score(), omit(), and tesselate_auto().
Referenced by QtessInputEntry::count_tris().
void QtessSurface::tesselate_specific | ( | const pvector< double > & | u_list, |
const pvector< double > & | v_list | ||
) |
Sets the surface up to tesselate itself at specific isoparams only.
Definition at line 205 of file qtessSurface.cxx.
Referenced by QtessInputEntry::count_tris().
void QtessSurface::tesselate_uv | ( | int | u, |
int | v, | ||
bool | autoplace, | ||
double | ratio | ||
) |
Sets the surface up to tesselate itself uniformly at u x v, or if autoplace is true, automatically with u x v quads.
Definition at line 188 of file qtessSurface.cxx.
References tesselate_auto().
Referenced by QtessInputEntry::count_tris().
int QtessSurface::write_qtess_parameter | ( | ostream & | out | ) |
Writes a line to the given output file telling qtess how this surface should be tesselated uniformly.
Returns the number of tris.
Definition at line 149 of file qtessSurface.cxx.
References count_tris(), and QtessInputEntry::output_extra().