ImFusion SDK 4.3
TransferFunctionTissue Class Reference

#include <ImFusion/GL/TransferFunctionTissue.h>

Describes a single tissue of a transfer function. More...

+ Inheritance diagram for TransferFunctionTissue:

Detailed Description

Describes a single tissue of a transfer function.

A tissue is described by a unique name and a set of key points.

See also
TransferFunction

Classes

struct  KeyPoint
 Describes a single key point of a tissue. More...
 

Public Types

using ID = int
 Alias for the type uniquely identifying a KeyPoint within a tissue.
 

Public Member Functions

 TransferFunctionTissue ()
 Creates a new empty TF tissue.
 
 TransferFunctionTissue (std::vector< KeyPoint > &&keyPoints)
 Creates a new TF tissue with the given key points.
 
 TransferFunctionTissue (const std::vector< KeyPoint > &keyPoints)
 Creates a new TF tissue with the given key points.
 
bool operator== (const TransferFunctionTissue &other) const
 
std::vector< KeyPoint > & keyPoints ()
 Returns the set of key points defining this tissue. Sorted by their absolute position.
 
const std::vector< KeyPoint > & keyPoints () const
 Returns the set of key points defining this tissue. Sorted by their absolute position.
 
std::vector< KeyPoint >::iterator find (ID keyPoint)
 Returns an iterator to the KeyPoint with the given ID.
 
ID addKeyPoint (double position, vec4 color, bool sort=true)
 Adds a key point to this tissue.
 
void moveKeyPoint (ID keyPoint, double position)
 Moves the key point to a new position.
 
void removeKeyPoint (ID keyPoint)
 Removes the given key point.
 
void sortKeyPoints ()
 Sorts all key points by their absolute position.
 

Constructor & Destructor Documentation

◆ TransferFunctionTissue() [1/2]

TransferFunctionTissue ( std::vector< KeyPoint > && keyPoints)
explicit

Creates a new TF tissue with the given key points.

Parameters
keyPointsSet of key points defining this tissue.

◆ TransferFunctionTissue() [2/2]

TransferFunctionTissue ( const std::vector< KeyPoint > & keyPoints)
explicit

Creates a new TF tissue with the given key points.

Parameters
keyPointsSet of key points defining this tissue.

Member Function Documentation

◆ addKeyPoint()

ID addKeyPoint ( double position,
vec4 color,
bool sort = true )

Adds a key point to this tissue.

Parameters
positionAbsolute position of the new key point in TF space.
colorColor of the new key point.
sortWhether to resort the data structure, otherwise you have to trigger sortKeyPoints yourself when done
Returns
ID of the newly created key point.

◆ moveKeyPoint()

void moveKeyPoint ( ID keyPoint,
double position )

Moves the key point to a new position.

Please do not change a key point's position member directly and use this method instead, since it ensures the correct sorting of the key points.

Parameters
keyPointID of the key point to move.
positionNew position in TF space.

◆ removeKeyPoint()

void removeKeyPoint ( ID keyPoint)

Removes the given key point.

Parameters
keyPointID of the key point to remove.

◆ sortKeyPoints()

void sortKeyPoints ( )

Sorts all key points by their absolute position.

Should be called every time you change a key point's position directly.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close