65 lines
1.6 KiB
C++
65 lines
1.6 KiB
C++
#ifndef VOXELSPACE_H
|
|
#define VOXELSPACE_H
|
|
|
|
#include <vector>
|
|
#include <cstdint>
|
|
|
|
namespace Voxel {
|
|
struct Extrema {
|
|
int xMax;
|
|
int xMin;
|
|
int yMax;
|
|
int yMin;
|
|
int zMax;
|
|
int zMin;
|
|
};
|
|
|
|
struct Space {
|
|
uint64_t space;
|
|
int dims[3];
|
|
};
|
|
|
|
inline auto index(int dims[3], int x, int y, int z) -> int;
|
|
|
|
inline auto newIndexRotX(int dims[3], int x, int y, int z) -> int;
|
|
|
|
inline auto newIndexRotY(int dims[3], int x, int y, int z) -> int;
|
|
|
|
inline auto newIndexRotZ(int dims[3], int x, int y, int z) -> int;
|
|
|
|
inline auto toggle(uint64_t space, int index) -> uint64_t;
|
|
|
|
inline auto set(uint64_t space, int index, bool val) -> uint64_t;
|
|
|
|
inline auto collides(Space *a, Space *b) -> bool;
|
|
inline auto collides(uint64_t a, uint64_t b) -> bool;
|
|
|
|
inline auto add(Space *a, Space *b) -> Space;
|
|
|
|
inline auto filledAt(Space *space, int index) -> bool;
|
|
|
|
auto getExtrema(uint64_t space, int dims[3]) -> Extrema;
|
|
|
|
auto cullEmptySpace(Space *space) -> void;
|
|
|
|
auto isMatch(Space *a, Space *b) -> bool;
|
|
|
|
auto rotate90X(Space *space) -> void;
|
|
|
|
auto rotate90Y(Space *space) -> void;
|
|
|
|
auto rotate90Z(Space *space) -> void;
|
|
|
|
auto pushNewUniqueSpins(std::vector<Space> *existingSpaces, Space* spaceToSpin) -> void;
|
|
|
|
auto getUniqueRotations(Space *space) -> std::vector<Space>;
|
|
|
|
auto getAllPositionsInPrism(uint64_t space, int space_dims[3], int prism_dims[3]) -> std::vector<uint64_t>;
|
|
|
|
auto getAllPermutationsInPrism(Space *space, int prism_dims[3]) -> std::vector<uint64_t>;
|
|
|
|
auto size(uint64_t space) -> int;
|
|
}
|
|
|
|
#endif
|