18 namespace SpatialStructures {
71 Node(
float x,
float y,
float z,
int ID = -1);
85 Node(
const std::array<float, 3>& position);
99 Node(
const std::array<float, 3>& position,
NODE_TYPE t,
int id);
171 std::array<float, 3>
getArray()
const;
413 template <
typename SizeT>
416 seed ^= value + 0x9e3779b9 + (seed << 6) + (seed >> 2);
421 struct hash<
HF::SpatialStructures::Node>
425 size_t seed = std::hash<float>()(k.x);
434 os <<
"(" << n.
x <<
", " << n.
y <<
", " << n.
z <<
")";
439 inline ostream&
operator<<(ostream& os,
const std::array<float, 3> n) {
440 os <<
"(" << n[0] <<
"," << n[1] <<
"," << n[2] <<
")";
void hash_combine_impl(SizeT &seed, SizeT value) noexcept
combine value into the hash value of seed
ostream & operator<<(ostream &os, const HF::SpatialStructures::Node n)
Create a string containing the x,y,z position of this node.
Perform human scale analysis on 3D environments.
NODE_TYPE
The type of node this is.
@ POI
POI is 'point of interest'.
@ GRAPH
This node is a graph node.
@ OTHER
This node doesn't belong in any other category.
A point in space with an ID.
Node operator+(const Node &n2) const
Creates a new node from the vector addition of this node and n2.
Node operator*(const Node &n2) const
Creates a new node from the dot product of this node and n2.
bool operator<(const Node &n2) const
Determines if this node's id (an integer) is less than n2's id.
float angleTo(const Node &n2) const
Calculate the angle between node 1 and n2
Node()
Default constructor. Every element contained is defaulted to NAN.
float z
Cartesian coordinates x, y, z.
std::array< float, 3 > getArray() const
Returns the x,y,z of this node as an array of 3 floats.
float & operator[](int i)
Directly access a nodes's position as if it were an array of 3 floats,
bool operator!=(const Node &n2) const
See operator==, checks if this node does NOT occupy the same space as n2.
bool operator>(const Node &n2) const
Determines if this node's id (an integer) is greater than n2's id
float distanceTo(const Node &n2) const
Calculate the distance between this node and n2.
std::array< float, 3 > directionTo(const Node &n2) const
Get the direction between this node and another node
Node operator-(const Node &n2) const
Creates a node from the vector subtraction of this node and n2's position.
bool operator==(const Node &n2) const
Check if this node occupies the same space as n2.
std::size_t operator()(const HF::SpatialStructures::Node &k) const noexcept