31 #if defined(RigidTransformation3D_RECURSES)
32 #error Recursive header files inclusion detected in RigidTransformation3D.h
35 #define RigidTransformation3D_RECURSES
37 #if !defined RigidTransformation3D_h
39 #define RigidTransformation3D_h
48 #include "DGtal/kernel/BasicPointFunctors.h"
49 #include "DGtal/base/Common.h"
50 #include "DGtal/kernel/domains/CDomain.h"
51 #include "DGtal/kernel/CSpace.h"
75 typename TFunctor = VectorRounding < TInputValue, TOutputValue > >
99 const double & angle,
const RealVector & aTranslate )
104 if ( std::isnan(
axis.norm() ) )
105 throw std::runtime_error (
"Axis of rotation can not be set as a vector of length 0!" );
106 t_sin = std::sin ( angle );
107 t_cos = std::cos ( angle );
187 const double & angle,
const RealVector & aTranslate )
190 if ( std::isnan(
axis.norm() ) )
191 throw std::runtime_error (
"Axis of rotation can not be set as a vector of length 0!" );
193 t_sin = std::sin ( angle );
194 t_cos = std::cos ( angle );
242 template <
typename TDomain,
typename TRig
idTransformFunctor >
251 typedef std::pair < typename TDomain::Space::Point, typename TDomain::Space::Point >
Bounds;
272 points[0] =
transform ( aInput.lowerBound() );
273 points[1] =
transform ( aInput.upperBound() );
274 points[2] =
transform (
Point ( aInput.upperBound()[0], aInput.lowerBound()[1], aInput.lowerBound()[2] ) );
275 points[3] =
transform (
Point ( aInput.lowerBound()[0], aInput.upperBound()[1], aInput.upperBound()[2] ) );
276 points[4] =
transform (
Point ( aInput.upperBound()[0], aInput.lowerBound()[1], aInput.upperBound()[2] ) );
277 points[5] =
transform (
Point ( aInput.lowerBound()[0], aInput.upperBound()[1], aInput.lowerBound()[2] ) );
278 points[6] =
transform (
Point ( aInput.lowerBound()[0], aInput.lowerBound()[1], aInput.upperBound()[2] ) );
279 points[7] =
transform (
Point ( aInput.upperBound()[0], aInput.upperBound()[1], aInput.lowerBound()[2] ) );
281 Point t_min ( INT_MAX, INT_MAX, INT_MAX ), t_max ( INT_MIN, INT_MIN, INT_MIN );
282 for (
int i = 0; i < 8; i++ )
284 if ( points[i][0] < t_min[0] )
285 t_min[0] = points[i][0];
286 if ( points[i][1] < t_min[1] )
287 t_min[1] = points[i][1];
288 if ( points[i][2] < t_min[2] )
289 t_min[2] = points[i][2];
291 if ( points[i][0] > t_max[0] )
292 t_max[0] = points[i][0];
293 if ( points[i][1] > t_max[1] )
294 t_max[1] = points[i][1];
295 if ( points[i][2] > t_max[2] )
296 t_max[2] = points[i][2];
299 bounds.first = t_min;
300 bounds.second = t_max;
314 #undef RigidTransformation3D_RECURSES
Aim: implements bounds of transformed domain.
BOOST_CONCEPT_ASSERT((concepts::CDomain< TDomain >))
Bounds operator()(const TDomain &aInput) const
const TRigidTransformFunctor & transform
BOOST_STATIC_ASSERT((TDomain::dimension==3))
Checking concepts.
DomainRigidTransformation3D(const TRigidTransformFunctor &aRigidFunctor)
std::pair< typename TDomain::Space::Point, typename TDomain::Space::Point > Bounds
Space::RealVector RealVector
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: This concept represents a digital domain, i.e. a non mutable subset of points of the given digit...
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
PointVector< 3, double > RealPoint