NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
List of all members
References in manual:  1  2 
mi::IFreeform_surface Class Referenceabstract

Interface representing a freeform surface. More...

Inheritance diagram for mi::IFreeform_surface:
Inheritance graph
[legend]

Public Member Functions

Methods related to surfaces
virtual Uint32  get_surfaces_size () const =0
  Returns the number of surfaces. More...
 
virtual ISurface add_surface ()=0
  Adds and returns a new surface. More...
 
virtual const ISurface access_surface (Surface_handle_struct s) const =0
  Returns a surface (const). More...
 
virtual ISurface edit_surface (Surface_handle_struct s)=0
  Returns a surface (mutable). More...
 
virtual Sint32  remove_surface (Surface_handle_struct s)=0
  Removes a surface. More...
 
Methods related to per-primitive attributes
virtual bool  has_attribute (Mesh_attribute_name name) const =0
  Indicates whether the freeform surface has a particular mesh attribute. More...
 
virtual IAttribute_vector create_attribute_vector (Mesh_attribute_name name, Uint32 dim=1)=0
  Creates a per-primitive mesh attribute. More...
 
virtual const IAttribute_vector access_attribute_vector (Mesh_attribute_name name) const =0
  Returns a per-primitive mesh attribute. More...
 
virtual IAttribute_vector edit_attribute_vector (Mesh_attribute_name name)=0
  Detaches and returns a per-primitive mesh attribute. More...
 
virtual Sint32  attach_attribute_vector (IAttribute_vector *attribute_vector)=0
  Attaches a given per-primitive mesh attribute to the freeform surface. More...
 
Methods related to the bounding box
virtual const Float32_3_struct get_bbox_min () const =0
  Returns minimal corner of the bounding box. More...
 
virtual const Float32_3_struct get_bbox_max () const =0
  Returns maximal corner of the bounding box. More...
 
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. More...
 
Methods related to displacement
virtual void  set_maximum_displacement (Float32 displacement)=0
  Sets the maximum displacement of the triangle mesh. More...
 
virtual Float32  get_maximum_displacement () const =0
  Returns the maximum displacement of the triangle mesh. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x5b54fda0, 0x1034, 0x48a2, 0x9d, 0xd1, 0x4d, 0x14, 0xaa, 0xba, 0xa2, 0xa7, IScene_element >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IScene_element
Self
  Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
  Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x5b54fda0, 0x1034, 0x48a2, 0x9d, 0xd1, 0x4d, 0x14, 0xaa, 0xba, 0xa2, 0xa7, IScene_element >
static bool  compare_iid (const Uuid &iid)
  Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

Interface representing a freeform surface.

Conceptually, a freeform surface object consists of several surfaces (see mi::ISurface). Due to a current limitation, only one surface is supported.

Surfaces are stored with consecutive indices, starting with the index 0. For type safety, surface indices are represented using mi::Surface_handle instead of plain integers.

In addition to regular attributes (see mi::IAttribute_set), freeform surfaces can also have mesh attributes. In contrast to regular attributes which exist only once per object, mesh attributes are always a vector of values with one vector element per primitive, per point, or per vertex (see mi::Mesh_attribute_name and mi::IAttribute_vector for details).

For freeform surfaces, only per-primitive mesh attributes are supported (the primitives are the the individual surfaces). Texture spaces are represented via so-called texture surfaces. Other per-point or per-vertex mesh attributes are not supported for freeform surfaces.

See also the "approx" and "approx_curve" attributes on mi::IAttribute_set for information how to control the tessellation of the freeform surface.

See Also
mi::IAttribute_vector
mi::ISurface

Member Function Documentation

virtual const IAttribute_vector* mi::IFreeform_surface::access_attribute_vector ( Mesh_attribute_name  name) const
pure virtual

Returns a per-primitive mesh attribute.

