1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file GUI/ba3d/model/geometry_inc.h
//! @brief Defines geometry namespace
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************** //
#ifndef BORNAGAIN_GUI_BA3D_MODEL_GEOMETRY_INC_H
#define BORNAGAIN_GUI_BA3D_MODEL_GEOMETRY_INC_H
#include "GUI/ba3d/def.h"
#include <memory>
// include to use geometry basics, without details
namespace RealSpace
{
//------------------------------------------------------------------------------
class Geometry;
typedef std::shared_ptr<Geometry> GeometryHandle;
typedef std::weak_ptr<Geometry> GeometryRef;
// some useful constants:
extern const float GoldenRatio;
extern const float IcosahedronL2R; // L/R conversion
extern const float DodecahedronL2R;
namespace GeometricID
{
// Enum id for basic shapes
enum class BaseShape {
Plane,
Box,
Sphere,
Column,
Icosahedron,
Dodecahedron,
TruncatedBox,
Cuboctahedron,
Ripple
};
// Real shapes will be parameterized by BaseShape enum and possibly two floats
struct Key {
Key(BaseShape, float = 0.0f, float = 0.0f, float = 0.0f);
bool operator==(Key const&) const;
BaseShape id;
float p1, p2, p3;
};
// Hash functor for Key objects
struct KeyHash {
std::size_t operator()(const Key& key) const noexcept;
};
} // namespace GeometricID
} // namespace RealSpace
#endif // BORNAGAIN_GUI_BA3D_MODEL_GEOMETRY_INC_H
|