ai_map.h
Go to the documentation of this file.
1 // Copyright 2020 Autodesk, Inc. All rights reserved.
2 //
3 // Use of this software is subject to the terms of the Autodesk license
4 // agreement provided at the time of installation or download, or which
5 // otherwise accompanies this software in either electronic or hard copy form.
6 
12 #pragma once
13 #include "ai_node_entry.h"
14 #include "ai_vector.h"
15 #include "ai_color.h"
16 #include "ai_api.h"
17 #include "ai_string.h"
18 #ifdef AI_CPU_COMPILER
19 
20 struct AtParamValueMap;
21 struct AtParamValueMapIterator;
22 
27 AI_API AtParamValueMap* AiParamValueMap();
28 AI_API void AiParamValueMapDestroy(AtParamValueMap* map);
29 AI_API AtParamValueMapIterator* AiParamValueMapGetIterator(const AtParamValueMap* map);
30 AI_API void AiParamValueMapMerge(AtParamValueMap* target_map, const AtParamValueMap* src_map);
31 AI_API AtParamValueMap* AiParamValueMapClone(const AtParamValueMap* src_map);
32 /* \}*/
33 
52 #define AiCreateFuncs(_name, _type) \
53 AI_API void AiParamValueMapSet##_name(AtParamValueMap* map, const AtString name, _type value);
54 
55 AiCreateFuncs(Bool, bool)
56 AiCreateFuncs(Int, int)
57 AiCreateFuncs(Flt, float)
58 AiCreateFuncs(RGB, AtRGB)
59 AiCreateFuncs(Vec, AtVector)
60 AiCreateFuncs(Vec2, AtVector2)
61 AiCreateFuncs(Str, AtString)
62 AiCreateFuncs(Array,AtArray*)
63 #undef AiCreateFuncs
64 
65 /*\}*/
66 
87 #define AiCreateFuncs(_name, _type) \
88 AI_API bool AiParamValueMapGet##_name(const AtParamValueMap* map, const AtString name, _type* value);
89 
90 AiCreateFuncs(Bool, bool)
91 AiCreateFuncs(Int, int)
92 AiCreateFuncs(Flt, float)
93 AiCreateFuncs(RGB, AtRGB)
94 AiCreateFuncs(Vec, AtVector)
95 AiCreateFuncs(Vec2, AtVector2)
96 AiCreateFuncs(Str, AtString)
97 AiCreateFuncs(Array,AtArray*)
98 #undef AiCreateFuncs
99 /*\}*/
100 
102 {
103  AtString name;
104  uint8_t type;
105  AtParamValue value;
106 };
107 
112 AI_API void AiParamValueMapIteratorDestroy(AtParamValueMapIterator* iter);
113 AI_API const AtParamValueMapEntry* AiParamValueMapIteratorGetNext(AtParamValueMapIterator* iter);
114 AI_API bool AiParamValueMapIteratorFinished(const AtParamValueMapIterator* iter);
115 /* \}*/
116 #endif // AI_CPU_COMPILER
RGB color.
Definition: ai_color.h:31
AI_API AtParamValueMap * AiParamValueMapClone(const AtParamValueMap *src_map)
Clones an existing param value map using shallow copy (so any pointer value will be shared) ...
Definition: ai_map.cpp:110
AI_API void AiParamValueMapMerge(AtParamValueMap *target_map, const AtParamValueMap *src_map)
Merge all contents of a map into another map.
Definition: ai_map.cpp:79
AI_API bool AiParamValueMapIteratorFinished(const AtParamValueMapIterator *iter)
Returns true if there is no more key/values to iterate over.
Definition: ai_map.cpp:162
Vector math types, operators and utilities.
AI_API const AtParamValueMapEntry * AiParamValueMapIteratorGetNext(AtParamValueMapIterator *iter)
Returns current map entry and points map iterator to the next one.
Definition: ai_map.cpp:151
AI_API void AiParamValueMapIteratorDestroy(AtParamValueMapIterator *iter)
Destroys a map iterator when it is no longer needed.
Definition: ai_map.cpp:124
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
3D point (single precision)
Definition: ai_vector.h:29
AI_API void AiParamValueMapDestroy(AtParamValueMap *map)
Destroys a map object.
Definition: ai_map.cpp:50
Definition: ai_map.h:101
Color types and utilities.
DLL export prefix for API functions (necessary for multi-platform development)
2D point
Definition: ai_vector.h:254
AI_API AtParamValueMap * AiParamValueMap()
Creates a new map.
Definition: ai_map.cpp:42
Actual parameter value for each supported type.
Definition: ai_params.h:105
AtNodeEntry type and methods.
AI_API AtParamValueMapIterator * AiParamValueMapGetIterator(const AtParamValueMap *map)
Creates a new map iterator and resets it to the first entry.
Definition: ai_map.cpp:60
AtString class for fast comparisons.

© 2020 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com