This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/editors/space_spreadsheet/spreadsheet_dataset_layout.hh
Fabian Schempp ae085e301c Spreadsheet: Dataset region for spreadsheet editor
This patch adds a left aligned sidebar to the spreadsheet editor. This
Sidebar can be used to navigate the geometry component types and
attribute domains. It also provides a quick overview of domain sizes.
It replaces the two dropdowns in the regions header.
Next step will be to add the domain cycling shortcut
using the CTRL + mouse wheel.

Reviewer: Dalai Felinto (dfelinto), Julian Eisel (Severin),
Hans Goudey (HooglyBoogly).

Differential Revision: https://developer.blender.org/D11046
2021-06-25 07:57:24 +02:00

69 lines
2.1 KiB
C++

/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#pragma once
#include <array>
#include <optional>
/* Enum definitions... */
#include "BKE_attribute.h"
#include "BKE_geometry_set.h"
#include "BLI_span.hh"
/* More enum definitions... */
#include "UI_resources.h"
#pragma once
namespace blender::ed::spreadsheet {
struct DatasetAttrDomainLayoutInfo {
AttributeDomain type;
const char *label;
BIFIconID icon;
constexpr DatasetAttrDomainLayoutInfo(AttributeDomain type, const char *label, BIFIconID icon)
: type(type), label(label), icon(icon)
{
}
};
struct DatasetComponentLayoutInfo {
GeometryComponentType type;
const char *label;
BIFIconID icon;
/** Array of attribute-domains. Has to be fixed size based on #AttributeDomain enum, but not all
* values need displaying for all parent components. Hence the optional use. */
using AttrDomainArray = std::array<std::optional<DatasetAttrDomainLayoutInfo>, ATTR_DOMAIN_NUM>;
const AttrDomainArray attr_domains;
};
struct DatasetLayoutHierarchy {
/** The components for display (with layout info like icon and label). Each component stores
* the attribute domains it wants to display (also with layout info like icon and label). */
const Span<DatasetComponentLayoutInfo> components;
};
DatasetLayoutHierarchy dataset_layout_hierarchy();
#ifndef NDEBUG
void dataset_layout_hierarchy_sanity_check(const DatasetLayoutHierarchy &hierarchy);
#endif
} // namespace blender::ed::spreadsheet