Fish - FiberLib for VISH 0.3
Fish - The Fiber Bundle API for the Vish Visualization Shell
065-F5moveSkeleton.cpp File Reference

[← Previous Example] [Next Example → 066-StorageTransformationWithPositions.cpp ]. More...

#include <algorithm>
#include <fiber/bundle/Bundle.hpp>
#include <fiber/bundle/StorageTransformations.hpp>
#include <fiber/finit/FinitAPI.h>
#include <memcore/Console.hpp>

Functions

int main (int argc, const char **argv)

Detailed Description

[← Previous Example] [Next Example → 066-StorageTransformationWithPositions.cpp ].

In FiberLib Tutorial

#include <algorithm>
#include <fiber/bundle/Bundle.hpp>
#include <fiber/bundle/StorageTransformations.hpp>
#include <fiber/finit/FinitAPI.h>
#include <memcore/Console.hpp>
using namespace Fiber;
using namespace Eagle::PhysicalSpace;
int main(int argc, const char**argv)
{
Finit();
string InFile = "065_F5moveSkeleton_InputFile.f5";
if (argc>1)
{
BundlePtr BP = new Bundle() ;
BP->bindTo(InFile);
return 0;
}
{
BundlePtr BPIn = new Bundle ;
Grid&myGrid = BPIn[0.0]["TestGrid"];
RefPtr<Field> PositionsF = myGrid[FIBER_POSITIONS];
std::fill(Mem->myChunk()->get_vector().begin(),
Mem->myChunk()->get_vector().end(),
point{1.,0.,2.} );
Console() << "Mem size: " << Mem->nElements();
PositionsF->setPersistentData(Mem);
{
std::fill(Mem->myChunk()->get_vector().begin(),
Mem->myChunk()->get_vector().end(), 42.0);
myGrid["Values"]->setPersistentData(Mem);
}
BPIn->save(InFile);
Console() << "Save file " << InFile;
}
string OutFile = "065_F5moveSkeleton_OutFile.f5";
{
BundlePtr BP = new Bundle() ;
BP->bindToNew(OutFile);
bool success;
RefPtr<LoaderParameters> ld = new LoaderParameters(InFile);
BP = Bundle::load(success, ld , BP );
BP->sync();
RefPtr<Grid> myGrid = BP[0.0]("TestGrid");
if (!myGrid)
{
Console() <<"No Grid" ;
return 1;
}
const int PointSkeletonDims = 3;
/* change root skeleton-id (e.g point) to refinement
skeleton (that is: index depth, dims AND REFINEMENTLEVEL!) */
SkeletonID mySkeletonIDCoarse(PointSkeletonDims,0);
RefPtr<Skeleton> mySkeletonFine = (*myGrid)(mySkeletonIDCoarse);
if (!mySkeletonFine)
{
Console() << "Cannot find root (finest) skeleton" ;
return false;
}
mySkeletonFine->setIsotropicRefinement(10);
/* note: use index depth 2 for fragments instead of
index depth 0 which correspond incorrectly to point*/
}
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 fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value)
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
static RefPtr< Bundle > load(bool &success, const RefPtr< LoaderParameters > &ld, const RefPtr< Bundle > &B=nullptr)
Load a Bundle object or append new data to an existing Bundle.
Definition Bundle.cpp:139
A Grid is a set of Skeleton objects, each of them accessed via some unique SkeletonID object.
Definition Grid.hpp:60
Identifier for Skeletons within a Grid.
Definition SkeletonID.hpp:24
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2