|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <macros.h>
|
|
|
|
|
|
|
|
|
|
#include "primitive/simple/sphere.hpp"
|
|
|
|
|
#include "primitive/simple/cylinder.hpp"
|
|
|
|
|
#include "primitive/simple/cone.hpp"
|
|
|
|
|
#include "primitive/simple/box.hpp"
|
|
|
|
|
#include "primitive/extrude/extrude.hpp"
|
|
|
|
|
|
|
|
|
|
#include "primitive/axis/helixline_extrude_axis.hpp"
|
|
|
|
|
#include "primitive/axis/polyline_extrude_axis.hpp"
|
|
|
|
|
#include "primitive/pattern/polyline_pattern.hpp"
|
|
|
|
|
|
|
|
|
|
using plane_container_t = flat_object_set<internal::plane_t>;
|
|
|
|
|
using sphere_container_t = flat_object_set<internal::sphere_face_t>;
|
|
|
|
|
using cylinder_container_t = flat_object_set<internal::cylinder_face_t>;
|
|
|
|
|
using cone_container_t = flat_object_set<internal::cone_face_t>;
|
|
|
|
|
using extrude_side_container_t = flat_object_set<internal::extrude_side_face_t>;
|
|
|
|
|
|
|
|
|
|
using helixline_axis_container_t = flat_object_set<internal::helixline_extrude_axis>;
|
|
|
|
|
using polyline_axis_container_t = flat_object_set<internal::polyline_extrude_axis>;
|
|
|
|
|
|
|
|
|
|
using polyline_pattern_container_t = flat_object_set<internal::polyline_pattern>;
|
|
|
|
|
|
|
|
|
|
EXTERN_C struct PE_API primitive_data_center_t {
|
|
|
|
|
// all other data depend on cached transform_blocks
|
|
|
|
|
using surface_containers =
|
|
|
|
|
std::variant<plane_container_t, sphere_container_t, cylinder_container_t, cone_container_t, extrude_side_container_t>;
|
|
|
|
|
std::array<surface_containers, static_cast<uint8_t>(surface_type::max_count)> surfaces{};
|
|
|
|
|
|
|
|
|
|
void require_surface(surface_type type,
|
|
|
|
|
const internal::paired_model_matrix& matrix,
|
|
|
|
|
std::array<void*, 2> additional_structure,
|
|
|
|
|
marked_subface_ptr_t<subface>& subface);
|
|
|
|
|
void release_surface(surface_type type, const marked_subface_ptr_t<subface>& subface);
|
|
|
|
|
|
|
|
|
|
using axis_containers = std::variant<polyline_axis_container_t, helixline_axis_container_t>;
|
|
|
|
|
std::array<axis_containers, AXIS_TYPE_MAX_COUNT> axes{};
|
|
|
|
|
internal::extrude_axis* require_axis(axis_type type, const internal::extrude_axis& temp_axis_ptr);
|
|
|
|
|
void release_axis(axis_type type, const pointer_wrapper<internal::extrude_axis>& axis);
|
|
|
|
|
|
|
|
|
|
using pattern_containers = std::variant<polyline_pattern_container_t>;
|
|
|
|
|
std::array<pattern_containers, PATTERN_TYPE_MAX_COUNT> patterns{};
|
|
|
|
|
internal::pattern* require_pattern(pattern_type type, const internal::pattern& temp_pattern_ptr);
|
|
|
|
|
void release_pattern(pattern_type type, const pointer_wrapper<internal::pattern>& pattern);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
namespace internal
|
|
|
|
|
{
|
|
|
|
|
PE_API primitive* new_primitive(primitive_type type, primitive_data_center_t* data_center_ptr);
|
|
|
|
|
PE_API primitive* copy_primitive(primitive* ptr);
|
|
|
|
|
PE_API primitive* new_param_primitive(const void* axis,
|
|
|
|
|
bool closed_axis,
|
|
|
|
|
const Eigen::AffineCompact3d& axis_to_world,
|
|
|
|
|
const void* pattern,
|
|
|
|
|
primitive_type type,
|
|
|
|
|
primitive_data_center_t* data_center_ptr);
|
|
|
|
|
} // namespace internal
|