OpenWalnut  1.5.0dev
WManipulatorScaling.cpp
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #include "WManipulatorScaling.h"
26 
28  : WObjectNDIP< WManipulatorInterface >( "Scaling", "Scales the dataset." )
29 {
30  m_scaling = m_properties->addProperty( "Scale", "Scale of the data.", WPosition( 1.0, 1.0, 1.0 ) );
31 }
32 
34 {
35 }
36 
38 {
40  WPosition s = m_scaling->get( true );
41  m( 0, 0 ) = s[ 0 ];
42  m( 1, 1 ) = s[ 1 ];
43  m( 2, 2 ) = s[ 2 ];
44 
45  return m;
46 }
47 
49 {
50  return m_scaling->changed();
51 }
52 
54 {
55  m_scaling->set( WPosition( 1.0, 1.0, 1.0 ) );
56 }
57 
An interface for dataset transformation manipulators.
virtual ~WManipulatorScaling()
Destructor.
WManipulatorScaling()
Constructor.
WPropPosition m_scaling
The scaling parameters as a vector.
virtual void reset()
Reset the transform.
virtual WMatrixFixed< double, 4, 4 > getTransformationMatrix() const
Get the transformation matrix from this manipulator.
virtual bool transformationChanged() const
Check if the transform has changed, for example because of a change to properties.
static MatrixType identity()
Returns an identity matrix.
Definition: WMatrixFixed.h:310
This is a base class for everything which has a Name,Description,Icon and Properties (=NDIP).
Definition: WObjectNDIP.h:42
WProperties::SPtr m_properties
the properties of the object.
Definition: WObjectNDIP.h:99
This only is a 3d double vector.