CustusX  15.3.3-beta
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cx::Presets Class Reference

Base class for a group of presets in the system. More...

#include <cxPresets.h>

Inheritance diagram for cx::Presets:
cx::TransferFunctions3DPresets cx::TSFPresets

Signals

void changed ()
 

Public Member Functions

 Presets (XmlOptionFile presetFile, XmlOptionFile customFile)
 
virtual ~Presets ()
 
void addCustomPreset (QDomElement &element)
 adds a custom preset More...
 
virtual void deleteCustomPreset (QString name)
 deletes the custom preset with the given name if it exists More...
 
virtual void save ()
 saves the presets to file More...
 
virtual void remove ()
 removes the presets from file More...
 
QStringList getPresetList (QString tag="")
 returns a list of the preset names for the given tag More...
 
bool isDefaultPreset (QString presetName)
 Check is the preset is one of the "system presets". More...
 
XmlOptionFile getCustomFile ()
 

Protected Member Functions

virtual QStringList generatePresetList (QString tag)
 internally generate the preset list More...
 
XmlOptionFile getPresetNode (const QString &presetName)
 Look for a preset with the given name. Create one if not found. More...
 
void addDefaultPreset (QDomElement &element)
 
void addPreset (XmlOptionFile &file, QDomElement &element)
 
void print (QDomElement element)
 debugging function for printing xml elements More...
 

Protected Attributes

QString mLastCustomPresetAdded
 
QString mLastCustomPresetRemoved
 < the name of the last custom preset added More...
 
XmlOptionFile mPresetFile
 < the name of the last custom preset removed More...
 

Detailed Description

Base class for a group of presets in the system.

A preset node should look like this: <Preset name="example" valuename1="value1" valuename2="value2" ... valuenameN="valueN"/>

Date
Mar 11, 2013
Author
Janne Beate Bakeng, SINTEF

Definition at line 61 of file cxPresets.h.

Constructor & Destructor Documentation

cx::Presets::Presets ( XmlOptionFile  presetFile,
XmlOptionFile  customFile 
)

Definition at line 43 of file cxPresets.cpp.

virtual cx::Presets::~Presets ( )
inlinevirtual

Definition at line 67 of file cxPresets.h.

Member Function Documentation

void cx::Presets::addCustomPreset ( QDomElement &  element)

adds a custom preset

Definition at line 57 of file cxPresets.cpp.

void cx::Presets::addDefaultPreset ( QDomElement &  element)
protected

Definition at line 110 of file cxPresets.cpp.

void cx::Presets::addPreset ( XmlOptionFile file,
QDomElement &  element 
)
protected

Definition at line 115 of file cxPresets.cpp.

void cx::Presets::changed ( )
signal
void cx::Presets::deleteCustomPreset ( QString  name)
virtual

deletes the custom preset with the given name if it exists

Definition at line 50 of file cxPresets.cpp.

QStringList cx::Presets::generatePresetList ( QString  tag)
protectedvirtual

internally generate the preset list

Reimplemented in cx::TransferFunctions3DPresets, and cx::TSFPresets.

Definition at line 88 of file cxPresets.cpp.

XmlOptionFile cx::Presets::getCustomFile ( )

Definition at line 93 of file cxPresets.cpp.

QStringList cx::Presets::getPresetList ( QString  tag = "")

returns a list of the preset names for the given tag

Definition at line 74 of file cxPresets.cpp.

XmlOptionFile cx::Presets::getPresetNode ( const QString &  presetName)
protected

Look for a preset with the given name. Create one if not found.

Definition at line 98 of file cxPresets.cpp.

bool cx::Presets::isDefaultPreset ( QString  presetName)

Check is the preset is one of the "system presets".

Definition at line 79 of file cxPresets.cpp.

void cx::Presets::print ( QDomElement  element)
protected

debugging function for printing xml elements

Definition at line 129 of file cxPresets.cpp.

void cx::Presets::remove ( )
virtual

removes the presets from file

Reimplemented in cx::TSFPresets.

Definition at line 68 of file cxPresets.cpp.

void cx::Presets::save ( )
virtual

saves the presets to file

Reimplemented in cx::TSFPresets.

Definition at line 63 of file cxPresets.cpp.

Member Data Documentation

QString cx::Presets::mLastCustomPresetAdded
protected

Definition at line 90 of file cxPresets.h.

QString cx::Presets::mLastCustomPresetRemoved
protected

< the name of the last custom preset added

Definition at line 91 of file cxPresets.h.

XmlOptionFile cx::Presets::mPresetFile
protected

< the name of the last custom preset removed

Definition at line 93 of file cxPresets.h.


The documentation for this class was generated from the following files: