Blender  V2.93
spreadsheet_cell_value.hh
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
19 #include <optional>
20 
21 #include "BLI_color.hh"
22 #include "BLI_float2.hh"
23 #include "BLI_float3.hh"
24 
25 struct Object;
26 struct Collection;
27 
29 
31  const Object *object;
32 };
33 
36 };
37 
42 class CellValue {
43  public:
44  /* The implementation just uses a bunch of `std::option` for now. Unfortunately, we cannot use
45  * `std::variant` yet, due to missing compiler support. This type can really be optimized more,
46  * but it does not really matter too much currently. */
47 
48  std::optional<int> value_int;
49  std::optional<float> value_float;
50  std::optional<bool> value_bool;
51  std::optional<float2> value_float2;
52  std::optional<float3> value_float3;
53  std::optional<Color4f> value_color;
54  std::optional<ObjectCellValue> value_object;
55  std::optional<CollectionCellValue> value_collection;
56 };
57 
58 } // namespace blender::ed::spreadsheet
std::optional< ObjectCellValue > value_object
std::optional< CollectionCellValue > value_collection