OpendTect-6_4  6.4
vistransform.h
Go to the documentation of this file.
1 #ifndef vistransform_h
2 #define vistransform_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Kris Tingdahl
9  Date: Jan 2002
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "visbasemod.h"
16 #include "visdatagroup.h"
17 #include "position.h"
18 
19 namespace osg { class MatrixTransform; class Vec3d; class Vec3f; class Quat; }
20 
21 
22 namespace visBase
23 {
24 #define mDefTransType( func, tp ) \
25  void func( tp& ) const; \
26  void func( const tp& f, tp& t ) const; \
27  static void func( const Transformation* tr, tp& v ) \
28  { if ( tr ) tr->func( v ); } \
29  static void func( const Transformation* tr, const tp& f, tp& t );
30 
31 #define mDefTrans( tp ) \
32 mDefTransType( transform, tp ); \
33 mDefTransType( transformBack, tp ); \
34 mDefTransType( transformDir, tp ); \
35 mDefTransType( transformBackDir, tp ); \
36 mDefTransType( transformSize, tp ); \
37 mDefTransType( transformBackSize, tp ); \
38 mDefTransType( transformNormal, tp ); \
39 mDefTransType( transformBackNormal, tp );
40 
41 
42 #define mDefConvTransType( func, frtp, totp ) \
43 void func( const frtp&, totp& ) const; \
44 static void func( const Transformation* tr, const frtp& f, totp& t);
45 
46 #define mDefConvTrans( frtp, totp ) \
47 mDefConvTransType( transform, frtp, totp ); \
48 mDefConvTransType( transformBack, frtp, totp ); \
49 mDefConvTransType( transformDir, frtp, totp ); \
50 mDefConvTransType( transformBackDir, frtp, totp ); \
51 mDefConvTransType( transformSize, frtp, totp ); \
52 mDefConvTransType( transformBackSize, frtp, totp ); \
53 mDefConvTransType( transformNormal, frtp, totp ); \
54 mDefConvTransType( transformBackNormal, frtp, totp );
55 
56 
75 {
76 public:
79 
80  void reset();
81 
82  void setA(double a11,double a12,double a13,double a14,
83  double a21,double a22,double a23,double a24,
84  double a31,double a32,double a33,double a34,
85  double a41,double a42,double a43,double a44 );
86 
87  void setMatrix(const Coord3& trans,
88  const Coord3& rotvec,double rotangle,
89  const Coord3& scale);
90 
91  void setTranslation(const Coord3&);
92  void setRotation(const Coord3& vec,double angle);
93  void setScale(const Coord3&);
94  void setScaleOrientation(const Coord3& vec,double angle);
95 
96  Coord3 getTranslation() const;
97  Coord3 getScale() const;
98  void getRotation(Coord3& vec,double& angle) const;
99 
100 
101  void setAbsoluteReferenceFrame();
102  const osg::MatrixTransform* getTransformNode() const { return node_; };
103 
105  mDefTrans( osg::Vec3d );
106  mDefTrans( osg::Vec3f );
107  mDefConvTrans( Coord3, osg::Vec3d );
108  mDefConvTrans( Coord3, osg::Vec3f );
109  mDefConvTrans( osg::Vec3d, Coord3 );
110  mDefConvTrans( osg::Vec3f, Coord3 );
111 
112  Transformation& operator*=(const Transformation&);
113 
114 private:
115 
116  virtual ~Transformation();
117 
118  void updateMatrix();
119  void updateNormalizationMode();
120 
121  osg::MatrixTransform* node_;
122 
123  osg::Vec3d& curscale_;
124  osg::Vec3d& curtrans_;
125  osg::Quat& currot_;
126  osg::Quat& curso_;
127 };
128 
129 }
130 
131 #endif
#define mDefTrans(tp)
Definition: vistransform.h:31
#define mExpClass(module)
Definition: commondefs.h:160
osg::Quat & curso_
Definition: vistransform.h:126
Definition: visdatagroup.h:27
#define mDefConvTrans(frtp, totp)
Definition: vistransform.h:46
osg::MatrixTransform * node_
Definition: vistransform.h:121
osg::Vec3d & curscale_
Definition: vistransform.h:123
osg::Quat & currot_
Definition: vistransform.h:125
A cartesian coordinate in 3D space.
Definition: coord.h:72
Definition: visannot.h:43
osg::Vec3d & curtrans_
Definition: vistransform.h:124
Open Scene Graph.
Definition: visannot.h:29
static Transformation * create()
Definition: vistransform.h:77
#define mCreateDataObj(clss)
Definition: visdata.h:209
The Transformation is an object that transforms everything following the node.
Definition: vistransform.h:74

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019