PLaSK library
Loading...
Searching...
No Matches
align.cpp
Go to the documentation of this file.
1/*
2 * This file is part of PLaSK (https://plask.app) by Photonics Group at TUL
3 * Copyright (c) 2022 Lodz University of Technology
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14#include "align.hpp"
15
16#include <boost/algorithm/string.hpp>
17#include <boost/lexical_cast.hpp>
18
19namespace plask {
20namespace align {
21
22namespace details {
23
25inline void tryGetAligner(Aligner<dir>& ans, plask::optional<double> param) {
26 if (!param) return;
27 if (!ans.isNull()) throw Exception("multiple specifications of aligner in direction {0}", dir);
29}
30
42
54
66
67} // namespace details
68
69/*Aligner3D<Primitive<3>::DIRECTION_LONG, Primitive<3>::DIRECTION_TRAN>* aligner3DFromString(std::string str) {
70 boost::algorithm::to_lower(str);
71 if (str == "front left" || str == "fl" || str == "left front" || str == "lf") return new FrontLeft();
72 else if (str == "center left" || str == "cl" || str == "left center" || str == "lc") return new CenterLeft();
73 else if (str == "back left" || str == "bl" || str == "left back" || str == "lb") return new BackLeft();
74 else if (str == "front center" || str == "fc" || str == "center front" || str == "lf") return new FrontCenter();
75 else if (str == "center center" || str == "cc" || str == "center" || str == "c") return new CenterCenter();
76 else if (str == "back center" || str == "bl" || str == "center back" || str == "lb") return new BackCenter();
77 else if (str == "front right" || str == "fr" || str == "right front" || str == "rf") return new FrontRight();
78 else if (str == "center right" || str == "cr" || str == "right center" || str == "rc") return new CenterRight();
79 else if (str == "back right" || str == "br" || str == "right back" || str == "rb") return new BackRight();
80 throw BadInput("alignerFromString", "wrong aligner specification");
81 return nullptr;
82}*/
83
84
85
86} // namespace align
87} // namespace plask