Iray SDK API nvidia_logo_transpbg.gif Up
ifreeform_surface.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IFREEFORM_SURFACE_H
8#define MI_NEURAYLIB_IFREEFORM_SURFACE_H
9
14
15namespace mi {
16
17namespace neuraylib {
18
19class ISurface;
20class ICurve;
21class ICurve_segment;
22class ITexture_surface;
23
30{
33
36
37 // Undocumented, for alignment only.
38 BASIS_TYPE_FORCE_32_BIT = 0xffffffffU
39};
40
41mi_static_assert( sizeof( Basis_type) == sizeof( Uint32));
42
45{
48
51
52 // Undocumented, for alignment only.
53 DIMENSION_FORCE_32_BIT = 0xffffffffU
54};
55
57
60{
63
66
67 // Undocumented, for alignment only.
68 CURVE_TYPE_FORCE_32_BIT = 0xffffffffU
69};
70
71mi_static_assert( sizeof( Curve_type) == sizeof( Uint32));
72
97 public base::Interface_declare<0x5b54fda0,0x1034,0x48a2,0x9d,0xd1,0x4d,0x14,0xaa,0xba,0xa2,0xa7,
98 neuraylib::IScene_element>
99{
100public:
101
103
104
106 virtual Uint32 get_surfaces_size() const = 0;
107
111 virtual ISurface* add_surface() = 0;
112
114 virtual const ISurface* access_surface( Surface_handle_struct s) const = 0;
115
118
123
125
127
132 virtual bool has_attribute( Mesh_attribute_name name) const = 0;
133
154 Mesh_attribute_name name, Uint32 dim = 1) = 0;
155
164 Mesh_attribute_name name) const = 0;
165
178
195 virtual Sint32 attach_attribute_vector( IAttribute_vector* attribute_vector) = 0;
196
205
207
209
211 virtual Bbox3_struct get_bbox() const = 0;
212
218 const Float64_4_4_struct& transformation_matrix) const = 0;
219
221
223
228 virtual void set_maximum_displacement( Float32 displacement) = 0;
229
234
236};
237
292class ISurface :
293 public base::Interface_declare<0x8bc55fb4,0x91cb,0x4b0c,0xa2,0x3a,0x1a,0x67,0x71,0x61,0x73,0xf0>
294{
295public:
296
298
299
308 virtual Sint32 set_basis_type( Basis_type type) = 0;
309
311 virtual Basis_type get_basis_type() const = 0;
312
324
330
332
334
346
352
354
356
365
376
383
385
387
396
405 virtual Sint32 set_control_point( Uint32 index_u, Uint32 index_v, Float32_3_struct p) = 0;
406
416 Uint32 index_u, Uint32 index_v, Float32_3_struct& p) const = 0;
417
426 virtual Sint32 set_control_point( Uint32 index_u, Uint32 index_v, Float64_3_struct p) = 0;
427
437 Uint32 index_u, Uint32 index_v, Float64_3_struct& p) const = 0;
438
450 virtual Sint32 set_weight( Uint32 index_u, Uint32 index_v, Float32 weight) = 0;
451
460 virtual Sint32 get_weight( Uint32 index_u, Uint32 index_v, Float32& weight) const = 0;
461
473 virtual Sint32 set_weight( Uint32 index_u, Uint32 index_v, Float64 weight) = 0;
474
483 virtual Sint32 get_weight( Uint32 index_u, Uint32 index_v, Float64& weight) const = 0;
484
490 virtual void set_rational( bool rational) = 0;
491
493 virtual bool get_rational() const = 0;
494
496
498
512 Parameter_space_dimension dim, Float64 range_min, Float64 range_max) = 0;
513
526 Parameter_space_dimension dim, Float64& range_min, Float64& range_max) const = 0;
527
529
531
533 virtual Uint32 curves_size() const = 0;
534
536 virtual ICurve* add_curve() = 0;
537
539 virtual const ICurve* access_curve( Curve_handle_struct c) const = 0;
540
543
548
550
552
554 virtual Uint32 texture_surfaces_size() const = 0;
555
558
562
565
570
572};
573
600class ICurve :
601 public base::Interface_declare<0xa4e79414,0x6b74,0x422c,0x93,0x83,0x8a,0x08,0x41,0xf9,0x0a,0x27>
602{
603public:
604
606
607
614 virtual Sint32 set_type( Curve_type curve_type) = 0;
615
617 virtual Curve_type get_type() const = 0;
618
620
622
624 virtual Uint32 get_curve_segments_size() const = 0;
625
628
631
634
639
641};
642
655 public base::Interface_declare<0x1aae0632,0xcac0,0x4cab,0xb7,0xb4,0x26,0x6c,0x8a,0xf5,0x44,0x4e>
656{
657public:
658
660
661
670 virtual Sint32 set_basis_type( Basis_type type) = 0;
671
673 virtual Basis_type get_basis_type() const = 0;
674
683 virtual Sint32 set_degree( Uint32 degree) = 0;
684
688 virtual Uint32 get_degree() const = 0;
689
691
693
702 virtual Sint32 set_patches_size( Uint32 count) = 0;
703
707 virtual Uint32 get_patches_size() const = 0;
708
710
712
719 virtual Uint32 get_parameters_size() const = 0;
720
728 virtual Sint32 set_parameter( Uint32 index, Float64 value) = 0;
729
734 virtual Float64 get_parameter( Uint32 index) const = 0;
735
737
739
746 virtual Uint32 get_control_points_size() const = 0;
747
756
764 virtual Sint32 get_control_point( Uint32 index, Float32_2_struct& p) const = 0;
765
774
782 virtual Sint32 get_control_point( Uint32 index, Float64_2_struct& p) const = 0;
783
794 virtual Sint32 set_weight( Uint32 index, Float32 weight) = 0;
795
803 virtual Sint32 get_weight( Uint32 index, Float32& weight) const = 0;
804
815 virtual Sint32 set_weight( Uint32 index, Float64 weight) = 0;
816
824 virtual Sint32 get_weight( Uint32 index, Float64& weight) const = 0;
825
831 virtual void set_rational( bool rational) = 0;
832
836 virtual bool get_rational() const = 0;
837
839
841
849 virtual Sint32 set_range( Float64 range_min, Float64 range_max) = 0;
850
855 virtual void get_range( Float64& range_min, Float64& range_max) const = 0;
856
858};
859
874 public base::Interface_declare<0x5d39fdcb,0x9a3d,0x42ed,0xb3,0x90,0xc3,0x20,0x3d,0x31,0xa9,0x9d>
875{
876public:
877
887
893
901
906
919 Uint32 index_u, Uint32 index_v, const Float32* f, Uint32 n) = 0;
920
933 Uint32 index_u, Uint32 index_v, Float32* f, Uint32 n) const = 0;
934
947 Uint32 index_u, Uint32 index_v, const Float64* d, Uint32 n) = 0;
948
961 Uint32 index_u, Uint32 index_v, Float64* d, Uint32 n) const = 0;
962};
963 // end group mi_neuray_leaf_nodes
965
966} // namespace neuraylib
967
968} // namespace mi
969
970#endif // MI_NEURAYLIB_IFREEFORM_SURFACE_H
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
Interface representing an attribute vector for triangle meshes, polygon meshes, and subdivision surfa...
Definition: iattribute_vector.h:184
A curve segment used by freeform surfaces.
Definition: ifreeform_surface.h:656
virtual Sint32 set_degree(Uint32 degree)=0
Sets the basis degree.
virtual Sint32 set_control_point(Uint32 index, Float64_2_struct p)=0
Sets a control point.
virtual Uint32 get_control_points_size() const =0
Returns the number of control points.
virtual Sint32 set_basis_type(Basis_type type)=0
Sets the basis type.
virtual Uint32 get_parameters_size() const =0
Returns the size of the parameter vector.
virtual Sint32 get_control_point(Uint32 index, Float64_2_struct &p) const =0
Returns a control point.
virtual Sint32 get_weight(Uint32 index, Float32 &weight) const =0
Returns a weight.
virtual void get_range(Float64 &range_min, Float64 &range_max) const =0
Returns the parameter range.
virtual Sint32 set_parameter(Uint32 index, Float64 value)=0
Sets a parameter.
virtual Sint32 set_weight(Uint32 index, Float32 weight)=0
Sets a weight.
virtual Uint32 get_degree() const =0
Returns the basis degree.
virtual void set_rational(bool rational)=0
Sets the rational flag.
virtual Uint32 get_patches_size() const =0
Returns the number of patches.
virtual Sint32 set_control_point(Uint32 index, Float32_2_struct p)=0
Sets a control point.
virtual bool get_rational() const =0
Returns the rational flag.
virtual Sint32 get_weight(Uint32 index, Float64 &weight) const =0
Returns a weight.
virtual Basis_type get_basis_type() const =0
Returns the basis type.
virtual Sint32 set_weight(Uint32 index, Float64 weight)=0
Sets a weight.
virtual Sint32 set_patches_size(Uint32 count)=0
Sets the number of patches.
virtual Sint32 set_range(Float64 range_min, Float64 range_max)=0
Sets the parameter range.
virtual Float64 get_parameter(Uint32 index) const =0
Returns a parameter.
virtual Sint32 get_control_point(Uint32 index, Float32_2_struct &p) const =0
Returns a control point.
A curve used by freeform surfaces.
Definition: ifreeform_surface.h:602
virtual Sint32 remove_curve_segment(Curve_segment_handle_struct s)=0
Removes a curve segment.
virtual Curve_type get_type() const =0
Returns the curve type.
virtual const ICurve_segment * access_curve_segment(Curve_segment_handle_struct s) const =0
Returns a curve segment (const).
virtual Sint32 set_type(Curve_type curve_type)=0
Sets the curve type.
virtual ICurve_segment * edit_curve_segment(Curve_segment_handle_struct s)=0
Returns a curve segment (mutable).
virtual Uint32 get_curve_segments_size() const =0
Returns the number of curve segments.
virtual ICurve_segment * add_curve_segment()=0
Adds and returns a new curve segment.
Interface representing a freeform surface.
Definition: ifreeform_surface.h:99
virtual ISurface * edit_surface(Surface_handle_struct s)=0
Returns a surface (mutable).
virtual Float32 get_maximum_displacement() const =0
Returns the maximum displacement of the freeform surface.
virtual Bbox3_struct get_tight_bbox(const Float64_4_4_struct &transformation_matrix) const =0
Returns the bounding box of the freeform surface after transformation.
virtual Bbox3_struct get_bbox() const =0
Returns the bounding box of the freeform surface.
virtual Sint32 remove_surface(Surface_handle_struct s)=0
Removes a surface.
virtual IAttribute_vector * edit_attribute_vector(Mesh_attribute_name name)=0
Detaches and returns a per-primitive mesh attribute.
virtual Sint32 attach_attribute_vector(IAttribute_vector *attribute_vector)=0
Attaches a given per-primitive mesh attribute to the freeform surface.
virtual Sint32 remove_attribute_vector(Mesh_attribute_name name)=0
Removes a per-primitive mesh attribute.
virtual IAttribute_vector * create_attribute_vector(Mesh_attribute_name name, Uint32 dim=1)=0
Creates a per-primitive mesh attribute.
virtual bool has_attribute(Mesh_attribute_name name) const =0
Indicates whether the freeform surface has a particular mesh attribute.
virtual ISurface * add_surface()=0
Adds and returns a new surface.
virtual void set_maximum_displacement(Float32 displacement)=0
Sets the maximum displacement of the freeform surface.
virtual Uint32 get_surfaces_size() const =0
Returns the number of surfaces.
virtual const IAttribute_vector * access_attribute_vector(Mesh_attribute_name name) const =0
Returns a per-primitive mesh attribute.
virtual const ISurface * access_surface(Surface_handle_struct s) const =0
Returns a surface (const).
A surface of a freeform surface.
Definition: ifreeform_surface.h:294
virtual Sint32 remove_curve(Curve_handle_struct c)=0
Removes a curve.
virtual Sint32 set_control_point(Uint32 index_u, Uint32 index_v, Float64_3_struct p)=0
Sets a control point.
virtual const ICurve * access_curve(Curve_handle_struct c) const =0
Returns a curve (const).
virtual Uint32 get_parameters_size(Parameter_space_dimension dim) const =0
Returns the size of the parameter vector.
virtual Sint32 set_basis_type(Basis_type type)=0
Sets the basis type.
virtual Sint32 get_weight(Uint32 index_u, Uint32 index_v, Float64 &weight) const =0
Returns a weight.
virtual Sint32 set_patches_size(Parameter_space_dimension dim, Uint32 count)=0
Sets the number of patches.
virtual Uint32 texture_surfaces_size() const =0
Returns the number of texture surfaces.
virtual Sint32 set_weight(Uint32 index_u, Uint32 index_v, Float32 weight)=0
Sets a weight.
virtual bool get_rational() const =0
Returns the rational flag.
virtual Uint32 get_control_points_size(Parameter_space_dimension dim) const =0
Returns the number of control points.
virtual Sint32 set_range(Parameter_space_dimension dim, Float64 range_min, Float64 range_max)=0
Sets the parameter range.
virtual Sint32 get_control_point(Uint32 index_u, Uint32 index_v, Float64_3_struct &p) const =0
Returns a control point.
virtual Sint32 set_parameter(Parameter_space_dimension dim, Uint32 index, Float64 value)=0
Sets a parameter.
virtual void set_rational(bool rational)=0
Sets the rational flag.
virtual Sint32 set_weight(Uint32 index_u, Uint32 index_v, Float64 weight)=0
Sets a weight.
virtual ICurve * edit_curve(Curve_handle_struct c)=0
Returns a curve (mutable).
virtual Uint32 get_patches_size(Parameter_space_dimension dim) const =0
Returns the number of patches.
virtual Sint32 set_degree(Parameter_space_dimension dim, Uint32 degree)=0
Sets the basis degree.
virtual Uint32 get_degree(Parameter_space_dimension dim) const =0
Returns the basis degree.
virtual ITexture_surface * edit_texture_surface(Texture_surface_handle_struct t) const =0
Returns a texture surface (mutable).
virtual ITexture_surface * add_texture_surface()=0
Adds and returns a new texture surface.
virtual Uint32 curves_size() const =0
Returns the number of curves.
virtual Sint32 get_range(Parameter_space_dimension dim, Float64 &range_min, Float64 &range_max) const =0
Returns the parameter range.
virtual ICurve * add_curve()=0
Adds and returns a new curve.
virtual Sint32 get_control_point(Uint32 index_u, Uint32 index_v, Float32_3_struct &p) const =0
Returns a control point.
virtual const ITexture_surface * access_texture_surface(Texture_surface_handle_struct t) const =0
Returns a texture surface (const).
virtual Sint32 get_weight(Uint32 index_u, Uint32 index_v, Float32 &weight) const =0
Returns a weight.
virtual Float64 get_parameter(Parameter_space_dimension dim, Uint32 index) const =0
Returns a parameter.
virtual Basis_type get_basis_type() const =0
Returns the basis type.
virtual Sint32 remove_texture_surface(Texture_surface_handle_struct t)=0
Removes a texture surface.
virtual Sint32 set_control_point(Uint32 index_u, Uint32 index_v, Float32_3_struct p)=0
Sets a control point.
A texture surface associated with freeform surfaces.
Definition: ifreeform_surface.h:875
virtual Uint32 get_texture_coordinate_length() const =0
Returns the length of the texture coordinates.
virtual Sint32 set_texture_coordinate(Uint32 index_u, Uint32 index_v, const Float64 *d, Uint32 n)=0
Sets a texture coordinate.
virtual Sint32 set_texture_coordinates_size(Parameter_space_dimension dim, Uint32 count)=0
Sets the size of the texture coordinates.
virtual Sint32 get_texture_coordinate(Uint32 index_u, Uint32 index_v, Float64 *d, Uint32 n) const =0
Returns a texture coordinate.
virtual Sint32 get_texture_coordinate(Uint32 index_u, Uint32 index_v, Float32 *f, Uint32 n) const =0
Returns a texture coordinate.
virtual Uint32 get_texture_coordinates_size(Parameter_space_dimension dim) const =0
Returns the size of the texture coordinates.
virtual Sint32 set_texture_coordinate(Uint32 index_u, Uint32 index_v, const Float32 *f, Uint32 n)=0
Sets a texture coordinate.
virtual Sint32 set_texture_coordinate_length(Uint32 length)=0
Sets the length of the texture coordinates.
#define mi_static_assert(expr)
Compile time assertion that raises a compilation error if the constant expression expr evaluates to f...
Definition: assert.h:65
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
double Float64
64-bit float.
Definition: types.h:52
float Float32
32-bit float.
Definition: types.h:51
signed int Sint32
32-bit signed integer.
Definition: types.h:46
Float32 length(Float32 a)
Returns the Euclidean norm of the scalar a (its absolute value).
Definition: function.h:1114
Basis_type
Different basis types that are supported by freeform surfaces.
Definition: ifreeform_surface.h:30
Curve_type
Different curve types that are supported by freeform surfaces.
Definition: ifreeform_surface.h:60
Parameter_space_dimension
Distinguishes the two dimensions of the parameter space of freeform surfaces.
Definition: ifreeform_surface.h:45
Mesh_attribute_name
Symbolic constants for mesh attributes.
Definition: iattribute_vector.h:60
@ BASIS_BEZIER
Represents a Bezier basis.
Definition: ifreeform_surface.h:32
@ BASIS_BSPLINE
Represents a B-spline basis.
Definition: ifreeform_surface.h:35
@ HOLE_CURVE
A hole curve cuts away all parts of the surface inside the curve.
Definition: ifreeform_surface.h:65
@ TRIM_CURVE
A trim curve cuts away all parts of the surface outside the curve.
Definition: ifreeform_surface.h:62
@ DIMENSION_V
Represents the V-dimension of the parameter space.
Definition: ifreeform_surface.h:50
@ DIMENSION_U
Represents the U-dimension of the parameter space.
Definition: ifreeform_surface.h:47
Attribute vectors, used for triangle and polygon meshes.
Simple integer-based handles used by mesh interfaces.
Base class for all scene elements.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: neuraylib.h:179
Storage class for an axis-aligned N-dimensional bounding box class template of fixed dimension.
Definition: bbox.h:47
Storage class for a NxM-dimensional matrix class template of fixed dimensions.
Definition: matrix.h:90
Generic storage class template for math vector representations storing DIM elements of type T.
Definition: vector.h:135
Handle class for type-safety.
Definition: identifier.h:56
Typedefs for types from the math API.