Iray SDK API nvidia_logo_transpbg.gif Up
iattribute_set.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2025 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IATTRIBUTE_SET_H
8#define MI_NEURAYLIB_IATTRIBUTE_SET_H
9
11#include <mi/neuraylib/idata.h>
13#include <mi/neuraylib/version.h> // for MI_NEURAYLIB_DEPRECATED_ENUM_VALUE
14
15namespace mi {
16namespace neuraylib {
17
58 MI_NEURAYLIB_DEPRECATED_ENUM_VALUE(PROPAGATION_FORCE_32_BIT, 0xffffffffU)
59};
60
381 public base::Interface_declare<0x1bcb8d48,0x10c1,0x4b3e,0x9b,0xfa,0x06,0x23,0x61,0x81,0xd3,0xe1>
382{
383public:
396 virtual IData* create_attribute( const char* name, const char* type) = 0;
397
430 template<class T>
431 T* create_attribute( const char* name, const char* type)
432 {
433 IData* ptr_iinterface = create_attribute( name, type);
434 if ( !ptr_iinterface)
435 return 0;
436 T* ptr_T = static_cast<T*>( ptr_iinterface->get_interface( typename T::IID()));
437 ptr_iinterface->release();
438 return ptr_T;
439 }
440
470 template<class T>
471 T* create_attribute( const char* name)
472 {
473 return create_attribute<T>( name, Type_traits<T>::get_type_name());
474 }
475
481 virtual bool destroy_attribute( const char* name) = 0;
482
492 virtual const IData* access_attribute( const char* name) const = 0;
493
510 template<class T>
511 const T* access_attribute( const char* name) const
512 {
513 const IData* ptr_iinterface = access_attribute( name);
514 if ( !ptr_iinterface)
515 return 0;
516 const T* ptr_T = static_cast<const T*>( ptr_iinterface->get_interface( typename T::IID()));
517 ptr_iinterface->release();
518 return ptr_T;
519 }
520
530 virtual IData* edit_attribute( const char* name) = 0;
531
548 template<class T>
549 T* edit_attribute( const char* name)
550 {
551 IData* ptr_iinterface = edit_attribute( name);
552 if ( !ptr_iinterface)
553 return 0;
554 T* ptr_T = static_cast<T*>( ptr_iinterface->get_interface( typename T::IID()));
555 ptr_iinterface->release();
556 return ptr_T;
557 }
558
569 virtual bool is_attribute( const char* name) const = 0;
570
585 virtual const char* get_attribute_type_name( const char* name) const = 0;
586
593 virtual Sint32 set_attribute_propagation( const char* name, Propagation_type value) = 0;
594
598 virtual Propagation_type get_attribute_propagation( const char* name) const = 0;
599
605 virtual const char* enumerate_attributes( Sint32 index) const = 0;
606};
607 // end group mi_neuray_scene_element
609
610} // namespace neuraylib
611
612} // namespace mi
613
614#endif // MI_NEURAYLIB_IATTRIBUTE_SET_H
This interface is the base interface of all types.
Definition: idata.h:297
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
The attribute set comprises all attributes attached to a database element.
Definition: iattribute_set.h:382
T * edit_attribute(const char *name)
Returns a mutable pointer to the attribute name.
Definition: iattribute_set.h:549
virtual IData * edit_attribute(const char *name)=0
Returns a mutable pointer to the attribute name.
virtual const char * enumerate_attributes(Sint32 index) const =0
Returns the name of the attribute indicated by index.
const T * access_attribute(const char *name) const
Returns a const pointer to the attribute name.
Definition: iattribute_set.h:511
virtual Sint32 set_attribute_propagation(const char *name, Propagation_type value)=0
Sets the propagation type of the attribute name.
virtual IData * create_attribute(const char *name, const char *type)=0
Creates a new attribute name of the type type.
virtual const IData * access_attribute(const char *name) const =0
Returns a const pointer to the attribute name.
virtual bool is_attribute(const char *name) const =0
Indicates existence of an attribute.
virtual const char * get_attribute_type_name(const char *name) const =0
Returns the type of an attribute.
virtual Propagation_type get_attribute_propagation(const char *name) const =0
Returns the propagation type of the attribute name.
T * create_attribute(const char *name)
Creates a new attribute name of the type T.
Definition: iattribute_set.h:471
virtual bool destroy_attribute(const char *name)=0
Destroys the attribute name.
T * create_attribute(const char *name, const char *type)
Creates a new attribute name of the type type.
Definition: iattribute_set.h:431
virtual const IInterface * get_interface(const Uuid &interface_id) const =0
Acquires a const interface from another.
virtual Uint32 release() const =0
Decrements the reference count.
int Sint32
32-bit signed integer.
Definition: types.h:46
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Propagation_type
Propagation types for attribute inheritance.
Definition: iattribute_set.h:55
@ PROPAGATION_STANDARD
Standard inheritance of attributes without any special flags.
Definition: iattribute_set.h:56
@ PROPAGATION_OVERRIDE
The override flag for attribute inheritance.
Definition: iattribute_set.h:57
Types.
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: neuraylib.h:179
Major and minor version number and an optional qualifier.
Type traits relating interfaces, corresponding primitive types, and their type names.
Definition: type_traits.h:162
Type traits.