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 std::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 (std::ostream &out) |
Writes a line to the given output file telling qtess how this surface should be tesselated uniformly. | |
![]() | |
int | get_ref_count () const |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. | |
void | ref () const |
Explicitly increments the reference count. | |
bool | ref_if_nonzero () const |
Atomically increases the reference count of this object if it is not zero. | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
virtual bool | unref () const |
Explicitly decrements the reference count. | |
bool | unref_if_one () const |
Atomically decreases the reference count of this object if it is one. | |
WeakReferenceList * | weak_ref () |
Adds the indicated PointerToVoid as a weak reference to this object. | |
void | weak_unref () |
Removes the indicated PointerToVoid as a weak reference to this object. | |
![]() | |
void | operator delete (void *, void *) |
void | operator delete (void *ptr) |
void | operator delete[] (void *, void *) |
void | operator delete[] (void *ptr) |
void * | operator new (size_t size) |
void * | operator new (size_t size, void *ptr) |
void * | operator new[] (size_t size) |
void * | operator new[] (size_t size, void *ptr) |
Additional Inherited Members | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
get_ref_count | |
Returns the current reference count. | |
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 32 of file qtessSurface.h.
QtessSurface::QtessSurface | ( | EggNurbsSurface * | egg_surface | ) |
Definition at line 32 of file qtessSurface.cxx.
|
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 94 of file qtessSurface.I.
Referenced by QtessInputEntry::match().
|
inline |
Returns the number of triangles that will be generated by the current tesselation parameters.
Definition at line 103 of file qtessSurface.I.
Referenced by QtessInputEntry::count_tris(), and write_qtess_parameter().
|
inline |
Definition at line 17 of file qtessSurface.I.
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 90 of file qtessSurface.cxx.
Referenced by QtessInputEntry::match(), tesselate_auto(), and tesselate_per_score().
|
inline |
Returns true if the defined surface is valid, false otherwise.
Definition at line 25 of file qtessSurface.I.
void QtessSurface::omit | ( | ) |
Sets up the surface to omit itself from the output.
Definition at line 162 of file qtessSurface.cxx.
Referenced by QtessInputEntry::count_tris(), tesselate_auto(), tesselate_per_isoparam(), and tesselate_per_score().
|
inline |
Sets the importance of the surface, as a ratio in proportion to the square of its size.
Definition at line 34 of file qtessSurface.I.
Referenced by QtessInputEntry::match().
|
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 49 of file qtessSurface.I.
Referenced by QtessInputEntry::match().
|
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 64 of file qtessSurface.I.
Referenced by QtessInputEntry::match().
|
inline |
Specifies the absolute minimum number of segments allowed in the U direction.
Definition at line 74 of file qtessSurface.I.
Referenced by QtessInputEntry::match().
|
inline |
Specifies the absolute minimum number of segments allowed in the V direction.
Definition at line 83 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 114 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 239 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 198 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 219 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 186 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 172 of file qtessSurface.cxx.
References tesselate_auto().
Referenced by QtessInputEntry::count_tris().
int QtessSurface::write_qtess_parameter | ( | std::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 138 of file qtessSurface.cxx.
References count_tris(), and QtessInputEntry::output_extra().