FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
HeightDots.hpp
1#include <anemonefish/ShadedFieldAnemone.hpp>
2#include <anemonefish/CarpetAnemone.hpp>
3#include <ocean/shrimp/VEnum.hpp>
4#include <ocean/Anemonia/ShaderConditionals.hpp>
5#include <eye/retina/Billboard.hpp>
6#include <pond/eye/shaders/ContourLines.hpp>
7#include <anemonefish/Texturizer.hpp>
8#include <eye/shaders/Phong.hpp>
9#include <ocean/Anemonia/FogInjector.hpp>
10#include <eye/retina/FieldVisibilityInjector.hpp>
11#include <ocean/Anemonia/Cursor3DProperties.hpp>
12
13
14namespace Wizt
15{
16
17using namespace Fiber;
18
19struct Masking
20{
21 VObject::in<VEnum> inMaskMode, inMaskDisplayMode;
22 VObject::in<double> inMaskThreshold;
24 VObject::in<Color> inMaskColor;
25 VObject::in<double> inMaskVisibilityBoost,
26 inMaskScaleFactor;
27
28 Masking(VObject*that, int EL=5)
29 : inMaskMode(that, "maskmode", VEnum{"Show All", "Mask", "No Mask"}, EL)
30 , inMaskDisplayMode(that, "maskdisplay",
31 VEnum{1, "Interior" , "Exterior" , "Stars" , "Spikes",
32 "tInterior", "tStars", "tSpikes"}, EL+2)
33 , inMaskThreshold(that, "maskthreshold", 0.5, EL)
34 , MaskField(that, "mask", EL)
35 , inMaskColor(that, "maskcolor", Color{1,0,0,0.7}, EL)
36 , inMaskVisibilityBoost(that, "MaskVisibilityBoost", 1.0, EL+4)
37 , inMaskScaleFactor(that, "MaskScaleFactor", 0.0, EL+4)
38 {
39 inMaskScaleFactor /=
40 inMaskVisibilityBoost /=
41 inMaskMode /=
42 inMaskDisplayMode /=
43 MaskField /=
44 inMaskThreshold /=
45 inMaskColor /=
46 that->recognizeInputClass("masking");
47
48 inMaskVisibilityBoost.setProperty("min", 1.0);
49 inMaskVisibilityBoost.setProperty("max", 1.1);
50 inMaskVisibilityBoost.setProperty<string>("tooltip",
51 "Enhance the visibility of masked points in a strongly visual, though unnatural, way "
52 " by placing them into the foreground of unmasked points.");
53
54 inMaskScaleFactor.setProperty<string>("tooltip",
55 "Increase visible size of masked points. This increase is dependent on the mask value "
56 "such that heavily masked points are scaled even stronger. For boolean-valued masks "
57 "all increments are identical."
58 );
59
60
61 inMaskScaleFactor.setProperty("min", -.004);
62 inMaskScaleFactor.setProperty("max", +.01);
63 }
64
65
66 void initializeVertexAnemoneMaskProperties(Anemone&RenderAnemone,
68 AnemoneCreator<>&AC) const
69 {
70 VRenderContext&Context = ARC.myContext;
71
72 RenderAnemone << Context << "MaskThreshold" << inMaskThreshold;
73 RenderAnemone << Context << "MaskColor" << inMaskColor;
74 RenderAnemone << Context << "MaskVisibilityBoost" << inMaskVisibilityBoost;
75 RenderAnemone << Context << "MaskScaleFactor" << inMaskScaleFactor;
76 }
77};
78
79
83 , Phong
87 , Masking
88 , Cursor3D
89{
91 using InputTypes = FieldType;
92
93 in<Range> inHeightRange,
94 inColorRange,
95 inSizeRange;
96
97 in<int> inColorSteps,
98 inHeightSteps;
99
100 in<double> inColorBlendFactor,
101 inGamma,
102 inBrightness,
103 inBorder,
104 inSidedness
105 , inAlphaThreshold;
106 //scaleHeight;
107
108 in<double,6> inExtendedHeightSensitivity = { "HeightSensitivity" , 10.0 },
109 inExtendedHeightSensitivityWeight = { "HeightSensitivityWeight", 0.0 };
110
111 in<double> inNormalValidityOffset;
112
113 TypedSlot<VColormap> myFieldColormap;
114
115 in<bool> inOrientHeightDots,
116 inDoShading,
117 inCircularHeightDots,
118 inDoHighlights,
119 inXray,
120 inInvertNormals,
121 inDoConsiderInputAsSRGBColorSpace;
122
123 in<bool , 61> inDoFog = { "Fog" , false };
124
125 in<RefPtr<Fog>,4> inFog;
126 in<RefPtr<FieldVisibility>,2> inFieldVisibility;
127
128 TypedSlot<Fiber::Field> NormalField = {this, "normalvectors" , 3};
129 TypedSlot<Fiber::Field> NormalValidity = {this, "normalvalidity", 5};
130
131 TypedSlot<Fiber::Field> AlphaChannelField ;
132 TypedSlot<Fiber::Field> OverrideHeightField;
133 TypedSlot<Fiber::Field> SelectionField;
134 TypedSlot<Fiber::Field> inSizeField;
135
136 HeightDots(const string&Name, int, const RefPtr<VCreationPreferences>&VP );
137 ~HeightDots();
138
139
148 string&InfoString) override;
149//static constexpr bool hasShaderConditionals = true;
150
151 string getShaderConditionals(Anemone&RenderAnemone,
153 const RefPtr<FieldAnemone::AnemoneExplorer>&AE) const override;
154
155 bool isValidVertexAnemone(const Anemone&RenderAnemone,
157 const AnemoneCreator<>&AC) const override;
158
159 RefPtr<DataRangeBase> getHeight(const RefPtr<ValuePool>&Context, bool) const;
160
166 bool AllowAsynchLoading) const override;
167
169 bool initializeVertexAnemone(Anemone&RenderAnemone,
170 const RefPtr<RenderBasin::Program>&ShaderProgram,
172 AnemoneCreator<>&AC) const override;
173
174
180 bool validateAnemoneData(VRenderContext&theContext,
183 const Fiber::SkeletonID&theSkeletonID) const override;
184
185
187 Anemone&RenderAnemone,
189 const RefPtr<GridAnemone::AnemoneExplorer>&AE) const override;
190
191 std::string VertexShaderPrefix(VRenderContext&Context) const override;
192 std::string GeometryShaderPrefix(VRenderContext&Context) const override;
193 std::string FragmentShaderPrefix(VRenderContext&Context) const override;
194
195
197 RenderNamespace::glsl
198 vertex_shader(VRenderContext&Context) const override;
199
200 std::string geometry_shader(VRenderContext&Context) const override;
201
204
205 string getShaderAttributeName( const TypedSlot<Fiber::Field>&) const override;
206
207};
208
209
210} // namespace
basic_string< char > string
Base class for multidimensional arrays that employ deferred storage, i.e.
Definition CreativeArrayBase.hpp:75
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Identifier for Skeletons within a Grid.
Definition SkeletonID.hpp:24
const std::string & Name() const
Convenience class for drawing billboards using a Geometry Shader.
Definition Billboard.hpp:21
The CarpetAnemone handles a colormap attached to an Anemone.
Definition CarpetAnemone.hpp:62
Handling a hierarchy of fields.
Definition RenderFields.hpp:21
A FieldAnemone with shader support.
Definition ShadedFieldAnemone.hpp:24
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
note: cannot derive from FloatingSkeletonRenderer as long as independent base class TriangleRenderer ...
Definition ContourLines.hpp:18
The context of creating a RenderAnemone.
Definition AnemoneCreationContext.hpp:58
Definition HeightDots.hpp:89
RenderNamespace::glsl vertex_shader(VRenderContext &Context) const override
Vertexshader GLGS code.
Definition HeightDots.cpp:553
string getShaderAttributeName(const TypedSlot< Fiber::Field > &) const override
Get the name of this field as it should be called in the shader program.
Definition HeightDots.cpp:619
bool validateAnemoneData(VRenderContext &theContext, map< string, RefPtr< MemBase > > &AnemoneData, const RefPtr< Fiber::FragmentID > &theFragmentID, const Fiber::SkeletonID &theSkeletonID) const override
Checks for availability of Mask data and the "Mask only" setting: If only masked data should be displ...
Definition HeightDots.cpp:384
RefPtr< BoundingBox > getModifiedBBox(const RefPtr< ValuePool > &Context, CreativeArrayBase &CoordinateFragment, const RefPtr< FragmentID > &theFragmentID, const RefPtr< Fiber::Skeleton > &DestVertexSkeleton, const RefPtr< Fiber::Chart > &chart, bool AllowAsynchLoading) const override
Definition HeightDots.cpp:686
std::string fragment_shader(VRenderContext &Context) const override
Fragmentshader GLSL code that might stem from an text file.
Definition HeightDots.cpp:590
bool addFields(VRequest &Context, Fiber::Info< Fiber::Grid > &iG, RenderFields &FAS, const RefPtr< Fiber::Skeleton > &theVertexSkeleton, const RefPtr< Fiber::Chart > &theChart, string &InfoString) override
Automatically attach a range object to the input field if is a scalar field and no range has been pro...
Definition HeightDots.cpp:235
RenderBasin::Program::Parameters setProgramParameters(RenderBasin::Program::Parameters P, Anemone &RenderAnemone, const GridAnemone::AnemoneCreationContext &ARC, const RefPtr< GridAnemone::AnemoneExplorer > &AE) const override
Callback function to set for instance the number of output vertices for a geometry shader.
Definition HeightDots.cpp:530
Definition HeightDots.hpp:20
Definition Phong.hpp:16
Helper class to manage textures used in shaders.
Definition Texturizer.hpp:17