25#include <OpticalElement.h>
37 std::string parameter;
38 std::string expression;
44 std::vector<std::string> params;
45 std::map<std::string, std::string> values;
46 std::list<std::string> defined;
48 unsigned int positionalNdx = 0;
49 unsigned int nonPositionalNdx = 0;
51 void pushParam(std::string
const &name, std::string
const &value =
"") {
52 params.push_back(name);
57 operator[](std::string
const &name)
62 bool isSet(std::string
const &name)
const;
64 void set(std::string
const &, std::string
const &);
70 std::list<ParamAssignExpression *> positionalParams;
71 std::map<std::string, ParamAssignExpression *> params;
74 bool delayedCreation =
false;
78 void set(std::string
const &name, std::string
const &expr);
87 enum RecipeContextType {
88 RECIPE_CONTEXT_TYPE_ROOT,
89 RECIPE_CONTEXT_TYPE_ROTATION,
90 RECIPE_CONTEXT_TYPE_TRANSLATION,
91 RECIPE_CONTEXT_TYPE_PORT
96 RecipeContextType type;
98 std::list<RecipeContext *> contexts;
99 std::list<RecipeElementStep *> elements;
101 std::list<std::string> varNames;
102 std::map<std::string, ParamAssignExpression *> variables;
103 std::map<std::string, ParamAssignExpression *> params;
107 bool delayed =
false;
110 std::string parentNS;
119 if (parentNS.size() == 0)
122 return name.size() > 0
123 ? parentNS +
"." + name
127 std::string to_string()
const;
132 std::list<std::string> steps;
136 plug(std::string
const &element)
138 steps.push_back(element);
144 Recipe *m_parent =
nullptr;
147 std::list<std::string> m_searchPaths;
150 std::vector<RecipeContext *> m_contexts;
151 std::vector<RecipeElementStep *> m_elementSteps;
152 std::vector<RecipeOpticalPath *> m_pathSteps;
153 std::vector<Recipe *> m_subRecipes;
154 std::list<std::string> m_scripts;
156 std::vector<ParamAssignExpression *> m_elemParameters;
157 std::vector<ParamAssignExpression *> m_frameParameters;
158 std::vector<ParamAssignExpression *> m_variables;
160 std::map<std::string, RecipeContext *> m_frames;
161 std::map<std::string, RecipeElementStep *> m_elements;
162 std::map<std::string, Recipe *> m_customElements;
163 std::map<std::string, RecipeOpticalPath *> m_paths;
164 std::map<std::string, RecipeParameter> m_parameters;
165 std::map<std::string, RecipeParameter> m_dofs;
166 std::map<std::string, RecipeContext *> m_ports;
170 unsigned int m_nestedPorts = 0;
172 std::string currNS()
const;
175 std::string genElementName(std::string
const &type);
176 std::string genReferenceFrameName(std::string
const &type);
178 std::string genElementName(std::string
const &parent, std::string
const &type);
179 std::string genReferenceFrameName(std::string
const &parent, std::string
const &type);
184 RecipeParameter *makeRecipeParam(std::map<std::string, RecipeParameter> &, std::string
const &);
188 std::string
const &name,
189 std::string
const &expression);
193 std::string
const &name,
194 std::string
const &expression);
198 std::string
const &name,
199 std::string
const &expression);
208 inline std::list<std::string>
const &
214 inline std::list<std::string>
const &
217 return m_searchPaths;
221 currentContext()
const
223 return m_currContext;
229 std::vector<RecipeContext *>
const &contexts()
const;
230 std::vector<RecipeElementStep *>
const &elements()
const;
231 std::vector<RecipeOpticalPath *>
const &paths()
const;
232 std::map<std::string, RecipeContext *>
const &ports()
const;
234 std::map<std::string, Recipe *>
const &customElements()
const;
235 std::map<std::string, RecipeParameter>
const &dofs()
const;
236 std::map<std::string, RecipeParameter>
const ¶ms()
const;
238 RecipeContext *lookupReferenceFrame(std::string
const &)
const;
242 Recipe *makeCustomElement(std::string
const &);
244 bool addScript(std::string
const &scriptPath);
245 void pushSearchPath(std::string
const &path);
246 void pushVariable(std::string
const &name, std::string
const &value);
249 std::string
const &angle,
250 std::string
const &eX,
251 std::string
const &eY,
252 std::string
const &eZ,
253 std::string
const &name =
"");
255 void pushTranslation(
256 std::string
const &dX,
257 std::string
const &dY,
258 std::string
const &dZ,
259 std::string
const &name =
"");
266 std::string
const &name,
267 std::string
const &factory,
268 std::map<std::string, std::string>
const ¶meters
269 = std::map<std::string, std::string>());
273 void addPort(std::string
const &name);
276 std::string
const &name,
278 Real min = -INFINITY,
279 Real max = +INFINITY);
282 std::string
const &name,
284 Real min = -INFINITY,
285 Real max = +INFINITY);
Definition: GenericCompositeModel.h:120