8#include <EnvironmentQuantityField.h>
9#include <RefreshSchedule.h>
10#include <ScalarFieldBake.h>
13#include <fhsim/PrintDuringExec.h>
14#include <fhsim/simobject/SimObject.h>
21class EnvironmentProvider;
24#ifdef FH_VISUALIZATION
25# include "visual/BakedFieldTexture.h"
27# include <OgreMaterial.h>
64 void FinalSetup(
const double T,
const double*
const X, ISimObjectCreator* Creator)
override;
67 void OdeFcn(
const double T,
const double*
const X,
double*
const XDot)
const override;
85 VisualField(std::string SimObjectName, ISimObjectCreator* Creator,
int numAxes);
99 void ResolveCounts(
const double extent[3], std::size_t budget,
int counts[3])
const;
112 void ValidateGridCounts(ISimObjectCreator* Creator,
const int counts[3],
const std::string& extentParameterName)
const;
138 [[nodiscard]] environment::field::ScalarField&
Field()
const;
141 [[nodiscard]]
double StartTime()
const {
return m_startTime; }
170 [[nodiscard]]
double ValueMin()
const {
return m_valueMin; }
173 [[nodiscard]]
double ValueMax()
const {
return m_valueMax; }
175#ifdef FH_VISUALIZATION
192 void SwapTextures(std::unique_ptr<visual::BakedFieldTexture> textures);
200 Ogre::MaterialPtr CloneMaterial(
const Ogre::String& baseMaterialName);
207 void ApplyMaterialSettings()
const;
212 [[nodiscard]]
const Ogre::MaterialPtr& Material()
const {
return m_material; }
222 void Log(
const std::string& message, fhsim::ELogLevel level)
const;
226 void ReadQuantity(ISimObjectCreator* Creator);
229 void ReadRefresh(ISimObjectCreator* Creator);
235 [[nodiscard]] std::uint64_t Revision()
const;
238 [[nodiscard]]
bool UnchangedSinceLastSample()
const;
241 [[nodiscard]]
bool ChangesWithWakesOnly()
const;
248 std::string m_fieldName;
251 double m_refreshPeriod;
252 std::optional<util::RefreshSchedule> m_schedule;
255 bool m_hasResolution;
259 double m_colorRange[2];
260 double m_visibleRange[2];
261 double m_alphaRange[2];
263 bool m_hasColorRange;
264 bool m_hasVisibleRange;
265 bool m_showExtrapolated;
267 bool m_encodingFixed;
273 environment::EnvironmentProvider* m_pEnvironment;
274 PrintDuringExec* m_print =
nullptr;
276 std::shared_ptr<environment::field::ScalarField> m_field;
278#ifdef FH_VISUALIZATION
279 std::unique_ptr<visual::BakedFieldTexture> m_texture;
280 Ogre::MaterialPtr m_material;
Definition VisualField.h:54
void Log(const std::string &message, fhsim::ELogLevel level) const
bool RefreshDue(double T, bool moved) const
~VisualField() override
Releases the cloned material and the textures.
environment::field::ScalarField & Field() const
void OdeFcn(const double T, const double *const X, double *const XDot) const override
No state; the ODE function is a no-op.
double ValueMax() const
Field value encoded as code 65535, fixed at the first SampleOver().
Definition VisualField.h:173
void ValidateGridCounts(ISimObjectCreator *Creator, const int counts[3], const std::string &extentParameterName) const
bool MaySampleInTheBackground() const
double StartTime() const
Simulation time of FinalSetup [s], the time of the first sample.
Definition VisualField.h:141
bool MaskInaccurate() const
Definition VisualField.h:117
util::Refresh RefreshMode() const
bool ExpectsToSampleOnce() const
void FinalSetup(const double T, const double *const X, ISimObjectCreator *Creator) override
double ValueMin() const
Field value encoded as code 1, fixed at the first SampleOver().
Definition VisualField.h:170
util::BakedField SampleOver(double T, const util::SamplingBox &box)
void ResolveCounts(const double extent[3], std::size_t budget, int counts[3]) const
VisualField(std::string SimObjectName, ISimObjectCreator *Creator, int numAxes)
Environment SimObjects.
Definition Environment.h:30
FieldQuantity
The quantity a field visualiser shows, its Quantity parameter.
Definition EnvironmentQuantityField.h:23
Refresh
When a field visualiser samples again, its Refresh parameter.
Definition RefreshSchedule.h:15
Definition WaterVelocity.h:33
A scalar field evaluated over a SamplingBox and encoded to 16-bit codes.
Definition ScalarFieldBake.h:52
Definition ScalarFieldBake.h:44