ai_map.h
Go to the documentation of this file.
1// Copyright 2021 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
20struct AtParamValueMap;
21struct AtParamValueMapIterator;
22
27AI_API AtParamValueMap* AiParamValueMap();
28AI_API void AiParamValueMapDestroy(AtParamValueMap* map);
29AI_API AtParamValueMapIterator* AiParamValueMapGetIterator(const AtParamValueMap* map);
30AI_API void AiParamValueMapMerge(AtParamValueMap* target_map, const AtParamValueMap* src_map);
31AI_API AtParamValueMap* AiParamValueMapClone(const AtParamValueMap* src_map);
32/* \}*/
33
52#define AiCreateFuncs(_name, _type) \
53AI_API void AiParamValueMapSet##_name(AtParamValueMap* map, const AtString name, _type value);
54
55AiCreateFuncs(Bool, bool)
56AiCreateFuncs(Int, int)
57AiCreateFuncs(Flt, float)
58AiCreateFuncs(RGB, AtRGB)
59AiCreateFuncs(Vec, AtVector)
60AiCreateFuncs(Vec2, AtVector2)
61AiCreateFuncs(Str, AtString)
62AiCreateFuncs(Array,AtArray*)
63AiCreateFuncs(Ptr, void*)
64#undef AiCreateFuncs
65
66/*\}*/
67
88#define AiCreateFuncs(_name, _type) \
89AI_API bool AiParamValueMapGet##_name(const AtParamValueMap* map, const AtString name, _type* value);
90
91AiCreateFuncs(Bool, bool)
92AiCreateFuncs(Int, int)
93AiCreateFuncs(Flt, float)
94AiCreateFuncs(RGB, AtRGB)
95AiCreateFuncs(Vec, AtVector)
96AiCreateFuncs(Vec2, AtVector2)
97AiCreateFuncs(Str, AtString)
98AiCreateFuncs(Array,AtArray*)
99AiCreateFuncs(Ptr, void*)
100#undef AiCreateFuncs
101/*\}*/
102
104{
105 AtString name;
106 uint8_t type;
107 AtParamValue value;
108};
109
114AI_API void AiParamValueMapIteratorDestroy(AtParamValueMapIterator* iter);
115AI_API const AtParamValueMapEntry* AiParamValueMapIteratorGetNext(AtParamValueMapIterator* iter);
116AI_API bool AiParamValueMapIteratorFinished(const AtParamValueMapIterator* iter);
117/* \}*/
118#endif // AI_CPU_COMPILER
DLL export prefix for API functions (necessary for multi-platform development)
Color types and utilities.
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:118
AI_API void AiParamValueMapIteratorDestroy(AtParamValueMapIterator *iter)
Destroys a map iterator when it is no longer needed.
Definition: ai_map.cpp:133
AI_API AtParamValueMap * AiParamValueMap()
Creates a new map.
Definition: ai_map.cpp:46
AI_API AtParamValueMapIterator * AiParamValueMapGetIterator(const AtParamValueMap *map)
Creates a new map iterator and resets it to the first entry.
Definition: ai_map.cpp:66
AI_API const AtParamValueMapEntry * AiParamValueMapIteratorGetNext(AtParamValueMapIterator *iter)
Returns current map entry and points map iterator to the next one.
Definition: ai_map.cpp:160
AI_API void AiParamValueMapMerge(AtParamValueMap *target_map, const AtParamValueMap *src_map)
Merge all contents of a map into another map.
Definition: ai_map.cpp:85
AI_API void AiParamValueMapDestroy(AtParamValueMap *map)
Destroys a map object.
Definition: ai_map.cpp:55
AI_API bool AiParamValueMapIteratorFinished(const AtParamValueMapIterator *iter)
Returns true if there is no more key/values to iterate over.
Definition: ai_map.cpp:171
AtNodeEntry type and methods.
AtString class for fast comparisons.
Vector math types, operators and utilities.
Actual parameter value for each supported type.
Definition: ai_params.h:106
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
Definition: ai_map.h:104
RGB color.
Definition: ai_color.h:32
2D point
Definition: ai_vector.h:255
3D point (single precision)
Definition: ai_vector.h:30

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