HOG2
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Voxels Class Reference

#include <Voxels.h>

Inheritance diagram for Voxels:
Inheritance graph
[legend]
Collaboration diagram for Voxels:
Collaboration graph
[legend]

Classes

struct  OctreeNode
 
struct  voxelWorld
 

Public Member Functions

 Voxels (const char *filename)
 
 ~Voxels ()
 
void Export (const char *filename)
 
void GetSuccessors (const voxelState &nodeID, std::vector< voxelState > &neighbors) const
 
void GetActions (const voxelState &nodeID, std::vector< voxelAction > &actions) const
 
void ApplyAction (voxelState &s, voxelAction a) const
 
bool InvertAction (voxelAction &a) const
 
double HCost (const voxelState &node1, const voxelState &node2) const
 Heuristic value between two arbitrary nodes. More...
 
double GCost (const voxelState &node1, const voxelState &node2) const
 
double GCost (const voxelState &node, const voxelAction &act) const
 
bool GoalTest (const voxelState &node, const voxelState &goal) const
 
uint64_t GetStateHash (const voxelState &node) const
 
void GetStateFromHash (uint64_t parent, voxelState &s)
 
uint64_t GetActionHash (voxelAction act) const
 
void OpenGLDraw () const
 
void OpenGLDraw (const voxelState &) const
 
void OpenGLDraw (const voxelState &, const voxelState &, float) const
 Draw the transition at some percentage 0...1 between two states. More...
 
void OpenGLDraw (const voxelState &, const voxelAction &) const
 
void GLLabelState (const voxelState &, const char *) const
 
void GLDrawLine (const voxelState &x, const voxelState &y) const
 
void Draw (Graphics::Display &display) const
 
- Public Member Functions inherited from SearchEnvironment< voxelState, voxelAction >
virtual ~SearchEnvironment ()
 
virtual int GetNumSuccessors (const voxelState &stateID) const
 
virtual voxelAction GetAction (const voxelState &s1, const voxelState &s2) const
 
virtual void UndoAction (voxelState &s, voxelAction a) const
 
virtual void GetNextState (const voxelState &s1, voxelAction a, voxelState &s2) const
 
virtual void StoreGoal (voxelState &s)
 Stores the goal for use by single-state HCost. More...
 
virtual void ClearGoal ()
 Clears the goal from memory. More...
 
virtual bool IsGoalStored () const
 Returns true if the goal is stored and false otherwise. More...
 
virtual double HCost (const voxelState &node1, const voxelState &node2, double parentHCost) const
 
virtual double HCost (const voxelState &node) const
 Heuristic value between node and the stored goal. More...
 
virtual bool GoalTest (const voxelState &node) const
 Goal Test if the goal is stored. More...
 
virtual uint64_t GetMaxHash () const
 
virtual void GetStateFromHash (uint64_t parent, voxelState &s) const
 
virtual double GetPathLength (std::vector< voxelState > &neighbors)
 
virtual double GetPathLength (const voxelState &start, std::vector< voxelAction > &neighbors)
 
virtual OccupancyInterface< voxelState, voxelAction > * GetOccupancyInfo ()
 
virtual void SetOccupancyInfo (OccupancyInterface< voxelState, voxelAction > *)
 
virtual void OpenGLDraw () const
 
virtual void GLDrawPath (const std::vector< voxelState > &x) const
 
virtual void SetColor (const rgbColor &r) const
 
virtual void SetColor (GLfloat rr, GLfloat g, GLfloat b, GLfloat t=1.0) const
 
virtual void GetColor (GLfloat &rr, GLfloat &g, GLfloat &b, GLfloat &t) const
 
virtual rgbColor GetColor () const
 
virtual void Draw (Graphics::Display &display, const voxelState &) const
 
virtual void DrawLine (Graphics::Display &display, const voxelState &x, const voxelState &y, float width=1.0) const
 
- Public Member Functions inherited from Heuristic< voxelState >
 Heuristic ()
 
virtual ~Heuristic ()
 

Private Types

typedef std::vector< OctreeNodeOctreeLayer
 

Private Member Functions

void AddVoxelCubeToOctree (uint64_t values, point3d p)
 
point3d GetVoxelCoordinate (uint64_t morton, float voxelSize, const float minbounds[4]) const
 
uint32_t Part1By2 (uint32_t x) const
 
uint32_t EncodeMorton3 (uint32_t x, uint32_t y, uint32_t z) const
 
