34 #ifndef OCTOMAP_SCANGRAPH_H 35 #define OCTOMAP_SCANGRAPH_H 64 return (
id == other.
id);
87 : first(_first), second(_second), constraint(_constraint), weight(1.0) { }
91 return ( (*first == *(other.
first) ) && ( *second == *(other.
second) ) );
98 std::ostream& writeASCII(std::ostream &s)
const;
99 std::istream& readASCII(std::istream &s,
ScanGraph& graph);
145 ScanEdge* addEdge(
unsigned int first_id,
unsigned int second_id);
148 ScanNode* getNodeByID(
unsigned int id);
151 bool edgeExists(
unsigned int first_id,
unsigned int second_id);
154 void connectPrevious();
156 std::vector<unsigned int> getNeighborIDs(
unsigned int id);
157 std::vector<ScanEdge*> getOutEdges(
ScanNode* node);
159 std::vector<ScanEdge*> getInEdges(
ScanNode* node);
161 void exportDot(std::string filename);
164 void transformScans();
175 iterator
begin() {
return nodes.begin(); }
176 iterator
end() {
return nodes.end(); }
177 const_iterator
begin()
const {
return nodes.begin(); }
178 const_iterator
end()
const {
return nodes.end(); }
180 size_t size()
const {
return nodes.size(); }
181 size_t getNumPoints(
unsigned int max_id = -1)
const;
188 const_edge_iterator
edges_end()
const {
return edges.end(); }
193 bool writeBinary(
const std::string& filename)
const;
197 std::ostream& writeEdgesASCII(std::ostream &s)
const;
198 std::istream& readEdgesASCII(std::istream &s);
200 std::ostream& writeNodePosesASCII(std::ostream &s)
const;
201 std::istream& readNodePosesASCII(std::istream &s);
219 std::istream& readPlainASCII(std::istream& s);
220 void readPlainASCII(
const std::string& filename);
std::istream & readPoseASCII(std::istream &s)
edge_iterator edges_end()
std::vector< ScanNode * >::const_iterator const_iterator
ScanNode(Pointcloud *_scan, pose6d _pose, unsigned int _id)
pose6d pose
6D pose from which the scan was performed
std::istream & readBinary(std::istream &s)
ScanEdge(ScanNode *_first, ScanNode *_second, pose6d _constraint)
std::vector< ScanNode * >::iterator iterator
const_iterator begin() const
const_iterator end() const
bool operator==(const ScanNode &other)
std::vector< ScanEdge * > edges
std::vector< ScanEdge * >::iterator edge_iterator
This class represents a tree-dimensional pose of an object.
const_edge_iterator edges_begin() const
std::ostream & writeBinary(std::ostream &s) const
This class represents a three-dimensional vector.
const_edge_iterator edges_end() const
std::vector< ScanEdge * >::const_iterator const_edge_iterator
std::vector< ScanNode * > nodes
std::ostream & writePoseASCII(std::ostream &s) const
edge_iterator edges_begin()