More advanced surface renderers are PolychromeSurface, TransparentSurface and CrystalSurface_8cpp-example.html ( CrystalSurface.cpp ).
#include <ocean/GLvish/VGLRenderObject.hpp>
#include <ocean/GLvish/BoundingBox.hpp>
#include <ocean/GLvish/ArrayTypes.hpp>
#include <ocean/GLvish/colors.hpp>
#include <ocean/shrimp/VEnum.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 <ocean/Anemonia/FloatOrigin.hpp>
namespace
{
{
public:
{
using TriangularSurface::operator=;
Eagle::tvector3 TranslationVector = {0,0,0};
};
{
return new MyState();
}
, LineWidth(this, "linewidth", 1.5, 1)
, SurfaceColor(this, "color", Color(.8,.5,.1, 1.0),0)
, SurfaceMode(
this,
"mode",
VEnum(
"solid",
"line",
"points") )
{
}
bool update(
VRequest&R,
double precision)
override;
};
{
if (!G)
{
return setStatusError(
Context,
"No Grid found.");
}
*S = G;
if (!*S)
{
return setStatusError(
Context,
"No surface available.");
}
setBoundingBall(
Context, getBoundingBox( S->CoordField ) );
return setStatusInfo(
Context,
"Surface ready to render.");
}
{
{
switch(i)
{
}
}
{
}
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 :( \n");
return false;
}
{
puts(
"MonochromeSurface: No triangles.");
return false;
}
double line_width = 1.0;
if( line_width < 1.0 )
line_width = 1.0;
Eagle::tvector3 TranslationVector = {0,0,0};
VRenderContext::ModelViewState
MVS
= getCoordinateTranslation(
Context, TranslationVector);
try
{
&& myState->TranslationVector == TranslationVector)
{
{
TR->setLineWidth( line_width );
TR->setMode( Mode.Case(
"solid",
"line",
"points") );
{
return true;
}
}
}
}
{}
computeShiftedCoordinates( myState->getCoords()->myChunk(), TranslationVector ) ));
{
}
myState->TranslationVector = TranslationVector;
TR->setLineWidth( line_width );
TR->setMode( Mode.Case(
"solid",
"line",
"points") );
return true;
}
}
namespace
{
Description(
"Display a triangular surface using standard rendering methods. ")
, ObjectQuality::OUTDATED);
}
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Context information to select a grid from within a bundle.
Definition GridSelector.hpp:26
Base class for objects that render information given on the triangle of a Grid.
Definition TriangleRenderer.hpp:22
bool setProperty(const string &theName, const Type &theValue) const
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 GridInspector.hpp:13
A triangular surface stored on a Grid.
Definition TriangularSurface.hpp:43