21 #ifndef KJB_PSI_WEIGHTED_BOX_H
22 #define KJB_PSI_WEIGHTED_BOX_H
29 #include <boost/io/ios_state.hpp>
31 #ifdef KJB_HAVE_UA_CARTWHEEL
32 #include <Control/BoxState.h>
77 #ifdef KJB_HAVE_UA_CARTWHEEL
78 inline Cuboid to_cuboid(
const CartWheel::BoxState& cw_box)
81 to_kjb(cw_box.getPosition()),
82 to_kjb(cw_box.getSize()),
83 to_kjb(cw_box.getQuaternion()));
109 static size_t size() {
return 7; }
132 double get(
size_t i)
const
143 return log(
size_[0]);
145 return log(
size_[1]);
147 return log(
size_[2]);
158 void set(
size_t i,
double value)
172 size_[0] = exp(value);
175 size_[1] = exp(value);
179 size_[2] = exp(value);
206 ost << box.
size_[0] <<
" ";
207 ost << box.
size_[1] <<
" ";
208 ost << box.
size_[2] <<
" ";
218 boost::io::ios_flags_saver ifs( ist );
246 std::istringstream ist(line);
Vector & resize(int new_length, Value_type pad=Value_type(0))
Resize vector, retaining previous values.
Definition: m_vector.cpp:242
friend std::ostream & operator<<(std::ostream &ost, const Weighted_box &box)
Definition: psi_weighted_box.h:196
std::ostream & operator<<(std::ostream &ost, const Action &action)
serialize an action
Definition: psi_action.cpp:333
size_type size() const
Alias to get_length(). Required to comply with stl Container concept.
Definition: m_vector.h:510
Definition: psi_units.h:38
Object thrown when an index argument exceeds the size of a container.
Definition: l_exception.h:399
std::istream & operator>>(std::istream &ist, Action &action)
unserialize an action
Definition: psi_action.cpp:346
Unit_type
Definition: psi_units.h:30
Definition: psi_weighted_box.h:43
double get_mass() const
Definition: psi_weighted_box.h:105
#define KJB_THROW(ex)
Definition: l_exception.h:46
This class implements vectors, in the linear-algebra sense, with real-valued elements.
Definition: m_vector.h:87
void set_mass(double mass)
Definition: psi_weighted_box.h:106
Definition: psi_weighted_box.h:91
Quaternion orientation_
Definition: psi_weighted_box.h:71
void set_center(const Vector ¢er)
Definition: psi_weighted_box.h:65
void set(size_t i, double value)
Definition: psi_weighted_box.h:158
static size_t size()
Definition: psi_weighted_box.h:109
std::vector< Vector > get_corners(const Cuboid &c)
Definition: psi_weighted_box.cpp:31
Weighted_box()
Definition: psi_weighted_box.h:95
Definition: g_quaternion.h:40
const Vector & get_center() const
Definition: psi_weighted_box.h:61
Cuboid(const Vector ¢er, const Vector &size, const Quaternion &orientation)
Definition: psi_weighted_box.h:52
void render(const Cuboid &c)
Definition: psi_weighted_box.cpp:56
Quaternion & set_axis_angle(const Vector &, double angle)
Definition: g_quaternion.cpp:370
static Unit_type get_units(size_t i)
Definition: psi_weighted_box.h:110
void set_orientation(const Quaternion &orientation)
Definition: psi_weighted_box.h:67
Cuboid Base
Definition: psi_weighted_box.h:93
Cuboid()
Definition: psi_weighted_box.h:46
friend std::istream & operator>>(std::istream &ist, Weighted_box &box)
Definition: psi_weighted_box.h:215
void set_size(const Vector &size)
Definition: psi_weighted_box.h:66
const Vector & get_size() const
Definition: psi_weighted_box.h:62
Definition: psi_units.h:39
double get_angle() const
Definition: g_quaternion.cpp:294
const Quaternion & get_orientation() const
Definition: psi_weighted_box.h:63
get the indices of edges in each direction for i
Definition: APPgetLargeConnectedEdges.m:48
Weighted_box(const kjb::Vector &position, double rotation, const kjb::Vector &size, double mass)
Definition: psi_weighted_box.h:100
Definition: psi_units.h:31
Vector center_
Definition: psi_weighted_box.h:69
Weighted_box parse_cli_weighted_box(const std::string &line)
Definition: psi_weighted_box.h:242
Vector size_
Definition: psi_weighted_box.h:70
Definition: psi_units.h:34
Definition for the Vector class, a thin wrapper on the KJB Vector struct and its related functionalit...