FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
FishBasin.hpp
1#ifndef __FISH_ANEMONE_FISHBASIN_HPP
2#define __FISH_ANEMONE_FISHBASIN_HPP
3
4#include <ocean/Anemonia/RenderBasin.hpp>
5#include <ocean/Anemonia/Seagrass.hpp>
6
7#include <ocean/plankton/VManagedObject.hpp>
8
9#include <fish/fiber/field/MemBase.hpp>
10#include <fish/fiber/grid/Grid.hpp>
11
12#include <memcore/MultiPtrMap.hpp>
13
14#include "anemonefishDllApi.h"
15
16namespace Wizt
17{
18
26
27
73{
74
90 [[deprecated("revise the nullptr chart argument")]]
92 getAnemoneCreator(RenderBasin&RB,
95 const RefPtr<Fiber::Chart>&theCurrentChart = nullptr );
96
97
99 getAnemoneCreator(RenderBasin&Context,
103 const std::function<RefPtr<AnemoneCreatorBase>(const Seagrass&)>&newAnemoneCreator,
105
106 using DataFilter_t = std::function<RefPtr<ChunkBase> (const RefPtr<Fiber::MemBase>&FieldDataArray, const std::string&FieldName)>;
107
108
121 createVertexAttribute(RenderBasin&RB,
123 const std::string&name,
124 const DataFilter_t&DF,
126
127
129 createVertexAttribute(RenderBasin&RB,
131 const std::string&name,
132 const DataFilter_t&DF,
134
136 createTexture(RenderBasin&RB,
138 RenderBasin::TextureFormat TF,
139 int TextureUnit = 0,
140 RenderBasin::TextureStorageFormat TSF = RenderBasin::AutomaticTexture(),
141 int level = 0, bool GenerateDoMipMap = false,
143 bool AllowProceduralArray = false
144 );
145
146
147
149 createTexture(RenderBasin&RB,
151 RenderBasin::TextureFormat TF,
152 int TextureUnit = 0,
153 RenderBasin::TextureStorageFormat TSF = RenderBasin::AutomaticTexture(),
154 int level=0, bool GenerateDoMipMap = false,
156 bool AllowProceduralArray = false
157 )
158 {
159 if (!CAB)
160 return MemCore::NullPtr();
161
162 return createTexture( RB, CAB->create(),
166 }
167
168
169
171 createTexture(RenderBasin&RB,
174 RenderBasin::TextureFormat TF,
175 int TextureUnit = 0,
176 RenderBasin::TextureStorageFormat TSF = RenderBasin::AutomaticTexture(),
177 int level = 0, bool GenerateDoMipMap = false,
179 bool AllowProceduralArray = false
180 )
181 {
182 if (!CAB)
183 return MemCore::NullPtr();
184
186 TXT = createTexture( RB, CAB->create(),
190 {
191 if (const MemCore::WeakPtr<Seagrass>&S = RB.getSeagrassPtr() )
192 {
193 S->addDependency( AnemoneCreator, *CAB);
194 }
195 return TXT;
196 }
197
198 return MemCore::NullPtr();
199 }
200
201
202
241 createTextureBuffer(RenderBasin&RB,
243 int TextureUnit = 0,
244 bool doNormalize = false,
245 int AttributeClass = 0,
246 int MaxBitStorage = 0,
247 bool AllowProceduralArray = false);
248
255 int TextureUnit = 0,
256 bool doNormalize = false,
257 int AttributeClass = 0,
258 int MaxBitStorage = 0,
259 bool AllowProceduralArray = false)
260 {
261 if (!CAB)
262 return MemCore::NullPtr();
263
264 return createTextureBuffer(RB, CAB->create(),
270 }
271
272
281 int TextureUnit = 0,
282 bool doNormalize = false,
283 int AttributeClass = 0,
284 int MaxBitStorage = 0,
285 bool AllowProceduralArray = false)
286 {
287 if (!CAB)
288 return MemCore::NullPtr();
289
291 TXT = createTextureBuffer( RB, CAB->create(),
297 {
298 if (const MemCore::WeakPtr<Seagrass>&S = RB.getSeagrassPtr() )
299 {
300 S->addDependency( AnemoneCreator, *CAB);
301 }
302 return TXT;
303 }
304
305 return MemCore::NullPtr();
306 }
307
308
316 {
317 if (!CAB) return;
318
319 if (const MemCore::WeakPtr<Seagrass>&S = RB.getSeagrassPtr() )
320 {
321 S->addDependency( AnemoneCreator, *CAB);
322 }
323 }
324
325
326#if 0
327
332static void addDependency(RenderBasin&RB,
334 const MemCore::WeakPtr<Fiber::Field>&theField)
335 {
336 if (!theField) return;
337
338 if (const MemCore::WeakPtr<Seagrass>&S = RB.getSeagrassPtr() )
339 {
340 S->addDependency( AnemoneCreator, *theField);
341 }
342 }
343
348static void addDependency(RenderBasin&RB,
349 const MemCore::WeakPtr<AnemoneCreatorBase>&AnemoneCreator,
350 const MemCore::WeakPtr<Fiber::Grid>&theGrid)
351 {
352 if (!theGrid) return;
353
354 if (const MemCore::WeakPtr<Seagrass>&S = RB.getSeagrassPtr() )
355 {
356 S->addDependency( AnemoneCreator, *theGrid );
357 }
358 }
359
360#endif
361
362
363};
364
365
366} // namespace
367
368#endif // __FISH_ANEMONE_FISHBASIN_HPP
basic_string< char > string
_Hashtable::key_type key_type
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
std::nullptr_t NullPtr
note: cannot derive from FloatingSkeletonRenderer as long as independent base class TriangleRenderer ...
A namespace for the Anemone Fish API to field fragments into textures.
Definition FishBasin.hpp:73
static MemCore::RefPtr< RenderBasin::Attribute > createTextureBuffer(RenderBasin &RB, const MemCore::RefPtr< Fiber::CreativeArrayBase > &CAB, int TextureUnit=0, bool doNormalize=false, int AttributeClass=0, int MaxBitStorage=0, bool AllowProceduralArray=false)
Create a texture buffer from a data creator.
Definition FishBasin.hpp:253
static void addDependency(RenderBasin &RB, const MemCore::WeakPtr< AnemoneCreatorBase > &AnemoneCreator, const MemCore::RefPtr< Fiber::CreativeArrayBase > &CAB)
Specify a dependency of the anemone creator on the given Field such that the anemone is removed if th...
Definition FishBasin.hpp:313
static MemCore::RefPtr< RenderBasin::Attribute > createTextureBuffer(RenderBasin &RB, const MemCore::WeakPtr< AnemoneCreatorBase > &AnemoneCreator, const MemCore::RefPtr< Fiber::CreativeArrayBase > &CAB, int TextureUnit=0, bool doNormalize=false, int AttributeClass=0, int MaxBitStorage=0, bool AllowProceduralArray=false)
Create a texture buffer from a data creator with caching, i.e.
Definition FishBasin.hpp:278