neuray API Programmer's Manual

mi::neuraylib::ICurve_segment Class Reference

[Leaf nodes]

Description

A curve segment used by freeform surfaces. Curve segments are similar to surfaces, except that they are only 1-dimensional. A sequence of curve segments forms a curve which can be used to trim the surface. Note that the control points of a curve segment are not defined in 3D space, but in the UV parameter space of the surface.

See the documentation of mi::neuraylib::ISurface for the general concepts of basis, patches, control points and weights.

See also:

mi::neuraylib::ICurve

Methods related to the basis

virtual Basis_type get_basis_type() const =0
Returns the basis type.
virtual Uint32 get_degree() const =0
Returns the basis degree. More...
virtual Sint32 set_basis_type( Basis_type type) =0
Sets the basis type. More...
virtual Sint32 set_degree( Uint32 degree) =0
Sets the basis degree. More...

Methods related to the patches

virtual Uint32 get_patches_size() const =0
Returns the number of patches. More...
virtual Sint32 set_patches_size( Uint32 count) =0
Sets the number of patches. More...

Methods related to the parameter vector

virtual Float64 get_parameter( Uint32 index) const =0
Returns a parameter. More...
virtual Uint32 get_parameters_size() const =0
Returns the size of the parameter vector. More...
virtual Sint32 set_parameter( Uint32 index, Float64 value) =0
Sets a parameter. More...

Methods related to control points and weights

virtual Sint32 get_control_point( Uint32 index, Float32_2_struct& p) const =0
Returns a control point. More...
virtual Sint32 get_control_point( Uint32 index, Float64_2_struct& p) const =0
Returns a control point. More...
virtual Uint32 get_control_points_size() const =0
Returns the number of control points. More...
virtual bool  get_rational() const =0
Returns the rational flag. More...
virtual Sint32 get_weight( Uint32 index, Float32& weight) const =0
Returns a weight. More...
virtual Sint32 get_weight( Uint32 index, Float64& weight) const =0
Returns a weight. More...
virtual Sint32 set_control_point( Uint32 index, Float32_2_struct p) =0
Sets a control point. More...
virtual Sint32 set_control_point( Uint32 index, Float64_2_struct p) =0
Sets a control point. More...
virtual void set_rational( bool rational) =0
Sets the rational flag. More...
virtual Sint32 set_weight( Uint32 index, Float32 weight) =0
Sets a weight. More...
virtual Sint32 set_weight( Uint32 index, Float64 weight) =0
Sets a weight. More...

Methods related to the range

virtual void get_range( Float64& range_min, Float64& range_max) const =0
Returns the parameter range. More...
virtual Sint32 set_range( Float64 range_min, Float64 range_max) =0
Sets the parameter range. More...

Member Functions

virtual Basis_type mi::​neuraylib::​ICurve_segment::get_basis_type() const [pure virtual]

Returns the basis type.

virtual Sint32 mi::​neuraylib::​ICurve_segment::get_control_point( Uint32 index, Float32_2_struct& p) const [pure virtual]

Returns a control point.

Parameters

index
The index of the control point.
p
The current value of the control point.

Returns

  • 0: Success.
  • -1: index is out of bounds.
virtual Sint32 mi::​neuraylib::​ICurve_segment::get_control_point( Uint32 index, Float64_2_struct& p) const [pure virtual]

Returns a control point.

Parameters

index
The index of the control point.
p
The current value of the control point.

Returns

  • 0: Success.
  • -1: index is out of bounds.
virtual Uint32 mi::​neuraylib::​ICurve_segment::get_control_points_size() 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.

Returns

The number of control points, or 0 in case of an invalid dimension.

virtual Uint32 mi::​neuraylib::​ICurve_segment::get_degree() const [pure virtual]

Returns the basis degree.

Returns

The basis degree.

virtual Float64 mi::​neuraylib::​ICurve_segment::get_parameter( Uint32 index) const [pure virtual]

Returns a parameter.

Parameters

index
The index of the requested parameter.

Returns

The parameter, or 0.0f in case of invalid index.

virtual Uint32 mi::​neuraylib::​ICurve_segment::get_parameters_size() 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.

Returns

The number of parameters.

virtual Uint32 mi::​neuraylib::​ICurve_segment::get_patches_size() const [pure virtual]

