Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 1.24 KB

ModelView_multiple.md

File metadata and controls

28 lines (19 loc) · 1.24 KB

Model View

Multiple containers

Example of how to create a table managing data based on multiple containers. Here is considered the example of a 8 dimensions array. The type is a custom enum, and the editor is here managed by persistent dedicated widgets.

glvm_SlvEnum(EnumName, A, B, C, D)
typedef EnumName Tvalue;
// Use alias for std::vector<std::vector<>> for simplicity
template <class T>
using Matrix = std::vector< std::vector<T> >;
GlvTableView< Matrix< Matrix< Matrix< Matrix<Tvalue> > > >, GlvWidget, true>* table_view8D = new GlvTableView< Matrix< Matrix< Matrix< Matrix<Tvalue> > > >, GlvWidget, true>(matrix8D);
table_view8D->show();

sample004

The size of the intermediate editors adjusts automatically to manage navigation and edition on multiple dimensions.

More details in sample004_0.cpp and sample004.cpp.

Remark

Containers of different types can be used together: std::vector, std::map, std::array, std::list, std::deque. Example in sample004_6.cpp.