Quantum Phenomena Explorer 7.9.8
Interactive quantum-phenomena Explorer Tutor — source documentation
Loading...
Searching...
No Matches
potentialcontours2d.h
Go to the documentation of this file.
1/**
2 * @file potentialcontours2d.h
3 * @brief Declares the potentialcontours2d physics/numerical component used by QPE experiments.
4 * @ingroup qpe_quantum
5 *
6 * Source: @c core/quantum/potentialcontours2d.h. This file is part of Quantum Phenomena Explorer (QPE),
7 * maintained by Officina Turini. See LICENSE_IT.txt / LICENSE.txt for the
8 * QPE freeware source-available terms and THIRD_PARTY_NOTICES.txt for
9 * third-party components.
10 */
11
12#pragma once
13
14#include <cstddef>
15#include <vector>
16
17namespace qpe {
18
19class PotentialField2D;
20
21/**
22 * @brief Data structure used by the Potential Contour Segment2D component.
23 *
24 * The structure keeps related values explicit and testable across the QPE physics, analysis, or persistence layers.
25 */
27{
28 float x1 = 0.0f;
29 float y1 = 0.0f;
30 float x2 = 0.0f;
31 float y2 = 0.0f;
32 float level = 0.0f;
33};
34
35/**
36 * @brief Data record containing Potential Contours2D Result.
37 *
38 * The structure carries computed data without coupling the numerical component to the GUI or renderer.
39 */
41{
42 std::vector<float> levels;
43 std::vector<PotentialContourSegment2D> segments;
44 float minimum = 0.0f;
45 float maximum = 0.0f;
46 bool binaryField = false;
47
48 /**
49 * @brief Returns whether the object contains no data.
50 * @param empty The empty value used by the operation.
51 */
52 bool empty() const noexcept { return segments.empty(); }
53};
54
55/**
56 * @brief Implements the Potential Contours2D component.
57 *
58 * The class provides one focused service within the QPE architecture and is documented here independently of the experiment-level Help.
59 */
61{
62public:
63 // Extract V(x,y)=constant curves using marching squares.
64 // For a binary field (only min/max values), all intermediate levels have
65 // the same geometry, so a single midpoint contour is returned.
66 /**
67 * @brief Performs compute.
68 * @param potential Potential field used by the operation.
69 * @param requestedLevels The requested levels value used by the operation.
70 */
72 std::size_t requestedLevels);
73};
74
75} // namespace qpe
Implements the Potential Contours2D component.
static PotentialContours2DResult compute(const PotentialField2D &potential, std::size_t requestedLevels)
Performs compute.
Implements the Potential Field2D component.
Data structure used by the Potential Contour Segment2D component.
Data record containing Potential Contours2D Result.
std::vector< PotentialContourSegment2D > segments
bool empty() const noexcept
Returns whether the object contains no data.