50 #include <visp3/core/vpDebug.h>
51 #include <visp3/core/vpException.h>
52 #include <visp3/core/vpMath.h>
53 #include <visp3/core/vpMatrixException.h>
54 #include <visp3/core/vpPoseVector.h>
155 void vpPoseVector::set(
const double tx,
const double ty,
const double tz,
const double tux,
const double tuy,
184 const double tuy,
const double tuz)
230 for (
unsigned int i = 0; i < 3; i++) {
232 (*this)[i + 3] = tu[i];
343 for (
unsigned int i = 0; i < 6; i++)
345 std::cout << (*this)[i] <<
" ";
348 std::cout << std::endl;
384 for (
unsigned int i = 0; i < 6; i++) {
424 typedef std::string::size_type size_type;
429 std::vector<std::string> values(m * n);
430 std::ostringstream oss;
431 std::ostringstream ossFixed;
432 std::ios_base::fmtflags original_flags = oss.flags();
435 ossFixed.setf(std::ios::fixed, std::ios::floatfield);
437 size_type maxBefore = 0;
438 size_type maxAfter = 0;
440 for (
unsigned int i = 0; i < m; ++i) {
443 if (oss.str().find(
"e") != std::string::npos) {
445 ossFixed << (*this)[i];
446 oss.str(ossFixed.str());
449 values[i] = oss.str();
450 size_type thislen = values[i].size();
451 size_type p = values[i].find(
'.');
453 if (p == std::string::npos) {
462 size_type totalLength = length;
466 maxAfter = (std::min)(maxAfter, totalLength - maxBefore);
475 s <<
"[" << m <<
"," << n <<
"]=\n";
477 for (
unsigned int i = 0; i < m; i++) {
479 size_type p = values[i].find(
'.');
480 s.setf(std::ios::right, std::ios::adjustfield);
481 s.width((std::streamsize)maxBefore);
482 s << values[i].substr(0, p).c_str();
485 s.setf(std::ios::left, std::ios::adjustfield);
486 if (p != std::string::npos) {
487 s.width((std::streamsize)maxAfter);
488 s << values[i].substr(p, maxAfter).c_str();
490 assert(maxAfter > 1);
491 s.width((std::streamsize)maxAfter);
501 s.flags(original_flags);
503 return (
int)(maxBefore + maxAfter);