neuray API Programmer's Manual

iattribute_vector.h File Reference

Description

Attribute vectors, used for triangle and polygon meshes.

Code Example

iattribute_vector.h

‎/***************************************************************************************************
 * Copyright 2024 NVIDIA Corporation. All rights reserved.
 **************************************************************************************************/

#ifndef MI_NEURAYLIB_IATTRIBUTE_VECTOR_H
#define MI_NEURAYLIB_IATTRIBUTE_VECTOR_H

#include <mi/base/interface_declare.h>
#include <mi/neuraylib/typedefs.h>

namespace mi {

namespace neuraylib {







































enum Mesh_attribute_name
{
    //  Tag used to indicate no attribute.
    ATTR_NONE = 0,

    ATTR_NORMAL = 1,

    ATTR_MOTION = 2,

    ATTR_DERIVATIVES = 3,

    ATTR_MATERIAL_INDEX = 4,

    ATTR_TEXTURE = 6,

    ATTR_TEXTURE_NUM = 256,

    ATTR_USER = ATTR_TEXTURE + ATTR_TEXTURE_NUM,

    ATTR_USER_NUM = 4,

    ATTR_MAX = ATTR_USER + ATTR_USER_NUM,

    //  Undocumented, for alignment only.
    ATTR_FORCE_32_BIT = 0xffffffffU
};

mi_static_assert( sizeof( Mesh_attribute_name) == sizeof( Uint32));

enum Connectivity_map_type {

    CONNECTIVITY_MAP_GENERIC,

    //  Undocumented, for alignment only.
    CONNECTIVITY_FORCE_32_BIT = 0xffffffffU
};

mi_static_assert( sizeof( Connectivity_map_type) == sizeof( Uint32));


class IAttribute_vector :
    public base::Interface_declare<0xfbe79601,0x3c89,0x4a8d,0xbf,0x0d,0xae,0x21,0x59,0x9a,0xbf,0x80>
{
public:


    virtual Uint32 
               size() const = 0;

    virtual Uint32 
               capacity() const = 0;

    virtual void resize( Uint32 
               size) = 0;

    virtual void reserve( Uint32 size) = 0;

    virtual void clear() = 0;

    virtual bool is_valid_attribute() const = 0;

    virtual Uint32 
               array_size() const = 0;




    virtual Uint32 
               get_uint32( Uint32 index) const = 0;

    virtual Sint32 
               append_uint32( Uint32 u) = 0;

    virtual Sint32 
               append_uint32( const Uint32* u, Uint32 k, Size n = 1) = 0;

    virtual Sint32 
               set_uint32( Uint32 index, Uint32 u) = 0;

    virtual Sint32 
               set_uint32( Uint32 index, const Uint32* u, Uint32 k, Size n = 1) = 0;




    virtual const Float32_3_struct& get_vector3( Uint32 index) const = 0;

    virtual Sint32 
               append_vector3( const Float32_3_struct& v) = 0;

    virtual Sint32 
               set_vector3( Uint32 index, const Float32_3_struct& v) = 0;




    virtual const Float32_3_struct* get_vector3( Uint32 index, Uint32 k) const = 0;

    virtual Sint32 
               append_vector3( const Float32_3_struct* v, Uint32 k, Size n = 1) = 0;

    virtual Sint32 
               set_vector3(
        Uint32 index, const Float32_3_struct* v, Uint32 k, Size n = 1) = 0;




    virtual const Float32* get_float32( Uint32 index, Uint32 k) const = 0;

    virtual Sint32 
               append_float32( const Float32* f, Uint32 k, Size n = 1) = 0;

    virtual Sint32 
               set_float32( Uint32 index, const Float32* f, Uint32 k, Size n = 1) = 0;




    virtual Sint32 
               set_user_attribute_name( const char* name) = 0;

    virtual const char* get_user_attribute_name() const = 0;

};
 // end group mi_neuray_leaf_nodes

} // namespace neuraylib

} // namespace mi

#endif // MI_NEURAYLIB_IATTRIBUTE_VECTOR_H

Namespaces

namespace 
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH. More...
namespace 
Namespace for the neuray API. More...

Classes

class 
Interface representing an attribute vector for triangle meshes, polygon meshes, and subdivision surfaces. More...

Enumerations

enum  {CONNECTIVITY_MAP_GENERIC, CONNECTIVITY_FORCE_32_BIT = 0xffffffffU }
Symbolic constants for different connectivity types. More...
enum  {ATTR_NONE = 0, ATTR_NORMAL = 1, ATTR_MOTION = 2, ATTR_DERIVATIVES = 3, ATTR_MATERIAL_INDEX = 4, ATTR_TEXTURE = 6, ATTR_TEXTURE_NUM = 256, ATTR_USER = ATTR_TEXTURE+ATTR_TEXTURE_NUM, ATTR_USER_NUM = 4, ATTR_MAX = ATTR_USER+ATTR_USER_NUM, ATTR_FORCE_32_BIT = 0xffffffffU }
Symbolic constants for mesh attributes. More...