Iray SDK API nvidia_logo_transpbg.gif Up
mi::neuraylib::ISurface Class Referenceabstract

A surface of a freeform surface. More...

#include <ifreeform_surface.h>

Inheritance diagram for mi::neuraylib::ISurface:

Public Member Functions

Methods related to bases
virtual Sint32 set_basis_type (Basis_type type)=0
 Sets the basis type. More...
 
virtual Basis_type get_basis_type () const =0
 Returns the basis type. More...
 
virtual Sint32 set_degree (Parameter_space_dimension dim, Uint32 degree)=0
 Sets the basis degree. More...
 
virtual Uint32 get_degree (Parameter_space_dimension dim) const =0
 Returns the basis degree. More...
 
Methods related to the patches
virtual Sint32 set_patches_size (Parameter_space_dimension dim, Uint32 count)=0
 Sets the number of patches. More...
 
virtual Uint32 get_patches_size (Parameter_space_dimension dim) const =0
 Returns the number of patches. More...
 
Methods related to the parameter vector
virtual Uint32 get_parameters_size (Parameter_space_dimension dim) const =0
 Returns the size of the parameter vector. More...
 
virtual Sint32 set_parameter (Parameter_space_dimension dim, Uint32 index, Float64 value)=0
 Sets a parameter. More...
 
virtual Float64 get_parameter (Parameter_space_dimension dim, Uint32 index) const =0
 Returns a parameter. More...
 
Methods related to control points and weights
virtual Uint32 get_control_points_size (Parameter_space_dimension dim) const =0
 Returns the number of control points. More...
 
virtual Sint32 set_control_point (Uint32 index_u, Uint32 index_v, Float32_3_struct p)=0
 Sets a control point. More...
 
virtual Sint32 get_control_point (Uint32 index_u, Uint32 index_v, Float32_3_struct &p) const =0
 Returns a control point. More...
 
virtual Sint32 set_control_point (Uint32 index_u, Uint32 index_v, Float64_3_struct p)=0
 Sets a control point. More...
 
virtual Sint32 get_control_point (Uint32 index_u, Uint32 index_v, Float64_3_struct &p) const =0
 Returns a control point. More...
 
virtual Sint32 set_weight (Uint32 index_u, Uint32 index_v, Float32 weight)=0
 Sets a weight. More...
 
virtual Sint32 get_weight (Uint32 index_u, Uint32 index_v, Float32 &weight) const =0
 Returns a weight. More...
 
virtual Sint32 set_weight (Uint32 index_u, Uint32 index_v, Float64 weight)=0
 Sets a weight. More...
 
virtual Sint32 get_weight (Uint32 index_u, Uint32 index_v, Float64 &weight) const =0
 Returns a weight. More...
 
virtual void set_rational (bool rational)=0
 Sets the rational flag. More...
 
virtual bool get_rational () const =0
 Returns the rational flag. More...
 
Methods related to ranges
virtual Sint32 set_range (Parameter_space_dimension dim, Float64 range_min, Float64 range_max)=0
 Sets the parameter range. More...
 
virtual Sint32 get_range (Parameter_space_dimension dim, Float64 &range_min, Float64 &range_max) const =0
 Returns the parameter range. More...
 
Methods related to curves
virtual Uint32 curves_size () const =0
 Returns the number of curves. More...
 
virtual ICurveadd_curve ()=0
 Adds and returns a new curve. More...
 
virtual const ICurveaccess_curve (Curve_handle_struct c) const =0
 Returns a curve (const). More...
 
virtual ICurveedit_curve (Curve_handle_struct c)=0
 Returns a curve (mutable). More...
 
virtual Sint32 remove_curve (Curve_handle_struct c)=0
 Removes a curve. More...
 
Methods related to texture surfaces
virtual Uint32 texture_surfaces_size () const =0
 Returns the number of texture surfaces. More...
 
virtual ITexture_surfaceadd_texture_surface ()=0
 Adds and returns a new texture surface. More...
 
virtual const ITexture_surfaceaccess_texture_surface (Texture_surface_handle_struct t) const =0
 Returns a texture surface (const). More...
 
