1#ifndef __FIBER_GRID_TYPES_LINESET_HPP
2#define __FIBER_GRID_TYPES_LINESET_HPP
4#include "gridtypesDllApi.h"
5#include <grid/Grid.hpp>
6#include <eagle/PhysicalSpace.hpp>
96 return PerLineSkeletonID();
99static SkeletonID IDFragmented()
101 return SkeletonID(3,0);
104 RefPtr<Skeleton> Vertices,
107 RefPtr<Representation> CartesianVertices,
128static const char NormalVectorFieldName[];
136static const char ArcLengthFieldName[];
256 :
LineSet(G.self(), Coords, Lineset, Tangents )
283 return LineIndices.valid();
302 return Coords->getData( f );
312 return -(Coords->getData());
319 if (!TangentialVectors)
322 return -(TangentialVectors->getData());
330 Verbose(0) <<
"LineSet::getLineset() No LineIndices";
334 return LineIndices->getData( f );
339 template<
int N,
class T>
346 f = (*CartesianVertices)(fieldname);
349 Verbose(0) << fieldname <<
": NullPtr() in LineSet::extractDataFromField [f]";
357 Verbose(0) << fieldname <<
": NullPtr() in LineSet::extractDataFromField [mem]";
393 using CoordinateFragmentIterator =
397 using CoordinateFragmentIteratorWithVertexID =
401 void iterateCompatibleFragmentation(
const CoordinateFragmentIterator&);
402 void iterateCompatibleFragmentation(
const CoordinateFragmentIteratorWithVertexID&);
424 void iterateCompatibleFragmentation(
const LineVertexIterator&);
455 return Func.exec( myLineSet, f,
DC);
465#ifdef USE_DEPRECATED_LINESET_FUNCTIONS
479 template <
class Iterator>
491 if (!getCoords( f ) )
493 Verbose(0) <<
"LineSet::IterateLineSetFragment() No Coords?!";
497 CoordsArray_t&VertexArray = *getCoords( f );
499 const CreativeIterator<Eagle::PhysicalSpace::point>*V = VertexArray.creativeIterator();
500 const CreativeIterator<Eagle::PhysicalSpace::point>&Vertices = *V;
505 for(index_t line = 0; line < LinesetArray.count(); line++)
507 const LineIndices_t&Line = LinesetArray[ line ];
508 IC.apply(Vertices, Line);
512 template<
class Iterator>
513 [[deprecated(
"Use iterateCompatibleFragmentation() instead.")]]
514 void Iterate(Iterator&IC)
const
522 ApplyOnVertexFragment(IC,
NullPtr() );
528 template <
class Iterator>
529 void ApplyOnVertexFragment(Iterator&IC,
const RefPtr<FragmentID>& f =
NullPtr() ) const
533 IterateLineSetFragment(IC, f);
536 struct [[deprecated(
"Use iterateCompatibleFragmentation() instead.")]] CurveIterator;
538 struct gridtypes_API CurveIterator
540 virtual ~CurveIterator();
542 virtual void apply(
const CreativeIterator<Eagle::PhysicalSpace::point>&Vertices,
543 const LineIndices_t&Line) = 0;
546 [[deprecated(
"Use iterateCompatibleFragmentation() instead.")]]
547 void IterateCurves(CurveIterator&IC)
const;
552static void ComputeCurveTangents(
553 MultiArray<1, Eagle::tvector3>&Tangents,
554 const CreativeIterator<Eagle::PhysicalSpace::point>&Vertices,
555 const LineIndices_t&Line);
561static RefPtr<TangentialVector_t>
563 const LinesetArray_t&LinesetArray);
581 RefPtr<TangentialVector_t>
588 RefPtr<TangentialVector_t>
589 getNormalVectors(
const string&FieldName = NormalVectorFieldName);
591static RefPtr<TangentialVector_t>
592 ComputeArcLength(
const CoordsArray_t&Vertices,
593 const LinesetArray_t&LinesetArray);
595 RefPtr<FieldID> ComputeTVectorDerivative (
const RefPtr<Grid>&theGrid,
const string&F,
const string&dF =
"");
596 RefPtr<FieldID> ComputeScalarDerivative (
const RefPtr<Grid>&theGrid,
const string&F,
const string&dF =
"");
597 RefPtr<FieldID> ComputeUnitTVectorDerivative(
const RefPtr<Grid>&theGrid,
const string&F,
const string&dF =
"");
627 RefPtr<Field> getFieldOnLines(
const string& field_name )
const;
constexpr complex< _Tp > & operator=(const _Tp &)
_Expr< _ValFunClos< _ValArray, _Tp >, _Tp > apply(_Tp __func(_Tp)) const
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
Identify the edges on a skeleton within a Grid.
Definition Edges.hpp:35
Base class for iterators over the fragments of a field.
Definition FragmentID.hpp:249
A Grid is a set of Skeleton objects, each of them accessed via some unique SkeletonID object.
Definition Grid.hpp:60
Implementation of an Iterator to a sequence of elements, which might be contiguous or a projection of...
Definition vector/Iterator.hpp:525
Definition LineSet.hpp:643
A set of lines stored on a Grid.
Definition LineSet.hpp:55
RefPtr< LinesetArray_t > getLineset(const RefPtr< FragmentID > &f=NullPtr()) const
Return edges information.
Definition LineSet.hpp:326
uint32_t LineIndex_t
The index type used for line set indices.
Definition LineSet.hpp:67
RefPtr< MemCore::ChunkBase > getCoordsAsMemChunk() const
Return Mem ChunkBase of Coordinates Added by Bidur.
Definition LineSet.hpp:307
RefPtr< CoordsArray_t > getCoords(const RefPtr< FragmentID > &f=NullPtr()) const
Return coordinate array.
Definition LineSet.hpp:296
bool operator!() const
Inverse operator of the line indices check.
Definition LineSet.hpp:289
index_t NumberOfLines(const RefPtr< FragmentID > &f) const
Return the number of lines stored here.
Definition LineSet.cpp:221
std::vector< LineSet::LineIndex_t > LineIndices_t
A vector of line indices.
Definition LineSet.hpp:72
static SkeletonID PerLineSkeletonID()
A Skeleton ID for sets of edges, thereby defining lines.
Definition LineSet.hpp:89
RefPtr< Fiber::MemBase > extractDataFromField(const std::string &fieldname, RefPtr< FragmentID > fragID=NullPtr())
Return data arrays stored on the line.
Definition LineSet.hpp:340
MemArray< 1, LineIndices_t > LinesetArray_t
An array of line indices.
Definition LineSet.hpp:77
RefPtr< MemCore::ChunkBase > getTangentsAsMemChunk() const
Return Mem ChunkBase of Tangential Vectors Added by Bidur.
Definition LineSet.hpp:317
Class for N-dimensional MultiArrays with MemCore memory management.
Definition MemArray.hpp:34
Identifier for Skeletons within a Grid.
Definition SkeletonID.hpp:24
An intermediate class that allows to operate on the pure type information of some memory array.
Definition TypedArray.hpp:58
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
RefPtr< MemArray< 1, Eagle::tvector3 > > ComputeTangentialVectors(const MemArray< 1, Eagle::point3 > &Vertices, const MemArray< 1, std::vector< index_t > > &EdgesArray, const MemBase::Creator_t &Crec)
Compute tangential vectors along a set of lines.
Definition TangentialVectors.cpp:14
RefPtr< MemArray< 1, Eagle::tvector3 > > getTangentialVectors(Grid &G, const string &TangentialVectorFieldName)
Compute tangential vectors in a grid object, which has a set of lines defined.
Definition TangentialVectors.cpp:47
const char TangentialVectorFieldName[]
A default name for the field that holds the tangential vectors of a grid describing lines.
Definition TangentialVectors.cpp:10
IndexTypeConfig< sizeof(void *)>::index_t index_t
Define the index type as according to the size of a pointer, i.e.
Definition Index.hpp:22
Compute the curvature of a curve, which is a line with Velocity given.
Definition CurveOperators.hpp:320
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
Compute the step size of a curve.
Definition CurveOperators.hpp:95
Store the velocity of curve, which determines its parameterization.
Definition CurveOperators.hpp:140
Definition LineSet.hpp:443
Definition LineSet.hpp:434
Definition LineSet.hpp:373
Predefined field names on linesets.
Definition LineSet.hpp:142
Definition LineSet.hpp:602
Definition LineSet.hpp:462
Definition LineSet.hpp:461
Definition LineSet.hpp:463