8#include <EnvironmentQuantityField.h>
9#include <RefreshSchedule.h>
10#include <ScalarFieldBake.h>
13#include <fhsim/simobject/SimObject.h>
20class EnvironmentProvider;
23#ifdef FH_VISUALIZATION
24# include "visual/BakedFieldTexture.h"
26# include <OgreMaterial.h>
63 void FinalSetup(
const double T,
const double*
const X, ISimObjectCreator* Creator)
override;
66 void OdeFcn(
const double T,
const double*
const X,
double*
const XDot)
const override;
84 VisualField(std::string SimObjectName, ISimObjectCreator* Creator,
int numAxes);
98 void ResolveCounts(
const double extent[3], std::size_t budget,
int counts[3])
const;
111 void ValidateGridCounts(ISimObjectCreator* Creator,
const int counts[3],
const std::string& extentParameterName)
const;
137 [[nodiscard]] environment::field::ScalarField&
Field()
const;
140 [[nodiscard]]
double StartTime()
const {
return m_startTime; }
169 [[nodiscard]]
double ValueMin()
const {
return m_valueMin; }
172 [[nodiscard]]
double ValueMax()
const {
return m_valueMax; }
174#ifdef FH_VISUALIZATION
191 void SwapTextures(std::unique_ptr<visual::BakedFieldTexture> textures);
199 Ogre::MaterialPtr CloneMaterial(
const Ogre::String& baseMaterialName);
206 void ApplyMaterialSettings()
const;
211 [[nodiscard]]
const Ogre::MaterialPtr& Material()
const {
return m_material; }
216 void ReadQuantity(ISimObjectCreator* Creator);
219 void ReadRefresh(ISimObjectCreator* Creator);
225 [[nodiscard]] std::uint64_t Revision()
const;
228 [[nodiscard]]
bool UnchangedSinceLastSample()
const;
231 [[nodiscard]]
bool ChangesWithWakesOnly()
const;
238 std::string m_fieldName;
241 double m_refreshPeriod;
242 std::optional<util::RefreshSchedule> m_schedule;
245 bool m_hasResolution;
249 double m_colorRange[2];
250 double m_visibleRange[2];
251 double m_alphaRange[2];
253 bool m_hasColorRange;
254 bool m_hasVisibleRange;
255 bool m_showExtrapolated;
257 bool m_encodingFixed;
263 environment::EnvironmentProvider* m_pEnvironment;
265 std::shared_ptr<environment::field::ScalarField> m_field;
267#ifdef FH_VISUALIZATION
268 std::unique_ptr<visual::BakedFieldTexture> m_texture;
269 Ogre::MaterialPtr m_material;
Definition VisualField.h:53
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:172
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:140
bool MaskInaccurate() const
Definition VisualField.h:116
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:169
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:25
FieldQuantity
The quantity a field visualiser shows, its Quantity parameter.
Definition EnvironmentQuantityField.h:22
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