14#ifndef EGGNURBSSURFACE_H
15#define EGGNURBSSURFACE_H
27class EXPCL_PANDA_EGG EggNurbsSurface :
public EggSurface {
35 INLINE
explicit EggNurbsSurface(
const std::string &name =
"");
36 INLINE EggNurbsSurface(
const EggNurbsSurface ©);
37 INLINE EggNurbsSurface &operator = (
const EggNurbsSurface ©);
39 virtual EggNurbsSurface *
make_copy()
const override;
41 void setup(
int u_order,
int v_order,
42 int num_u_knots,
int num_v_knots);
78 virtual void write(std::ostream &out,
int indent_level)
const override;
81 Curves _curves_on_surface;
85 virtual void r_apply_texmats(EggTextureCollection &textures)
override;
88 typedef vector_double Knots;
99 static void init_type() {
100 EggSurface::init_type();
102 EggSurface::get_class_type());
104 virtual TypeHandle get_type()
const override {
105 return get_class_type();
107 virtual TypeHandle force_init_type()
override {
109 return get_class_type();
113 static TypeHandle _type_handle;
A parametric NURBS curve.
void setup(int u_order, int v_order, int num_u_knots, int num_v_knots)
Prepares a new surface definition with the indicated order and number of knots in each dimension.
void set_num_v_knots(int num)
Directly changes the number of knots in the V direction.
int get_u_order() const
Returns the order of the surface in the U direction.
int get_num_cvs() const
Returns the total number of control vertices that *should* be defined for the surface.
void set_u_order(int u_order)
Directly changes the order in the U direction to the indicated value (which must be an integer in the...
bool is_closed_u() const
Returns true if the surface appears to be closed in the U direction.
bool is_closed_v() const
Returns true if the surface appears to be closed in the V direction.
virtual EggNurbsSurface * make_copy() const override
Makes a copy of this object.
get_num_u_knots
Returns the number of knots in the U direction.
void set_num_u_knots(int num)
Directly changes the number of knots in the U direction.
int get_vertex_index(int ui, int vi) const
Returns the index number within the EggPrimitive's list of the control vertex at position ui,...
int get_v_order() const
Returns the order of the surface in the V direction.
int get_v_degree() const
Returns the degree of the surface in the V direction.
void set_v_order(int v_order)
Directly changes the order in the V direction to the indicated value (which must be an integer in the...
get_v_knot
Returns the nth knot value defined in the V direction.
EggVertex * get_cv(int ui, int vi) const
Returns the control vertex at the indicate U, V position.
bool is_valid() const
Returns true if the NURBS parameters are all internally consistent (e.g.
int get_u_index(int vertex_index) const
Returns the U index number of the given vertex within the EggPrimitive's linear list of vertices.
virtual void write(std::ostream &out, int indent_level) const override
Writes the nurbsSurface to the indicated output stream in Egg format.
int get_num_v_cvs() const
Returns the number of control vertices that should be present in the V direction.
int get_u_degree() const
Returns the degree of the surface in the U direction.
void set_cv(int ui, int vi, EggVertex *vertex)
Redefines the control vertex associated with a particular u, v coordinate pair.
get_u_knot
Returns the nth knot value defined in the U direction.
int get_num_u_cvs() const
Returns the number of control vertices that should be present in the U direction.
void set_u_knot(int k, double value)
Resets the value of the indicated knot as indicated.
get_num_v_knots
Returns the number of knots in the V direction.
int get_v_index(int vertex_index) const
Returns the V index number of the given vertex within the EggPrimitive's linear list of vertices.
void set_v_knot(int k, double value)
Resets the value of the indicated knot as indicated.
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal.
TypeHandle is the identifier used to differentiate C++ class types.
This is our own Panda specialization on the default STL list.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.