1 |
|
|
// |
2 |
|
|
// Copyright (c) 2016 CNRS |
3 |
|
|
// Authors: Pierre Fernbach |
4 |
|
|
// |
5 |
|
|
// This file is part of hpp-rbprm |
6 |
|
|
// hpp-rbprm is free software: you can redistribute it |
7 |
|
|
// and/or modify it under the terms of the GNU Lesser General Public |
8 |
|
|
// License as published by the Free Software Foundation, either version |
9 |
|
|
// 3 of the License, or (at your option) any later version. |
10 |
|
|
// |
11 |
|
|
// hpp-core is distributed in the hope that it will be |
12 |
|
|
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
13 |
|
|
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 |
|
|
// General Lesser Public License for more details. You should have |
15 |
|
|
// received a copy of the GNU Lesser General Public License along with |
16 |
|
|
// hpp-core If not, see |
17 |
|
|
// <http://www.gnu.org/licenses/>. |
18 |
|
|
|
19 |
|
|
#ifndef HPP_RBPRM_VALIDATION_REPORT_HH |
20 |
|
|
#define HPP_RBPRM_VALIDATION_REPORT_HH |
21 |
|
|
|
22 |
|
|
#include <hpp/core/collision-validation-report.hh> |
23 |
|
|
#include <hpp/core/validation-report.hh> |
24 |
|
|
|
25 |
|
|
namespace hpp { |
26 |
|
|
namespace core { |
27 |
|
|
|
28 |
|
|
HPP_PREDEF_CLASS(RbprmValidationReport); |
29 |
|
|
typedef shared_ptr<RbprmValidationReport> RbprmValidationReportPtr_t; |
30 |
|
|
|
31 |
|
|
/// \addtogroup validation |
32 |
|
|
/// \{ |
33 |
|
|
|
34 |
|
|
/// Validate a configuration with respect to collision |
35 |
|
|
/// |
36 |
|
|
struct HPP_CORE_DLLAPI RbprmValidationReport |
37 |
|
|
: public CollisionValidationReport { |
38 |
|
|
/// Directing vector between collision point of geometries |
39 |
|
|
std::map<std::string, CollisionValidationReportPtr_t> |
40 |
|
|
ROMReports; // name ; collision report |
41 |
|
|
std::map<std::string, bool> ROMFilters; // name ; true if valid |
42 |
|
|
|
43 |
|
|
bool trunkInCollision; |
44 |
|
|
bool romsValid; |
45 |
|
|
|
46 |
|
|
/// Write report in a stream |
47 |
|
|
virtual std::ostream& print(std::ostream& os) const { |
48 |
|
|
if (trunkInCollision) { |
49 |
|
|
os << "Collision between object " << object1->name() << " and " |
50 |
|
|
<< object2->name(); |
51 |
|
|
} |
52 |
|
|
if (!romsValid) { |
53 |
|
|
os << "Rom filters not respected : " << std::endl; |
54 |
|
|
for (std::map<std::string, bool>::const_iterator it = ROMFilters.begin(); |
55 |
|
|
it != ROMFilters.end(); ++it) { |
56 |
|
|
if (!it->second) os << " " << it->first << std::endl; |
57 |
|
|
} |
58 |
|
|
} |
59 |
|
|
return os; |
60 |
|
|
} |
61 |
|
|
|
62 |
|
|
}; // class RbprmValidationReport |
63 |
|
|
/// \} |
64 |
|
|
} // namespace core |
65 |
|
|
} // namespace hpp |
66 |
|
|
|
67 |
|
|
#endif // HPP_RBPRM__VALIDATION_REPORT_HH |