Fovia C++ In-Process API
Public Member Functions | List of all members
IRenderEngine Struct Referenceabstract
Inheritance diagram for IRenderEngine:
IRoot

Public Member Functions

virtual signed int ApplyVolumetricShadowMap (IVolumeShadow *pShadow)=0
 
virtual signed int AskInterface (const BGUID *piid, IRoot **ppr)=0
 
virtual signed int Close ()=0
 
virtual signed int DecRef ()=0
 
virtual signed int FastSwap (IVolumeData *pData, IVolumeOctree *pOctree)=0
 
virtual signed int FreeHandCut (signed int numPoints, POINT *arrPoints, int ppWidth, int ppHeight, int type)=0
 
virtual signed int GetCurvedResampling (IVolumeData **pOutputData, signed int numProjPlanesPerSlice, signed int numSlices, signed int ppWidth, signed int ppHeight, signed int measurementSlice, float Zoom, MATRIX44D **arrProjPlanes, ENUM_CURVED_MPR_TYPE type)=0
 
virtual signed int GetCurvedResamplingAlongNormal (IVolumeData **pOutputData, signed int numProjPlanes, signed int numSlicesInFront, signed int numSlicesBehind, double sliceSpacing, signed int ppWidth, signed int ppHeight, float Zoom, MATRIX44D *arrProjPlanes, ENUM_CURVED_MPR_TYPE type)=0
 
virtual signed int GetCurvedSegmentationResampling (DATABYTE ***pBuffer, signed int numProjPlanesPerSlice, signed int numSlices, signed int ppWidth, signed int ppHeight, signed int measurementSlice, float Zoom, MATRIX44D **arrProjPlanes, ENUM_CURVED_MPR_TYPE type, IAllocator *pAlloc)=0
 
virtual signed int GetFramesPerPhase (signed int *frames)=0
 
virtual signed int GetLastRenderedParams (RENDER_PARAMS *pVal)=0
 
virtual signed int GetMandibleTrace (VECTOR3D *left, VECTOR3D *right, VECTOR3D *front, unsigned int *numPoints, VECTOR3D *points, MATRIX44D *projectionPlane, float *zoom, double *slabThickness)=0
 
virtual signed int GetNavigationVector (VECTOR3D *v)=0
 
virtual signed int GetPointVisibility (VERTEX3D *vtr, POINTVISIBLEINFO *pt, signed int Num)=0
 
virtual signed int GetPolygonCrossSectionLineParameters (double *width, COLOR_RGBA *color)=0
 
virtual signed int GetRenderCallback (IRenderEngineCallback **irec, signed int **id)=0
 
virtual signed int GetRenderParams (RENDER_PARAMS *rp)=0
 
virtual signed int GetSegmentationBoundaries (unsigned long long *masks)=0
 
virtual signed int GetTransferFunction (unsigned int index, RENDER_RANGE_PARAMS *arrParams)=0
 
virtual signed int GetTransferFunctionCount (unsigned int *numTFs)=0
 
virtual signed int GetVertexCallLists (unsigned int *numLists, IVertexCallList ***arrLists)=0
 
virtual signed int GetVolumeCount (signed int *numVolumes)=0
 
virtual signed int GetVolumeData (IVolumeData **vd, IVolumeOctree **vo)=0
 
virtual signed int GetVoumetricShadowMap (IVolumeShadow **ppShadow)=0
 
virtual signed int IncRef ()=0
 
virtual signed int InterruptCurvedResampling ()=0
 
virtual signed int InterruptRender ()=0
 
virtual signed int IsRenderingFinished ()=0
 
virtual signed int ProjectPoint (VERTEX3D *vtr, POINT *pt, signed int Num)=0
 
virtual signed int ProjectVolumetricShadow ()=0
 
virtual signed int Render (signed int Reserved, VOLVISIMAGE imReq, VOLVISIMAGE *imRes)=0
 
virtual signed int RenderShadowLight ()=0
 
virtual signed int ResetRenderParams ()=0
 
