#pragma once #include #include #include "IDrawable.h" #include "Vertex.h" #include using namespace DirectX; namespace eg3d { struct STLTriangle { XMFLOAT3 normal; XMFLOAT3 v1, v2, v3; uint16_t attributeByteCount; }; class Geometry : public IDrawable { private: ComPtr mDevice; // device std::vector mVertices; // vertexek std::vector mIndices; // indexek std::mutex mModifMtx; // ... // topológia D3D_PRIMITIVE_TOPOLOGY mTopology; // bufferek ComPtr mVertexBuffer; ComPtr mIndexBuffer; // leírók D3D12_VERTEX_BUFFER_VIEW mVertexBufferView; D3D12_INDEX_BUFFER_VIEW mIndexBufferView; public: explicit Geometry(ComPtr device); // konstr. Geometry(const Geometry& other); // másolókonstruktor void setVertices(const std::vector &vertices); // vertexek beállítása std::vector getVertices() const; // vertexek lekérése void setIndices(const std::vector &indices); // indexek beállítása std::vector getIndices() const; // indexek lekérése void setTopology(D3D_PRIMITIVE_TOPOLOGY topology); // topológia beállítása D3D_PRIMITIVE_TOPOLOGY getTopology() const; // topológia lekérése void setupInputAssembler(ComPtr commandList) const; // input assembler beállítása void draw(ComPtr commandList) const override; // kirajzolás void merge(const Geometry& other); // két geometria egyesítése Geometry& operator+=(const Geometry& other); // két geometria egyesítése void loadBinarySTL(const std::string& fileName); // bináris STL fájl betöltése }; // geometriatároló típusa using GeometryPool = std::vector>; }