3#include "Resources/VertexFormats.h"
5#include "Foundation/ComponentModel/Component.h"
6#include "Foundation/Geometry/BoundingBox.hpp"
7#include "Foundation/Geometry/Glm.hpp"
8#include "Foundation/Logging/Logger.h"
18 enum struct Shape :
int
27 LoftedCrossSectionsComponent::Shape shape = Shape::Hollow;
31 bool doubleSeamVertices =
false;
33 std::vector<PositionNormalVertex> vertices_vn;
34 std::vector<PositionNormalTexVertex> vertices_vnt;
35 std::vector<glm::vec3> spine;
36 Geometry::BoundingBox boundingBox;
38 bool visibility =
false;
40 template<
typename Arg0,
typename Arg1>
41 bool set(Arg0&& vertices,
43 LoftedCrossSectionsComponent::Shape shape,
46 bool doubleSeamVertices)
51 LOG_ERROR(log,
"Parameter sanity tests failed.");
52 this->visibility =
false;
53 this->hasData =
false;
60 this->doubleSeamVertices = doubleSeamVertices;
61 switch (this->shape) {
62 case LoftedCrossSectionsComponent::Shape::Hollow:
65 case LoftedCrossSectionsComponent::Shape::Solid:
68 case LoftedCrossSectionsComponent::Shape::Shell:
71 setVertices<Arg0>(std::forward<Arg0>(vertices));
72 this->spine = std::forward<Arg1>(spine);
78 static void registerType();
80 template<
typename Arg0>
void setVertices(Arg0&& arg);
84 inline void LoftedCrossSectionsComponent::setVertices<std::vector<PositionNormalVertex>&>(std::vector<PositionNormalVertex>& arg)
90 inline void LoftedCrossSectionsComponent::setVertices<std::vector<PositionNormalVertex>>(std::vector<PositionNormalVertex>&& arg)
92 vertices_vn = std::move(arg);
96 inline void LoftedCrossSectionsComponent::setVertices<std::vector<PositionNormalTexVertex>&>(std::vector<PositionNormalTexVertex>& arg)
102 inline void LoftedCrossSectionsComponent::setVertices<std::vector<PositionNormalTexVertex>>(std::vector<PositionNormalTexVertex>&& arg)
104 vertices_vnt = std::move(arg);
114 return "LoftedCrossSectionsComponent";
Base class for Component instances.
void setChanged()
Sets the component to the ComponentFlags::Changed state with carry.
Log implementation class.
Provides a weakly referenced view over the contents of a string.
@ Solid
Opaque geometry in arbitrary order.
constexpr Log getLogger(const char(&name)[LEN]) noexcept
Contains all Cogs related functionality.
bool boundingBoxSet
True when bounding box info is set but not yet forwarded to mesh.
int crossSections
Number of cross sections (inner & outer cross sections count as one).
bool screenAligned
Let open geometry be screen-aligned.
bool hollow
True if shape has inner and outer cross sections, otherwise shape is solid with only outer cross sect...
int samples
Number of sample points in each of the cross sections.
bool open
If true, cull the front of the shape such that the inside is visible.
bool hasData
True if we have (sane) data.