virtual ITexture_surfaceedit_texture_surface (Texture_surface_handle_struct t) const =0
 Returns a texture surface (mutable). More...
 
virtual Sint32 remove_texture_surface (Texture_surface_handle_struct t)=0
 Removes a texture surface. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x8bc55fb4, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x8bc55fb4, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

A surface of a freeform surface.

Surfaces are defined by their basis type, degree (in U and V direction), number of patches (in U and V direction), the parameter vector (in U and V direction), and the 2-dimensional grid of control points. In case of rational surfaces, an additional weight is associated with each control point.

Two basis types are currently supported: Bezier and B-Spline.

Note the distinction between surfaces and patches. A patch is the smallest unit that can be described with a given basis. For example, a patch for a cubic Bezier bases has 4 x 4 control points. A surface consists of one or more patches. Neighboring patches share control points. For example, a patch in a B-Spline surface of degrees d in a given parameter space dimension shares its last d control points with the next patch in that dimension.

The degree, the number of patches, the length of the parameter vector, and the number of control points in a given parameter space dimension are related as follows:

Bezier basis B-Spline basis
#parameters #patches + 1 #patches + 2*degree + 1
#control points #patches * degree + 1 #patches + degree

The degree and the number of patches can be explicitly controlled (see set_degree() and set_patches_size()). The numbers of parameters and controls points are automatically computed based on the degree and the number of patches.

Furthermore, surfaces can be trimmed by parametric curves (see mi::neuraylib::ICurve). Texture surfaces can be attached to specify how surface vertices are mapped to texture coordinates (see mi::neuraylib::ITexture_surface).

Curves and texture surfaces are stored with consecutive indices, starting with the index 0. For type safety, indices of curves and textures surfaces are represented using mi::neuraylib::Curve_handle and mi::neuraylib::Texture_surface_handle instead of plain integers.

See also
mi::neuraylib::IFreeform_surface
mi::neuraylib::ICurve
mi::neuraylib::ITexture_surface
mi::neuraylib::Parameter_space_dimension
mi::neuraylib::Basis_type

Member Function Documentation

 access_curve()

virtual const ICurve * mi::neuraylib::ISurface::access_curve ( Curve_handle_struct  c) const
pure virtual

Returns a curve (const).

 access_texture_surface()

virtual const ITexture_surface * mi::neuraylib::ISurface::access_texture_surface ( Texture_surface_handle_struct  t) const
pure virtual

Returns a texture surface (const).

 add_curve()

virtual ICurve * mi::neuraylib::ISurface::add_curve ( )
pure virtual

Adds and returns a new curve.

 add_texture_surface()

virtual ITexture_surface * mi::neuraylib::ISurface::add_texture_surface ( )
pure virtual

Adds and returns a new texture surface.

 curves_size()

virtual Uint32 mi::neuraylib::ISurface::curves_size ( ) const
pure virtual

Returns the number of curves.

 edit_curve()

virtual ICurve * mi::neuraylib::ISurface::edit_curve ( Curve_handle_struct  c)
pure virtual

Returns a curve (mutable).

 edit_texture_surface()

virtual ITexture_surface * mi::neuraylib::ISurface::edit_texture_surface ( Texture_surface_handle_struct  t) const
pure virtual

Returns a texture surface (mutable).

 get_basis_type()

virtual Basis_type mi::neuraylib::ISurface::get_basis_type ( ) const
pure virtual

Returns the basis type.

 get_control_point() [1/2]

virtual Sint32 mi::neuraylib::ISurface::get_control_point ( Uint32  index_u,
Uint32  index_v,
Float32_3_struct p 
) const
pure virtual

Returns a control point.

Parameters
index_uThe index of the control point in u-direction.
index_vThe index of the control point in v-direction.
pThe current value of the control point.
Returns
  • 0: Success.
  • -1: index_u or index_v is out of bounds.

 get_control_point() [2/2]

virtual Sint32 mi::neuraylib::ISurface::get_control_point ( Uint32  index_u,
Uint32  index_v,
Float64_3_struct p 
) const
pure virtual

Returns a control point.

