43 lines
887 B
C++
43 lines
887 B
C++
#pragma once
|
|
|
|
#include "dvc_config.h"
|
|
#include "dvc_pre_declare.h"
|
|
|
|
DV_CORE_BEGIN_NAMESPACE
|
|
|
|
class DV_CORE_API Mesh
|
|
{
|
|
public:
|
|
typedef std::map<VertexElementType, DeviceBufferAccessorConstPtr> PrimitiveAttributes;
|
|
struct Primitive
|
|
{
|
|
PrimitiveType type;
|
|
PrimitiveAttributes attributes;
|
|
DeviceBufferAccessorConstPtr indices;
|
|
};
|
|
typedef std::shared_ptr<Primitive> PrimitivePtr;
|
|
typedef std::shared_ptr<const Primitive> PrimitiveConstPtr;
|
|
typedef std::vector<PrimitivePtr> PrimitiveArray;
|
|
|
|
public:
|
|
const std::string& getName(void) const {
|
|
return m_name;
|
|
}
|
|
|
|
PrimitivePtr newPrimitive(void);
|
|
int32_t getPrimitiveCounts(void) const {
|
|
return (int32_t)m_primitiveArray.size();
|
|
}
|
|
PrimitiveConstPtr getPrimitive(int32_t index) const;
|
|
|
|
private:
|
|
std::string m_name;
|
|
PrimitiveArray m_primitiveArray;
|
|
|
|
public:
|
|
Mesh(const std::string& name);
|
|
~Mesh();
|
|
};
|
|
|
|
DV_CORE_END_NAMESPACE
|