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

[← Previous Example] [Next Example → 130-PerformanceCreator.cpp ]. More...

#include <fiber/bundle/Bundle.hpp>
#include <fiber/finit/FinitAPI.h>
#include <fiber/field/UniformCartesianArray.hpp>
#include <fiber/baseop/Resample.hpp>

Functions

int main ()
 

Detailed Description

[← Previous Example] [Next Example → 130-PerformanceCreator.cpp ].

In FiberLib Tutorial

#include <fiber/bundle/Bundle.hpp>
#include <fiber/finit/FinitAPI.h>
#include <fiber/field/UniformCartesianArray.hpp>
#include <fiber/baseop/Resample.hpp>
using namespace Fiber;
using namespace Eagle;
using namespace Eagle::PhysicalSpace;
int main()
{
// Initialize I/O layers
Finit();
RefPtr<Cache>&theGlobalCache = Cache::MemCache();
const int kB = 1024, MB = kB*kB;
theGlobalCache->setMaxCost( 3*MB );
Grid&InputGrid = BP[1.0]["DemoGrid"];
Representation&myCartesianRepresentation = InputGrid.makeCartesianRepresentation(3);
BP->bindTo("070_RegularSample_LowRes.f5");
//MultiIndex<3> DemoGridSize = {8,16,12};
Verbose(0) << "Creating low-resolution Grid of dimension " << DemoGridSize
<< " bound to " << BP->boundUrl();
CoordsP = new UniformCartesianArray( {-1.0,-1.0,-1.0} , DemoGridSize, point{+1.0, +1.0, +1.0} );
myCartesianRepresentation.setPositions( new Field( M ) );
// myCartesianRepresentation.setPositions( new Field( CoordsP ) );
#if 1
myCartesianRepresentation[ "scalardata"] = new Field( ScalarData );
for(auto&value : ScalarData->myChunk()->get_vector())
value = -1.0;
for(auto I : ScalarData->Size() )
{
const point&P = Coords[I];
double x = P.x(), y = P.y(), z = P.z();
(*ScalarData)[ I ] += x*x + y*y - z*z;
}
#endif
#if 1
Verbose(0) << "#################### CREATE OUTPUT GRID AND ASSOCIATE WITH FILE ###################";
{
Grid&OutputGrid = OutputBP[0.1]["ResampledDemoGrid"];
OutputBP->bindTo("070_RegularSample_HighRes.f5");
Verbose(0) << "#################### RESAMPLE AND SAVE VIA DESTRUCTION ###################";
ResampledField = ResampleRegularGrid3D(OutputGrid, InputGrid,
"scalardata",
{2.0, 2.0, 2.0} );
}
#endif
Verbose(0) << "Demo done.";
return true;
}
Convenience class that implements a pointer to a Bundle object but adds some useful member funtions t...
Definition Bundle.hpp:779
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
A Representation is a set of Field objects, each of them accessed via some FieldID identifier.
Definition Representation.hpp:101
Convenience class for procedural linear arrays in cartesian coordinates.
Definition UniformCartesianArray.hpp:22
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2