#include <trafu_data.h>
Public Member Functions | |
TraFuData (const char *tfd_filename=0) | |
Constructor. | |
void | Init () |
Initializes the transfer function to the standard values (black-transparent to white-opaque). | |
Mapping_point_t | mapDensity (float density) const |
Returns a Mapping_point Object containing color and opacity for a given density value. | |
void | createDensityVectorPart (Mapping_point_vector_t &vec, int first_element, int number_of_elements, const Mapping_point_iterator_const_t &lower, const Mapping_point_iterator_const_t &upper) const |
Create a partial density vector from lower to upper. | |
Mapping_point_vector_t | createDensityVector (int number_of_elements) const |
Returns an, evenly distributed, number of Mapping_point objects covering the whole transfer function. | |
void | load_file (const char *tfd_filename) |
Load a ".tf" file with the provided filename. | |
void | save_file (const char *tfd_filename) |
Save a ".tf" file with the provided filename. | |
void | Sort () |
Sort the transfer function points (ordered by the density). | |
void | Delete (Mapping_point_iterator_t &target) |
Delete the provided point from the transfer function. | |
void | Add (const Mapping_point_t &new_point) |
Add the provided point to the transfer function. | |
Mapping_point_iterator_t | begin () |
Return an iterator pointing to the first point of the transfer function. | |
Mapping_point_iterator_t | end () |
Return an iterator pointing just past the last point of the transfer function. | |
Private Attributes | |
Mapping_point_list_t | m_mapping_points |
List holding all points of the transfer function. |
Definition at line 23 of file trafu_data.h.
TraFuData::TraFuData | ( | const char * | tfd_filename = 0 |
) |
void TraFuData::Init | ( | ) |
Initializes the transfer function to the standard values (black-transparent to white-opaque).
Definition at line 19 of file trafu_data.cpp.
References m_mapping_points, TFP_END, and TFP_START.
Referenced by TraFuDialog::OnTFReset(), and TraFuData().
Mapping_point_t TraFuData::mapDensity | ( | float | density | ) | const |
Returns a Mapping_point Object containing color and opacity for a given density value.
Definition at line 26 of file trafu_data.cpp.
References Mapping_data::m_density, and m_mapping_points.
void TraFuData::createDensityVectorPart | ( | Mapping_point_vector_t & | vec, | |
int | first_element, | |||
int | number_of_elements, | |||
const Mapping_point_iterator_const_t & | lower, | |||
const Mapping_point_iterator_const_t & | upper | |||
) | const |
Create a partial density vector from lower to upper.
Definition at line 87 of file trafu_data.cpp.
References tfRGB::blue, tfRGB::green, Mapping_data::m_colour, Mapping_data::m_density, Mapping_data::m_opacity, and tfRGB::red.
Referenced by createDensityVector().
Mapping_point_vector_t TraFuData::createDensityVector | ( | int | number_of_elements | ) | const |
Returns an, evenly distributed, number of Mapping_point objects covering the whole transfer function.
Definition at line 107 of file trafu_data.cpp.
References createDensityVectorPart(), and m_mapping_points.
Referenced by TransferFunctionCtrlCanvas::DrawRange().
void TraFuData::load_file | ( | const char * | tfd_filename | ) |
Load a ".tf" file with the provided filename.
Definition at line 136 of file trafu_data.cpp.
References m_mapping_points.
Referenced by TraFuDialog::OnLoadTF(), and TraFuData().
void TraFuData::save_file | ( | const char * | tfd_filename | ) |
Save a ".tf" file with the provided filename.
Definition at line 163 of file trafu_data.cpp.
References m_mapping_points.
Referenced by TraFuDialog::OnSaveTF().
void TraFuData::Sort | ( | ) | [inline] |
Sort the transfer function points (ordered by the density).
Definition at line 49 of file trafu_data.h.
References m_mapping_points.
Referenced by Add(), TransferFunctionCtrlCanvas::AddNewPoint(), Delete(), and TransferFunctionCtrlCanvas::OnPaint().
void TraFuData::Delete | ( | Mapping_point_iterator_t & | target | ) | [inline] |
Delete the provided point from the transfer function.
Definition at line 51 of file trafu_data.h.
References m_mapping_points, and Sort().
Referenced by TransferFunctionCtrlCanvas::DeletePoint().
void TraFuData::Add | ( | const Mapping_point_t & | new_point | ) | [inline] |
Add the provided point to the transfer function.
Definition at line 53 of file trafu_data.h.
References m_mapping_points, and Sort().
Referenced by TransferFunctionCtrlCanvas::AddNewPoint().
Mapping_point_iterator_t TraFuData::begin | ( | ) | [inline] |
Return an iterator pointing to the first point of the transfer function.
Definition at line 56 of file trafu_data.h.
References m_mapping_points.
Referenced by TransferFunctionCtrlCanvas::DrawPoints(), TransferFunctionCtrlCanvas::GetHitPoint(), and TransferFunctionCtrlCanvas::OnPaint().
Mapping_point_iterator_t TraFuData::end | ( | ) | [inline] |
Return an iterator pointing just past the last point of the transfer function.
Definition at line 58 of file trafu_data.h.
References m_mapping_points.
Referenced by TransferFunctionCtrlCanvas::DrawPoints(), TransferFunctionCtrlCanvas::GetHitPoint(), TransferFunctionCtrlCanvas::OnMouseEvent(), TransferFunctionCtrlCanvas::OnPaint(), TransferFunctionCtrlCanvas::SetMoving(), and TransferFunctionCtrlCanvas::SetTraFuDataPointer().
List holding all points of the transfer function.
Definition at line 62 of file trafu_data.h.
Referenced by Add(), begin(), createDensityVector(), Delete(), end(), Init(), load_file(), mapDensity(), save_file(), and Sort().