15 #ifndef QTESSSURFACE_H
16 #define QTESSSURFACE_H
18 #include "pandatoolbase.h"
19 #include "isoPlacer.h"
20 #include "eggNurbsSurface.h"
22 #include "eggVertex.h"
23 #include "nurbsSurfaceEvaluator.h"
24 #include "nurbsSurfaceResult.h"
25 #include "referenceCount.h"
26 #include "pointerTo.h"
38 INLINE
const string &get_name()
const;
55 void tesselate_uv(
int u,
int v,
bool autoplace,
double ratio);
63 void record_vertex_extras();
64 INLINE
int get_joint_membership_index(
EggGroup *joint);
65 INLINE
int get_dxyz_index(
const string &morph_name);
66 INLINE
int get_drgba_index(
const string &morph_name);
69 PT(
EggGroup) do_uniform_tesselate(
int &tris)
const;
70 PT(
EggVertex) evaluate_vertex(
double u,
double v)
const;
75 bool _has_vertex_color;
81 typedef map<EggGroup *, int> JointTable;
82 JointTable _joint_table;
83 typedef map<string, int> MorphTable;
84 MorphTable _dxyz_table;
85 MorphTable _drgba_table;
103 bool _match_u_to_u, _match_v_to_v;
115 #include "qtessSurface.I"
double count_patches() const
Returns the number of patches the NURBS contains.
A reference to an EggNurbsSurface in the egg file, and its parameters as set by the user input file a...
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_v(QtessSurface **match_v, bool match_v_to_v)
Indicates the surface to which this surface must match in its V direction.
This class is an abstraction for evaluating NURBS surfaces.
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.
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
Contains the logic used to place isoparams where they'll do the most good on a surface.
void set_min_v(int min_v)
Specifies the absolute minimum number of segments allowed in the V direction.
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal...
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 indica...
The result of a NurbsSurfaceEvaluator.
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.
void set_min_u(int min_u)
Specifies the absolute minimum number of segments allowed in the U direction.
int write_qtess_parameter(ostream &out)
Writes a line to the given output file telling qtess how this surface should be tesselated uniformly...
void omit()
Sets up the surface to omit itself from the output.
bool is_valid() const
Returns true if the defined surface is valid, false otherwise.
void tesselate_specific(const pvector< double > &u_list, const pvector< double > &v_list)
Sets the surface up to tesselate itself at specific isoparams only.
A base class for all things that want to be reference-counted.
int tesselate()
Applies the appropriate tesselation to the surface, and replaces its node in the tree with an EggGrou...
A parametric NURBS surface.
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_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 count_tris() const
Returns the number of triangles that will be generated by the current tesselation parameters...