Returns the number of patches.

Returns

The number of patches.

virtual void mi::​neuraylib::​ICurve_segment::get_range( Float64& range_min, Float64& range_max) const [pure virtual]

Returns the parameter range.

Parameters

range_min
The lower bound of the parameter range.
range_max
The upper bound of the parameter range.
virtual bool mi::​neuraylib::​ICurve_segment::get_rational() const [pure virtual]

Returns the rational flag. The rational flag indicates whether the weights are taken into account.

virtual Sint32 mi::​neuraylib::​ICurve_segment::get_weight( Uint32 index, Float32& weight) const [pure virtual]

Returns a weight.

Parameters

index
The index of the weight.
weight
The current value of the weight.

Returns

  • 0: Success.
  • -1: index is out of bounds.
virtual Sint32 mi::​neuraylib::​ICurve_segment::get_weight( Uint32 index, Float64& weight) const [pure virtual]

Returns a weight.

Parameters

index
The index of the weight.
weight
The current value of the weight.

Returns

  • 0: Success.
  • -1: index is out of bounds.
virtual Sint32 mi::​neuraylib::​ICurve_segment::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

type
The desired basis type.

Returns

  • 0: Success.
  • -1: Invalid basis type.
virtual Sint32 mi::​neuraylib::​ICurve_segment::set_control_point( Uint32 index, Float32_2_struct p) [pure virtual]

Sets a control point.

Parameters

index
The index of the control point.
p
The new value of the control point.

Returns

  • 0: Success.
  • -1: index is out of bounds.
virtual Sint32 mi::​neuraylib::​ICurve_segment::set_control_point( Uint32 index, Float64_2_struct p) [pure virtual]

Sets a control point.

Parameters

index
The index of the control point.
p
The new value of the control point.

Returns

  • 0: Success.
  • -1: index_u or index_v is out of bounds.
virtual Sint32 mi::​neuraylib::​ICurve_segment::set_degree( Uint32 degree) [pure virtual]

Sets the basis degree.

Note:

This method resets the parameter vector, and all control points and weights.

Parameters

degree
The desired basis degree.

Returns

  • 0: Success.
  • -1: Invalid degree (zero).
virtual Sint32 mi::​neuraylib::​ICurve_segment::set_parameter( Uint32 index, Float64 value) [pure virtual]

Sets a parameter.

Parameters

index
The index of the parameter to update.
value
The new value of the parameter.

Returns

  • 0: Success.
  • -1: index is out of bounds.
virtual Sint32 mi::​neuraylib::​ICurve_segment::set_patches_size( Uint32 count) [pure virtual]

Sets the number of patches.

Note:

This method resets the parameter vector, and all control points and weights.

Parameters

count
The desired number of patches.

Returns

  • 0: Success.
  • -1: Invalid count (zero).
virtual Sint32 mi::​neuraylib::​ICurve_segment::set_range( Float64 range_min, Float64 range_max) [pure virtual]

Sets the parameter range.

Parameters

range_min
The lower bound of the parameter range.
range_max
The upper bound of the parameter range.

Returns

  • 0: Success.
  • -1: range_min is larger than range_max.
virtual void mi::​neuraylib::​ICurve_segment::set_rational( bool rational) [pure virtual]

Sets the rational flag.

Parameters

rational
Indicates whether weights should be used (rational curves) or not (non-rational curves). If false, all weights are removed. If true, all weights are set to 1.0f (if they did not already exist).
virtual Sint32 mi::​neuraylib::​ICurve_segment::set_weight( Uint32 index, Float32 weight) [pure virtual]

Sets a weight.

Note:

This method implicitly calls set_rational() with true as argument.

Parameters

index
The index of the weight.
weight
The new value of the weight.

Returns

  • 0: Success.
  • -1: index is out of bounds.
  • -2: weight has an invalid value (0.0f).
virtual Sint32 mi::​neuraylib::​ICurve_segment::set_weight( Uint32 index, Float64 weight) [pure virtual]

Sets a weight.

Note:

This method implicitly calls set_rational() with true as argument.

Parameters

index
The index of the weight.
weight
The new value of the weight.

Returns

  • 0: Success.
  • -1: index is out of bounds.
  • -2: weight has an invalid value (0.0f).