VAPOR3 3.9.4
FlowParams.h
Go to the documentation of this file.
1#ifndef FLOWPARAMS_H
2#define FLOWPARAMS_H
3
5#include <vapor/DataMgr.h>
6#include <vector>
7#include <utility>
8
9namespace VAPoR {
10
11//
12// These two enums are used across params, GUI, and renderer.
13// Note: use static_cast to cast between them and int types.
14//
15enum class FlowSeedMode : int { UNIFORM = 0, RANDOM = 1, RANDOM_BIAS = 2, LIST = 3 };
16enum class FlowDir : int { FORWARD = 0, BACKWARD = 1, BI_DIR = 2 };
17
18class FlowParams;
19class PARAMS_API FakeRakeBox : public Box {
20 string _tag;
21
22public:
23 using Box::Box;
24 FlowParams *parent = nullptr;
25
26 void Initialize(string tag);
27 void SetExtents(const vector<double> &minExt, const vector<double> &maxExt) override;
28};
29
31 StateSave _fakeRakeStateSave;
32 FakeRakeBox *_fakeRakeBox = nullptr;
33 FakeRakeBox *_fakeIntegrationBox = nullptr;
34 bool _initialized = false;
35
36 void _setRakeCenter(int dim, double center);
37 double _getRakeCenter(int dim);
38
39public:
40 enum RenderType { RenderTypeStream, RenderTypeSamples, RenderTypeDensity };
41 enum GlpyhType { GlpyhTypeSphere, GlpyhTypeArrow };
42
43 // Constructors
44 FlowParams(DataMgr *dataManager, ParamsBase::StateSave *stateSave);
45 FlowParams(DataMgr *dataManager, ParamsBase::StateSave *stateSave, XmlNode *xmlNode);
46
49
50 virtual ~FlowParams();
51
52 virtual int Initialize() override;
53
54 static std::string GetClassType() { return ("FlowParams"); }
55
57 void SetDefaultVariables(int dim = 3, bool secondaryColormapVariable = false) override;
58
63 void SetIsSteady(bool steady);
64
68 bool GetIsSteady() const;
69
75 double GetVelocityMultiplier() const;
76
84
90
95
100
105
110
115
120
128
131 int GetSeedGenMode() const;
132
135 void SetSeedGenMode(int);
136
140
144
147 int GetFlowDirection() const;
148
152
156 std::string GetSeedInputFilename() const;
157
161 void SetSeedInputFilename(const std::string &);
162
165 std::string GetFlowlineOutputFilename() const;
166
169 void SetFlowlineOutputFilename(const std::string &);
170
173 std::vector<std::string> GetFlowOutputMoreVariables() const;
174
177 void SetFlowOutputMoreVariables(std::vector<std::string> vars);
178
183 std::vector<bool> GetPeriodic() const;
184
188 void SetPeriodic(const std::vector<bool> &);
189
190 /*
191 * 6 values to represent a rake in this particular order:
192 * xmin, xmax, ymin, ymax, zmin, zmax
193 * If the rake wasn't set by users, it returns a vector containing nans.
194 * If it represents a 2D area, then it will contain the first 4 elements.
195 */
197 std::vector<float> GetRake() const;
198 void SetRake(const std::vector<float> &);
199
201 void SetIntegrationVolume(const std::vector<float> &);
202
205 std::vector<long> GetGridNumOfSeeds() const;
206
209 void SetGridNumOfSeeds(const std::vector<long> &);
210
214
218
221 std::string GetRakeBiasVariable() const;
222
225 void SetRakeBiasVariable(const std::string &);
226
231
236
237
240
244
249
251 //
252 virtual size_t GetRenderDim() const override
253 {
254 for (const auto &p : GetFieldVariableNames()) {
255 if (!p.empty()) return _dataMgr->GetVarTopologyDim(p);
256 }
257 return GetBox()->IsPlanar() ? 2 : 3;
258 }
259
261 virtual string GetActualColorMapVariableName() const override
262 {
263 if (UseSingleColor())
264 return "";
265 else
266 return GetColorMapVariableName();
267 }
268
272
275 void SetXRakeCenter(double center);
276
280
283 void SetYRakeCenter(double center);
284
288
291 void SetZRakeCenter(double center);
292
295 static const std::string RenderTypeTag;
296
297 static const std::string RenderRadiusBaseTag;
298
303 static const std::string RenderRadiusScalarTag;
304
308 static const std::string RenderGeom3DTag;
309
310 static const std::string RenderLightAtCameraTag;
311
315 static const std::string RenderShowStreamDirTag;
316
320 static const std::string RenderGlyphTypeTag;
321
326 static const std::string RenderGlyphStrideTag;
327
331 static const std::string RenderGlyphOnlyLeadingTag;
332
338 static const std::string RenderDensityFalloffTag;
339
345 static const std::string RenderDensityToneMappingTag;
346
350 static const std::string RenderFadeTailTag;
351
356 static const std::string RenderFadeTailStartTag;
357
358
363 static const std::string RenderFadeTailStopTag;
364
369 static const std::string RenderFadeTailLengthTag;
370
375 static const std::string PhongAmbientTag;
376
381 static const std::string PhongDiffuseTag;
382
387 static const std::string PhongSpecularTag;
388
393 static const std::string PhongShininessTag;
394
395 static const std::string _isSteadyTag;
396 static const std::string _velocityMultiplierTag;
397 static const std::string _firstStepSizeMultiplierTag;
398 static const std::string _fixedAdvectionStepTag;
399 static const std::string _fixedAdvectionStepSizeTag;
400 static const std::string _steadyNumOfStepsTag;
401 static const std::string _seedGenModeTag;
402 static const std::string _seedInputFilenameTag;
403 static const std::string _flowlineOutputFilenameTag;
404 static const std::string _flowOutputMoreVariablesTag;
405 static const std::string _flowDirectionTag;
406 static const std::string _needFlowlineOutputTag;
407 static const std::string _xPeriodicTag;
408 static const std::string _yPeriodicTag;
409 static const std::string _zPeriodicTag;
410 static const std::string _rakeTag;
411 static const std::string _doIntegrationTag;
412 static const std::string _integrationScalarTag;
413 static const std::string _integrationSetAllToFinalValueTag;
414 static const std::string _integrationBoxTag;
415 static const std::string _rakeBiasVariable;
416 static const std::string _rakeBiasStrength;
417 static const std::string _pastNumOfTimeSteps;
418 static const std::string _seedInjInterval;
419 static const std::string _xGridNumOfSeedsTag;
420 static const std::string _yGridNumOfSeedsTag;
421 static const std::string _zGridNumOfSeedsTag;
422 static const std::string _randomNumOfSeedsTag;
423
424 // maps between ints and "human readable" strings
425 const std::vector<std::pair<int, std::string>> _seed2Str = {{static_cast<int>(FlowSeedMode::UNIFORM), ""}, // default value
426 {static_cast<int>(FlowSeedMode::UNIFORM), "UNIFORM"},
427 {static_cast<int>(FlowSeedMode::RANDOM), "RANDOM"},
428 {static_cast<int>(FlowSeedMode::RANDOM_BIAS), "RANDOM_BIAS"},
429 {static_cast<int>(FlowSeedMode::LIST), "LIST"}};
430
431 const std::vector<std::pair<int, std::string>> _dir2Str = {{static_cast<int>(FlowDir::FORWARD), ""}, // default value
432 {static_cast<int>(FlowDir::FORWARD), "FORWARD"},
433 {static_cast<int>(FlowDir::BACKWARD), "BACKWARD"},
434 {static_cast<int>(FlowDir::BI_DIR), "BI_DIRECTIONAL"}};
435};
436
437} // namespace VAPoR
438
439#endif
3D or 2D box with options for orientation angles .
Definition: Box.h:39
A cache based data reader.
Definition: DataMgr.h:110
void SetExtents(const vector< double > &minExt, const vector< double > &maxExt) override
void Initialize(string tag)
static const std::string _integrationBoxTag
Definition: FlowParams.h:414
void SetVelocityMultiplier(double)
void SetFlowDirection(int)
void SetZRakeCenter(double center)
static const std::string PhongDiffuseTag
Definition: FlowParams.h:381
static const std::string _flowOutputMoreVariablesTag
Definition: FlowParams.h:404
static const std::string _integrationScalarTag
Definition: FlowParams.h:412
static const std::string RenderFadeTailStartTag
Definition: FlowParams.h:356
long GetRakeBiasStrength() const
static const std::string _integrationSetAllToFinalValueTag
Definition: FlowParams.h:413
static const std::string _xPeriodicTag
Definition: FlowParams.h:407
static const std::string RenderRadiusScalarTag
Definition: FlowParams.h:303
void SetDefaultVariables(int dim=3, bool secondaryColormapVariable=false) override
void SetFirstStepSizeMultiplier(double)
static const std::string _seedInjInterval
Definition: FlowParams.h:418
static const std::string RenderRadiusBaseTag
Definition: FlowParams.h:297
static const std::string _zGridNumOfSeedsTag
Definition: FlowParams.h:421
void SetSteadyNumOfSteps(long)
int GetPastNumOfTimeSteps() const
virtual string GetActualColorMapVariableName() const override
Definition: FlowParams.h:261
static const std::string RenderGlyphTypeTag
Definition: FlowParams.h:320
static const std::string RenderDensityFalloffTag
Definition: FlowParams.h:338
static const std::string _flowDirectionTag
Definition: FlowParams.h:405
static const std::string _randomNumOfSeedsTag
Definition: FlowParams.h:422
static const std::string _xGridNumOfSeedsTag
Definition: FlowParams.h:419
void SetFlowOutputMoreVariables(std::vector< std::string > vars)
int GetSeedGenMode() const
static const std::string PhongSpecularTag
Definition: FlowParams.h:387
static const std::string PhongShininessTag
Definition: FlowParams.h:393
void SetGridNumOfSeeds(const std::vector< long > &)
double GetVelocityMultiplier() const
void SetRake(const std::vector< float > &)
double GetYRakeCenter()
int GetFlowDirection() const
double GetXRakeCenter()
void SetPastNumOfTimeSteps(int)
bool GetUseFixedAdvectionSteps() const
virtual ~FlowParams()
std::string GetFlowlineOutputFilename() const
void SetPeriodic(const std::vector< bool > &)
static const std::string _seedGenModeTag
Definition: FlowParams.h:401
static const std::string _yPeriodicTag
Definition: FlowParams.h:408
static const std::string RenderLightAtCameraTag
Definition: FlowParams.h:310
static const std::string _rakeBiasVariable
Definition: FlowParams.h:415
void SetFlowlineOutputFilename(const std::string &)
static const std::string RenderGeom3DTag
Definition: FlowParams.h:308
void SetSeedGenMode(int)
static const std::string RenderFadeTailTag
Definition: FlowParams.h:350
std::string GetSeedInputFilename() const
void SetIsSteady(bool steady)
static const std::string RenderShowStreamDirTag
Definition: FlowParams.h:315
static const std::string _zPeriodicTag
Definition: FlowParams.h:409
static const std::string _steadyNumOfStepsTag
Definition: FlowParams.h:400
std::vector< long > GetGridNumOfSeeds() const
void SetRakeBiasStrength(long)
long GetRandomNumOfSeeds() const
static const std::string _rakeBiasStrength
Definition: FlowParams.h:416
static const std::string _velocityMultiplierTag
Definition: FlowParams.h:396
double GetZRakeCenter()
static const std::string _yGridNumOfSeedsTag
Definition: FlowParams.h:420
void SetFixedAdvectionStepSize(double)
FlowParams(const FlowParams &rhs)
void SetUseFixedAdvectionSteps(bool)
static const std::string _seedInputFilenameTag
Definition: FlowParams.h:402
bool GetIsSteady() const
static const std::string _isSteadyTag
Definition: FlowParams.h:395
FlowParams & operator=(const FlowParams &rhs)
static const std::string _flowlineOutputFilenameTag
Definition: FlowParams.h:403
void SetNeedFlowlineOutput(bool)
std::vector< float > GetRake() const
static const std::string RenderGlyphStrideTag
Definition: FlowParams.h:326
static const std::string PhongAmbientTag
Definition: FlowParams.h:375
static const std::string _fixedAdvectionStepTag
Definition: FlowParams.h:398
static const std::string RenderFadeTailLengthTag
Definition: FlowParams.h:369
int GetSeedInjInterval() const
static std::string GetClassType()
Definition: FlowParams.h:54
virtual int Initialize() override
void SetYRakeCenter(double center)
static const std::string _firstStepSizeMultiplierTag
Definition: FlowParams.h:397
static const std::string RenderDensityToneMappingTag
Definition: FlowParams.h:345
std::string GetRakeBiasVariable() const
void SetRandomNumOfSeeds(long)
void SetSeedInputFilename(const std::string &)
static const std::string RenderGlyphOnlyLeadingTag
Definition: FlowParams.h:331
void SetXRakeCenter(double center)
void SetSeedInjInterval(int)
std::vector< std::string > GetFlowOutputMoreVariables() const
static const std::string _rakeTag
Definition: FlowParams.h:410
std::vector< bool > GetPeriodic() const
static const std::string _doIntegrationTag
Definition: FlowParams.h:411
static const std::string _pastNumOfTimeSteps
Definition: FlowParams.h:417
static const std::string _needFlowlineOutputTag
Definition: FlowParams.h:406
long GetSteadyNumOfSteps() const
bool GetNeedFlowlineOutput() const
void SetRakeBiasVariable(const std::string &)
static const std::string RenderFadeTailStopTag
Definition: FlowParams.h:363
double GetFirstStepSizeMultiplier() const
Box * GetIntegrationBox()
double GetFixedAdvectionStepSize() const
void SetIntegrationVolume(const std::vector< float > &)
virtual size_t GetRenderDim() const override
Definition: FlowParams.h:252
FlowParams(DataMgr *dataManager, ParamsBase::StateSave *stateSave)
FlowParams(DataMgr *dataManager, ParamsBase::StateSave *stateSave, XmlNode *xmlNode)
static const std::string _fixedAdvectionStepSizeTag
Definition: FlowParams.h:399
static const std::string RenderTypeTag
Definition: FlowParams.h:295
State capture class.
Definition: ParamsBase.h:62
A Params subclass for managing parameters used by Renderers.
Definition: RenderParams.h:43
An Xml tree.
Definition: XmlNode.h:49
#define PARAMS_API
Definition: common.h:77
FlowSeedMode
Definition: FlowParams.h:15