You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.7 KiB
50 lines
1.7 KiB
#pragma once
|
|
|
|
#include <macros.h>
|
|
|
|
#include <math/eigen_alias.hpp>
|
|
#include <utils/marked_ptr.hpp>
|
|
#include <container/stl_alias.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) {}
|
|
|
|
void destroy();
|
|
|
|
virtual primitive_type get_type() const = 0;
|
|
virtual span<marked_subface_ptr_t<subface>> get_subfaces() const = 0;
|
|
virtual stl_vector_mp<surface_type> get_subface_types() const = 0;
|
|
virtual stl_vector_mp<const void *> get_subface_geometries() const = 0;
|
|
|
|
void update_geometry(const void *geometry_ptr, size_t subface_index = 0);
|
|
|
|
dynamic_bitset_mp<> judge_sign_by_subface_sign(const stl_vector_mp<dynamic_bitset_mp<>> &) const;
|
|
dynamic_bitset_mp<> judge_sign_by_subface_sign(const stl_vector_mp<dynamic_bitset_mp<>> &,
|
|
const stl_vector_mp<uint32_t> &,
|
|
const stl_vector_mp<bool> &) const;
|
|
|
|
aabb_t fetch_aabb() const { return m_aabb; }
|
|
|
|
void apply_transform(internal::transform_type, Eigen::Vector4d);
|
|
|
|
protected:
|
|
void initialize(
|
|
const stl_vector_mp<internal::paired_model_matrix_ptr_t> &,
|
|
const stl_vector_mp<bool> &,
|
|
const stl_vector_mp<const void *> &,
|
|
const aabb_t &);
|
|
void recompute_aabb();
|
|
|
|
aabb_t m_aabb{};
|
|
primitive_data_center_ptr_t data_center{};
|
|
};
|