@@ -25,33 +25,21 @@ class CMitsubaMetadata : public asset::IAssetMetadata
2525 public:
2626 std::string m_id;
2727 };
28- class IGeometry : public CID
29- {
30- public:
31- inline IGeometry () : CID(), type(CElementShape::Type::INVALID) {}
32- inline ~IGeometry () = default ;
33-
34- CElementShape::Type type;
35- };
36- class CPolygonGeometry final : public asset::IPolygonGeometryMetadata, public IGeometry
28+ class CGeometryCollection final : public asset::IGeometryCollectionMetadata, public CID
3729 {
3830 public:
39- inline CPolygonGeometry () : asset::IPolygonGeometryMetadata (), IGeometry( ) {}
40- inline CPolygonGeometry (CPolygonGeometry && other) : CPolygonGeometry () {operator =(std::move (other));}
41- inline ~CPolygonGeometry () = default ;
31+ inline CGeometryCollection () : asset::IGeometryCollectionMetadata (), CID(), type(CElementShape::Type::INVALID ) {}
32+ inline CGeometryCollection (CGeometryCollection && other) : CGeometryCollection () {operator =(std::move (other));}
33+ inline ~CGeometryCollection () = default ;
4234
43- inline CPolygonGeometry & operator =(CPolygonGeometry && other)
35+ inline CGeometryCollection & operator =(CGeometryCollection && other)
4436 {
45- asset::IPolygonGeometryMetadata ::operator =(std::move (other));
46- IGeometry ::operator =(std::move (other));
37+ asset::IGeometryCollectionMetadata ::operator =(std::move (other));
38+ CID ::operator =(std::move (other));
4739 return *this ;
4840 }
49- };
50- class CGeometryCollection final : public asset::IGeometryCollectionMetadata, public CID
51- {
52- public:
53- inline CGeometryCollection () : asset::IGeometryCollectionMetadata(), CID() {}
54- inline ~CGeometryCollection () = default ;
41+
42+ CElementShape::Type type;
5543 };
5644
5745 struct SGlobal
@@ -69,32 +57,33 @@ class CMitsubaMetadata : public asset::IAssetMetadata
6957 const char * getLoaderName () const override {return LoaderName;}
7058
7159 // add more overloads when more asset implementations of IGeometry<ICPUBuffer> exist
72- inline const CPolygonGeometry * getAssetSpecificMetadata (const asset::ICPUPolygonGeometry * asset) const
60+ inline const CGeometryCollection * getAssetSpecificMetadata (const asset::ICPUGeometryCollection * asset) const
7361 {
7462 const auto found = IAssetMetadata::getAssetSpecificMetadata (asset);
75- return static_cast <const CPolygonGeometry *>(found);
63+ return static_cast <const CGeometryCollection *>(found);
7664 }
7765
7866 private:
7967 friend struct SContext ;
80- struct SGeometryMetaPair
68+ struct SGeometryCollectionMetaPair
8169 {
82- core::smart_refctd_ptr<asset::ICPUPolygonGeometry> geom ;
83- CMitsubaMetadata::CPolygonGeometry meta;
70+ core::smart_refctd_ptr<asset::ICPUGeometryCollection> collection ;
71+ CMitsubaMetadata::CGeometryCollection meta;
8472 };
85- inline void setPolygonGeometryMeta (core::unordered_map<const CElementShape*,SGeometryMetaPair>&& container)
73+ template <typename Key>
74+ inline void setGeometryCollectionMeta (core::unordered_map<Key,SGeometryCollectionMetaPair>&& container)
8675 {
8776 const uint32_t count = container.size ();
88- m_metaPolygonGeometryStorage = IAssetMetadata::createContainer<CPolygonGeometry >(count);
77+ m_metaPolygonGeometryStorage = IAssetMetadata::createContainer<CGeometryCollection >(count);
8978 auto outIt = m_metaPolygonGeometryStorage->begin ();
9079 for (auto & el : container)
9180 {
9281 *outIt = std::move (el.second .meta );
93- IAssetMetadata::insertAssetSpecificMetadata (el.second .geom .get (),outIt++);
82+ IAssetMetadata::insertAssetSpecificMetadata (el.second .collection .get (),outIt++);
9483 }
9584 }
9685
97- meta_container_t <CPolygonGeometry > m_metaPolygonGeometryStorage;
86+ meta_container_t <CGeometryCollection > m_metaPolygonGeometryStorage;
9887};
9988
10089}
0 commit comments