FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
CurveOperators.hpp
1#ifndef __FIBER_GRID_TYPES_CURVEOPERATORS_HPP
2#define __FIBER_GRID_TYPES_CURVEOPERATORS_HPP
3
4#define USE_DEPRECATED_LINESET_FUNCTIONS
5
6#include "LineSet.hpp"
7#include <field/OnDemandCreator.hpp>
8
9
10namespace Fiber
11{
12 namespace Curve
13 {
14
15
17 {
18 WeakPtr<Grid> theGrid;
20
22 : theGrid( theGridP )
23 , fragV( fragVP )
24 {}
25 };
26
39{
41// typedef WeakPtr<Grid> Constructor_t;
43
45
49// ArcLength(const LineSet&LS, double InitialMaxArcLen = 0.0, const MemBase::Creator_t&C = MemCore::NullPtr() )
51 {
52#ifdef VERBOSE
53 puts("ArcLength::ArcLength() >>>>>>>> Computing Arclength, NOW !!!!");
54#endif
55 const LineSet& LS = CurveData.theGrid;
56
57 if (!LS)
58 return;
59
60 if (!LS.getCoords( CurveData.fragV ) )
61 {
62 puts("ArcLength::ArcLength() Arclength, has no coords found !!!!");
63 return;
64 }
65 Data = new ResultArray_t( LS.getCoords( CurveData.fragV )->nElements(), C);
66
67 LS.ApplyOnVertexFragment( *this, CurveData.fragV ); // vertexiterator
68 }
69
70 ~ArcLength();
71
72 RefPtr<ResultArray_t> result() const
73 {
74 return Data;
75 }
76
79
80};
81
82
95{
98
100
105 {
106 const LineSet& LS = CurveData.theGrid;
107
108 if (!LS)
109 return;
110
111 if (!LS.getCoords( CurveData.fragV ) )
112 return;
113
114 Data = new ResultArray_t( LS.getCoords( CurveData.fragV )->nElements(), C);
115
116 LS.ApplyOnVertexFragment( *this, CurveData.fragV );
117 }
118
119 ~StepSize();
120
121 RefPtr<ResultArray_t> result() const
122 {
123 return Data;
124 }
125
128
129};
130
131
132
140{
142
143// typedef WeakPtr<Grid> Constructor_t;
145
146 Velocity( const CurveOperatorData& CD );
147
148 ~Velocity();
149};
150
151
152
157template <class FieldType>
159{
161
163// typedef WeakPtr<Grid> Constructor_t;
165
167
172 : Velocity( CD )
173 {
174 const LineSet& LS = CD.theGrid;
175 if (! CD.fragV ) {}
176
177 if (!LS)
178 return;
179
180 if (!LS.getCoords( CD.fragV ) )
181 return;
182
183 if (!VelocityData)
184 return;
185
186 Data = new ResultArray_t( LS.getCoords( CD.fragV )->nElements(), C);
187 }
188
189 RefPtr<ResultArray_t> result() const
190 {
191 return Data;
192 }
193
194// void apply(const CreativeIterator<Eagle::PhysicalSpace::point>&Vertices,
195// const std::vector<LineSet::LineIndex_t>&Line);
196
197};
198
199
200
201
202
203
204
205
211{
214 {
215 const LineSet& LS = CD.theGrid;
216
217 if (!LS)
218 return;
219
220 if (!Data)
221 return;
222
223 LS.ApplyOnVertexFragment( *this, CD.fragV );
224 }
225
226 ~Energy();
227
228
234};
235
236
237
251{
256 : CurveQuantity_t(CD, C)
257 {
258 const LineSet& LS = CD.theGrid;
259
260 if (!LS)
261 return;
262
263 if (!Data)
264 return;
265
266 LS.ApplyOnVertexFragment( *this, CD.fragV );
267 }
268
269 ~ProperTime();
270
273
274};
275
276
277
282struct gridtypes_API Acceleration : CurveQuantity<Eagle::PhysicalSpace::tvector>
283{
284
286 : CurveQuantity_t(CD, C)
287 {
288 const LineSet& LS = CD.theGrid;
289
290 if (!LS)
291 return;
292
293 if (!Data)
294 return;
295
296 LS.ApplyOnVertexFragment( *this, CD.fragV );
297 }
298
300
303
304};
305
306
320{
325 : CurveQuantity_t(CD, C)
326 {
327 const LineSet& LS = CD.theGrid;
328
329 if (!LS)
330 return;
331
332 if (!Data)
333 return;
334
335 LS.ApplyOnVertexFragment( *this, CD.fragV );
336 }
337
338 ~Curvature();
339
340
343
344};
345
346
360{
365 : CurveQuantity_t(CD, C)
366 {
367 const LineSet& LS = CD.theGrid;
368
369 if(!LS)
370 return;
371
372 if (!Data)
373 return;
374
375 LS.ApplyOnVertexFragment( *this );
376 }
377
378 ~Torsion();
379
382
383};
384
385
386 } // Curve
387
388} // Fiber
389
390#endif // __FIBER_GRID_TYPES_CURVEOPERATORS_HPP
391
_Expr< _ValFunClos< _ValArray, _Tp >, _Tp > apply(_Tp __func(_Tp)) const
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
A set of lines stored on a Grid.
Definition LineSet.hpp:55
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
std::nullptr_t NullPtr
Compute the acceleration along a curve.
Definition CurveOperators.hpp:283
Compute the arc length of a curve.
Definition CurveOperators.hpp:39
ArcLength(const CurveOperatorData &CurveData, const MemBase::Creator_t &C=MemCore::NullPtr())
Definition CurveOperators.hpp:50
Compute the curvature of a curve, which is a line with Velocity given.
Definition CurveOperators.hpp:320
Curvature(const CurveOperatorData &CD, const MemBase::Creator_t &C=MemCore::NullPtr())
Definition CurveOperators.hpp:324
Definition CurveOperators.hpp:17
Base class for quantities computed on a curve and therefore are dependent on the velocity.
Definition CurveOperators.hpp:159
CurveQuantity(const CurveOperatorData &CD, const MemBase::Creator_t &C=MemCore::NullPtr())
Definition CurveOperators.hpp:171
Compute the energy of a curve, which is .
Definition CurveOperators.hpp:211
Compute the proper time of a curve, which is a line with Velocity given.
Definition CurveOperators.hpp:251
ProperTime(const CurveOperatorData &CD, const MemBase::Creator_t &C=MemCore::NullPtr())
Definition CurveOperators.hpp:255
Compute the step size of a curve.
Definition CurveOperators.hpp:95
StepSize(const CurveOperatorData &CurveData, const MemBase::Creator_t &C=MemCore::NullPtr())
Definition CurveOperators.hpp:104
Compute the torsion of a curve, which is a line with Velocity given.
Definition CurveOperators.hpp:360
Torsion(const CurveOperatorData &CD, const MemBase::Creator_t &C=MemCore::NullPtr())
Definition CurveOperators.hpp:364
Store the velocity of curve, which determines its parameterization.
Definition CurveOperators.hpp:140