12 const double CoViS3DObservation::TOL = 1e-5;
15 CoViS3DObservation::CoViS3DObservation()
18 ColorPairDescriptor d;
27 NUKLEI_UNIQUE_PTR<kernel::base> CoViS3DObservation::getKernel()
const
32 void CoViS3DObservation::setKernel(
const kernel::base& k)
39 void CoViS3DObservation::setLoc(Vector3 loc)
45 Vector3 CoViS3DObservation::getLoc()
const {
return k_.loc_; }
47 void CoViS3DObservation::setDirection(Vector3 direction)
50 NUKLEI_ASSERT_AFE_TOL(direction.Length(), 1, TOL);
51 direction = la::normalized(direction);
56 Vector3 CoViS3DObservation::getDirection()
const {
return k_.dir_; }
60 NUKLEI_RANGE_CHECK(phi, - M_PI, M_PI);
61 NUKLEI_RANGE_CHECK(psi, -M_PI, 2*M_PI);
65 l[0] = std::sin( phi ) * std::cos( psi );
66 l[1] = - std::sin( phi ) * std::sin( psi );
67 l[2] = std::cos( phi );
72 coord_pair CoViS3DObservation::getPhiPsi()
const
75 Vector3 direction = getDirection();
76 coord_t phi = ACos(direction[2]);
77 coord_t psi = std::atan2( -direction[1] / std::sin(phi),
78 direction[0]/std::sin(phi) );
79 return std::make_pair(phi, psi);
83 void CoViS3DObservation::setCovMatrix(
const Matrix3& cov)
88 nullable<Matrix3> CoViS3DObservation::getCovMatrix()
const
93 void CoViS3DObservation::setWeight(
weight_t weight)
101 const Color& CoViS3DObservation::getLeftColor()
const
103 NUKLEI_TRACE_BEGIN();
104 return dynamic_cast<const ColorPairDescriptor&
>(k_.getDescriptor()).getLeftColor();
107 void CoViS3DObservation::setLeftColor(
const Color& color)
109 NUKLEI_TRACE_BEGIN();
110 dynamic_cast<ColorPairDescriptor&
>(k_.getDescriptor()).setLeftColor(color);
113 const Color& CoViS3DObservation::getRightColor()
const
115 NUKLEI_TRACE_BEGIN();
116 return dynamic_cast<const ColorPairDescriptor&
>(k_.getDescriptor()).getRightColor();
119 void CoViS3DObservation::setRightColor(
const Color& color)
121 NUKLEI_TRACE_BEGIN();
122 dynamic_cast<ColorPairDescriptor&
>(k_.getDescriptor()).setRightColor(color);
126 void CoViS3DObservation::setGamma(
const Vector3& gamma)
128 NUKLEI_TRACE_BEGIN();
129 NUKLEI_ASSERT_AFE(gamma.Length(), 1);
132 Vector3 y = la::normalized(gamma);
133 Vector3 z = la::normalized(x.Cross(y));
135 NUKLEI_ASSERT_AFE_TOL(x.Dot(k_.dir_), 1, 1e-6);
140 const Vector3& CoViS3DObservation::getGamma()
const
142 NUKLEI_TRACE_BEGIN();