Demonstrates creation of a set of lines that is fragmented into four regions.
Demonstrates creation of a set of lines that is fragmented into four regions.The fragmentation is identical for the coordinates and connectivity, using identical nomenclatura for the fragments in each separate Skeleton. This particular choice of fragmentation allows a 1:1 mapping between connectivity fragments and coordinate fragments and is easy to handle since fragments from both skeletons can be paired and considered independently from other fragments.
Other fragmentations are possible but involve higher complexity, so not all functions operating on a set of lines may support such yet or with same efficiency.
#include <fiber/bundle/Bundle.hpp>
#include <fiber/finit/FinitAPI.h>
#include <fiber/grid/types/LineSet.hpp>
{
Finit();
RefPtr<Field> Coordinates =
new Field(),
Connectivity =
new Field();
{
{
int some_int = 0;
for(auto&P : Crds)
{
P.x() = double( some_int%32 ) +
X*35.0;
P.y() = double( (some_int/ 8)%32 );
P.z() = 0.6*double( (some_int/64)%32 );
some_int++;
}
Coordinates->setPersistentDataByName( CoordsArray, FragmentName );
}
{
{for(index_t j=0; j<32; j++)
{
for(index_t i=0; i<32; i++)
{
E[i] = i + j*32;
}
}}
Connectivity->setPersistentDataByName( LinesetArray, FragmentName );
}
}
{
Grid&GridOfFragmentedLines = BP[0.0][
"FragmentedLineSet"];
Skeleton&TheVertices = GridOfFragmentedLines.
makeVertices( 1 );
}
BP.
save(
"LineSetFragmented.f5");
return 0;
}
int main()
Demonstrates minimal usage of the FiberLib Create Bundle, insert a time slice, and safe it to a file.
Definition 010-SimpleSave.cpp:13
constexpr void resize(size_type __new_size)
Convenience class that implements a pointer to a Bundle object but adds some useful member funtions t...
Definition Bundle.hpp:779
int save(const string &url, const RefPtr< LoaderProgress > &SaveProgress=nullptr, const RefPtrStorageTransformations &ST=nullptr)
Definition Bundle.cpp:1142
A Field is a collection of CreativeArrayBase reference pointers which are accessed via FragmentID obj...
Definition Field.hpp:245
A Grid is a set of Skeleton objects, each of them accessed via some unique SkeletonID object.
Definition Grid.hpp:60
Representation & makeCartesianRepresentation(int Dims, const string &name={}, uint16_t epsg_code=0)
Provide a representation in an n-dimensional skeleton of the vertices.
Definition Grid.cpp:124
static SkeletonID PerLineSkeletonID()
A Skeleton ID for sets of edges, thereby defining lines.
Definition LineSet.hpp:89
Definition MultiArray.hpp:371
A Representation is a set of Field objects, each of them accessed via some FieldID identifier.
Definition Representation.hpp:101
bool setPositions(const RefPtr< Field > &P)
Set the positional component of this Representation object.
Definition Representation.cpp:519
Skeleton & makeVertices(int dims)
Create a Skeleton describing the vertices of a Grid.
Definition SkeletonMap.cpp:290
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
string to_string(const Eagle::FixedArray< ElementType, N > &A, const char *OpenBrace="{", const char *CloseBrace="}", const char *Separator=",")