LCOV - code coverage report
Current view: top level - src/PointCloud - Object.cpp (source / functions) Hit Total Coverage
Test: HLR Lines: 1 22 4.5 %
Date: 2018-01-09 14:49:59 Functions: 2 6 33.3 %

          Line data    Source code
       1             : #include "Object.hpp"
       2             : #include <CGAL/IO/io.h>
       3             : 
       4             : namespace HLR
       5             : {
       6             : namespace PointCloud
       7             : {
       8             : namespace
       9             : {
      10             : bool is_same_polyhedron(
      11             :     const CGAL::Surface_mesh<CGAL::Simple_cartesian<double>::Point_3>& lhs,
      12             :     const CGAL::Surface_mesh<CGAL::Simple_cartesian<double>::Point_3>& rhs);
      13             : }
      14             : 
      15           0 : Object::operator HLR::Object() const
      16             : {
      17           0 :     HLR::Object object;
      18           0 :     object.id = id;
      19           0 :     if (speed)
      20             :     {
      21           0 :         object.speed = *speed;
      22           0 :         object.flags |= HLR::Object::HAS_SPEED;
      23             :     }
      24           0 :     object.flags |= static_cast<std::uint8_t>(is_cup ? HLR::Object::IS_CUP : 0);
      25           0 :     object.flags |=
      26           0 :         static_cast<std::uint8_t>(is_deleted ? HLR::Object::IS_DELETED : 0);
      27             : 
      28           0 :     std::ostringstream serialization_stream;
      29           0 :     serialization_stream << polyhedron;
      30           0 :     object.polyhedron = serialization_stream.str();
      31             : 
      32           0 :     return object;
      33             : }
      34             : 
      35           0 : bool Object::operator==(const Object& rhs) const
      36             : {
      37           0 :     return id == rhs.id && is_same_polyhedron(polyhedron, rhs.polyhedron)
      38           0 :            && speed == rhs.speed && is_cup == rhs.is_cup
      39           0 :            && is_deleted == rhs.is_deleted;
      40             : }
      41             : 
      42           0 : bool Object::operator!=(const Object& rhs) const
      43             : {
      44           0 :     return !(*this == rhs);
      45             : }
      46             : 
      47             : namespace
      48             : {
      49           0 : bool is_same_polyhedron(const CGAL::Surface_mesh<
      50             :                             CGAL::Simple_cartesian<double>::Point_3>& /* lhs */,
      51             :                         const CGAL::Surface_mesh<
      52             :                             CGAL::Simple_cartesian<double>::Point_3>& /* rhs */)
      53             : {
      54             :     // TODO: Actually implement this
      55           0 :     return true;
      56             : }
      57             : } // namespace
      58             : 
      59             : } // namespace PointCloud
      60           3 : } // namespace HLR

Generated by: LCOV version 1.12