![]() |
CTK
0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
|
Classes | |
class | ctkAbstractFactory< BaseClassType > |
ctkAbstractFactory is the base class of all the factory where items need to be registered before being instantiated. More... | |
class | ctkAbstractFactoryFileBasedItem< BaseClassType > |
class | ctkAbstractFactoryItem< BaseClassType > |
class | ctkAbstractFileBasedFactory< BaseClassType > |
class | ctkAbstractLibraryFactory< BaseClassType > |
class | ctkAbstractObjectFactory< BaseClassType > |
class | ctkAbstractPluginFactory< BaseClassType > |
class | ctkAbstractQObjectFactory< BaseClassType > |
class | ctkBackTrace |
Obtains a back trace from the current execution context. More... | |
class | ctkBinaryFileDescriptor |
class | ctkBooleanMapper |
class | ctkCallback |
class | ctkCommandLineParser |
class | ctkCorePythonQtDecorators |
class | ctkDependencyGraph |
Class to implement a dependency graph, converted to STL instead of Qt. More... | |
class | ctkErrorLogAbstractMessageHandler |
struct | ctkErrorLogContext |
class | ctkErrorLogFDMessageHandler |
class | ctkErrorLogLevel |
class | ctkErrorLogQtMessageHandler |
class | ctkErrorLogStreamMessageHandler |
class | ctkErrorLogTerminalOutput |
class | ctkException |
The base class for all exceptions defined in CTK. More... | |
class | ctkFactoryLibraryItem< BaseClassType > |
class | ctkFactoryObjectItem< BaseClassType, ClassType > |
class | ctkFactoryPluginItem< BaseClassType > |
class | ctkFileLogger |
class | ctkHighPrecisionTimer |
A fast and high precision timer. More... | |
class | ctkLinearValueProxy |
Implementation of an affine value proxy. The ctkLinearValueProxy takes a coefficient and an offset, effectively implementing a value proxy such as: valueProxy = coefficient * value + offset Note: If the coefficient is null then the property value given by value = (valueProxy - offset) / coefficient can give bad results (+ or - infinity depending on the sign of valueProxy - offset). More... | |
class | ctkLogger |
class | ctkModelTester |
class | ctkScopedCurrentDir |
Use this class to change the current application directory in a given scope and automatically restore it. More... | |
class | ctkValueProxy |
Base class for value proxies. Value proxy allows to decouple the displayed value from the values accessed within the program. For example, one may want to display Fahrenheit while still working with Celsius. More... | |
class | ctkWorkflow |
ctkWorkflow is the basis for a workflow engine, i.e. a state machine with enhancements to support ctkWorkflowStep. More... | |
class | ctkWorkflowInterstepTransition |
struct | ctkWorkflowInterstepTransitionEvent |
class | ctkWorkflowIntrastepTransition |
struct | ctkWorkflowIntrastepTransitionEvent |
Custom transitions for use with ctkWorkflow. More... | |
class | ctkWorkflowStep |
ctkWorkflowStep is the basis for a workflow step. More... | |
Macros | |
#define | CTK_DECLARE_EXCEPTION(API, CLS, BASE) |
Quickly declare a ctkException sub-class. More... | |
#define | CTK_IMPLEMENT_EXCEPTION(CLS, BASE, NAME) |
Quickly implement a ctkException sub-class. More... | |
Functions | |
double CTK_CORE_EXPORT | ctk::closestPowerOfTen (double value) |
bool CTK_CORE_EXPORT | ctk::copyDirRecursively (const QString &srcPath, const QString &dstPath) |
QString CTK_CORE_EXPORT | ctk::extensionToRegExp (const QString &extension) |
qint64 CTK_CORE_EXPORT | ctk::msecsTo (const QDateTime &t1, const QDateTime &t2) |
Compute the milli seconds from one QDateTime to an other. More... | |
QStringList CTK_CORE_EXPORT | ctk::nameFiltersToExtensions (const QStringList &nameFilters) |
QRegExp CTK_CORE_EXPORT | ctk::nameFiltersToRegExp (const QStringList &nameFilters) |
QStringList CTK_CORE_EXPORT | ctk::nameFilterToExtensions (const QString &nameFilter) |
CTK_CORE_EXPORT QDebug | operator<< (QDebug dbg, const ctkException &exc) |
CTK_CORE_EXPORT QDebug | operator<< (QDebug dbg, const ctkException::TraceManipulator &trace) |
int CTK_CORE_EXPORT | ctk::orderOfMagnitude (double value) |
void CTK_CORE_EXPORT | ctk::qListToSTLVector (const QStringList &list, std::vector< char * > &vector) |
void CTK_CORE_EXPORT | ctk::qListToSTLVector (const QStringList &list, std::vector< std::string > &vector) |
QString CTK_CORE_EXPORT | ctk::qtHandleToString (Qt::HANDLE handle) |
bool CTK_CORE_EXPORT | ctk::removeDirRecursively (const QString &dirName) |
int CTK_CORE_EXPORT | ctk::significantDecimals (double value, int defaultDecimals=-1) |
void CTK_CORE_EXPORT | ctk::stlVectorToQList (const std::vector< std::string > &vector, QStringList &list) |
#define | CTK_CONSTRUCTOR_NO_ARG_CPP(PUB) |
#define | CTK_CONSTRUCTOR_1_ARG_CPP(PUB, _ARG1) |
#define | CTK_SET_CPP(PUB, _TYPE, _NAME, _VARNAME) |
#define | CTK_GET_CPP(PUB, _TYPE, _NAME, _VARNAME) |
#define | CTK_SINGLETON_DECLARE(NAME) |
Inspired from VTK/Utilities/kwsys/SystemTools class. More... | |
#define | CTK_SINGLETON_DECLARE_INITIALIZER(EXPORT_DIRECTIVE, NAME) |
Should be added at the bottom of the header file, after the class declaration. More... | |
#define | CTK_SINGLETON_DEFINE_INITIALIZER(NAME) |
Implementation of NAME##Initialize class. More... | |
#define | CTK_SINGLETON_DEFINE(NAME) |
This should be added at the end of the CPP file. More... | |
The CTK Core library provides generally useful utility classes.
#define CTK_CONSTRUCTOR_1_ARG_CPP | ( | PUB, | |
_ARG1 | |||
) |
Define a public class constructor with one argument
Also make sure the Pimpl is initalized
Definition at line 158 of file ctkPimpl.h.
#define CTK_CONSTRUCTOR_NO_ARG_CPP | ( | PUB | ) |
Define a public class constructor with no argument
Also make sure the Pimpl is initalized
Definition at line 147 of file ctkPimpl.h.
#define CTK_DECLARE_EXCEPTION | ( | API, | |
CLS, | |||
BASE | |||
) |
Quickly declare a ctkException sub-class.
API | The export macro. |
CLS | The class name for the ctkException sub-class. |
BASE | The class name of the actual super class. |
Definition at line 196 of file ctkException.h.
#define CTK_GET_CPP | ( | PUB, | |
_TYPE, | |||
_NAME, | |||
_VARNAME | |||
) |
Define the setter in the public class.
This should be put in the .cxx file of the public class. The parameter are the name of the public class (PUB), the type of the argument to return (_TYPE), the name of the setter(_NAME) and the name of the variable in the Private class(_VARNAME).
Definition at line 188 of file ctkPimpl.h.
#define CTK_IMPLEMENT_EXCEPTION | ( | CLS, | |
BASE, | |||
NAME | |||
) |
Quickly implement a ctkException sub-class.
CLS | The class name for the ctkException sub-class. |
BASE | The class name of the actual super class. |
NAME | A human-readable name for this exception class. |
Definition at line 219 of file ctkException.h.
#define CTK_SET_CPP | ( | PUB, | |
_TYPE, | |||
_NAME, | |||
_VARNAME | |||
) |
Define the setter in the public class.
This should be put in the .cxx file of the public class. The parameter are the name of the public class (PUB), the type of the argument to return (_TYPE), the name of the getter(_NAME) and the name of the variable in the Private class(_VARNAME).
Definition at line 173 of file ctkPimpl.h.
#define CTK_SINGLETON_DECLARE | ( | NAME | ) |
Inspired from VTK/Utilities/kwsys/SystemTools class.
Singleton definition and declaration helpers See http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.12 and http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Nifty_Counter Should be included as a class protected member
Definition at line 38 of file ctkSingleton.h.
#define CTK_SINGLETON_DECLARE_INITIALIZER | ( | EXPORT_DIRECTIVE, | |
NAME | |||
) |
Should be added at the bottom of the header file, after the class declaration.
Help macro allowing to declare the utility class to make sure NAME is initialized before it is used. The instance (NAME##Initializer) will show up in any translation unit that uses NAME. It will make sure NAME is initialized before it is used.
Definition at line 54 of file ctkSingleton.h.
#define CTK_SINGLETON_DEFINE | ( | NAME | ) |
This should be added at the end of the CPP file.
Definition at line 97 of file ctkSingleton.h.
#define CTK_SINGLETON_DEFINE_INITIALIZER | ( | NAME | ) |
Implementation of NAME##Initialize class.
Note: NAME##Initialize::Count and NAME::Instance Must NOT be initialized. Default initialization to zero is necessary.
Definition at line 76 of file ctkSingleton.h.
double CTK_CORE_EXPORT ctk::closestPowerOfTen | ( | double | value | ) |
Return the order of magnitude of a number. e.g.: closestPowerOfTen(11) returns 10 closestPowerOfTen(-40) returns -10 closestPowerOfTen(99) returns 100 closestPowerOfTen(0.012) returns 0.010 closestPowerOfTen(0.) returns 0 See more cases in the test ctkUtilsClosestPowerOfTenTest1
bool CTK_CORE_EXPORT ctk::copyDirRecursively | ( | const QString & | srcPath, |
const QString & | dstPath | ||
) |
Copy a directory recursively
srcPath | The directory to be copied |
dstPath | The directory where the file should be copied |
true
on success, false
otherwise. QString CTK_CORE_EXPORT ctk::extensionToRegExp | ( | const QString & | extension | ) |
Convert a wildcar extension filter ("*.jpg") into a regular expression string "*.jpg" -> ".*\\.jpg?$"
qint64 CTK_CORE_EXPORT ctk::msecsTo | ( | const QDateTime & | t1, |
const QDateTime & | t2 | ||
) |
Compute the milli seconds from one QDateTime to an other.
This function can be used to correctly compute the amount of milli seconds from t1
to t2
. The QDateTime objects are converted to Qt::UTC to take daylight saving time into account. This is for back-wards compatibility with Qt 4.6. Since Qt 4.7 there exists a QDateTime::msecsTo() method which should be used instead, after bumping the minimum required Qt version for CTK.
QStringList CTK_CORE_EXPORT ctk::nameFiltersToExtensions | ( | const QStringList & | nameFilters | ) |
Convert a nameFilter to a list of file extensions: "Images (*.png *.jpg *.tiff)", "Text (*.txt)" -> "*.png", "*.jpg", "*.tiff", "*.txt"
QRegExp CTK_CORE_EXPORT ctk::nameFiltersToRegExp | ( | const QStringList & | nameFilters | ) |
Convert a list of wildcar extension filters ("*.jpg") into a regular expression string "*.jpg", "*.txt" -> "(.*\\.jpg?$|.*\\.txt?$)"
QStringList CTK_CORE_EXPORT ctk::nameFilterToExtensions | ( | const QString & | nameFilter | ) |
Convert a nameFilter to a list of file extensions: "Images (*.png *.jpg *.tiff)" -> "*.png", "*.jpg", "*.tiff" Note: the nameFilter can be a simple wildcard "*.jpg" in that case, it will simply return it.
CTK_CORE_EXPORT QDebug operator<< | ( | QDebug | dbg, |
const ctkException & | exc | ||
) |
CTK_CORE_EXPORT QDebug operator<< | ( | QDebug | dbg, |
const ctkException::TraceManipulator & | trace | ||
) |
int CTK_CORE_EXPORT ctk::orderOfMagnitude | ( | double | value | ) |
Return the order of magnitude of a number or numeric_limits<int>::min() if the order of magnitude can't be computed (e.g. 0, inf, Nan, denorm)... e.g.: orderOfMagnitude(1) returns 0 orderOfMagnitude(10) returns 1 orderOfMagnitude(99) returns 1 orderOfMagnitude(101) returns 2 orderOfMagnitude(0.1) returns -1 orderOfMagnitude(0.15) returns -1 orderOfMagnitude(0.) returns NaN See more cases in the test ctkUtilsOrderOfMagnitudeTest1
void CTK_CORE_EXPORT ctk::qListToSTLVector | ( | const QStringList & | list, |
std::vector< char * > & | vector | ||
) |
Convert a QStringList to Vector of char* Caller will be responsible to delete the content of the vector
void CTK_CORE_EXPORT ctk::qListToSTLVector | ( | const QStringList & | list, |
std::vector< std::string > & | vector | ||
) |
Convert a QStringList to a Vector of string
QString CTK_CORE_EXPORT ctk::qtHandleToString | ( | Qt::HANDLE | handle | ) |
Convert Qt::HANDLE to string
bool CTK_CORE_EXPORT ctk::removeDirRecursively | ( | const QString & | dirName | ) |
Remove a directory recursively.
dirName | The directory to remove |
true
on success, false
otherwise. int CTK_CORE_EXPORT ctk::significantDecimals | ( | double | value, |
int | defaultDecimals = -1 |
||
) |
Return a "smart" number of decimals needed to display (in a gui) a floating number. 16 is the max that can be returned, -1 for NaN numbers. When the number of decimals is not obvious, it defaults to defaultDecimals if it is different from -1, 16 otherwise. e.g. significantDecimals(120.01) returns 2 significantDecimals(123456.1333333) returns 3 significantDecimals(123456.26999999999999996) returns 2 significantDecimals(123456.12345678901234567, 3) return 3 See more cases in the test ctkUtilsSignificantDecimalsTest1
void CTK_CORE_EXPORT ctk::stlVectorToQList | ( | const std::vector< std::string > & | vector, |
QStringList & | list | ||
) |
Convert a Vector of string to QStringList