FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
FieldObject.hpp
1#ifndef __FISH_FIELDOBJECT_HPP
2#define __FISH_FIELDOBJECT_HPP
3
4#include "fishboneDllApi.h"
5
6#include <bundle/Bundle.hpp>
7#include <ocean/shrimp/VObjectStatus.hpp>
8#include <ocean/shrimp/VEnum.hpp>
9
10#include "FishField.hpp"
11#include "FishSlice.hpp"
12#include "GridObject.hpp"
13#include "TypedCreationPreferences.hpp"
14
15
16
17namespace Wizt
18{
19
20
29 , public Fish<Fiber::Slice>
30 , public Fish<Fiber::Grid>
31 , public StatusIndicator
32// , public VChartDependent
33{
34public:
37
42
45
48
51
56// out<Range> outFieldRange;
57
63 {
64 return theField().FieldTypes();
65 }
66
68 FieldObject(const string&name, int p = 0, const RefPtr<VCreationPreferences>&VP = NullPtr(), bool ExportGrid = true);
69
72
76static bool HasFields(const WeakPtr<VCreatorBase>&, const RefPtr<VObject>&vobj, const Fiber::TypeList_t&AcceptedFields);
77
84 bool update(VRequest&R, double precision) override;
85
86 const char*const*xpm_icon() const override;
87
88 string help(HelpType) const override;
89
90 std::string type_key() const override;
91};
92
93
101template <class FieldVObject>
102struct FieldObjectCreator : VCreator<FieldVObject, AcceptList<Fiber::Grid> >
103{
105
106 FieldObjectCreator(const string&name, int p=0,
108 : Base_t(name, p, VP)
109 {}
110
111 template <unsigned ID>
115 {}
116
117#if 0
118 string createChildname(const string&parent_name) const override
119 {
120 string BaseName = right_of( this->Name(), '/');
121 return BaseName + "On" + parent_name;
122
123
124// return parent_name + "->" + BaseName;
125// return parent_name + "(" + this->Name() + ")";
126 }
127#endif
128
129 VAcceptInfoList_t accept(const RefPtr<VObject>&vobj) const override
130 {
132
133 /*
134 Filtering of the grid connections according to the fields
135 that are to be connected.
136 */
138 for(VAcceptInfoList_t::const_iterator git = AcceptedGridConnections.begin();
139 git != AcceptedGridConnections.end(); git++)
140 {
142 {
143 Fiber::TypeList_t AcceptedFields;
145 {
146 TypedPrefs->getAcceptTypes(AcceptedFields);
147 }
148
149 if (FieldVObject::HasFields(this->self(), vobj, AcceptedFields) )
150 {
151 AcceptedFieldConnections.push_back( VAI );
152 }
153 }
154 }
155
157 }
158};
159
160} // namespace Wizt
161
162#endif /* __FISH_FISHOBJECT_HPP */
163
164
basic_string< char > string
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
const std::string & Name() const
std::string BaseName(const char Separator) const
Base class for selecting fields from a Grid object.
Definition FieldObject.hpp:33
const Fiber::TypeList_t & OutputFieldTypes() const
Optional output: the range of the field.
Definition FieldObject.hpp:62
VOutput< Fiber::Field > theField
The output: a field.
Definition FieldObject.hpp:47
VOutput< string > theFieldName
Also output: the name of the Field.
Definition FieldObject.hpp:50
Fiber::TypeList_t AcceptedFields
Input selection: which field types are acceptable here.
Definition FieldObject.hpp:44
TypedSlot< VStringList > MyFieldNames
The input: a list of field names to select one of them.
Definition FieldObject.hpp:36
in< VEnum > inSkeletonType
The skeleton type used for selection, for instance vertices (default), edges, faces,...
Definition FieldObject.hpp:41
VAcceptInfoList_t accept(const RefPtr< VObject > &vobj) const override
string createChildname(const string &parent_name) const override
RefPtr< VCreationPreferences > CreationPreferences(const RefPtr< VCreationPreferences > &AdditionalPreferences=nullptr) const
std::nullptr_t NullPtr
note: cannot derive from FloatingSkeletonRenderer as long as independent base class TriangleRenderer ...
A set of types.
Definition FiberType.hpp:213
VCreator class that operates on fields or bundles.
Definition FieldObject.hpp:103