Transformation.hpp
1 #pragma once
2 
3 #include "DM/config.hpp"
4 #include "DM/Handle.hpp"
5 #include "DM/IGeometry.hpp"
6 
7 DM_NAMESPACE_BEGIN
8 
9 /// Interface for generic geometry object coordiante transformation
10 class DM_API ITrafo
11 {
12 protected:
13  virtual ~ITrafo() {}
14 
15 public:
16  /// \brief retuns the dimension of transformation.
17  /// This info helps to optimize the actual transformation process of the geometry objects
18  ///
19  /// \return 1 if only z values are changed
20  /// \return 2 for 2d transformations
21  /// \return 3 if all coordinate values may be changed
22  virtual int trafoDim() const = 0;
23 
24  /// \brief performs coordiante transformation
25  /// please note that coordinates must not be changed if not effected by the transformation
26  ///
27  /// \param[in,out] x x-coordinates
28  /// \param[in,out] y y-coordinates
29  /// \param[in,out] z z-coordinates
30  /// \param[in] inv inversion flag if transformation should be inverted
31  virtual void transform(double &x, double &y, double &z, bool inv = false) const = 0;
32 };
33 
34 /// \brief provides a generic framework for transforming geometry objects
35 void DM_API transform(const ITrafo &trafo, IGeometry &geom, bool inv = false);
36 
37 DM_NAMESPACE_END
Interface for generic geometry object coordiante transformation.
Definition: Transformation.hpp:10
void DM_API transform(const ITrafo &trafo, IGeometry &geom, bool inv=false)
provides a generic framework for transforming geometry objects
Base class of all geometry objects.
Definition: IGeometry.hpp:26