Parameters
index_uThe index of the control point in u-direction.
index_vThe index of the control point in v-direction.
pThe current value of the control point.
Returns
  • 0: Success.
  • -1: index_u or index_v is out of bounds.

 get_control_points_size()

virtual Uint32 mi::neuraylib::ISurface::get_control_points_size ( Parameter_space_dimension  dim) const
pure virtual

Returns the number of control points.

Note
The number of control points is determined by the basis degree and the number of patches.
Parameters
dimThe affected dimension.
Returns
The number of control points, or 0 in case of an invalid dimension.

 get_degree()

virtual Uint32 mi::neuraylib::ISurface::get_degree ( Parameter_space_dimension  dim) const
pure virtual

Returns the basis degree.

Parameters
dimThe affected dimension.
Returns
The basis degree, or 0 in case of an invalid dimension.

 get_parameter()

virtual Float64 mi::neuraylib::ISurface::get_parameter ( Parameter_space_dimension  dim,
Uint32  index 
) const
pure virtual

Returns a parameter.

Parameters
dimThe affected dimension.
indexThe index of the requested parameter.
Returns
The parameter, or 0.0f in case of invalid dimension or index.

 get_parameters_size()

virtual Uint32 mi::neuraylib::ISurface::get_parameters_size ( Parameter_space_dimension  dim) const
pure virtual

Returns the size of the parameter vector.

Note
The size of the parameter vector is determined by the basis degree and the number of patches.
Parameters
dimThe affected dimension.
Returns
The number of parameters, or 0 in case of an invalid dimension.

 get_patches_size()

virtual Uint32 mi::neuraylib::ISurface::get_patches_size ( Parameter_space_dimension  dim) const
pure virtual

Returns the number of patches.

Parameters
dimThe affected dimension.
Returns
The number of patches, or 0 in case of an invalid dimension.

 get_range()

virtual Sint32 mi::neuraylib::ISurface::get_range ( Parameter_space_dimension  dim,
Float64 range_min,
Float64 range_max 
) const
pure virtual

Returns the parameter range.

The parameter range basically is a trimming curve of rectangular shape in the parameter space.

Parameters
dimThe affected dimension.
range_minThe lower bound of the parameter range.
range_maxThe upper bound of the parameter range.
Returns
  • 0: Success.
  • -1: Invalid dimension.

 get_rational()

virtual bool mi::neuraylib::ISurface::get_rational ( ) const
pure virtual

Returns the rational flag.

 get_weight() [1/2]

virtual Sint32 mi::neuraylib::ISurface::get_weight ( Uint32  index_u,
Uint32  index_v,
Float32 weight 
) const
pure virtual

Returns a weight.

Parameters
index_uThe index of the weight in u-direction.
index_vThe index of the weight in v-direction.
weightThe current value of the weight.
Returns
  • 0: Success.
  • -1: index_u or index_v is out of bounds.

 get_weight() [2/2]

virtual Sint32 mi::neuraylib::ISurface::get_weight ( Uint32  index_u,
Uint32  index_v,
Float64 weight 
) const
pure virtual

Returns a weight.

Parameters
index_uThe index of the weight in u-direction.
index_vThe index of the weight in v-direction.
weightThe current value of the weight.
Returns
  • 0: Success.
  • -1: index_u or index_v is out of bounds.

 remove_curve()

virtual Sint32 mi::neuraylib::ISurface::remove_curve ( Curve_handle_struct  c)
pure virtual

Removes a curve.

Note that the curve IDs of the following curves are decreased by 1.

 remove_texture_surface()

virtual Sint32 mi::neuraylib::ISurface::remove_texture_surface ( Texture_surface_handle_struct  t)
pure virtual

Removes a texture surface.

Note that the texture surface IDs of the following texture surfaces are decreased by 1.

 set_basis_type()

virtual Sint32 mi::neuraylib::ISurface::set_basis_type ( Basis_type  type)
pure virtual

Sets the basis type.

Note
This method resets the parameter vector, and all control points and weights.
Parameters
typeThe desired basis type.
Returns
  • 0: Success.
  • -1: Invalid basis type.

 set_control_point() [1/2]