virtual signed int SetCurvedMPRPath (signed int numProjPlanes, MATRIX44D *arrProjPlanes, ENUM_CURVED_MPR_TYPE type)=0
 
virtual signed int SetFastPolygonsEnabled (signed int bEnabled)=0
 
virtual signed int SetFramesPerPhase (signed int frames)=0
 
virtual signed int SetFreeHandCutMode (ENUM_FHC_MODE mode)=0
 
virtual signed int SetOpacityReductionForSegmentationBoundary (unsigned int log2reduction)=0
 
virtual signed int SetPhase (signed int phase)=0
 
virtual signed int SetPolygonCrossSectionLineParameters (double width, COLOR_RGBA color)=0
 
virtual signed int SetProbeRayEnergyThreshold (double val)=0
 
virtual signed int SetRenderCallback (IRenderEngineCallback *irec, signed int *id)=0
 
virtual signed int SetRenderParams (RENDER_PARAMS *rd)=0
 
virtual signed int SetSegmentationBoundaries (unsigned long long *masks)=0
 
virtual signed int SetSegmentationBoundaryLightingThreshold (double threshold)=0
 
virtual signed int SetTransferFunction (unsigned int index, RENDER_RANGE_PARAMS *arrParams)=0
 
virtual signed int SetVertexCallLists (unsigned int numLists, IVertexCallList **arrLists)=0
 
virtual signed int SetVertexColorMapTransferFunction (RENDER_RANGE_PARAMS *rrp)=0
 
virtual signed int SetViewMode (ENUM_VIEW_MODE rm)=0
 
virtual signed int SetVolumeData (IVolumeData *vd, IVolumeOctree *vo)=0
 
virtual signed int SetVolumeData4D (IVolumeData **vd, IVolumeOctree **vo, signed int numVolumes)=0
 
virtual signed int ShootRay (POINT *pt, RAYSTOPINFO *rsi, signed int Num)=0
 
virtual signed int ShootRayEx (POINT *pt, VECTOR3D *start, VECTOR3D *direction, double percent, RAYSTOPINFO *rsi, signed int Num)=0
 
virtual signed int ShootRayFast (POINT *pt, RAYSTOPINFO *rsi, signed int Num)=0
 
virtual signed int ShootRayGetWall (POINT *pt, RAYWALLINFO *rwi, signed int Num)=0
 
virtual signed int StartRender (signed int Reserved, VOLVISIMAGE imReq)=0
 
virtual signed int TestFunction (unsigned int testType, void *pTestData, signed int bVRColor)=0
 
virtual signed int WaitRender (VOLVISIMAGE *imRes)=0
 
- Public Member Functions inherited from IRoot
template<class T >
signed int AskInterface (T **pp)
 

Detailed Description

IRenderEngine is the main interface for all rendering engines.

Member Function Documentation

virtual signed int IRenderEngine::AskInterface ( const BGUID piid,
IRoot **  ppr 
)
pure virtual

Queries this object to see if the interface piid is supported and returns the result in ppr.

Parameters
piidThe BGUID of the requested interface.
pprThe address of an IRoot pointer which will receive the new interface.
Returns
S_OK if the interface is supported. E_FAIL if it is not.

Implements IRoot.

virtual signed int IRenderEngine::Close ( )
pure virtual

Deprecated non-functioning interface. Decreasing the reference count on this object until it reaches 0 will cause all memory used by the object to be freed and all referenced objects to have their reference counts decremented.

virtual signed int IRenderEngine::DecRef ( )
pure virtual

Decreases the reference count on this object by 1. If the reference count reaches 0, the object is deallocated.

Implements IRoot.

virtual signed int IRenderEngine::FastSwap ( IVolumeData pData,
IVolumeOctree pOctree 
)
pure virtual

Swaps out the current data set. You must not be in the process of rendering. Call InterruptRendering() if you're not sure. You also must be positive that the new volume's dimension and orientation is identical to the previous.

