FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
trimesh.cpp

Demonstration of Creation an Artificial Triangular Mesh.

Demonstration of Creation an Artificial Triangular Mesh

#include <iostream>
#include <bundle/Bundle.hpp>
#include <grid/CartesianChart.hpp>
using namespace Fiber;
using namespace std;
using namespace MemCore;
using namespace Eagle;
int main()
{
double time = 0.0;
Slice &T0 = (*B)[time];
Grid &G = T0[ "MySpecialTriangularMesh" ];
Skeleton&MeshVertices = G[ SkeletonID(3,0) ];
Skeleton&MeshConnectivity = G[ SkeletonID(3,1) ];
RefPtr<Chart> myCartesianChart = G.makeChart( typeid(Fiber::CartesianChart3D) );
Representation&CartesianVertices = MeshVertices[ myCartesianChart ];
Representation&CellsAsVertices = MeshConnectivity[ MeshVertices ];
// Define the vertices of the mesh
(*Vertices)[0] = 1.0, 3.4, 5.1;
(*Vertices)[1] = 5.0, 1.3, 2.2;
(*Vertices)[2] = 3.0, 2.8, 4.3;
(*Vertices)[3] = 1.4, 8.9, 7.6;
(*Vertices)[4] = 5.3, 2.1, 6.12;
// Define the triangles of the mesh
(*Connectivity)[0] = 0,1,2;
(*Connectivity)[1] = 3,2,4;
(*Connectivity)[2] = 0,3,2;
CartesianVertices [ FIBER_POSITIONS ] = new Field(Vertices, Cache::MemCache() );
CellsAsVertices.setPositions( new Field(Connectivity, Cache::MemCache() ) );
B.save("MyMesh.f5");
return 0;
}
Convenience class that implements a pointer to a Bundle object but adds some useful member funtions t...
Definition Bundle.hpp:779
Chart object for cartesian coordinates.
Definition CartesianChart.hpp:15
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
Class for N-dimensional MultiArrays with MemCore memory management.
Definition MemArray.hpp:34
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
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
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
STL namespace.