2 #ifndef GLTF_DATA_VIEWER_HAS_BEEN_INCLUDED_ 3 #define GLTF_DATA_VIEWER_HAS_BEEN_INCLUDED_ 5 #include "GltfCommon.h" 10 template <
typename ResultT,
typename ElemT = ResultT>
14 virtual const ResultT operator[](
size_t aIndex)
const = 0;
15 virtual const ResultT at(
size_t aIndex)
const = 0;
17 virtual const gltf::TypePair& internalTypeInfo()
const noexcept = 0;
19 inline size_t size()
const noexcept {
return(mSize);}
28 template <
typename ResultT,
typename ElemT, gltf::DataType T_dataType, gltf::ComponentType T_compType>
33 : mDataAccBundle(aDataAccBundle), mSkipStride(aSkipStride)
38 virtual const ResultT operator[](
size_t aIndex)
const override;
39 virtual const ResultT at(
size_t aIndex)
const override;
40 virtual const gltf::TypePair& internalTypeInfo()
const noexcept
override {
return(mTypeInfo);}
52 template <
typename ResultT,
typename ElemT = std::false_type>
57 template <
typename ResultT,
typename ElemT = ResultT>
62 using result_t = ResultT;
63 using element_t = ElemT;
68 bool isValid()
const noexcept {
return(_mInternalAdaptor !=
nullptr);}
70 virtual const ResultT operator[](
size_t aIndex)
const override {
71 return(_mInternalAdaptor->operator[](aIndex));
73 virtual const ResultT at(
size_t aIndex)
const override {
74 return(_mInternalAdaptor->at(aIndex));
76 virtual const gltf::TypePair& internalTypeInfo()
const noexcept
override {
77 return(_mInternalAdaptor->internalTypeInfo());
80 void fillVector(std::vector<ResultT>& aOutVector){
81 size_t size = _mInternalAdaptor->size();
82 aOutVector.reserve(size);
83 for(
size_t idx = 0; idx < size; ++idx){
84 aOutVector.emplace_back(
operator[](idx));
91 _mInternalAdaptor = aAdaptorInterface;
95 std::shared_ptr<GltfDataAdaptorInterface<ResultT, ElemT>> _mInternalAdaptor =
nullptr;
100 #include "GltfDataViewer.inl" Definition: GltfDataViewer.h:11
Definition: GltfCommon.h:58
Definition: GltfCommon.h:15
Definition: GltfDataViewer.h:29
Definition: GltfDataViewer.h:58
Definition: GltfCommon.h:24