virtual Sint32 mi::neuraylib::ISurface::set_control_point ( Uint32  index_u,
Uint32  index_v,
Float32_3_struct  p 
)
pure virtual

Sets a control point.

Parameters
index_uThe index of the control point in u-direction.
index_vThe index of the control point in v-direction.
pThe new value of the control point.
Returns
  • 0: Success.
  • -1: index_u or index_v is out of bounds.

 set_control_point() [2/2]

virtual Sint32 mi::neuraylib::ISurface::set_control_point ( Uint32  index_u,
Uint32  index_v,
Float64_3_struct  p 
)
pure virtual

Sets a control point.

Parameters
index_uThe index of the control point in u-direction.
index_vThe index of the control point in v-direction.
pThe new value of the control point.
Returns
  • 0: Success.
  • -1: index_u or index_v is out of bounds.

 set_degree()

virtual Sint32 mi::neuraylib::ISurface::set_degree ( Parameter_space_dimension  dim,
Uint32  degree 
)
pure virtual

Sets the basis degree.

Note
This method resets the parameter vector, and all control points and weights.
Parameters
dimThe affected dimension.
degreeThe desired basis degree.
Returns
  • 0: Success.
  • -1: Invalid dimension.
  • -2: Invalid degree (zero).

 set_parameter()

virtual Sint32 mi::neuraylib::ISurface::set_parameter ( Parameter_space_dimension  dim,
Uint32  index,
Float64  value 
)
pure virtual

Sets a parameter.

Parameters
dimThe affected dimension.
indexThe index of the parameter to update.
valueThe new value of the parameter.
Returns
  • 0: Success.
  • -1: Invalid dimension.
  • -2: index is out of bounds.

 set_patches_size()

virtual Sint32 mi::neuraylib::ISurface::set_patches_size ( Parameter_space_dimension  dim,
Uint32  count 
)
pure virtual

Sets the number of patches.

Note
This method resets the parameter vector, and all control points and weights.
Parameters
dimThe affected dimension.
countThe desired number of patches.
Returns
  • 0: Success.
  • -1: Invalid dimension.
  • -2: Invalid count (zero).

 set_range()

virtual Sint32 mi::neuraylib::ISurface::set_range ( Parameter_space_dimension  dim,
Float64  range_min,
Float64  range_max 
)
pure virtual

Sets the parameter range.

The parameter range basically is a trimming curve of rectangular shape in the parameter space.

Parameters
dimThe affected dimension.
range_minThe lower bound of the parameter range.
range_maxThe upper bound of the parameter range.
Returns
  • 0: Success.
  • -1: Invalid dimension.
  • -2: range_min is larger than range_max.

 set_rational()

virtual void mi::neuraylib::ISurface::set_rational ( bool  rational)
pure virtual

Sets the rational flag.

Parameters
rationalIndicates whether weights should be used (rational surfaces) or not (non-rational surfaces). If false, all weights are removed. If true, all weights are set to 1.0f (if they did not already exist).

 set_weight() [1/2]

virtual Sint32 mi::neuraylib::ISurface::set_weight ( Uint32  index_u,
Uint32  index_v,
Float32  weight 
)
pure virtual

Sets a weight.

Note
This method implicitly calls set_rational() with true as argument.
Parameters
index_uThe index of the weight in u-direction.
index_vThe index of the weight in v-direction.
weightThe new value of the weight.
Returns
  • 0: Success.
  • -1: index_u or index_v is out of bounds.
  • -2: weight has an invalid value (0.0f).

 set_weight() [2/2]

virtual Sint32 mi::neuraylib::ISurface::set_weight ( Uint32  index_u,
Uint32  index_v,
Float64  weight 
)
pure virtual

Sets a weight.

Note
This method implicitly calls set_rational() with true as argument.
Parameters
index_uThe index of the weight in u-direction.
index_vThe index of the weight in v-direction.
weightThe new value of the weight.
Returns
  • 0: Success.
  • -1: index_u or index_v is out of bounds.
  • -2: weight has an invalid value (0.0f).

 texture_surfaces_size()

virtual Uint32 mi::neuraylib::ISurface::texture_surfaces_size ( ) const
pure virtual

Returns the number of texture surfaces.