Render a triangular surface transparently.
Render a triangular surface transparently. Display a triangular surface as transparent object using depth-sorting.
#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 <GL/PartialElementRenderer.hpp>
namespace
{
{
public:
{
};
{
return new MyState();
}
struct EvolutionSurfaceIterator: EvolutionIterator<Grid>
{
double startTime;
double skip;
int counter;
double pastTime;
: startTime(time)
, counter(0)
{}
{
{
return false;
}
if( counter==skip )
{
grid->push_back(*newGrid);
}
counter ++;
if(counter > skip)
{
counter = 0;
}
return true;
}
};
SurfaceBackColor;
, SurfaceColor(this, "color", {1.,.1,1., 1.0},0)
, SurfaceBackColor(this, "backcolor", {.0, 1.,1.0, 1.0},0)
, Transparency(this, "opacity", 0.5, 0)
, PastTime(this, "pastTime", 1)
, SkipSteps(this, "skipSteps", 1)
{
}
bool update(
VRequest&R,
double precision)
override;
static string createChildname(
const string&
parent_name)
{
}
};
{
if (!G)
{
return setStatusError(
Context,
"No Grid found.");
}
S->TriangularSurface::operator=(G);
if (!*S)
return setStatusError(
Context,
"No surface available.");
setBoundingBall(
Context, getBoundingBox( S->CoordField ) );
{
S->gridEvolution.clear();
double pastTime = 0.0;
S->gridEvolution.push_back(G);
}
return setStatusInfo(
Context,
"Surface ready to render.");
}
{
{
assert( Cells->getTypedStorage() );
}
{
}
{
}
};
{
if (!myState)
return false;
return false;
{
printf("Did not find coordinates :( \n");
return false;
}
{
printf("Did not find triangles :( \n");
return false;
}
double Alpha = 0.5;
BaryCenters =
Tmp->getCreator();
for(unsigned i=0; i<myState->gridEvolution.size(); i++)
{
try
{
{
for(
unsigned j=i; j<myState->gridEvolution.size()&&
myVBO; j++)
{
{
}
}
return true;
}
}
{}
{
}
}
return true;
}
}
namespace
{
Description(
"Show time evolution of a triangular surface" ) +
Url(
"http://ahm.co.at/wiki/en" ),
ObjectQuality::EXPERIMENTAL );
}
_Expr< _ValFunClos< _ValArray, _Tp >, _Tp > apply(_Tp __func(_Tp)) const
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 grid identifier.
Definition GridID.hpp:29
Context information to select a grid from within a bundle.
Definition GridSelector.hpp:26
const Fiber::BundlePtr & getBundle() const
Provide the original bundle of from where the Grid was selected.
Definition GridSelector.hpp:115
const string & getGridname() const
Name of the selected grid (member function)
Definition GridSelector.hpp:39
A Grid is a set of Skeleton objects, each of them accessed via some unique SkeletonID object.
Definition Grid.hpp:60
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
Base class to draw a selection of elements as OpenGL points.
Definition PartialElementRenderer.hpp:85