34#include <NDEVR/QTModelManager.h>
35#include <NDEVR/QTModelManagerView.h>
37#include <QSortFilterProxyModel>
114 QIcon::Mode
iconMode(
const QModelIndex& index)
const;
161 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
162 Qt::ItemFlags flags(
const QModelIndex& index)
const override;
163 QVariant data(
const QModelIndex& proxyIndex,
int role = Qt::DisplayRole)
const override;
164 bool setData(
const QModelIndex& index,
const QVariant& value,
int role = Qt::EditRole)
override;
227 virtual bool lessThan(
const QModelIndex& left,
const QModelIndex& right)
const override;
238 void _autosetCheckState(
const Model& parent, Qt::CheckState default_check_state);
239 bool filterAcceptsRow(
int row,
const QModelIndex& parent)
const override;
240 bool filterAcceptsColumn(
int row,
const QModelIndex& parent)
const override;
241 bool isTreeVisible(
const Model& m)
const;
242 bool calculateTreeVisible(
const Model& m)
const;
244 std::function<bool(
const Model&)> m_visible_filter;
249 String m_custom_header_icon;
250 bool m_allow_selections;
253 bool m_show_selected;
254 bool m_show_materials;
The equivelent of std::vector but with a bit more control.
A hash-based key-value store, useful for quick associative lookups.
A core class that represents a node on model hierarchy.
bool hasIndex(const UUID &id) const
Checks whether the given UUID exists in the proxy model.
QTModelManager & manager() const
Gets the model manager associated with this filter.
void setIsRootFilter(const std::function< bool(const Model &)> &filter)
Sets a filter function that determines whether a model is treated as a root.
void setCheckStateRecursive(const Model &model, Qt::CheckState check_state)
Sets the check state of a model and all its descendants recursively.
void selectAllVisible()
Sets all currently visible models to checked.
void setCheckState(const Model &model, Qt::CheckState check_state)
Sets the check state of a single model.
void setAllowSelections(bool allow)
Sets whether checkbox selection is allowed.
void setCheckStateAll(Qt::CheckState check_state)
Sets the check state of all models.
Model model(const QModelIndex &index) const
Gets the Model object at the given proxy index.
void setCheckStateAll(GeometryType type, Qt::CheckState check_state)
Sets the check state of all models matching the given geometry type.
void invalidate()
Invalidates the current filter and triggers re-evaluation.
void setRootModels(const Buffer< UUID > &ids)
Sets the root model UUIDs to display in the filtered view.
void setCheckStateAll(const String &model_type, Qt::CheckState check_state)
Sets the check state of all models matching the given model type.
QIcon::Mode iconMode(const QModelIndex &index) const
Gets the icon mode for the given proxy index based on the model state.
void setShowSelected(bool show_selected)
Sets whether to visually indicate selected models.
ProxyModelViewFilter(QTModelManagerView *view, QObject *parent=nullptr)
Constructs a proxy filter using a model manager view as the data source.
void setCheckStateAll(const String &model_type, GeometryType type, Qt::CheckState check_state)
Sets the check state of all models matching a model type and geometry type.
void clearCheckStates()
Clears all check states to unchecked.
void setGreyHidden(bool grey_hidden)
Sets whether hidden models should be displayed with greyed-out icons.
void setCustomHeader(const TranslatedString &header_title, const StringView &header_icon)
Sets a custom header title and icon for the view.
void setShowMaterials(bool show_materials)
Sets whether material entries are shown in the view.
void setSelectedModelRoots(const Buffer< UUID > &roots, bool only_visible_children)
Sets check states based on model root UUIDs with optional child visibility filtering.
UUID getModelID(const QModelIndex &index) const
Gets the model UUID at the given proxy index.
Qt::CheckState checkState(const Model &model) const
Gets the check state of the given model.
void setCheckStateAll(const std::function< bool(const Model &model)> &model_type, Qt::CheckState check_state)
Sets the check state of all models matching a custom predicate.
void setVisibleFilter(const std::function< bool(const Model &)> &filter)
Sets a custom filter function that determines whether a model is visible.
UUID getMaterialID(const QModelIndex &index) const
Gets the material UUID at the given proxy index.
QModelIndex getIndex(const UUID &id, int column) const
Gets the proxy index for the given UUID and column.
void setAllowEdits(bool allow)
Sets whether editing model names is allowed in the view.
Buffer< UUID > getSelectedModelRoots() const
Gets the UUIDs of all checked root models.
void refreshAll()
Forces a complete refresh of all filtered data.
Buffer< UUID > getModelRoots() const
Gets the UUIDs of all root models in the view.
QModelIndex getIndex(const Model &model, int column) const
Gets the proxy index for the given model and column.
ProxyModelViewFilter(QTModelManager *manager, QObject *parent=nullptr)
Constructs a proxy filter using a model manager as the data source.
A Qt compatible ItemModel for interfacing with a DesignObjectLookup.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
The primary namespace for the NDEVR SDK.
GeometryType
Describes the high-level geometric topology of a Geometry object.