uint32_t Compact1By2 (uint32_t x) const
 
uint32_t DecodeMorton3X (uint32_t code) const
 
uint32_t DecodeMorton3Y (uint32_t code) const
 
uint32_t DecodeMorton3Z (uint32_t code) const
 
size_t GetIndex (size_t x, size_t y, size_t z) const
 
void GetCoordsForIndex (size_t i, size_t &x, size_t &y, size_t &z) const
 

Private Attributes

std::vector< uint64_t > mLayer0VoxelGrids
 
std::vector< OctreeLayermOctreeLayers
 
voxelWorld w
 

Additional Inherited Members

- Public Attributes inherited from Heuristic< voxelState >
std::vector< HeuristicTreeNodelookups
 
std::vector< Heuristic * > heuristics
 
uint64_t histogram [256]
 
- Protected Attributes inherited from SearchEnvironment< voxelState, voxelAction >
bool bValidSearchGoal
 
voxelState searchGoal
 
rgbColor color
 
GLfloat transparency
 

Detailed Description

Definition at line 60 of file Voxels.h.

Member Typedef Documentation

◆ OctreeLayer

typedef std::vector<OctreeNode> Voxels::OctreeLayer
private

Definition at line 112 of file Voxels.h.

Constructor & Destructor Documentation

◆ Voxels()

Voxels::Voxels ( const char *  filename)

◆ ~Voxels()

Voxels::~Voxels ( )

Definition at line 107 of file Voxels.cpp.

Member Function Documentation

◆ AddVoxelCubeToOctree()

void Voxels::AddVoxelCubeToOctree ( uint64_t  values,
point3d  p 
)
private

Definition at line 245 of file Voxels.cpp.

References mLayer0VoxelGrids.

Referenced by Voxels().

◆ ApplyAction()

void Voxels::ApplyAction ( voxelState s,
voxelAction  a 
) const
virtual

Implements SearchEnvironment< voxelState, voxelAction >.

Definition at line 180 of file Voxels.cpp.

◆ Compact1By2()

uint32_t Voxels::Compact1By2 ( uint32_t  x) const
private

Definition at line 347 of file Voxels.cpp.

Referenced by DecodeMorton3X(), DecodeMorton3Y(), and DecodeMorton3Z().

◆ DecodeMorton3X()

uint32_t Voxels::DecodeMorton3X ( uint32_t  code) const
private

Definition at line 357 of file Voxels.cpp.

References Compact1By2().

Referenced by GetVoxelCoordinate().

◆ DecodeMorton3Y()

uint32_t Voxels::DecodeMorton3Y ( uint32_t  code) const
private

Definition at line 362 of file Voxels.cpp.

References Compact1By2().

Referenced by GetVoxelCoordinate().

◆ DecodeMorton3Z()

uint32_t Voxels::DecodeMorton3Z ( uint32_t  code) const
private

Definition at line 367 of file Voxels.cpp.

References Compact1By2().

Referenced by GetVoxelCoordinate().

◆ Draw()

void Voxels::Draw ( Graphics::Display display) const
virtual

Reimplemented from SearchEnvironment< voxelState, voxelAction >.

Definition at line 324 of file Voxels.cpp.

◆ EncodeMorton3()

uint32_t Voxels::EncodeMorton3 ( uint32_t  x,
uint32_t  y,
uint32_t  z 
) const
private

Definition at line 341 of file Voxels.cpp.

References Part1By2().

◆ Export()

void Voxels::Export ( const char *  filename)

◆ GCost() [1/2]

double Voxels::GCost ( const voxelState node,
const voxelAction act 
) const
virtual

Implements SearchEnvironment< voxelState, voxelAction >.

Definition at line 202 of file Voxels.cpp.

◆ GCost() [2/2]

double Voxels::GCost ( const voxelState node1,
const voxelState node2 
) const
virtual

Implements SearchEnvironment< voxelState, voxelAction >.

Definition at line 197 of file Voxels.cpp.

◆ GetActionHash()

uint64_t Voxels::GetActionHash ( voxelAction  act) const
virtual

Implements SearchEnvironment< voxelState, voxelAction >.

Definition at line 226 of file Voxels.cpp.

◆ GetActions()

void Voxels::GetActions ( const voxelState nodeID,
std::vector< voxelAction > &  actions 
) const
virtual

Implements SearchEnvironment< voxelState, voxelAction >.

Definition at line 175 of file Voxels.cpp.

◆ GetCoordsForIndex()

