SoVolumeRender(3)
π NAME π
SoVolumeRender β bestie, it renders the full volume. That's it, that's the job. π
π¦ SYNOPSIS π¦
#include <VolumeViz/nodes/SoVolumeRender.h>
β¨ Public Types β¨
enum Interpolation { NEAREST, LINEAR }
enum Composition { MAX_INTENSITY, SUM_INTENSITY, ALPHA_BLENDING }
enum NumSlicesControl { ALL, MANUAL, AUTOMATIC }
enum AbortCode { CONTINUE, ABORT, SKIP }
typedef AbortCode SoVolumeRenderAbortCB(int totalslices, int thisslice,
void *userdata)
β¨ Public Member Functions β¨
void setAbortCallback (SoVolumeRenderAbortCB *func, void *userdata=NULL)β drop in your own callback so you can bail out early or skip slices, your call π
β¨ Static Public Member Functions β¨
static void initClass (void)β sets the class up, iconic behavior, no notes π
β¨ Public Attributes β¨
SoSFEnum interpolationSoSFEnum compositionSoSFBool lightingSoSFVec3f lightDirectionSoSFFloat lightIntensitySoSFEnum numSlicesControlSoSFInt32 numSlicesSoSFBool viewAlignedSlices
β¨ Protected Member Functions β¨
virtual void GLRender (SoGLRenderAction *action)virtual void rayPick (SoRayPickAction *action)virtual void generatePrimitives (SoAction *action)virtual void computeBBox (SoAction *action, SbBox3f &box, SbVec3f ¢er)
β¨ Friends β¨
class SoVolumeRenderPβ the inner circle, the besties-only zone π«Ά
π DETAILED DESCRIPTION π
Render the full volume.
So here's the vibe: you insert a node of this type after an SoVolumeData node in the scene graph, and boom β the full volume data set gets rendered. That's the whole deal. π
π¦ See also
SoOrthoSlice,SoObliqueSlice,SoVolumeFaceSet,SoVolumeIndexedFaceSetSoVolumeTriangleStripSet,SoVolumeIndexedTriangleStripSet
π MEMBER TYPEDEF DOCUMENTATION π
typedef AbortCode SoVolumeRender::SoVolumeRenderAbortCB(int totalslices, int thisslice, void *userdata)
This is the function signature for callback function pointers that you pass on in to SoVolumeRender::setAbortCallback(). Basically the shape your little callback has to have. π§
totalslicesis the total number of textured slices that is expected to be rendered β unless, of course, the callback chooses to abort or skip any of them. Live your truth.thissliceis the index number of the next slice to render. Heads up, bestie: they are rendered back-to-front, and they are numbered from1tototalslices. Not zero-indexed. Not a drill. πuserdatais the second argument that was given toSoVolumeRender::setAbortCallback()when the callback was set up. It comes back to you like a boomerang. πͺ
πΈ MEMBER ENUMERATION DOCUMENTATION πΈ
enum SoVolumeRender::Interpolation
The enumeration of available types of voxel colors interpolation. Pick your fighter:
NEARESTβ For "in between" pixels of the screen rasterization, it picks the color of the nearest voxel. Will give you sharp edges and a distinct blocky look. Honestly? Aesthetic.LINEARβ For "in between" pixels of the screen rasterization, it interpolates by averaging the colors of several of the nearest voxels. Smoother appearance, but it sacrifies some "correctness" for appearance. Yes, that's the original spelling, I'm not touching it. π
enum SoVolumeRender::Composition
The enumeration of available types of composition for partly translucent volumes. Three flavors:
MAX_INTENSITYβ For each on-screen projected pixel, the voxel with the highest alpha intensity along that projection ray will be rendered.- This is for instance useful in medical imaging as a contrast enhancing operator for visualizing blood-flows. π©Έ
- > Note that the availability of this composition mode for rendering with 2D- and 3D-textureslices will be dependent on features of the underlying rendering library.
- > (Specifically, the OpenGL driver must support
glBlendEquation(), which is part of the optional "imaging" API-subset of OpenGL version 1.2 and later.)
SUM_INTENSITYβ For each on-screen projected pixel, the intensity of all voxels along that projection ray will be summed up before rendering.- This gives an appearance similar to medical X-ray images. The blending function is known as the "attenuate" operator.
- > Note that the availability of this composition mode for rendering with 2D- and 3D-textureslices will be dependent on features of the underlying rendering library.
- > (Specifically, the OpenGL driver must support
glBlendEquation(), which is part of the optional "imaging" API-subset of OpenGL version 1.2 and later.)
ALPHA_BLENDINGβ Composes volume by rendering voxels with higher opacity such that they progressively obscures voxels behind them.- This is an approximation of the visual appearance of the penetration and reflection of light through a transparent material. β¨
- The blending function for this is known as the "over" operator.
enum SoVolumeRender::NumSlicesControl
The enumeration of strategies for how to render the slices of the volume. Choose wisely:
ALLβ Always render as many slices as there are voxels in the depth dimension. This is the default value.- > Please note that
SoVolumeRender::NumSlicesControlwill always be considered asSoVolumeRender::ALLif theSoVolumeRender::numSlicesfield is less or equal to0. No arguing with the node. π€·
- > Please note that
MANUALβ Render as many slices as given by theSoVolumeRender::numSlicesfield.AUTOMATICβ The number of slices to render will be calculated as follows:
unsigned int numslices = complexity * 2.0f * this->numSlices;
- Where "complexity" is the current
SoComplexity::valuesetting in the scene graph traversal state. The default complexity value for a scene graph with noSoComplexitynode(s) is0.5. - For
"this->numSlices", seeSoVolumeRender::numSlices.
enum SoVolumeRender::AbortCode
The set of valid values that should be returned from a function set up in SoVolumeRender::setAbortCallback(). Return the right one or the vibe is off:
CONTINUEβ Continue rendering in the usual manner. Carry on, queen. πABORTβ Don't render any more textured slices of the volume. Done. Finished. Closed.SKIPβ Skip the next textured slice, and resume rendering on the next after that. (The abort callback function will still be called again.) So it's not an escape hatch, it's a lil detour. π
π₯ MEMBER FUNCTION DOCUMENTATION π₯
void SoVolumeRender::setAbortCallback (SoVolumeRenderAbortCB * func, void * userdata = NULL)
Lets the application programmer supply a callback function, by which it will be possible to either prematurely abort the rendering of a set of slices, or to skip certain slices.
Both of these measures are of course optimizations of rendering performance controlled from client code. Speeeeeed. π₯
void SoVolumeRender::rayPick (SoRayPickAction * action) [protected], [virtual]
Picking of a volume doesn't work in quite the same manner as picking polygon geometry: the SoPickedPoint set up in the SoRayPickAction class will only contain the entry point of the ray into the volume.
For further picking information, grab the detail object and cast it to an SoVolumeRenderDetail (after first checking that it is of this type, of course). Safety first, bestie. π
References SoVolumeDetail::setDetails().
β MEMBER DATA DOCUMENTATION β
SoSFEnum SoVolumeRender::interpolation
How to interpolate color values when rendering "in between" voxels. See SoVolumeRender::Interpolation.
Default value is SoVolumeRender::LINEAR.
SoSFEnum SoVolumeRender::composition
How to compose the projected volume rendering. See SoVolumeRender::Composition.
Default value is SoVolumeRender::ALPHA_BLENDING.
SoSFEnum SoVolumeRender::numSlicesControl
Specifies a strategy to use for calculating the number of slices to use for the visualization. The more slicer, the better quality and more correct the visualization will be, but the trade-off is that it will also influence the rendering performance. (Yes, "slicer" β that's the original, I'm keeping it. π)
The default value is SoVolumeRender::ALL.
(The rendering performance can be severly improved by changing this field's value to eitherSoVolumeRender::MANUALorSoVolumeRender::AUTOMATIC, and then tuning theSoVolumeRender::numSlicesfield.)
SoSFInt32 SoVolumeRender::numSlices
Decides how many slices to render if SoVolumeRender::numSlicesControl is set to either SoVolumeRender::MANUAL or SoVolumeRender::AUTOMATIC.
For MANUAL, it sets an absolute number. For AUTOMATIC, a calculation will be done based on the value of this field and the current SoComplexity::value setting in the scene graph traversal state.
Note that the default value of the field is 0.
π AUTHOR π
Generated automatically by Doxygen for SIMVoleon from the source code.
Okay so that's the whole entire page, and yeah β this one's SIMVoleon Version 2.1.0, and yes it is the SoVolumeRender(3) page, third section of the manual, living its best library-functions-manual life. Go render that volume, bestie, you've got this. π«Άπβ¨π
π¦ where this page comes from
- fedora 43: SIMVoleon-devel 2.1.0-9.fc43 Β· BSD-3-Clause
- fedora 43: SIMVoleon-devel 2.1.0-9.fc43 Β· BSD-3-Clause
- fedora 44: SIMVoleon-devel 2.1.0-11.fc44 Β· BSD-3-Clause
- fedora 44: SIMVoleon-devel 2.1.0-11.fc44 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms