All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Typedefs | Enumerations | Functions
SurgSim::DataStructures Namespace Reference

Namespaces

 Convert
 
 Names
 Common strings for NamedData.
 

Classes

class  AabbTree
 AabbTree is a tree that is organized by the bounding boxes of the referenced objects, the bounding box used is the Axis Aligned Bounding Box (AABB), with the extents of an AABB describing the min and max of each coordinate for the given object. More...
 
class  AabbTreeData
 Internal class to hold a list of AABBs and their respective object ids, it can calculate the elements that intersect with a given aabb each node in the AABB tree holds one of these. More...
 
class  AabbTreeIntersectionVisitor
 Visitor class to collect the items that intersect with a given bounding box. More...
 
class  AabbTreeNode
 Node class for the AabbTree, this handles groups of items and subdivision if the number of items gets too big. More...
 
class  BufferedValue
 BufferedValue is a class to enable a representation of two values for one variable, where both values need to be accessible at the same time, one in a thread safe, single threaded context, the other in a thread unsafe context. More...
 
class  DataGroup
 A collection of NamedData objects. More...
 
class  DataGroupBuilder
 A class that allows you to build a DataGroup structure. More...
 
class  DataGroupCopier
 A class that assists in copying from one DataGroup to another, when assignment is not possible. More...
 
class  EmptyData
 EmptyData class. More...
 
class  Image
 A templated Image class. More...
 
class  IndexDirectory
 A simple bidirectional mapping between names (strings) and distinct consecutive non-negative indices. More...
 
struct  IndexedLocalCoordinate
 A generic (size_t index, Vector coordinate) pair. More...
 
struct  Location
 
struct  MeshElement
 Element structure for meshes. More...
 
class  NamedData
 A templated dictionary in which data can be accessed by name or index, with immutable names & indices. More...
 
class  NamedDataBuilder
 A class that allows you to build a NamedData structure. More...
 
class  NamedDataTest
 
class  NamedVariantData
 A NamedData collection of variant data type. More...
 
struct  NormalData
 Store normal for each triangle in a triangle mesh. More...
 
class  OctreeNode
 Octree data structure. More...
 
class  OctreePathHash
 Enable the OctreePath to be used as a key in an unordered map, if the int range is exceeded this will just push the least significant numbers (root addresses) out of scope, it loses a little bit of address space as octree ids only go from 0-7. More...
 
class  OptionalValue
 Container class that can indicate whether the object has been assigned a value. More...
 
class  PlyReader
 Wrapper for the C .ply file parser This class wraps the main functionality for the original C .ply file parser at http://paulbourke.net/dataformats/ply/ it enables customization of the parsing process either through a delegate class or through executing the requestElement and requestProperty functions. More...
 
class  PlyReaderDelegate
 PlyReaderDelegate abstract class. More...
 
class  TetrahedronMesh
 Basic class for storing Tetrahedron Meshes, handling basic vertex, edge, triangle and tetrahedron functionality. More...
 
class  Tree
 Basic tree structure. More...
 
class  TreeData
 Abstract base class for data stored in a Tree. More...
 
class  TreeNode
 Basic tree node structure. More...
 
class  TreeVisitor
 Abstract Class for visitors, this needs to be extended for other tree nodes when necessary return false from handle() to abort traversal. More...
 
class  TriangleMesh
 A TriangleMesh stores normal information for the triangles. More...
 
class  TriangleMeshBase
 Basic class for storing Triangle Meshes, handling basic vertex, edge, and triangle functionality. More...
 
class  TriangleMeshPlyReaderDelegate
 Implementation of PlyReaderDelegate for simple triangle meshes. More...
 
struct  Vertex
 Vertex structure for meshes. More...
 
struct  Vertex< void >
 Specialization of Vertex with no data. More...
 
class  Vertices
 Base class for mesh structures, handling basic vertex functionality. More...
 

Typedefs

typedef std::array
< NamedDataCopyMap, 8 > 
DataGroupCopyMap
 The type used for copying values between two DataGroups that cannot assign to each other. More...
 
typedef Image< float > Imagef
 
typedef std::unordered_map
< int, int > 
NamedDataCopyMap
 The type used for copying values between two NamedData objects that cannot assign to each other. More...
 
typedef NamedDataBuilder
< boost::any > 
NamedVariantDataBuilder
 
typedef std::vector< size_t > OctreePath
 Typedef of octree path The path is a vector of children indexes (each within 0 to 7) that lead to the specific node the front of the vector holds the index of the root's children. More...
 
typedef TriangleMeshBase
< EmptyData, EmptyData,
EmptyData
TriangleMeshPlain
 

Enumerations

enum  Neighborhood {
  NEIGHBORHOOD_NONE = 0x0, NEIGHBORHOOD_FACE = 0x1, NEIGHBORHOOD_EDGE = 0x2, NEIGHBORHOOD_VERTEX = 0x4,
  NEIGHBORHOOD_ALL = 0x1 | 0x2 | 0x4
}
 Indicates what neighbors to grab. More...
 
enum  Symbol {
  SYMBOL_HALT = -1, SYMBOL_DOWN = 0, SYMBOL_UP = 1, SYMBOL_RIGHT = 2,
  SYMBOL_LEFT = 3, SYMBOL_BACK = 4, SYMBOL_FRONT = 5
}
 Direction code for the neighborhood search. More...
 

Functions

std::shared_ptr< OctreeNode
< EmptyData > > 
loadOctree (const std::string &fileName)
 A free function to load an octree from file. More...
 
SurgSim::DataStructures::OctreePath getNeighbor (const OctreePath &origin, const std::array< Symbol, 3 > &direction)
 Calculate the neighbor of an node in the octree by traversing a state machine, see http://ww1.ucmss.com/books/LFS/CSREA2006/MSV4517.pdf for detailed description. More...
 
std::vector< OctreePathgetNeighbors (const OctreePath &origin, int type)
 Fetch a list of neighbors, indicated by the type, Face, Edge and Vertex are possible types and can be combined via OR. More...
 
 TEST_F (NamedDataTest, GetByName)
 
 TEST_F (NamedDataTest, GetByIndex)
 
std::shared_ptr
< TriangleMeshPlain
loadTriangleMesh (const std::string &filename)
 Helper function to load a mesh from a given filename, does NOT do path resolution. More...
 

Typedef Documentation

The type used for copying values between two DataGroups that cannot assign to each other.

typedef std::unordered_map<int, int> SurgSim::DataStructures::NamedDataCopyMap

The type used for copying values between two NamedData objects that cannot assign to each other.

The keys are the source indices. The values are the target indices.

typedef std::vector<size_t> SurgSim::DataStructures::OctreePath

Typedef of octree path The path is a vector of children indexes (each within 0 to 7) that lead to the specific node the front of the vector holds the index of the root's children.

Enumeration Type Documentation

Indicates what neighbors to grab.

Enumerator
NEIGHBORHOOD_NONE 
NEIGHBORHOOD_FACE 
NEIGHBORHOOD_EDGE 
NEIGHBORHOOD_VERTEX 
NEIGHBORHOOD_ALL 

Direction code for the neighborhood search.

Enumerator
SYMBOL_HALT 
SYMBOL_DOWN 
SYMBOL_UP 
SYMBOL_RIGHT 
SYMBOL_LEFT 
SYMBOL_BACK 
SYMBOL_FRONT 

Function Documentation

OctreePath SurgSim::DataStructures::getNeighbor ( const OctreePath &  origin,
const std::array< Symbol, 3 > &  direction 
)

Calculate the neighbor of an node in the octree by traversing a state machine, see http://ww1.ucmss.com/books/LFS/CSREA2006/MSV4517.pdf for detailed description.

The information about the location of a nodes neighbor is encoded in a state machine, this machine is traversed until a 'Halt' instruction is found. If the neighbor is across a boundary on the octree, a new search direction is determined by the algorithm.

Note
The numbering in the paper and our numbering is slightly different, this means the following transformations took place. a) The colums where reordered to match our numbering b) All the numbers where replaced to match out numbering The number changes where as following: 0 => 6, 1 => 7, 2 => 4, 3 => 5, 4 => 2, 5 => 3, 6 => 0, 7 => 1
Parameters
originthe node whose neighbor is needed
directiona set of directions, for face neighbors use 1, for edge neighbors use 2 and for vertex neighbors use 3 direction, fill the other spots with SYMBOL_HALT. E.g. to find the left neighbor use {SYMBOL_LEFT, SYMBOL_HALT, SYMBOL_HALT}, for the vertex neighber on the upper left front corner use {SYMBOL_LEFT, SYMBOLD_FRONT, SYMBOL_UP}
Returns
a OctreePath to the correct neighbor, empty if the neighbor is outside of the tree
std::vector< OctreePath > SurgSim::DataStructures::getNeighbors ( const OctreePath &  origin,
int  type 
)

Fetch a list of neighbors, indicated by the type, Face, Edge and Vertex are possible types and can be combined via OR.

Parameters
originthe node whose neighbor is needed
typethe kind of neighborhood that is needed,
See also
Neighborhood
Returns
list of paths with neighbors of the node at origin
std::shared_ptr< OctreeNode< SurgSim::DataStructures::EmptyData > > SurgSim::DataStructures::loadOctree ( const std::string &  fileName)

A free function to load an octree from file.

Parameters
fileNameName of the external file which contains an octree.
Returns
A std::shared_ptr<> pointing to an OctreeNode.
std::shared_ptr< SurgSim::Graphics::Mesh > SurgSim::DataStructures::loadTriangleMesh ( const std::string &  filename)

Helper function to load a mesh from a given filename, does NOT do path resolution.

Specialization for Graphics::Mesh Helper function to load a mesh from a given filename, does NOT do path resolution.

Exceptions
SurgSim::Framework::AssertionFailureif the reader does not contain mesh information.
Parameters
filenamePath to the file that is to be read.
Returns
the filled mesh a filled mesh if the reading succeeds, nullptr otherwise
SurgSim::DataStructures::TEST_F ( NamedDataTest  ,
GetByName   
)
SurgSim::DataStructures::TEST_F ( NamedDataTest  ,
GetByIndex   
)