Geant4
11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI_axisDomain.cc
Go to the documentation of this file.
1
/*
2
# <<BEGIN-copyright>>
3
# Copyright 2019, Lawrence Livermore National Security, LLC.
4
# This file is part of the gidiplus package (https://github.com/LLNL/gidiplus).
5
# gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT).
6
# SPDX-License-Identifier: MIT
7
# <<END-copyright>>
8
*/
9
10
#include "
GIDI.hpp
"
11
#include <
HAPI.hpp
>
12
13
namespace
GIDI
{
14
15
/*! \class AxisDomain
16
* Class to store a the minimum and maximum limits for a domain (i.e., a section of an axis) and its unit.
17
*/
18
19
/* *********************************************************************************************************/
/**
20
*
21
* @param a_node [in] The **HAPI::Node** to be parsed and used to construct the AxisDomain.
22
* @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
23
***********************************************************************************************************/
24
25
AxisDomain::AxisDomain
(
HAPI::Node
const
&a_node,
SetupInfo
&a_setupInfo ) :
26
Form
( a_node, a_setupInfo,
FormType
::
axisDomain
),
27
m_minimum( a_node.attribute_as_double(
GIDI_minChars
) ),
28
m_maximum( a_node.attribute_as_double(
GIDI_maxChars
) ),
29
m_unit( a_node.attribute_as_string(
GIDI_unitChars
) ) {
30
31
}
32
33
/* *********************************************************************************************************/
/**
34
*
35
* @param a_minimum [in] The domain's minimum value.
36
* @param a_maximum [in] The domain's maximum.
37
* @param a_unit [in] The domain's unit.
38
***********************************************************************************************************/
39
40
AxisDomain::AxisDomain
(
double
a_minimum,
double
a_maximum, std::string
const
&a_unit ) :
41
Form
(
FormType
::
axisDomain
),
42
m_minimum( a_minimum ),
43
m_maximum( a_maximum ),
44
m_unit( a_unit ) {
45
46
}
47
48
/* *********************************************************************************************************/
/**
49
***********************************************************************************************************/
50
51
AxisDomain::~AxisDomain
( ) {
52
53
}
54
55
/* *********************************************************************************************************/
/**
56
* Fills the argument *a_writeInfo* with the XML lines that represent *this*. Recursively enters each sub-node.
57
*
58
* @param a_writeInfo [in/out] Instance containing incremental indentation and other information and stores the appended lines.
59
* @param a_indent [in] The amount to indent *this* node.
60
***********************************************************************************************************/
61
62
void
AxisDomain::toXMLList
(
GUPI::WriteInfo
&a_writeInfo, std::string
const
&a_indent )
const
{
63
64
std::string attributes = a_writeInfo.
addAttribute
(
GIDI_minChars
,
LUPI::Misc::doubleToShortestString
(
minimum
( ) ) ) +
65
a_writeInfo.
addAttribute
(
GIDI_minChars
,
LUPI::Misc::doubleToShortestString
(
maximum
( ) ) ) +
66
a_writeInfo.
addAttribute
(
GIDI_unitChars
,
unit
( ) );
67
68
a_writeInfo.
addNodeStarterEnder
( a_indent,
moniker
( ), attributes );
69
}
70
71
72
}
GIDI.hpp
GIDI_unitChars
#define GIDI_unitChars
Definition
GIDI.hpp:439
GIDI_minChars
#define GIDI_minChars
Definition
GIDI.hpp:443
GIDI_maxChars
#define GIDI_maxChars
Definition
GIDI.hpp:444
HAPI.hpp
GIDI::AxisDomain::maximum
double maximum() const
Definition
GIDI.hpp:788
GIDI::AxisDomain::unit
std::string const & unit() const
Definition
GIDI.hpp:789
GIDI::AxisDomain::AxisDomain
AxisDomain(HAPI::Node const &a_node, SetupInfo &a_setupInfo)
Definition
GIDI_axisDomain.cc:25
GIDI::AxisDomain::minimum
double minimum() const
Definition
GIDI.hpp:787
GIDI::AxisDomain::toXMLList
void toXMLList(GUPI::WriteInfo &a_writeInfo, std::string const &a_indent) const
Definition
GIDI_axisDomain.cc:62
GIDI::AxisDomain::~AxisDomain
~AxisDomain()
Definition
GIDI_axisDomain.cc:51
GIDI::Form::Form
Form(FormType a_type)
Definition
GIDI_form.cc:25
GIDI::SetupInfo
Definition
GIDI.hpp:594
GUPI::Ancestry::moniker
std::string const & moniker() const
Definition
GUPI.hpp:102
GUPI::WriteInfo
Definition
GUPI.hpp:42
GUPI::WriteInfo::addNodeStarterEnder
void addNodeStarterEnder(std::string const &indent, std::string const &a_moniker, std::string const &a_attributes="")
Definition
GUPI.hpp:57
GUPI::WriteInfo::addAttribute
std::string addAttribute(std::string const &a_name, std::string const &a_value) const
Definition
GUPI.hpp:60
HAPI::Node
Definition
HAPI.hpp:166
GIDI
Definition
GIDI.hpp:32
GIDI::FormType
FormType
Definition
GIDI.hpp:118
GIDI::FormType::axisDomain
@ axisDomain
Definition
GIDI.hpp:120
LUPI::Misc::doubleToShortestString
std::string doubleToShortestString(double a_value, int a_significantDigits=15, int a_favorEFormBy=0)
Definition
LUPI_misc.cc:349
geant4-v11.4.0
source
processes
hadronic
models
lend
src
GIDI_axisDomain.cc
Generated by
1.16.1