Cogs.Core
PingIsoSystem.h
1#pragma once
2
3#include "ExtensionRegistry.h"
4#include "Systems/ComponentSystem.h"
5
6#include "../Components/PingIsoComponent.h"
7
8#include "Foundation/Memory/MemoryBuffer.h"
9
10#include <vector>
11#include <mutex>
12
13namespace Cogs
14{
15 namespace Core
16 {
17 namespace EchoSounder
18 {
19
20 struct DataSetSystem;
21
23 std::mutex mutex;
24 std::atomic<int> runningTasks = 0;
25
26 MeshHandle issuedMesh;
27 glm::vec3 issuedPosition;
28 glm::quat issuedOrientation;
29
31 Memory::TypedBuffer<float> linearValues;
33 Memory::TypedBuffer<int32_t> volumeOffsets;
39
40
41 };
42
44 {
45 std::shared_ptr<SinglePingIsoSurfacesPersistent> persistent = std::make_shared<SinglePingIsoSurfacesPersistent>();
46 std::vector<MaterialInstanceHandle> layerMaterialInstances;
47
48 uint32_t layoutGeneration = ~0u;
49 const DataSetComponent* dataComp = nullptr;
50 float seabedClipOffset = 0.0f;
51 std::vector<float> thresholds;
52 int index = -1;
53 bool reIssue = true;
54
55 };
56
58 : public ComponentSystemWithDataPool<PingIsoComponent, SinglePingIsoSurfacesData>
59 {
60 public:
61 PingIsoSystem(Memory::Allocator * allocator, SizeType capacity) : ComponentSystemWithDataPool(allocator, capacity) {}
62
63 void initialize(Context * context) override;
64
65 void update(Context* context) override;
66
67 void cleanup(Context* context) override;
68
69 void setDataSystem(DataSetSystem * dataSystem) { dataSetSystem = dataSystem; }
70
71 private:
72 DataSetSystem * dataSetSystem = nullptr;
73 MaterialHandle surfaceMaterial;
74 VariableKey rangeKey;
75 VariableKey opacityKey;
76 };
77
78 }
79 }
80}
Context * context
Pointer to the Context instance the system lives in.
void update()
Updates the system state to that of the current frame.
Component system with parallel data per component stored in a pool similar to how the components them...
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Base allocator implementation.
Definition: Allocator.h:30
uint16_t VariableKey
Used to lookup material properties.
Definition: Resources.h:46
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
ComponentIndex SizeType
Type used to track the size of pools.
Definition: Component.h:19
void cleanup(Context *context) override
Provided for custom cleanup logic in derived systems.
void initialize(Context *context) override
Initialize the system.