Parameters
pDataThe new volume data.
pOctreeThe new volume's octree.
virtual signed int IRenderEngine::FreeHandCut ( signed int  numPoints,
POINT arrPoints,
int  ppWidth,
int  ppHeight,
int  type 
)
pure virtual

Cut a section out up the data using a polygon specified by the POINT array. Note that IVolumeSegmentation simply delegates to this function when performing free hand cut operations. Therefore, if you will only be doing free hand cut segmentation there is no need to create IVolumeSegmentation.

Parameters
numPointsNumber of points in our selection polygon.
arrPointsPoints in the polygon.
ppWidthwidth in pixels of the projection plane.
ppHeightheight in pixels of the projection plane.
typeSEGMENTATION_TYPE_POSITIVE or SEGMENTATION_TYPE_NEGATIVE.
virtual signed int IRenderEngine::GetCurvedResampling ( IVolumeData **  pOutputData,
signed int  numProjPlanesPerSlice,
signed int  numSlices,
signed int  ppWidth,
signed int  ppHeight,
signed int  measurementSlice,
float  Zoom,
MATRIX44D **  arrProjPlanes,
ENUM_CURVED_MPR_TYPE  type 
)
pure virtual

Creates a new volume from several curved MPR specifications. This function may be used to reformat a volume so that a curved render may have depth as well. The resultant volume may then be rendered in any available rendering mode. Viewing the volume axially will give the view you would get from SetCurvedMPRPAth().

Parameters
pOutputDataThe resultant volume data.
numProjPlanesPerSliceThe number of positions that make up the curve for each slice.
numSlicesThe number of slices
ppWidthOutput volume width
ppHeightOutput volume height
measurementSliceThis is the index (0-based) of the slice to specify for accurate measurement. For example, if you specify 3 the fourth image in the volume will have the property that pixels in the X and Y directions will be accurately represented in millimeters.
ZoomThe number of pixels per voxel in the non-curved dimension. If this is -1, the pixels per voxel is calculated based upon the length of the curve.
arrProjPlanesThe projecton plane positions for each slice. The dimensions are arrProjPlanes[slice][curvePoint].
typeWhich axis is going to be non-linear on every slice?
virtual signed int IRenderEngine::GetCurvedSegmentationResampling ( DATABYTE ***  pBuffer,
signed int  numProjPlanesPerSlice,
signed int  numSlices,
signed int  ppWidth,
signed int  ppHeight,
signed int  measurementSlice,
float  Zoom,
MATRIX44D **  arrProjPlanes,
ENUM_CURVED_MPR_TYPE  type,
IAllocator pAlloc 
)
pure virtual

Reserved for future use.

virtual signed int IRenderEngine::GetLastRenderedParams ( RENDER_PARAMS pVal)
pure virtual

Returns the RENDER_PARAMS used for the most recently completed frame.

Parameters
pValRENDER_PARAMS to receive the data.
virtual signed int IRenderEngine::GetNavigationVector ( VECTOR3D v)
pure virtual

Obtain autonavigation vector. Only valid for perspective rendering. This vector will define the direction in which we should move. The magnitude of the vector is the average screen depth during the last completed render.

Note that this function is closely related to rendering itself. You should only apply the navigation vector once per render call. Also, only apply this vector to the RENDER_PARAMS from the previously completed frame. This can be retrieved by calling GetLastRenderedParams().

Once you receive the autonavigation vector, you will probably want to rotate in the direction you've navigated. Here is some sample code to illustrate this:

pEngine->GetNavigationVector(&vec);
// add the nav vector to our position. AUTONAV_MAG_DIVIDE is a multiplier
// describing what portion of the average scene depth we should move per frame
// at speed 1.0
VECTOR3D newPos;
newPos.x = pos.x + ((vec.x/AUTONAV_MAG_DIVIDE)*speed);
newPos.y = pos.y + ((vec.y/AUTONAV_MAG_DIVIDE)*speed);
newPos.z = pos.z + ((vec.z/AUTONAV_MAG_DIVIDE)*speed);
// turn vec into our new Z vector
vec.normalize();
// use our old X as a basis
VECTOR3D vecX = rpCurr.Transform.getXVector();
VECTOR3D vecY;
VECTOR3D vecZ = vec;
// create Y by crossing Z with the old X
vecY = vecZ.cross(vecX);
// and create the new X by crossing our new Y with Z
vecX = vecY.cross(vecZ);
// normalize
vecX.normalize();
vecY.normalize();
// and we're done
newTransform.setXVector(vecX);
newTransform.setYVector(vecY);
newTransform.setZVector(vecZ);
newTransform.setOffsetVector(newPos);
newTransform.m41 = newTransform.m42 = newTransform.m43 = newTransform.m44 = 0.0;
Parameters
vVECTOR3D structure to receive the nav vector.
virtual signed int IRenderEngine::GetPointVisibility ( VERTEX3D vtr,
POINTVISIBLEINFO pt,
signed int  Num 
)
pure virtual

Project 3D coordinates (in patient system coordinates) onto the rendering plane. Output points are relative to the center of the rendering plane, with X axis increasing along the raster, Y axis increasing along rows. Additionally, the opacity of the specified point is returned. This information may be used to render 3D primitives on a video card with relatively accurate interaction with the volume.

Parameters
vtrPointer to an array of 3D vertices to project
ptPointer to an array of POINTVISIBLEINFO structures
NumNumber of vertices to convert
virtual signed int IRenderEngine::GetRenderCallback ( IRenderEngineCallback **  irec,
signed int **  id 
)
pure virtual

