GeoModel - GeoModelCore
ParameterNegation.cpp
1 //==========================================================================//
2 // Imported from the QAT library (qat.pitt.edu) by the copyright holder //
3 // Joe Boudreau. Software licensed under the terms and conditions of the //
4 // GNU Lesser Public License v3. //
5 //==========================================================================//
6 
7 #include "GeoGenericFunctions/ParameterNegation.h"
8 #include "GeoGenericFunctions/Parameter.h"
9 
10 namespace GeoGenfun {
11 PARAMETER_OBJECT_IMP(ParameterNegation)
12 
13 ParameterNegation::ParameterNegation(const AbsParameter *arg1):
14  _arg1(arg1->clone())
15 {
16  if (arg1->parameter() && _arg1->parameter()) _arg1->parameter()->connectFrom(arg1->parameter());
17 }
18 
19 ParameterNegation::ParameterNegation(const ParameterNegation & right) :
20 AbsParameter(),
21 _arg1(right._arg1->clone())
22 {}
23 
24 
25 ParameterNegation::~ParameterNegation()
26 {
27  delete _arg1;
28 }
29 
30 
31 double ParameterNegation::getValue() const {
32  return - _arg1->getValue();
33 }
34 
35 } // namespace GeoGenfun
Definition: Abs.h:15