A set of lines stored on a Grid. More...
#include <LineSet.hpp>
(Note that these are not member functions.)
A set of lines stored on a Grid.
The Grid must carry Vertices in Cartesian coordinates and a (1,2) Skeleton (dimension 1, depth 2) is a set of edges.
The positions field of this edge set is a set of vector<index_t> which describes the vertices that make up a curve each. This class supports computation of quantities such as defined at http://en.wikipedia.org/wiki/Differential_geometry_of_curves
A Grid object can be easily tested whether it is ("conforms to the concept of") a LineSet:
RefPtr<Grid> G; if (LineSet L = G) { ... yes is a lineset ... }
If the reason for not being a LineSet need to be inspected further, then the members of the LineSet can be investigated.
typedef uint32_t Fiber::LineSet::LineIndex_t |
The index type used for line set indices.
This is a 32 bit unsigned integer because of OpenGL, mostly. OpenGL cannot render 64bit indices, and we want to be able to shuffle the line set indices stored here directly to the graphics card.
Fiber::LineSet::LineSet | ( | const RefPtr< Grid > & | G, | |
const RefPtr< CoordsArray_t > & | Coords, | |||
const RefPtr< LinesetArray_t > & | Lineset, | |||
const RefPtr< TangentialVector_t > & | Tangents = NullPtr() | |||
) |
Create a new LineSet within a Grid object.
The Grid object will be modified, and existing information most likely destroyed.
For creating a line set, the following code may be used:
RefPtr<Bundle> myBundle; Ref<LineSet::CoordsMemArray_t> CoordsArray( 4000 ); std::vector<point>&Crds = CoordsArray->myChunk()->get_vector(); ... do something with Crds[i] ... Ref<LineSet::LinesetArray_t> LinesetArray(4); MultiArray<1, std::vector<LineSet::LineIndex_t> >&LineIndices = *LinesetArray; // // Put vertex indices into LineIndices array. // The following code will define four lines, // each constructed by 1000 vertices. // {for(index_t j=0; j<4; j++) { std::vector<LineSet::LineIndex_t>&E = LineIndices[ j ]; E.resize(1000); for(index_t i=0; i<1000; i++) { E[i] = i + j*1000; } }} RefPtr<Grid> G = myBundle->newGrid(); LineSet theLines(G, CoordsArray, EdgesArray );
RefPtr< LineSet::TangentialVector_t > Fiber::LineSet::ComputeTangentialVectors | ( | const CoordsArray_t & | Vertices, | |
const LinesetArray_t & | LinesetArray | |||
) | [static] |
Compute tangential vectors along a set of lines.
This function is computationally intensive.
RefPtr< LineSet::TangentialVector_t > Fiber::LineSet::getTangentialVectors | ( | const RefPtr< FragmentID > & | f = NullPtr() , |
|
const string & | FieldName = TangentialVectorFieldName | |||
) |
Compute tangential vectors in a grid object, which has a set of lines defined.
The resulting field is stored at the Grid.
FieldName | The name of the field under which the tangents shall be stored in the current Grid. It may be set to an empty string to disable storage. Even then, it will be stored in this LineSet object (but vanish once the LineSet object dies). |
Make use of timestamps of the involved fields (whatever this means)
Define an exception class here to indicate the many reasons of failures here, instead of just returning a NullPtr.
void Fiber::LineSet::IterateLineSetFragment | ( | Iterator & | IC, | |
const RefPtr< FragmentID > & | f | |||
) | const [inline] |
Template iterator for inline traversal.
The provided template argument class must provide a member function of the type
void apply(const CreativeIterator<Eagle::PhysicalSpace::point>&Vertices, const std::vector<LineSet::LineIndex_t>&Line);
which will be called for each curve in the LineSet.
static SkeletonID Fiber::LineSet::PerLineSkeletonID | ( | ) | [inline, static] |
bool Fiber::LineSet::setupStandardFields | ( | const RefPtr< Grid > & | theGrid | ) |
Setup some standard fields suitable for lines on this Grid.
Actually nothing is computed yet, just fields will be defined. They come with deferred creation (see class OnDemandCreator ) and will be computed once accessed via a Field's create() function.
gridop_API RefPtr< Grid > ExtractTrajectories | ( | Bundle & | B, | |
const string & | SelectedGridName, | |||
double | StartTime, | |||
double | ComaLength, | |||
const string & | TrajectoryGridName, | |||
bool | IterateOnlyLoadedSlices | |||
) | [related] |
Extract trajectories of the vertices of a Grid over time.
B | The Bundle that carries the time evolution of the input Grid and which will be used to host the output Grid. | |
SelectedGridName | The name of the evolving Grid | |
TrajectoryGridName | Name of the new Grid that will carry the trajectories as a LineSet. It will be cached in the Bundle. | |
StartTime | When shall we start the trajectories? Note that the trajectories run backward in time, thus they are rather a trail. | |
ComaLength | How long shall the trajectories be? | |
IterateOnlyLoadedSlices | Flag to specify if timesteps that have not yet been loaded into memory should be inspected. This will make the result more precise, but will significantly slow down the process if disc access is required. |
const char Fiber::LineSet::ArcLengthFieldName = "ArcLength" [static] |
A default name for the field that holds the respective values of a curve parameter.
It will just be "ArcLength".
const char Fiber::LineSet::NormalVectorFieldName = "NormalVectors" [static] |
A default name for the field that holds the normal vectors of a grid describing lines.
It will just be "NormalVectors";
const char Fiber::LineSet::TangentialVectorFieldName = "Tangents" [static] |
A set of pre-defined names used for standard fields on lines
A default name for the field that holds the tangential vectors of a grid describing lines. It will just be "Tangents";
Referenced by ~LineSet().