Gets the current callback (even if it's NULL).

Parameters
irecRecieves the address of the pointer to the callback interface
idRecieves the address of the pointer to the callback interface ID
virtual signed int IRenderEngine::GetRenderParams ( RENDER_PARAMS rp)
pure virtual

Get the current rendering parameters. This will represent all that is known about the state of the rendering engine. Examine the RENDER_PARAMS::Mask to determine what parameters are valid.

Parameters
rp
virtual signed int IRenderEngine::GetTransferFunction ( unsigned int  index,
RENDER_RANGE_PARAMS arrParams 
)
pure virtual

Only applicable in eight transfer function builds. Gets the transfer function currently at index (0-7) and puts it in arrParams.

Parameters
indexIndex (0-7) of the transfer function to get.
arrParamsThe transfer function. This should be an array of RENDER_RANGE_PARAMS that is MAX_RENDER_RANGES_PARAMS in length.
virtual signed int IRenderEngine::GetVertexCallLists ( unsigned int *  numLists,
IVertexCallList ***  arrLists 
)
pure virtual

Gets the call lists applied to this object. The pointer returned into *arrLists is still owned by this object Do not release this pointer.

virtual signed int IRenderEngine::GetVolumeCount ( signed int *  numVolumes)
pure virtual

Returns the number of volumes into numVolumes. If the number is greater than 1, we're in 4D mode.

Parameters
numVolumesInteger to recieve the number of volumes.
virtual signed int IRenderEngine::GetVolumeData ( IVolumeData **  vd,
IVolumeOctree **  vo 
)
pure virtual

vd and vo must be arrays large enough to hold the number of volume and octree pointers returned by GetVolumeCount(). If there is only one volume, a simple pointer is sufficient to recieve the volume and and octree pointers.

virtual signed int IRenderEngine::IncRef ( )
pure virtual

Increases the reference count on this object by 1. You do not need to call this after an object is first created. It is 1 by default.

Implements IRoot.

virtual signed int IRenderEngine::InterruptRender ( )
pure virtual

Interrupt rendering operation. If the rendering engine is performing a rendering operation, then the function returns as soon as the rendering process is terminated. If the rendering engine is not performing rendering operation then the function returns immediately.

Note that the final stage of rendering is the place where this call makes the most sense. In fact, internally interactive stages will complete regardless of whether you interrupted them. However, once interrupted no rendering stage requires you to call WaitRender().

See also
Render()
virtual signed int IRenderEngine::IsRenderingFinished ( )
pure virtual

Returns S_OK if the rendering is finished AS WELL AS if the function was called when no rendering is happening. Returns S_FALSE if rendering is still in progress.

See also
Render()
virtual signed int IRenderEngine::ProjectPoint ( VERTEX3D vtr,
POINT pt,
signed int  Num 
)
pure virtual

Project 3D coordinates (in patient system coordinates) onto the rendering plane. Output points are relative to the center of the rendering plane, with X axis increasing along the raster, Y axis increasing along rows

Parameters
vtrPointer to an array of 3D vertices to project
ptPointer to an array of 2D points
NumNumber of vertices to convert
virtual signed int IRenderEngine::ProjectVolumetricShadow ( )
pure virtual

Projects a volume shadow from the current view location. This is implemented by setting the parts of the volume to be shadowed to the second transfer function. The second TF should then be slightly darker than the first.

virtual signed int IRenderEngine::Render ( signed int  Reserved,
VOLVISIMAGE  imReq,
VOLVISIMAGE imRes 
)
pure virtual

Render image according to previously specified RENDER_PARAMS. This call will block until rendering completes.

Parameters
ReservedReserved for future use. Should be set to zero.
imReqSpecifies the required image dimensions, rendering stage, compression parameters...etc. Fill the structure with zeros to get the default image dimentions.
imResResult image. The client is responsible to free the data with the correct allocator. The allocator can be Retrieved through ILibrary::GetAllocator() with AP_IMAGE for the id parameter.
virtual signed int IRenderEngine::ResetRenderParams ( )
pure virtual

Reset rendering parameters.to default values. Should really only be a last resort. There is no state of RENDER_PARAMS that is unrecoverable.

virtual signed int IRenderEngine::SetCurvedMPRPath ( signed int  numProjPlanes,
MATRIX44D arrProjPlanes,
ENUM_CURVED_MPR_TYPE  type 
)
pure virtual

Sets the curved MPR path to use. Essentially, the X vector in the projection plane describes the direction for the linear slice to take at every interpolated point on the curve. The offset in the projection plane describes where each point is. From this description, the points you specify are interpolated via Catmull-Rom spline interpolation. The spacing between interpolated points is dictated by the image size. NOTE: You call this function every time you switch to RT_MPR_CURVED. It does not persist across other render types.

Parameters
numProjPlanesNumbers of projection plane positions that make up the curve.
arrProjPlanesProjection plane positions that describe what we should interpolate between.
typeWhich axis is going to be non-linear?
virtual signed int IRenderEngine::SetFramesPerPhase ( signed int  frames)
pure virtual

Sets the number of frames to render before moving on to the next phase. Set this to 0 to keep the current phase indefinitely.

Parameters
framesThe number of frames to render before moving on to the next phase.
virtual signed int IRenderEngine::SetFreeHandCutMode ( ENUM_FHC_MODE  mode)
pure virtual

Sets the free hand cut mode.

Parameters
modeMode to set
virtual signed int IRenderEngine::SetPhase ( signed int  phase)
pure virtual

If the control was initialized for 4D rendering, this sets the view to the specified phase.

Parameters
phaseThe phase to set.
virtual signed int IRenderEngine::SetRenderCallback ( IRenderEngineCallback irec,
signed int *  id 
)
pure virtual

Sets whether or not you'll recieve callbacks when rendering completes. If you call InterruptRender(), you will not recieve the callback.

Parameters
irecThe interface to call whenever rendering completes. Set to NULL for no callback.
idArbitrary id that will be passed back to you when the callback occurs. NULL is acceptable for this parameter.
virtual signed int IRenderEngine::SetRenderParams ( RENDER_PARAMS rd)
pure virtual

The SetRenderParams function updates rendering parameters according to the RENDER_PARAMS::Mask variable. For optimal performance, it is recommended to only update necessary rendering parameters.

SetRenderParams cannot be called between StartRender() / WaitRender() calls.

Parameters
rdNew parameters to apply.
virtual signed int IRenderEngine::SetTransferFunction ( unsigned int  index,
RENDER_RANGE_PARAMS arrParams 
)
pure virtual

Only applicable in eight transfer function builds. Sets the transfer function at index (0-7) to the TF specified in arrParams.

Parameters
indexIndex (0-7) of the transfer function to apply.
arrParamsThe transfer function. This should be an array of RENDER_RANGE_PARAMS that is MAX_RENDER_RANGES_PARAMS in length.
virtual signed int IRenderEngine::SetVertexCallLists ( unsigned int  numLists,
IVertexCallList **  arrLists 
)
pure virtual

Sets an array of call lists to apply to this render engine. All rendered frames after this call will contain the polygon objects defined in those call lists. Do not call this function while rendering is in progress.

virtual signed int IRenderEngine::SetViewMode ( ENUM_VIEW_MODE  rm)
pure virtual

WARNING: This call is deprecated and is really only a wrapper for setting the RF_FRONT_CLIPPING_PLANE_ENABLED flag to true for VM_MPR_CLIP or false for VM_VIEW3D.

Sets the method of viewing for the render engine. See ENUM_VIEW_MODE for more details.

Parameters
rmthe mode to set.
virtual signed int IRenderEngine::SetVolumeData ( IVolumeData vd,
IVolumeOctree vo 
)
pure virtual

Sets the volume that this rendering engine should be using.

Rendering engines must be associated with a VolumeData object. The association can be changed by repeatedly calling SetVolumeData() function. If the rendering engine is reassociated with a volume dataset of different size, then internal structures have to be updated. Switching between datasets of different size requires internal reinitialization of the engine, and therefore not recomended for real time interaction.

Parameters
vdThe data to render.
voThe octree asseciated with this data. If you will only be using thin MIP/MPR rendering modes, you may pass NULL for this parameter.
virtual signed int IRenderEngine::SetVolumeData4D ( IVolumeData **  vd,
IVolumeOctree **  vo,
signed int  numVolumes 
)
pure virtual

Initializes a volume for 4D rendering. All data sets must be the same dimensions and orientation/skew/spacing.

Parameters
vdArray of IVolumeData interface pointers; one for each dataset.
voArray of IVolumeOctree interface pointers; one for each dataset.
numVolumesThe number of volumes in vd/vo.
virtual signed int IRenderEngine::ShootRay ( POINT pt,
RAYSTOPINFO rsi,
signed int  Num 
)
pure virtual

Shoot a ray from specific points on the projection plane specified by RENDER_PARAMS::Transform.

Parameters
ptArray of coordinates from the projection plane
rsiArray of structures to receive the results of the ShootRay operation.
NumNumber of elements in both arrays.
virtual signed int IRenderEngine::ShootRayFast ( POINT pt,
RAYSTOPINFO rsi,
signed int  Num 
)
pure virtual

A significantly faster version of ShootRay() when shooting many rays. The catch is that you will NOT get the min and max information returned in the RAYSTOPINFO. For this reason, this function is insufficient for connectivity segmentation.

Parameters
ptArray of coordinates from the projection plane
rsiArray of structures to receive the results of the ShootRay operation.
NumNumber of elements in both arrays.
virtual signed int IRenderEngine::StartRender ( signed int  Reserved,
VOLVISIMAGE  imReq 
)
pure virtual

Start rendering operation. When rendering process for final rendering stage has completed and was not interrupted by the InterruptRender() function the rendering engine will call the callback function specified by SetRenderCallback().

To receive the rendered image the client shall call WaitRender().

After calling StartRender() function only WaitRender() and InterruptRender() methods can be called.

Parameters
ReservedReserved for future use. Should be set to zero.
imReqStructure describing the attributes of the requested image.
See also
Render
virtual signed int IRenderEngine::WaitRender ( VOLVISIMAGE imRes)
pure virtual

Wait for rendering operation to complete. The function can be called only if StartRender() function has been called.

Parameters
imResRecieves the result image. See Render() for details.
See also
Render()