void Voxels::GetCoordsForIndex ( size_t  i,
size_t &  x,
size_t &  y,
size_t &  z 
) const
private

Definition at line 377 of file Voxels.cpp.

Referenced by Export(), OpenGLDraw(), and Voxels().

◆ GetIndex()

size_t Voxels::GetIndex ( size_t  x,
size_t  y,
size_t  z 
) const
private

Definition at line 372 of file Voxels.cpp.

◆ GetStateFromHash()

void Voxels::GetStateFromHash ( uint64_t  parent,
voxelState s 
)

Definition at line 218 of file Voxels.cpp.

References voxelState::x, voxelState::y, and voxelState::z.

◆ GetStateHash()

uint64_t Voxels::GetStateHash ( const voxelState node) const
virtual

Implements SearchEnvironment< voxelState, voxelAction >.

Definition at line 213 of file Voxels.cpp.

◆ GetSuccessors()

void Voxels::GetSuccessors ( const voxelState nodeID,
std::vector< voxelState > &  neighbors 
) const
virtual

Implements SearchEnvironment< voxelState, voxelAction >.

Definition at line 170 of file Voxels.cpp.

◆ GetVoxelCoordinate()

point3d Voxels::GetVoxelCoordinate ( uint64_t  morton,
float  voxelSize,
const float  minbounds[4] 
) const
private

Definition at line 232 of file Voxels.cpp.

References DecodeMorton3X(), DecodeMorton3Y(), DecodeMorton3Z(), and point3d.

Referenced by Export(), OpenGLDraw(), and Voxels().

◆ GLDrawLine()

void Voxels::GLDrawLine ( const voxelState x,
const voxelState y 
) const
virtual

Reimplemented from SearchEnvironment< voxelState, voxelAction >.

Definition at line 319 of file Voxels.cpp.

◆ GLLabelState()

void Voxels::GLLabelState ( const voxelState ,
const char *   
) const
virtual

Reimplemented from SearchEnvironment< voxelState, voxelAction >.

Definition at line 314 of file Voxels.cpp.

◆ GoalTest()

bool Voxels::GoalTest ( const voxelState node,
const voxelState goal 
) const
virtual

Implements SearchEnvironment< voxelState, voxelAction >.

Definition at line 207 of file Voxels.cpp.

◆ HCost()

double Voxels::HCost ( const voxelState node1,
const voxelState node2 
) const
virtual

Heuristic value between two arbitrary nodes.

Implements SearchEnvironment< voxelState, voxelAction >.

Definition at line 192 of file Voxels.cpp.

◆ InvertAction()

bool Voxels::InvertAction ( voxelAction a) const
virtual

Implements SearchEnvironment< voxelState, voxelAction >.

Definition at line 185 of file Voxels.cpp.

◆ OpenGLDraw() [1/4]

void Voxels::OpenGLDraw ( ) const

◆ OpenGLDraw() [2/4]

void Voxels::OpenGLDraw ( const voxelState ) const
virtual

Reimplemented from SearchEnvironment< voxelState, voxelAction >.

Definition at line 299 of file Voxels.cpp.

◆ OpenGLDraw() [3/4]

void Voxels::OpenGLDraw ( const voxelState ,
const voxelAction  
) const
virtual

Reimplemented from SearchEnvironment< voxelState, voxelAction >.

Definition at line 309 of file Voxels.cpp.

◆ OpenGLDraw() [4/4]

void Voxels::OpenGLDraw ( const voxelState ,
const voxelState ,
float   
) const
virtual

Draw the transition at some percentage 0...1 between two states.

Reimplemented from SearchEnvironment< voxelState, voxelAction >.

Definition at line 304 of file Voxels.cpp.

◆ Part1By2()

uint32_t Voxels::Part1By2 ( uint32_t  x) const
private

Definition at line 331 of file Voxels.cpp.

Referenced by EncodeMorton3().

Member Data Documentation

◆ mLayer0VoxelGrids

std::vector<uint64_t> Voxels::mLayer0VoxelGrids
private

Definition at line 103 of file Voxels.h.

Referenced by AddVoxelCubeToOctree().

◆ mOctreeLayers

std::vector<OctreeLayer> Voxels::mOctreeLayers
private

Definition at line 113 of file Voxels.h.

◆ w

voxelWorld Voxels::w
private

Definition at line 117 of file Voxels.h.

Referenced by Export(), OpenGLDraw(), and Voxels().


The documentation for this class was generated from the following files: