Create a Grid object that describes sphere.
#include <stdio.h>
#include <ocean/plankton/VInputCreator.hpp>
#include <ocean/shrimp/VStringList.hpp>
#include <eagle/Matrix.hpp>
#include <ocean/shrimp/EaglePhysicalSpacePoint.hpp>
#include <ocean/shrimp/VEnum.hpp>
#include <ocean/shrimp/VObjectStatus.hpp>
#include <bone/FishField.hpp>
#include <bone/FishSaver.hpp>
#include <fish/fiber/bundle/Bundle.hpp>
#include <bone/FishGrid.hpp>
#include <fish/fiber/grid/Grid.hpp>
#include <fish/fiber/grid/CartesianChart.hpp>
#include <fish/fiber/field/Cell.hpp>
#include <fish/fiber/bundle/GridSelector.hpp>
namespace
{
struct edge
{
unsigned start,midpoint,
end;
};
}
{
template <>
string Fiber::element_to_string(const edge&)
{
return {};
}
}
namespace
{
#define GRIDNAME "spheregrid"
class SpherePoints :
public virtual VObject
{
int n_vertices, n_faces, n_edges, edge_walk;
double radius, frac, shiftDist;
public:
{
length = radius/length;
result[0] =
p1[0]*length;
result[1] =
p1[1]*length;
result[2] =
p1[2]*length;
return result;
}
{
printf("\nInitializing the Tetrahedron...\n");
n_vertices = n_faces = 4;
n_edges = 6; frac = 1/10;
}
{
printf("\nInitializing the Tetrahedron...\n");
n_vertices = 6; n_faces = 8;
n_edges = 12; frac = 1/10;
edgeVerticesData = new EdgeList_t(n_edges);
edgeFacesData = new EdgeList_t(n_edges);
}
{
printf("\nInitializing the Icosahedron...\n");
n_vertices = 12; n_faces = 20;
n_edges = 30; frac = 1/10;
}
{
printf("\nInitializing the sphere...\n");
n_vertices = 6; n_faces = 8;
n_edges = 12; frac = 1/10;
}
{
for(int i = 0; i < edge_walk; i++)
{
{
edge_walk--;
return result;
}
}
double length =
sqrt(coords[n_vertices][0]*coords[n_vertices][0] + coords[n_vertices][1]*coords[n_vertices][1] + coords[n_vertices][2]*coords[n_vertices][2]);
length = radius/length;
coords[n_vertices][0] *= length;
coords[n_vertices][1] *= length;
coords[n_vertices][2] *= length;
n_vertices++;
edge_walk++;
}
{
unsigned a = face[0];
unsigned b = face[1];
unsigned c = face[2];
if(a<b)
else
{
}
if(b<c)
else
{
}
if(a<c)
else
{
}
return edgeCount;
}
{
int edgeCount = 0;
n_edges = 4*n_edges;
edgeVerticesData = new EdgeList_t(n_edges);
edgeFacesData = new EdgeList_t(n_edges);
for(int j = 0; j<n_vertices; j++)
{
}
for(int i = 0; i < n_faces; i++)
{
}
for(int j = 0; j<n_vertices; j++)
{
}
for(int i = 0; i < n_faces; i++)
{
}
printf(
"\nn_vertice = %d .... n_vertice_new = %d\n", n_vertices,
n_vertices_new);
}
{
for(index_t i = 0; i <
subDiv; i++)
{
printf(
"\nWe are in %d level of sub division\n",
subDiv);
}
for(
int j = 0; j<
size; j++)
{
}
Coords->setPersistentData(
surface.first);
}
, SubDivision(
this,
"subdivision", 3)
, Separation(
this,
"shiftdistance", 0.0)
, SphereGrid(
this,
"sphereGrid")
, ColorField(
this,
"colors")
{
SphereGrid() = GS;
}
bool update(
VRequest&R,
double precision )
override;
};
bool SpherePoints::update(
VRequest&R,
double precision)
{
setStatusInfo(R, "Creating sphere now!!!");
return true;
double T = 0.0;
FS.selectField(
"COLORS");
SphereGrid << R << GS;
puts(
"bool SpherePoints::update(VRequest&R, double precision)");
return true;
}
}
namespace
{
Description(
"Create a sphere as triangular surface." ) +
Url(
"http://ahm.co.at/wiki/en" ),
ObjectQuality::EXPERIMENTAL );
}
complex< _Tp > sqrt(const complex< _Tp > &)
valarray< size_t > size() const
valarray< _Tp > shift(int __n) const
constexpr auto end(_Container &__cont) -> decltype(__cont.end())
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
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Identify the edges on a skeleton within a Grid.
Definition Edges.hpp:35
An internal class that stores a couple of textual names.
Definition FieldSelector.hpp:18
Context information to select a grid from within a bundle.
Definition GridSelector.hpp:26
string theGridname
Name of the selected grid.
Definition GridSelector.hpp:36
BundlePtr theSourceBundle
The bundle that was used to retrieve the grid name, meaning: the selected grid name is ensured to exi...
Definition GridSelector.hpp:33
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
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
Convenience class for objects that provide a Grid that may be saved.
Definition FishSaver.hpp:127
bool setProperty(const string &theName, const Type &theValue) const
Given a fragmented field of curvilinear coordinates, (3D array of coordinates), build a uniform Grid ...
Definition FAQ.dox:2
note: cannot derive from FloatingSkeletonRenderer as long as independent base class TriangleRenderer ...
Definition fs/init.hpp:20
A type describing an n-dimensional simplex cell.
Definition Cell.hpp:70