Cogs.Core
Extensions
EchoSounder
Source
Systems
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
13
namespace
Cogs
14
{
15
namespace
Core
16
{
17
namespace
EchoSounder
18
{
19
20
struct
DataSetSystem;
21
22
struct
SinglePingIsoSurfacesPersistent
{
23
std::mutex mutex;
24
std::atomic<int> runningTasks = 0;
25
26
MeshHandle
issuedMesh;
27
glm::vec3 issuedPosition;
28
glm::quat issuedOrientation;
29
30
Memory::TypedBuffer<float>
values;
31
Memory::TypedBuffer<float>
linearValues;
32
Memory::TypedBuffer<uint8_t>
volumeCases;
33
Memory::TypedBuffer<int32_t>
volumeOffsets;
34
Memory::TypedBuffer<int32_t>
volumeCells;
35
Memory::TypedBuffer<uint8_t>
wallCases;
36
Memory::TypedBuffer<int32_t>
wallOffsets;
37
Memory::TypedBuffer<int32_t>
wallCells;
38
Memory::TypedBuffer<float>
tmpValues;
39
40
41
};
42
43
struct
SinglePingIsoSurfacesData
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
57
struct
PingIsoSystem
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
}
Cogs::Core::ComponentSystemBase::context
Context * context
Pointer to the Context instance the system lives in.
Definition:
ComponentSystem.h:136
Cogs::Core::ComponentSystemBase::update
void update()
Updates the system state to that of the current frame.
Definition:
ComponentSystem.h:65
Cogs::Core::ComponentSystemWithDataPool
Component system with parallel data per component stored in a pool similar to how the components them...
Definition:
ComponentSystem.h:365
Cogs::Core::Context
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition:
Context.h:83
Cogs::Memory::Allocator
Base allocator implementation.
Definition:
Allocator.h:30
Cogs::Memory::TypedBuffer
Definition:
MemoryBuffer.h:196
Cogs::Core::VariableKey
uint16_t VariableKey
Used to lookup material properties.
Definition:
Resources.h:46
Cogs
Contains all Cogs related functionality.
Definition:
FieldSetter.h:23
Cogs::SizeType
ComponentIndex SizeType
Type used to track the size of pools.
Definition:
Component.h:19
Cogs::Core::EchoSounder::DataSetComponent
Definition:
DataSetComponent.h:90
Cogs::Core::EchoSounder::DataSetSystem
Definition:
DataSetSystem.h:72
Cogs::Core::EchoSounder::PingIsoSystem
Definition:
PingIsoSystem.h:59
Cogs::Core::EchoSounder::PingIsoSystem::cleanup
void cleanup(Context *context) override
Provided for custom cleanup logic in derived systems.
Definition:
PingIsoSystem.cpp:187
Cogs::Core::EchoSounder::PingIsoSystem::initialize
void initialize(Context *context) override
Initialize the system.
Definition:
PingIsoSystem.cpp:30
Cogs::Core::EchoSounder::SinglePingIsoSurfacesData
Definition:
PingIsoSystem.h:44
Cogs::Core::EchoSounder::SinglePingIsoSurfacesPersistent
Definition:
PingIsoSystem.h:22
Cogs::Core::ResourceHandle_t< Mesh >
Generated by
1.9.6