See Also
methods on mi::ISurface for texture spaces
Parameters
name The name of the attribute, see Mesh_attribute_name. The attribute must be a per-primitive attribute.
Returns
The requested attribute vector, or NULL in case of failure.
virtual const ISurface* mi::IFreeform_surface::access_surface ( Surface_handle_struct  s) const
pure virtual

Returns a surface (const).

virtual ISurface* mi::IFreeform_surface::add_surface ( )
pure virtual

Adds and returns a new surface.

Note
Currently only one surface is supported.
virtual Sint32 mi::IFreeform_surface::attach_attribute_vector ( IAttribute_vector attribute_vector)
pure virtual

Attaches a given per-primitive mesh attribute to the freeform surface.

The attribute vector must not be used any longer after it has been attached.

See Also
create_attribute_vector(), edit_attribute_vector()
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: The attribute vector has not been acquired from this freeform surface.
  • -3: The attribute vector is not a per-primitive attribute vector.
  • -4: The attribute vector is a per-primitive attribute vector and the number of elements does not match the number of surfaces of the freeform surface.
  • -5: An attribute of the same name is already attached to the freeform surface.
virtual IAttribute_vector* mi::IFreeform_surface::create_attribute_vector ( Mesh_attribute_name  name,
Uint32  dim = 1 
)
pure virtual

Creates a per-primitive mesh attribute.

The attribute is not yet attached to the freeform surface. It needs to be attached before it is released.

See Also
methods on mi::ISurface for texture spaces
attach_attribute_vector()
Parameters
name The name of the attribute, see Mesh_attribute_name. The attribute must be a per-primitive attribute.
dim Dimension of an attribute value. Only used for those attributes that have user specifiable dimensions.
Returns
The requested attribute vector, or NULL in case of failure.
virtual IAttribute_vector* mi::IFreeform_surface::edit_attribute_vector ( Mesh_attribute_name  name)
pure virtual

Detaches and returns a per-primitive mesh attribute.

The attribute needs to be reattached before it is released. Otherwise, the attribute is effectively removed from the freeform surface.

See Also
methods on mi::ISurface for texture spaces
attach_attribute_vector()
Parameters
name The name of the attribute, see Mesh_attribute_name. The attribute must be a per-primitive attribute.
Returns
The requested attribute vector, or NULL in case of failure.
virtual ISurface* mi::IFreeform_surface::edit_surface ( Surface_handle_struct  s)
pure virtual

Returns a surface (mutable).

virtual const Float32_3_struct& mi::IFreeform_surface::get_bbox_max ( ) const
pure virtual

Returns maximal corner of the bounding box.

virtual const Float32_3_struct& mi::IFreeform_surface::get_bbox_min ( ) const
pure virtual

Returns minimal corner of the bounding box.

virtual Float32 mi::IFreeform_surface::get_maximum_displacement ( ) const
pure virtual

Returns the maximum displacement of the triangle mesh.

See Also
set_maximum_displacement()
virtual Uint32 mi::IFreeform_surface::get_surfaces_size ( ) const
pure virtual

Returns the number of surfaces.

virtual Bbox3_struct mi::IFreeform_surface::get_tight_bbox ( const Float64_4_4_struct transformation_matrix) const
pure virtual

Returns the bounding box of the freeform surface after transformation.

Parameters
transformation_matrix The transformation matrix
virtual bool mi::IFreeform_surface::has_attribute ( Mesh_attribute_name  name) const
pure virtual

Indicates whether the freeform surface has a particular mesh attribute.

Parameters
name The attribute to query.
Returns
true if the freeform surface has this attribute, false otherwise.
virtual Sint32 mi::IFreeform_surface::remove_surface ( Surface_handle_struct  s)
pure virtual

Removes a surface.

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

virtual void mi::IFreeform_surface::set_maximum_displacement ( Float32  displacement)
pure virtual

Sets the maximum displacement of the triangle mesh.

This value is the maximum absolute value that any displacement shader applied to the object will return (defaults to 0.0). The bounding box of the object will be expanded all around by this value.