Cogs.Core
Extensions
WellLog
Source
Systems
ZipSystem.h
1
#pragma once
2
3
#include "Systems/ComponentSystem.h"
4
5
#include "../Components/ZipComponent.h"
6
7
#include "Resources/Resources.h"
8
9
#include "Foundation/ComponentModel/ComponentDataPool.h"
10
11
namespace
Cogs
12
{
13
namespace
Core
14
{
15
class
Context;
16
17
struct
ZipData
18
{
19
ZipData
() =
default
;
20
ZipData
(
const
ZipData
& other) =
delete
;
21
22
std::vector<float> depthList;
23
std::vector<float> samples;
24
25
std::vector<glm::vec3> basePositions;
26
std::vector<glm::vec3> baseDirections;
27
28
std::vector<float> values;
29
30
glm::vec3 axis;
31
float
radius = 0.0f;
32
};
33
34
class
ZipSystem
:
public
ComponentSystemWithDataPool
<ZipComponent, ZipData>
35
{
36
using
base
=
ComponentSystemWithDataPool<ZipComponent, ZipData>
;
37
public
:
38
ZipSystem
(
Memory::Allocator
* allocator,
SizeType
capacity) :
ComponentSystemWithDataPool
(allocator, capacity) {}
39
40
void
update
(
Context
*
context
)
override
;
41
void
cleanup
(
Context
*
context
)
override
;
42
43
private
:
44
bool
setupComponent(
Context
*
context
,
ZipComponent
& component);
45
bool
needsUpdate(
Context
*
context
,
ZipComponent
& component);
46
47
void
updateStaticLog(
Context
*
context
,
ZipComponent
& component);
48
bool
updateStaticHighLight(
Context
*
context
,
ZipComponent
& component);
49
void
updateDynamic(
Context
*
context
,
ZipComponent
& component);
50
51
void
setupMaterial(
Context
*
context
);
52
53
void
resetComponent(
ZipComponent
& component);
54
55
MaterialHandle
zipMaterial =
MaterialHandle::NoHandle
;
56
bool
useGpu =
false
;
57
58
VariableKey
axisKey = {};
59
VariableKey
parameterKey = {};
60
VariableKey
diffuseColorKey = {};
61
VariableKey
colorMapKey = {};
62
};
63
}
64
}
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::Core::ZipSystem
Definition:
ZipSystem.h:35
Cogs::Core::ZipSystem::cleanup
void cleanup(Context *context) override
Provided for custom cleanup logic in derived systems.
Definition:
ZipSystem.cpp:288
Cogs::Memory::Allocator
Base allocator implementation.
Definition:
Allocator.h:30
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::ResourceHandle_t< Material >
Cogs::Core::ResourceHandle_t< Material >::NoHandle
static const ResourceHandle_t NoHandle
Handle representing a default (or none if default not present) resource.
Definition:
ResourceHandle.h:193
Cogs::Core::ZipComponent
Component displaying a 3D log on a trajectory.
Definition:
ZipComponent.h:17
Cogs::Core::ZipData
Definition:
ZipSystem.h:18
Generated by
1.9.6