Fish - FiberLib for VISH 0.3
Fish - The Fiber Bundle API for the Vish Visualization Shell
Functions
132-RepresentSortedAsUnsortedCartesianChart.cpp File Reference

[← Previous Example] [Next Example → 141-LambdaBinding.cpp ]. More...

#include <fiber/bundle/Bundle.hpp>
#include <fiber/finit/FinitAPI.h>
#include <fiber/field/ArrayRef.hpp>
#include <eagle/PhysicalSpace.hpp>
#include <fiber/grid/types/RegularlyFragmentedGrid.hpp>

Functions

int main ()
 

Detailed Description

[← Previous Example] [Next Example → 141-LambdaBinding.cpp ].

In FiberLib Tutorial

#include <fiber/bundle/Bundle.hpp>
#include <fiber/finit/FinitAPI.h>
#include <fiber/field/ArrayRef.hpp>
#include <eagle/PhysicalSpace.hpp>
#include <fiber/grid/types/RegularlyFragmentedGrid.hpp>
using namespace Fiber;
using namespace Eagle::PhysicalSpace;
int main()
{
// Initialize I/O layers
Finit();
//
// Create a bundle object with a grid at T=1.0, named "myGrid", in
// a three-dimensional cartesian representation, using the default
// coordinate system.
//
BundlePtr BP = new Bundle();
Slice&mySlice = BP[0];
Grid&GridOfUnsortedPoints = mySlice["UnsortedPoints"];
GridOfUnsortedPoints.makeCartesianRepresentation(3);
for(auto P : *Coordinates )
{
index_t i = P.getIndex();
P->x() = 0.001 * i;
P->y() = 0.002 * i;
P->z() = 0.003 * i;
}
/**
######### Index List #######
*/
Grid&GridOfSortedPoints = mySlice["SortedPoints"];
Skeleton&VertexSkeletonOfSortedPoints = GridOfSortedPoints[ SkeletonID(3,0) ]; // 3d neighbourhood expected, 0 index depth ->point
/**
Representation of Skeleton Sorted to Skeleton Unsorted
*/
bool Unfragmented = true;
{
Ref< MemArray<1,index_t> > Indices(80);
for(auto I : *Indices)
{
I = I.getIndex();
}
RepresentSortedAsUnsorted.setPositions(new Field(Indices ));
}
else
{
for(auto&F :FieldPositionsOfSortedAsUnsorted->getNumberOfFragments() )
{
(*FieldPositionsOfSortedAsUnsorted)[F] = new CreativeArray(MB, MemCore::Cache::MemCache() );
}
}
BP.save("132_RepresentSortedAsUnsortedCartesianChart.f5");
Verbose(0) << BP->xml();
return 0;
}
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
The main entity holding all information.
Definition Bundle.hpp:173
A helper class that keeps objects in memory all time.
Definition CreativeArray.hpp:25
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
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
index_t getIndex(index_t i, int c) const
Given a major and a minor index, compute the overall index in the dataset according to.
Definition HyperslabParameters.hpp:176
A Representation is a set of Field objects, each of them accessed via some FieldID identifier.
Definition Representation.hpp:101
Identifier for Skeletons within a Grid.
Definition SkeletonID.hpp:24
A Skeleton is a set of Representation object, each of them accessed by an Representer object.
Definition Skeleton.hpp:102
Information per time slice, mainly a set of Grid objects that are accessed via GridID objects.
Definition Slice.hpp:36
static RefPtr< Cache, CacheBase > & MemCache()
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2

Function Documentation

◆ main()

int main ( )

######### Index List #######

Representation of Skeleton Sorted to Skeleton Unsorted

References Fiber::HyperslabParameters::getIndex(), MemCore::Cache::MemCache(), and Fiber::BundlePtr::save().