FiberVISH
0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
pond
anemonefish
FieldAnemone.hpp
1
#ifndef __FISH_POND_ANEMONEFISH_FieldAnemone_HPP
2
#define __FISH_POND_ANEMONEFISH_FieldAnemone_HPP
3
4
#include <fish/pond/spine/SkeletonOperator.hpp>
5
#include <ocean/Anemonia/VRenderObject.hpp>
6
#include <ocean/Anemonia/Seagrass.hpp>
7
8
#include <fish/pond/bone/FishSlice.hpp>
9
#include <fish/pond/bone/FishField.hpp>
10
#include <fish/fiber/baseop/GridField.hpp>
11
12
#include "GridAnemone.hpp"
13
#include "GridAnemoneState.hpp"
14
#include "FieldAnemoneBase.hpp"
15
#include "ShaderFields.hpp"
16
17
namespace
Wizt
18
{
19
38
class
anemonefish_API
FieldAnemone
:
public
FieldAnemoneBase
,
public
ShaderFields
39
{
40
public
:
41
std::unordered_map<int, std::string>
TextureUnitNames;
42
43
int
getTextureUnit(
const
string
&Name)
const
;
44
45
void
setNamedTextures(
const
Anemone
&,
const
RefPtr<RenderBasin::Program>
&)
const
;
46
47
using
FieldAnemoneState
=
GridAnemoneState
;
48
50
FieldAnemone
(
const
string
&name,
int
RenderCategory
,
const
RefPtr<VCreationPreferences>
&
VP
);
51
53
~FieldAnemone
();
54
55
59
virtual
string
getShaderAttributeName(
const
TypedSlot<Fiber::Field>
&MyField )
const
;
60
61
virtual
glsl getShaderPrefix(
const
FieldAnemone::AnemoneCreationContext
&
ARC
,
62
const
FieldAnemone::AnemoneExplorer
&
AE
)
const
;
63
67
bool
validateInput(
VRequest
&R,
Fiber::Info<Fiber::Grid>
&,
68
const
RefPtr<GridAnemoneState>
&
GAS
,
69
const
RefPtr<Fiber::Skeleton>
&
myVertexSkeleton
,
70
const
RefPtr<Fiber::Chart>
&
chart
,
71
string
&
ValidateInputInfoString
)
const override
;
72
73
/*
74
Validating fields during update(), possibly compute them.
75
76
This function will inspect input type slots of the derived object,
77
retrieve a field from it, and compare it with the field that is
78
currently stored in the FieldAnemoneState.
79
80
The function is called from update().
81
82
If any field has changed, the function will return false.
83
84
85
The default implementation will work off all slots registered
86
in the ShaderFields member variable.
87
*/
88
virtual
bool
validateFields(
VRequest
&
Context
,
Fiber::Info<Fiber::Grid>
&
iG
,
89
FieldAnemoneState
&
FAS
,
90
const
RefPtr<Fiber::Skeleton>
&
myVertexSkeleton
,
91
const
RefPtr<Fiber::Chart>
&
chart
,
92
string
&
ValidateInputInfoString
)
const
;
93
98
bool
addSupplementaryData(
VRequest
&
Context
,
Fiber::Info<Fiber::Grid>
&,
99
RenderFields
&
RF
,
100
const
RefPtr<Fiber::Skeleton>
&
myVertexSkeleton
,
101
const
RefPtr<Fiber::Chart>
&
chart
,
102
string
&
InfoString
)
override
;
103
104
105
109
void
requestSupplementaryData(
VRenderContext
&theContext,
110
const
RefPtr<Fiber::FragmentID>
&myFragmentID)
const override
;
111
115
bool
isCreatingSupplementaryData(
VRenderContext
&theContext,
116
const
RefPtr<Fiber::FragmentID>
&myFragmentID)
const override
;
117
118
119
/*
120
Add fields to the field list during update(), which means
121
registering the fields for usage in the shader.
122
123
The field may be computed, but probably already has been
124
computed by the validateFields() call which comes first.
125
However, computation in validateFields() might return
126
before checking all fields, whereas in addFields() we now
127
know that all fields are needed.
128
129
The default implementation will work off all slots registered
130
in the ShaderFields member variable.
131
*/
132
virtual
bool
addFields(
VRequest
&,
Fiber::Info<Fiber::Grid>
&,
133
RenderFields
&
RF
,
134
const
RefPtr<Fiber::Skeleton>
&,
135
const
RefPtr<Fiber::Chart>
&,
136
string
&);
137
142
bool
requireNewFieldComputation(
const
RefPtr<Fiber::Field>
&
Output
,
143
const
RefPtr<ValuePool>
&
Context
,
144
const
RefPtr<Fiber::Field>
&Input)
const
;
145
146
virtual
MemCore::RefPtr<RenderBasin::Painter>
147
createPainter(
Anemone
&RenderAnemone,
148
const
AnemoneCreationContext
&
ARC
,
149
const
RefPtr<AnemoneExplorer>
&,
150
const
RefPtr<RenderBasin::VertexAttribute>
&Vertices)
const
;
151
152
153
GridAnemone::AnemoneRenderStatus
154
initializeAnemone(
Anemone
&RenderAnemone,
const
AnemoneCreationContext
&
ARC
,
155
const
RefPtr<AnemoneExplorer>
&)
const override
;
156
157
158
bool
isValidAnemone(
const
Anemone
&RenderAnemone,
159
const
AnemoneCreationContext
&
ARC
,
160
const
RefPtr<AnemoneExplorer>
&)
const override
;
161
162
163
virtual
bool
validateAnemoneData(
VRenderContext
&theContext,
164
map
<
string
,
RefPtr<MemBase>
>&
AnemoneData
,
165
const
RefPtr<Fiber::FragmentID>
&
theFragmentID
,
166
const
Fiber::SkeletonID
&
theSkeletonID
)
const
;
167
168
169
};
// end FieldAnemone class
170
171
175
template
<
class
FieldType>
176
class
TypedFieldAnemone
:
public
FieldAnemone
177
{
178
public
:
179
typedef
FieldType InputTypes;
180
181
TypedFieldAnemone
(
const
string
&name,
int
RenderCategory
,
const
RefPtr<VCreationPreferences>
&
VP
)
182
:
FieldAnemone
(name,
RenderCategory
,
VP
)
183
{
184
acceptType<FieldType>
();
185
}
186
};
187
188
typedef
TypedFieldAnemone<double>
DoubleFieldAnemone
;
189
typedef
TypedFieldAnemone<float>
FloatFieldAnemone
;
190
191
// note: doesnt include long double
192
typedef
TypedFieldAnemone<LIST<double, float>
>
FloatScalarFieldAnemone
;
193
194
typedef
TypedFieldAnemone<META::IntegerTypeList>
IntegerScalarFieldAnemone
;
195
196
typedef
TypedFieldAnemone<META::NativeTypeList>
GenericScalarFieldAnemone
;
197
198
}
// namespace Wizt
199
200
#endif
// __FISH_POND_ANEMONEFISH_GridAnemone_HPP
std::map
std::unordered_map
Eagle::Context
Fiber::CreativeIterator
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition
CreativeIterator.hpp:34
Fiber::SkeletonID
Identifier for Skeletons within a Grid.
Definition
SkeletonID.hpp:24
MemCore::StrongPtr
Wizt::Anemone
Wizt::FieldAnemone
Base class for objects that render information given on a Field.
Definition
FieldAnemone.hpp:39
Wizt::GridAnemoneState
Definition
GridAnemoneState.hpp:46
Wizt::RenderFields
Handling a hierarchy of fields.
Definition
RenderFields.hpp:21
Wizt::ShaderFields
Definition
ShaderFields.hpp:18
Wizt::TypedFieldAnemone
A field Anemone operating on a certain type.
Definition
FieldAnemone.hpp:177
Wizt::VRenderContext
Wizt::VRequest
Wizt
note: cannot derive from FloatingSkeletonRenderer as long as independent base class TriangleRenderer ...
Wizt::RenderCategory
RenderCategory
Wizt::FieldAnemoneBase
Definition
FieldAnemoneBase.hpp:17
Wizt::GridAnemoneCreationContext
The context of creating a RenderAnemone.
Definition
AnemoneCreationContext.hpp:58
Wizt::GridAnemone::AnemoneExplorer
The Anemone Explorer is an object that lives throughout rendering of a set of Anemones.
Definition
GridAnemone.hpp:204
Generated on Sun Mar 1 2026 10:23:11 for FiberVISH by
1.9.8