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
31AI_API AtParamValueMap* AiParamValueMap();
32AI_API void AiParamValueMapDestroy(AtParamValueMap* map);
33AI_API AtParamValueMapIterator* AiParamValueMapGetIterator(const AtParamValueMap* map);
34AI_API void AiParamValueMapMerge(AtParamValueMap* target_map, const AtParamValueMap* src_map);
35AI_API AtParamValueMap* AiParamValueMapClone(const AtParamValueMap* src_map);
36/* \}*/
37
56#define AiCreateFuncs(_name, _type) \
57AI_API void AiParamValueMapSet##_name(AtParamValueMap* map, const AtString name, _type value);
58
59AiCreateFuncs(Bool, bool)
60AiCreateFuncs(Int, int)
61AiCreateFuncs(Flt, float)
62AiCreateFuncs(RGB, AtRGB)
63AiCreateFuncs(Vec, AtVector)
64AiCreateFuncs(Vec2, AtVector2)
65AiCreateFuncs(Str, AtString)
66AiCreateFuncs(Array,AtArray*)
67AiCreateFuncs(Ptr, void*)
68#undef AiCreateFuncs
69
70/*\}*/
71
92#define AiCreateFuncs(_name, _type) \
93AI_API bool AiParamValueMapGet##_name(const AtParamValueMap* map, const AtString name, _type* value);
94
95AiCreateFuncs(Bool, bool)
96AiCreateFuncs(Int, int)
97AiCreateFuncs(Flt, float)
98AiCreateFuncs(RGB, AtRGB)
99AiCreateFuncs(Vec, AtVector)
100AiCreateFuncs(Vec2, AtVector2)
101AiCreateFuncs(Str, AtString)
102AiCreateFuncs(Array,AtArray*)
103AiCreateFuncs(Ptr, void*)
104#undef AiCreateFuncs
105/*\}*/
106
108{
109 AtString name;
110 uint8_t type;
111 AtParamValue value;
112};
113
118AI_API void AiParamValueMapIteratorDestroy(AtParamValueMapIterator* iter);
119AI_API const AtParamValueMapEntry* AiParamValueMapIteratorGetNext(AtParamValueMapIterator* iter);
120AI_API bool AiParamValueMapIteratorFinished(const AtParamValueMapIterator* iter);
121/* \}*/
122
123/*\}*/
124#endif // AI_CPU_COMPILER
DLL export prefix for API functions (necessary for multi-platform development)
Color types and utilities.
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:54
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
Definition: ai_map.h:108
RGB color.
Definition: ai_color.h:32
2D point
Definition: ai_vector.h:255
3D point (single precision)
Definition: ai_vector.h:30

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