ALBA
|
#include "albaConfigure.h"
#include "albaIncludeWX.h"
#include <string.h>
#include <typeinfo>
#include <iosfwd>
#include <sstream>
Go to the source code of this file.
Macros | |
#define | MIN(x, y) ( (x) < (y) ? (x) : (y) ) |
#define | MAX(x, y) ( (x) > (y) ? (x) : (y) ) |
#define | round(x) (x<0?ceil((x)-0.5):floor((x)+0.5)) |
#define | ID_NO_EVENT 0 |
#define | ALBA_STRING_BUFFER_SIZE 2048 |
#define | vtkDEL(a) do{if (a) { a->Delete(); a = NULL; }}while(0) |
#define | vtkNEW(a) a=a->New() |
#define | albaNEW(a) do{a=a->New();a->Register(this);}while(0) |
#define | albaDEL(a) do{if (a) { a->Delete(); a = NULL;}}while(0) |
#define | cppDEL(a) do{if (a) { delete a; a = NULL;}}while(0) |
#define | albaAbstractTypeMacro(thisClass, superclass) |
#define | albaTypeMacro(thisClass, superclass) |
#define | albaCxxAbstractTypeMacro(thisClass) |
#define | albaCxxTypeMacro(thisClass) |
#define | IsALBAType(type_name) IsA(type_name::GetStaticTypeId()) |
#define | ALBA_ID_IMP(idname) const albaID idname = mmuIdFactory::GetNextId(#idname); |
#define | ALBA_ID_DEC(idname) static const albaID idname; |
#define | ALBA_ID_GLOBAL(idname) extern const albaID idname; |
#define | ALBA_ID_CLASS_DEC(baseClass) static const albaID BaseID; |
#define | ALBA_ID_CLASS_IMP(baseClass, num) const albaID baseClass::BaseID = mmuIdFactory::AllocIdGroup("#baseClass::BaseID",num); |
#define | ALBA_ID_LOC(name, idname) static const albaID name=mmuIdFactory::GetId(#idname); |
#define | albaGetEventClassId(event, baseClass) (event->GetID()-baseClass::BaseID) |
#define | albaGetEventGroupId(event, baseID) (event->GetID()-baseID) |
#define | albaEvalGroupId(baseClass, id) (baseClass::BaseID+id) |
#define | albaEventMacro(e) if (m_Listener) {m_Listener->OnEvent(&e);} |
#define | ALBA_TEST(a) |
#define | albaWarningMacro(x) |
#define | albaErrorMacro(x) |
#define | albaWarningMessageMacro(x) |
#define | albaErrorMessageMacro(x) |
#define | albaMessageMacro(x) |
#define | ALBA_PRINT_MACRO(format, buffer, size) |
Typedefs | |
typedef double | albaTimeStamp |
typedef long | albaID |
typedef std::type_info | albaTypeID |
Functions | |
ALBA_EXPORT void | albaLogMessage (const char *format,...) |
ALBA_EXPORT void | albaWarningMessage (const char *format,...) |
ALBA_EXPORT void | albaErrorMessage (const char *format,...) |
ALBA_EXPORT void | albaMessage (const char *format,...) |
ALBA_EXPORT bool | albaEquals (double x, double y) |
ALBA_EXPORT bool | albaFloatEquals (float x, float y) |
ALBA_EXPORT double | albaRoundToPrecision (double val, unsigned prec) |
ALBA_EXPORT bool | albaIsLittleEndian (void) |
ALBA_EXPORT void | albaSleep (int msec) |
Variables | |
enum ALBA_EXPORT | ALBA_RETURN_VALUES_ID |
ALBA_OK = 0 | |
ALBA_ERROR | |
ALBA_WAIT | |
#define MIN | ( | x, | |
y | |||
) | ( (x) < (y) ? (x) : (y) ) |
Standard macros and constants for the ALBA library.
This file include all the standard macros and constants used inside the ALBA library.
Definition at line 45 of file albaDefines.h.
#define MAX | ( | x, | |
y | |||
) | ( (x) > (y) ? (x) : (y) ) |
Definition at line 48 of file albaDefines.h.
#define round | ( | x | ) | (x<0?ceil((x)-0.5):floor((x)+0.5)) |
Definition at line 51 of file albaDefines.h.
#define ID_NO_EVENT 0 |
Definition at line 71 of file albaDefines.h.
#define ALBA_STRING_BUFFER_SIZE 2048 |
Definition at line 77 of file albaDefines.h.
#define vtkDEL | ( | a | ) | do{if (a) { a->Delete(); a = NULL; }}while(0) |
Delete a VTK object.
Definition at line 119 of file albaDefines.h.
#define vtkNEW | ( | a | ) | a=a->New() |
Allocate a new VTK object: don't worry, New is a static member function!
Definition at line 122 of file albaDefines.h.
#define albaNEW | ( | a | ) | do{a=a->New();a->Register(this);}while(0) |
Allocate a new ALBA object: don't worry, New is a static member function!
Definition at line 125 of file albaDefines.h.
#define albaDEL | ( | a | ) | do{if (a) { a->Delete(); a = NULL;}}while(0) |
Delete a ALBA object.
Definition at line 128 of file albaDefines.h.
#define cppDEL | ( | a | ) | do{if (a) { delete a; a = NULL;}}while(0) |
delete a new() allocated object
Definition at line 131 of file albaDefines.h.
#define albaAbstractTypeMacro | ( | thisClass, | |
superclass | |||
) |
Macro used by albaObjects for RTTI information.
This macro must be placed in the class definition public section.
Definition at line 136 of file albaDefines.h.
#define albaTypeMacro | ( | thisClass, | |
superclass | |||
) |
Macro used by albaObjects for RTTI information.
This macro must be placed in the class definition public section.
Definition at line 162 of file albaDefines.h.
#define albaCxxAbstractTypeMacro | ( | thisClass | ) |
Macro used by albaObjects for RTTI information.
This macor must be placed in the .cpp file.
Definition at line 176 of file albaDefines.h.
#define albaCxxTypeMacro | ( | thisClass | ) |
Macro used by albaObjects for RTTI information.
This macro must be placed in the .cpp file.
Definition at line 193 of file albaDefines.h.
#define IsALBAType | ( | type_name | ) | IsA(type_name::GetStaticTypeId()) |
Shortcut for type checking.
Definition at line 209 of file albaDefines.h.
#define ALBA_ID_IMP | ( | idname | ) | const albaID idname = mmuIdFactory::GetNextId(#idname); |
This macros is used to declare a new Id and should be placed in a .h file.
Definition at line 212 of file albaDefines.h.
#define ALBA_ID_DEC | ( | idname | ) | static const albaID idname; |
This macros is used to define a new Id and should be placed in a .cpp file.
Definition at line 214 of file albaDefines.h.
#define ALBA_ID_GLOBAL | ( | idname | ) | extern const albaID idname; |
This macros is used to declare a new global Id and should be placed in a .h file.
Definition at line 216 of file albaDefines.h.
#define ALBA_ID_CLASS_DEC | ( | baseClass | ) | static const albaID BaseID; |
This macro is used to define a group of IDs and should be placed in a .h file.
Ids declaration with ALBA_ID_DEC. This macro is used to declare the base ID of a group of ids.
Definition at line 223 of file albaDefines.h.
#define ALBA_ID_CLASS_IMP | ( | baseClass, | |
num | |||
) | const albaID baseClass::BaseID = mmuIdFactory::AllocIdGroup("#baseClass::BaseID",num); |
This macro is used to define the base ID of a group of ids.
Definition at line 225 of file albaDefines.h.
#define ALBA_ID_LOC | ( | name, | |
idname | |||
) | static const albaID name=mmuIdFactory::GetId(#idname); |
Definition at line 227 of file albaDefines.h.
#define albaGetEventClassId | ( | event, | |
baseClass | |||
) | (event->GetID()-baseClass::BaseID) |
These macros are used to retrieve the base ID of a group of events.
Definition at line 230 of file albaDefines.h.
#define albaGetEventGroupId | ( | event, | |
baseID | |||
) | (event->GetID()-baseID) |
Definition at line 231 of file albaDefines.h.
#define albaEvalGroupId | ( | baseClass, | |
id | |||
) | (baseClass::BaseID+id) |
Definition at line 232 of file albaDefines.h.
#define albaEventMacro | ( | e | ) | if (m_Listener) {m_Listener->OnEvent(&e);} |
albaEventMacro is an handy shortcut to send an Event.
Definition at line 235 of file albaDefines.h.
#define ALBA_TEST | ( | a | ) |
Helper macro used for testing.
Definition at line 238 of file albaDefines.h.
#define albaWarningMacro | ( | x | ) |
Macro for printing Warning messages in log area.
This macro also displays line at which error was printed.
Definition at line 248 of file albaDefines.h.
#define albaErrorMacro | ( | x | ) |
Macro for printing Error messages in log area.
This macro also displays line at which error was printed.
Definition at line 259 of file albaDefines.h.
#define albaWarningMessageMacro | ( | x | ) |
Macro for displaying Warning messages.
Definition at line 269 of file albaDefines.h.
#define albaErrorMessageMacro | ( | x | ) |
Macro for displaying Error messages.
Definition at line 278 of file albaDefines.h.
#define albaMessageMacro | ( | x | ) |
Macro for displaying messages.
Definition at line 287 of file albaDefines.h.
#define ALBA_PRINT_MACRO | ( | format, | |
buffer, | |||
size | |||
) |
Macro for formatted printing to string (adapted from wxWidgets IMPLEMENT_LOG_FUNCTION) To use it you will need to include <stdio.h>, <stdarg.h> and <varargs.h> This is less safe since it can't limit output string size.
Definition at line 298 of file albaDefines.h.
typedef double albaTimeStamp |
type for time varying data timestamps (not for pipelines timestamps!)
Definition at line 57 of file albaDefines.h.
typedef long albaID |
type for IDs inside ALBA
Definition at line 58 of file albaDefines.h.
typedef std::type_info albaTypeID |
type for albaObject's class type IDs
Definition at line 59 of file albaDefines.h.
ALBA_EXPORT void albaLogMessage | ( | const char * | format, |
... | |||
) |
write a message in the log area
Referenced by albaGizmoSlice::SetModalityToGlobal().
ALBA_EXPORT void albaWarningMessage | ( | const char * | format, |
... | |||
) |
open a warning dialog and write a message
ALBA_EXPORT void albaErrorMessage | ( | const char * | format, |
... | |||
) |
open an error dialog and write a message
ALBA_EXPORT void albaMessage | ( | const char * | format, |
... | |||
) |
open a message dialog and write a message
ALBA_EXPORT bool albaEquals | ( | double | x, |
double | y | ||
) |
reliable comparison test for floating point numbers.
Extracted from article: "Work Around Floating-Point Accuracy/Comparison Problems" Article ID: Q69333 of MSDN library
Referenced by albaMatrix::SetTimeStamp(), and albaTransformBase::SetTimeStamp().
ALBA_EXPORT bool albaFloatEquals | ( | float | x, |
float | y | ||
) |
ALBA_EXPORT double albaRoundToPrecision | ( | double | val, |
unsigned | prec | ||
) |
retrieve the double value with the desired precision
ALBA_EXPORT bool albaIsLittleEndian | ( | void | ) |
return true if it's little endian
ALBA_EXPORT void albaSleep | ( | int | msec | ) |
wait for given milliseconds
enum ALBA_EXPORT ALBA_RETURN_VALUES_ID |
Definition at line 64 of file albaDefines.h.
ALBA_OK = 0 |
Definition at line 66 of file albaDefines.h.
Referenced by albaStorableDictionary::InternalStore(), albaTimeMapScalar< T >::RemoveItem(), and albaTimeMap< T >::RemoveItem().
ALBA_ERROR |
Definition at line 67 of file albaDefines.h.
Referenced by albaTimeMapScalar< T >::RemoveItem(), and albaTimeMap< T >::RemoveItem().
ALBA_WAIT |
Definition at line 68 of file albaDefines.h.