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

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