Draw a bounding box for a Grid object residing in the fiber bundle.
Draw a bounding box for a Grid object residing in the fiber bundle.Refinement representations and field fragments are supported (which constitutes AMR).
For each coordinate field, the bounding box is stored with the field and thus re-used if possible. Also, there might be an field in the same data represention be specified. The bounding box information of this field is then shown in addition. This field may consist of various fragments, such that multiple bounding boxes are shown. The bounding box information is cached at each field fragment.
If values in field coordinates are changed, this is not recognized. Code doing so would have to clear the field's BoundingBox interface.
#include <bone/GridOperatorObject.hpp>
#include <ocean/shrimp/VObjectStatus.hpp>
#include <ocean/shrimp/ColorTypes.hpp>
#include <baseop/ExpandBBox.hpp>
#include <ocean/Anemonia/Programmable.hpp>
#include <ocean/Anemonia/VRenderObject.hpp>
#include <ocean/Anemonia/FloatOrigin.hpp>
#include <grid/CartesianChart.hpp>
namespace
{
{
public:
, Thickness(this, "thickness", 2.0, 0)
{
}
{
}
bool update(
VRequest&R,
double precision)
override;
static string createChildname(const string&obj)
{
return "BoundingBoxOf" + obj;
}
{
return default_vertex_shader;
}
{
return
"uniform vec4 Color;\n"
"void main (void)\n"
"{\n"
" gl_FragColor = Color;\n"
"}\n"
;
}
};
{
if (!
Level.getSkeleton() )
{
return setStatusError(
Context,
"No Vertices found on this grid's level.",
false);
else
return setStatusError(
Context,
"No Vertices found on this grid.",
false);
}
if (!G)
return setStatusError(
Context,
"No Grid found");
if (!myChart)
{
return setStatusError(
Context,
"No Cartesian Coordinates Available.",
false);
}
if (!Coords)
return setStatusError(
Context,
"No Coordinates");
{
return setStatusInfo(
Context,
"Bounding box" + String(
B ) );
}
else
return setStatusError(
Context,
"No Bounding box");
}
{
return true;
Eagle::tvector3 TranslationVector;
VRenderContext::ModelViewState
MVS = getCoordinateTranslation(
Context, TranslationVector) ;
P1 =
MyBBox->maxcoord() - TranslationVector;
P000 ( P0.x(), P0.y(), P0.z() ),
P001 ( P0.x(), P0.y(), P1.z() ),
P010 ( P0.x(), P1.y(), P0.z() ),
P011 ( P0.x(), P1.y(), P1.z() ),
P100 ( P1.x(), P0.y(), P0.z() ),
P101 ( P1.x(), P0.y(), P1.z() ),
P110 ( P1.x(), P1.y(), P0.z() ),
P111 ( P1.x(), P1.y(), P1.z() );
size_t i = 0;
ShaderProgram = CompileShader(
Context,
"GridBoundingBox" );
if (!ShaderProgram)
return true;
{
RenderAnemone->insert( ShaderProgram );
RenderAnemone->insert(
Context.drawPrimitives(RenderBasin::LINES) );
RenderAnemone->insert(
Context.createRenderParameter(
"Color", color) );
double width = 2.0;
RenderAnemone->insert(
Context.createRenderParameter(
"glLineWidth", width ) );
RenderAnemone->insert(
Context.Enable(
"GL_LINE_SMOOTH") );
RenderAnemone->insert(
Context.Enable(
"GL_DEPTH_TEST") );
RenderAnemone->insert(
Context.Disable(
"GL_LIGHTING") );
RenderAnemone->wave();
return true;
}
else
{
puts(
"void GridBoundingBox: CANNOT Create a vertex attribute?");
return true;
}
}
myCreator(
+
Help(
"Display the bounding volume of the grid object.")
+
Description(
"Display the boundaries of the data volume occupied "
"by the specific Grid object for the most recent time step. "
"Multiple refinement levels are supported, taking the most recent "
"refinement level for a given time. "
)
,
ObjectQuality::BETA);
}
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
Information per time slice, mainly a set of Grid objects that are accessed via GridID objects.
Definition Slice.hpp:36
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 GridInspector.hpp:13
The Fish Template provide an interface between the fiber bundle data model and the VISH objects and p...
Definition Fish.hpp:30
Convenience class for objects operating on Grid objects.
Definition GridOperatorObject.hpp:23