Colors need to be specified as an array of rgb_float_t data for each vertex. If no such field is defined, then this surface module creates something artificial, which maps each vertex into its own specific color. Render a triangular surface transparently.
#include <ocean/GLvish/VGLRenderObject.hpp>
#include <ocean/GLvish/BoundingBox.hpp>
#include <ocean/GLvish/ArrayTypes.hpp>
#include <ocean/GLvish/colors.hpp>
#include <ocean/shrimp/VObjectStatus.hpp>
#include <eagle/PhysicalSpace.hpp>
#include <field/Cell.hpp>
#include <GL/fiberGL.hpp>
#include <baseop/ExpandBBox.hpp>
#include <eye/retina/VSkeletonRenderObject.hpp>
#include <grid/types/TriangularSurface.hpp>
#include <bundle/BundleProperty.hpp>
#include <bone/GridActor.hpp>
#include <bone/FishField.hpp>
namespace
{
{
public:
{
string ColorFieldName;
using TriangularSurface::operator=;
};
{
return new MyState();
}
, SurfaceColorField(this, "colorfield" )
, SurfaceColor(this, "color", {.8,.5,.1, 1.0},0)
, ScaleFactor(this, "colorization", 0.0, 1)
{}
bool update(
VRequest&R,
double precision)
override;
static string createChildname(
const string&
parent_name)
{
}
};
{
if (!G)
{
return setStatusError(
Context,
"No Grid found.");
}
*S = G;
if (!*S)
return setStatusError(
Context,
"No surface available.");
S->ColorFieldName =
FS();
setBoundingBall(
Context, getBoundingBox( S->CoordField ) );
return setStatusInfo(
Context,
"Surface ready to render.");
}
{
{}
void prefix() override
{
}
bool draw() override
{
return true;
}
};
{
if (!myState)
return false;
return false;
{
printf("Did not find coordinates :( \n");
return false;
}
{
printf("Did not find cells :( %s\n",
Typename(
Surface.CellField->getFieldStorageType() ).c_str() );
return false;
}
double colorscale = 1.0;
if (Colors)
VBOKey += myState->ColorFieldName ;
else
Colors = (*
Surface.CartesianVertices)(
"Colors" );
try
{
&& (Colors && !
myVBO->isOlderThan( *Colors) ) )
{
{
{
return true;
}
}
}
}
{}
{
}
if (Colors)
{
{
}
}
else
{
index_t
nVertices =
Surface.CartesianVertices->getPositions()->getData()->nElements();
{
}
}
return true;
}
{
{
}
};
}
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
An internal class that stores a couple of textual names.
Definition FieldSelector.hpp:18
A concrete Grid Property which looks for the existence of a Skeleton of the specified dimension and i...
Definition BundleProperty.hpp:76
Base class for objects that render information given on the triangle of a Grid.
Definition TriangleRenderer.hpp:22
Base class for objects rendering skeletons of a fiber bundle.
Definition VSkeletonRenderObject.hpp:21
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
Definition GridInspector.hpp:13
A triangular surface stored on a Grid.
Definition TriangularSurface.hpp:43