|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <macros.h>
|
|
|
|
|
|
|
|
|
|
#include <math/eigen_alias.hpp>
|
|
|
|
|
#include <utils/marked_ptr.hpp>
|
|
|
|
|
#include <container/dynamic_bitset.hpp>
|
|
|
|
|
#include <container/span.hpp>
|
|
|
|
|
|
|
|
|
|
#include <primitive_descriptor.h>
|
|
|
|
|
#include <data/data_type.hpp>
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
|
using marked_subface_ptr_t = marked_ptr<T, 1>;
|
|
|
|
|
|
|
|
|
|
struct subface;
|
|
|
|
|
|
|
|
|
|
EXTERN_C struct PE_API primitive {
|
|
|
|
|
primitive(primitive_data_center_t *data_center_ptr) : data_center(data_center_ptr) {}
|
|
|
|
|
|
|
|
|
|
virtual ~primitive() = default;
|
|
|
|
|
|
|
|
|
|
void destroy();
|
|
|
|
|
|
|
|
|
|
virtual primitive_type get_type() const = 0;
|
|
|
|
|
virtual span<marked_subface_ptr_t<subface>> get_subfaces() const = 0;
|
|
|
|
|
virtual std::vector<surface_type> get_subface_types() const = 0;
|
|
|
|
|
|
|
|
|
|
dynamic_bitset<> judge_sign_by_subface_sign(const std::vector<dynamic_bitset<>> &) const;
|
|
|
|
|
dynamic_bitset<> judge_sign_by_subface_sign(const std::vector<dynamic_bitset<>> &, const std::vector<uint32_t> &) const;
|
|
|
|
|
|
|
|
|
|
aabb_t fetch_aabb() const { return m_aabb; }
|
|
|
|
|
|
|
|
|
|
void apply_transform(internal::transform_type, Eigen::Vector4d);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void initialize(const std::vector<internal::paired_model_matrix_ptr_t> &, const std::vector<bool> &, const aabb_t &);
|
|
|
|
|
|
|
|
|
|
aabb_t m_aabb{};
|
|
|
|
|
primitive_data_center_ptr_t data_center{};
|
|
|
|
|
};
|