Volume Cartographer 2.27.0
Sphere.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <string>
6#include <unordered_map>
7
8#include "ShapePrimitive.hpp"
9
10namespace volcart::shapes
11{
12// clang-format off
39// clang-format on
40class Sphere : public ShapePrimitive
41{
42public:
43 explicit Sphere(float radius = 5, int recursion = 2);
44
45private:
47 int midpoint_(int p1, int p2);
48
54 std::unordered_map<std::string, int> indexCache_;
55
56}; // Sphere
57} // namespace volcart::shapes
Base class for shape generators.
Icosphere shape.
Definition: Sphere.hpp:41
int midpoint_(int p1, int p2)
Compute and cache the midpoint between two vertices.
std::unordered_map< std::string, int > indexCache_
Vertex index cache.
Definition: Sphere.hpp:54
Shape and mesh primitives.