Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

igtlMacro.h File Reference

Go to the source code of this file.

Classes

class  igtl::OStringStream

Namespaces

namespace  igtl

Defines

#define IGTL_EMPTY
#define IGTL_EXPORT_IGTLCommon(c, x, n)   IGTL_EXPORT_TEMPLATE(IGTLCommon_EXPORT, c, x, n)
#define IGTL_EXPORT_TEMPLATE(EXPORT, c, x, y)   IGTL_TEMPLATE_##c(IGTL_TEMPLATE_EXPORT, EXPORT IGTL_EMPTY, x, y)
#define IGTL_IMPORT_IGTLCommon(c, x, n)   IGTL_IMPORT_TEMPLATE(IGTLCommon_EXPORT, c, x, n)
#define IGTL_IMPORT_TEMPLATE(EXPORT, c, x, y)   IGTL_TEMPLATE_##c(IGTL_TEMPLATE_IMPORT, EXPORT IGTL_EMPTY, x, y)
#define IGTL_LOCATION   "unknown"
#define IGTL_NO_RETURN
#define IGTL_TEMPLATE_1(x1)   x1
#define IGTL_TEMPLATE_2(x1, x2)   x1,x2
#define IGTL_TEMPLATE_3(x1, x2, x3)   x1,x2,x3
#define IGTL_TEMPLATE_4(x1, x2, x3, x4)   x1,x2,x3,x4
#define IGTL_TEMPLATE_5(x1, x2, x3, x4, x5)   x1,x2,x3,x4,x5
#define IGTL_TEMPLATE_6(x1, x2, x3, x4, x5, x6)   x1,x2,x3,x4,x5,x6
#define IGTL_TEMPLATE_7(x1, x2, x3, x4, x5, x6, x7)   x1,x2,x3,x4,x5,x6,x7
#define IGTL_TEMPLATE_8(x1, x2, x3, x4, x5, x6, x7, x8)   x1,x2,x3,x4,x5,x6,x7,x8
#define IGTL_TEMPLATE_9(x1, x2, x3, x4, x5, x6, x7, x8, x9)   x1,x2,x3,x4,x5,x6,x7,x8,x9
#define IGTL_TEMPLATE_DO_NOT_INSTANTIATE   0
#define IGTL_TEMPLATE_EXPLICIT   0
#define IGTL_TEMPLATE_EXPORT(x)   IGTL_TEMPLATE_EXPORT_DELAY(x)
#define IGTL_TEMPLATE_EXPORT_DELAY(x)   template IGTL_TEMPLATE_##x;
#define IGTL_TEMPLATE_EXTERN   0
#define IGTL_TEMPLATE_IMPORT(x)
#define IGTL_TEMPLATE_IMPORT_WORKS   0
#define IGTL_TEMPLATE_TXX   !(IGTL_TEMPLATE_CXX || IGTL_TEMPLATE_TYPE)
#define igtlErrorMacro(x)
#define igtlExceptionMacro(x)
#define igtlGenericOutputMacro(x)
#define igtlGetStaticConstMacro(name)   (Self::name)
#define igtlGetStringMacro(name)
#define igtlGetVectorMacro(name, type, count)
#define igtlLegacyBodyMacro(method, version)   igtlWarningMacro(#method " was deprecated for IGTL " #version " and will be removed in a future version.")
#define igtlLegacyMacro(method)   method
#define igtlLegacyReplaceBodyMacro(method, version, replace)   igtlWarningMacro(#method " was deprecated for IGTL " #version " and will be removed in a future version. Use " #replace " instead.")
#define igtlLogMacro(x, y)
#define igtlLogMacroStatic(obj, x, y)
#define igtlNotUsed(x)
#define igtlStaticConstMacro(name, type, value)   static const type name = value
#define igtlSuperclassTraitMacro(traitnameType)   typedef typename Superclass::traitnameType traitnameType;
#define igtlTypeMacro(thisClass, superclass)
#define igtlSetInputMacro(name, type, number)
#define igtlGetInputMacro(name, type, number)
#define igtlSetDecoratedInputMacro(name, type, number)
#define igtlSetDecoratedObjectInputMacro(name, type, number)
#define igtlSetMacro(name, type)
#define igtlGetMacro(name, type)
#define igtlGetConstMacro(name, type)
#define igtlGetConstReferenceMacro(name, type)
#define igtlSetEnumMacro(name, type)
#define igtlGetEnumMacro(name, type)
#define igtlSetStringMacro(name)
#define igtlSetClampMacro(name, type, min, max)
#define igtlSetObjectMacro(name, type)
#define igtlGetObjectMacro(name, type)
#define igtlSetConstObjectMacro(name, type)
#define igtlGetConstObjectMacro(name, type)
#define igtlGetConstReferenceObjectMacro(name, type)
#define igtlBooleanMacro(name)
#define igtlSetVectorMacro(name, type, count)
#define igtlNewMacro(x)
#define igtlFactorylessNewMacro(x)
#define igtlDebugMacro(x)
#define igtlWarningMacro(x)

Define Documentation

#define IGTL_EMPTY

Definition at line 859 of file igtlMacro.h.

#define IGTL_EXPORT_IGTLCommon (   c,
  x,
 
)    IGTL_EXPORT_TEMPLATE(IGTLCommon_EXPORT, c, x, n)

Definition at line 906 of file igtlMacro.h.

#define IGTL_EXPORT_TEMPLATE (   EXPORT,
  c,
  x,
 
)    IGTL_TEMPLATE_##c(IGTL_TEMPLATE_EXPORT, EXPORT IGTL_EMPTY, x, y)

Definition at line 855 of file igtlMacro.h.

#define IGTL_IMPORT_IGTLCommon (   c,
  x,
 
)    IGTL_IMPORT_TEMPLATE(IGTLCommon_EXPORT, c, x, n)

Definition at line 908 of file igtlMacro.h.

#define IGTL_IMPORT_TEMPLATE (   EXPORT,
  c,
  x,
 
)    IGTL_TEMPLATE_##c(IGTL_TEMPLATE_IMPORT, EXPORT IGTL_EMPTY, x, y)

Definition at line 857 of file igtlMacro.h.

#define IGTL_LOCATION   "unknown"

Definition at line 609 of file igtlMacro.h.

#define IGTL_NO_RETURN

Definition at line 943 of file igtlMacro.h.

#define IGTL_TEMPLATE_1 (   x1)    x1

Definition at line 865 of file igtlMacro.h.

#define IGTL_TEMPLATE_2 (   x1,
  x2 
)    x1,x2

Definition at line 866 of file igtlMacro.h.

#define IGTL_TEMPLATE_3 (   x1,
  x2,
  x3 
)    x1,x2,x3

Definition at line 867 of file igtlMacro.h.

#define IGTL_TEMPLATE_4 (   x1,
  x2,
  x3,
  x4 
)    x1,x2,x3,x4

Definition at line 868 of file igtlMacro.h.

#define IGTL_TEMPLATE_5 (   x1,
  x2,
  x3,
  x4,
  x5 
)    x1,x2,x3,x4,x5

Definition at line 869 of file igtlMacro.h.

#define IGTL_TEMPLATE_6 (   x1,
  x2,
  x3,
  x4,
  x5,
  x6 
)    x1,x2,x3,x4,x5,x6

Definition at line 870 of file igtlMacro.h.

#define IGTL_TEMPLATE_7 (   x1,
  x2,
  x3,
  x4,
  x5,
  x6,
  x7 
)    x1,x2,x3,x4,x5,x6,x7

Definition at line 871 of file igtlMacro.h.

#define IGTL_TEMPLATE_8 (   x1,
  x2,
  x3,
  x4,
  x5,
  x6,
  x7,
  x8 
)    x1,x2,x3,x4,x5,x6,x7,x8

Definition at line 872 of file igtlMacro.h.

#define IGTL_TEMPLATE_9 (   x1,
  x2,
  x3,
  x4,
  x5,
  x6,
  x7,
  x8,
  x9 
)    x1,x2,x3,x4,x5,x6,x7,x8,x9

Definition at line 873 of file igtlMacro.h.

#define IGTL_TEMPLATE_DO_NOT_INSTANTIATE   0

Definition at line 757 of file igtlMacro.h.

#define IGTL_TEMPLATE_EXPLICIT   0

Definition at line 927 of file igtlMacro.h.

#define IGTL_TEMPLATE_EXPORT (   x)    IGTL_TEMPLATE_EXPORT_DELAY(x)

Definition at line 770 of file igtlMacro.h.

#define IGTL_TEMPLATE_EXPORT_DELAY (   x)    template IGTL_TEMPLATE_##x;

Definition at line 771 of file igtlMacro.h.

#define IGTL_TEMPLATE_EXTERN   0

Definition at line 760 of file igtlMacro.h.

#define IGTL_TEMPLATE_IMPORT (   x)

Definition at line 795 of file igtlMacro.h.

#define IGTL_TEMPLATE_IMPORT_WORKS   0

Definition at line 796 of file igtlMacro.h.

#define IGTL_TEMPLATE_TXX   !(IGTL_TEMPLATE_CXX || IGTL_TEMPLATE_TYPE)

Definition at line 886 of file igtlMacro.h.

#define igtlBooleanMacro (   name)
Value:
virtual void name##On () { this->Set##name(true);} \
  virtual void name##Off () { this->Set##name(false);}

Create members "name"On() and "name"Off() (e.g., DebugOn() DebugOff()). Set method must be defined to use this macro.

Definition at line 390 of file igtlMacro.h.

#define igtlDebugMacro (   x)
Value:
{ if (this->GetDebug() /*&& ::igtl::Object::GetGlobalWarningDisplay()*/)   \
    { ::igtl::OStringStream igtlmsg; \
      igtlmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n" \
             << this->GetNameOfClass() << " (" << this << "): " x  \
             << "\n\n"; \
      std::cerr << igtlmsg.str(); /*::igtl::OutputWindowDisplayDebugText(igtlmsg.str().c_str());*/} \
}

The following is used to output debug, warning, and error messages. Use a global function which actually calls: OutputWindow::GetInstance()->DisplayText(); This is to avoid Object #include of OutputWindow while OutputWindow #includes Object. This macro is used to print debug (or other information). They are also used to catch errors, etc. Example usage looks like: igtlDebugMacro(<< "this is debug info" << this->SomeVariable);

Definition at line 516 of file igtlMacro.h.

#define igtlErrorMacro (   x)
Value:
{ \
  ::igtl::OStringStream igtlmsg;                                 \
  igtlmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n" \
          << this->GetNameOfClass() << " (" << this << "): " x   \
          << "\n\n";                                             \
  std::cerr << igtlmsg.str(); /*::igtl::OutputWindowDisplayDebugText(igtlmsg.str().c_str());*/ \
}

Definition at line 621 of file igtlMacro.h.

#define igtlExceptionMacro (   x)
Value:
{ \
  ::igtl::OStringStream igtlmsg;                                 \
  igtlmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n" \
          << this->GetNameOfClass() << " (" << this << "): " x   \
          << "\n\n";                                             \
  std::cerr << igtlmsg.str(); /*::igtl::OutputWindowDisplayDebugText(igtlmsg.str().c_str());*/ \
}

Definition at line 612 of file igtlMacro.h.

#define igtlFactorylessNewMacro (   x)
Value:
static Pointer New(void) \
{ \
  Pointer smartPtr; \
  x *rawPtr = new x; \
  smartPtr = rawPtr; \
  rawPtr->UnRegister(); \
  return smartPtr; \
} \
  virtual ::igtl::LightObject::Pointer CreateAnother(void) const \
{ \
  ::igtl::LightObject::Pointer smartPtr;         \
  smartPtr = x::New().GetPointer(); \
  return smartPtr; \
}

Define two object creation methods. The first method, New(), creates an object from a class but does not defer to a factory. The second method, CreateAnother(), creates an object from an instance, again without deferring to a factory. This second method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

These creation methods first try asking the object factory to create an instance, and then default to the standard "new" operator if the factory fails.

These routines assigns the raw pointer to a smart pointer and then call UnRegister() on the rawPtr to compensate for LightObject's constructor initializing an object's reference count to 1 (needed for proper initialization of process objects and data objects cycles).

Definition at line 470 of file igtlMacro.h.

#define igtlGenericOutputMacro (   x)
Value:
{ if (1/*::igtl::Object::GetGlobalWarningDisplay()*/) \
    { ::igtl::OStringStream igtlmsg; \
      igtlmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \
             x << "\n\n"; \
      std::cerr << igtlmsg.str();/*::igtl::OutputWindowDisplayGenericOutputText(igtlmsg.str().c_str());*/} \
}

Definition at line 634 of file igtlMacro.h.

#define igtlGetConstMacro (   name,
  type 
)
Value:
virtual type Get##name () const \
  { \
    igtlDebugMacro("returning " << #name " of " << this->m_##name ); \
    return this->m_##name; \
  }

Get built-in type. Creates member Get"name"() (e.g., GetVisibility()); This is the "const" form of the igtlGetMacro. It should be used unless the member can be changed through the "Get" access routine.

Definition at line 236 of file igtlMacro.h.

#define igtlGetConstObjectMacro (   name,
  type 
)
Value:
virtual const type * Get##name () const \
  { \
    igtlDebugMacro("returning " #name " address " << this->m_##name ); \
    return this->m_##name.GetPointer(); \
  }

Get a smart const pointer to an object. Creates the member Get"name"() (e.g., GetPoints()).

Definition at line 370 of file igtlMacro.h.

#define igtlGetConstReferenceMacro (   name,
  type 
)
Value:
virtual const type & Get##name () const \
  { \
    igtlDebugMacro("returning " << #name " of " << this->m_##name ); \
    return this->m_##name; \
  }

Get built-in type. Creates member Get"name"() (e.g., GetVisibility()); This is the "const" form of the igtlGetMacro. It should be used unless the member can be changed through the "Get" access routine. This versions returns a const reference to the variable.

Definition at line 248 of file igtlMacro.h.

#define igtlGetConstReferenceObjectMacro (   name,
  type 
)
Value:
virtual const typename type::Pointer & Get##name () const \
  { \
    igtlDebugMacro("returning " #name " address " << this->m_##name ); \
    return this->m_##name; \
  }

Get a const reference to a smart pointer to an object. Creates the member Get"name"() (e.g., GetPoints()).

Definition at line 380 of file igtlMacro.h.

#define igtlGetEnumMacro (   name,
  type 
)
Value:
virtual type Get##name () const \
  { \
    igtlDebugMacro("returning " << #name " of " << static_cast<long>(this->m_##name) ); \
    return this->m_##name; \
  }

Get built-in type. Creates member Get"name"() (e.g., GetVisibility()); This should be use when the type is an enum. It is use to avoid warnings on some compilers with non specified enum types passed to igtlDebugMacro.

Definition at line 273 of file igtlMacro.h.

#define igtlGetInputMacro (   name,
  type,
  number 
)
Value:
virtual const type * Get##name##Input() const \
  { \
    igtlDebugMacro("returning input " << #name " of " << static_cast<const type *>(this->ProcessObject::GetInput( number )) ); \
    return static_cast<const type *>(this->ProcessObject::GetInput( number )); \
  } \
  virtual const type * GetInput##number() const \
  { \
    igtlDebugMacro("returning input " << #number " of " << static_cast<const type *>(this->ProcessObject::GetInput( number )) ); \
    return static_cast<const type *>(this->ProcessObject::GetInput( number )); \
  }

Get an input. This defines the Get"name"Input() method

Definition at line 153 of file igtlMacro.h.

#define igtlGetMacro (   name,
  type 
)
Value:
virtual type Get##name () \
  { \
    igtlDebugMacro("returning " << #name " of " << this->m_##name ); \
    return this->m_##name; \
  }

Get built-in type. Creates member Get"name"() (e.g., GetVisibility());

Definition at line 225 of file igtlMacro.h.

#define igtlGetObjectMacro (   name,
  type 
)
Value:
virtual type * Get##name () \
  { \
    igtlDebugMacro("returning " #name " address " << this->m_##name ); \
    return this->m_##name.GetPointer(); \
  }

Get a smart pointer to an object. Creates the member Get"name"() (e.g., GetPoints()).

Definition at line 344 of file igtlMacro.h.

#define igtlGetStaticConstMacro (   name)    (Self::name)

Definition at line 125 of file igtlMacro.h.

#define igtlGetStringMacro (   name)
Value:
virtual const char* Get##name () const \
  { \
    return this->m_##name.c_str(); \
  }

Get character string. Creates member Get"name"() (e.g., SetFilename(char *)). The macro assumes that the class member (name) is declared as a type std::string.

Definition at line 307 of file igtlMacro.h.

#define igtlGetVectorMacro (   name,
  type,
  count 
)
Value:
virtual type *Get##name () const \
  { \
    return this->m_##name; \
  }

Get vector macro. Returns pointer to type (i.e., array of type). This is for efficiency.

Definition at line 412 of file igtlMacro.h.

#define igtlLegacyBodyMacro (   method,
  version 
)    igtlWarningMacro(#method " was deprecated for IGTL " #version " and will be removed in a future version.")

Definition at line 727 of file igtlMacro.h.

#define igtlLegacyMacro (   method)    method

Definition at line 706 of file igtlMacro.h.

#define igtlLegacyReplaceBodyMacro (   method,
  version,
  replace 
)    igtlWarningMacro(#method " was deprecated for IGTL " #version " and will be removed in a future version. Use " #replace " instead.")

Definition at line 729 of file igtlMacro.h.

#define igtlLogMacro (   x,
 
)
Value:
{         \
  if (this->GetLogger() ) \
    {  \
    this->GetLogger()->Write(::igtl::LoggerBase::x, y); \
    }  \
}

Definition at line 648 of file igtlMacro.h.

#define igtlLogMacroStatic (   obj,
  x,
 
)
Value:
{         \
  if (obj->GetLogger() ) \
    {  \
    obj->GetLogger()->Write(::igtl::LoggerBase::x, y); \
    }  \
}

Definition at line 657 of file igtlMacro.h.

#define igtlNewMacro (   x)
Value:
static Pointer New(void) \
{ \
  Pointer smartPtr = ::igtl::ObjectFactory<x>::Create(); \
  if(smartPtr.GetPointer() == NULL) \
    { \
    smartPtr = new x; \
    } \
  smartPtr->UnRegister(); \
  return smartPtr; \
} \
virtual ::igtl::LightObject::Pointer CreateAnother(void) const \
{ \
  ::igtl::LightObject::Pointer smartPtr; \
  smartPtr = x::New().GetPointer(); \
  return smartPtr; \
}

Define two object creation methods. The first method, New(), creates an object from a class, potentially deferring to a factory. The second method, CreateAnother(), creates an object from an instance, potentially deferring to a factory. This second method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

These creation methods first try asking the object factory to create an instance, and then default to the standard "new" operator if the factory fails.

These routines assigns the raw pointer to a smart pointer and then call UnRegister() on the rawPtr to compensate for LightObject's constructor initializing an object's reference count to 1 (needed for proper initialization of process objects and data objects cycles).

Definition at line 434 of file igtlMacro.h.

#define igtlNotUsed (   x)

A convenience macro marks variables as not being used by a method, avoiding compile-time warnings.

Definition at line 74 of file igtlMacro.h.

#define igtlSetClampMacro (   name,
  type,
  min,
  max 
)
Value:
virtual void Set##name (type _arg) \
  { \
    igtlDebugMacro("setting " << #name " to " << _arg ); \
    if (this->m_##name != (_arg<min?min:(_arg>max?max:_arg))) \
      { \
      this->m_##name = (_arg<min?min:(_arg>max?max:_arg)); \
      } \
  }

Set built-in type where value is constrained between min/max limits. Create member Set"name"() (e.q., SetRadius()). #defines are convienience for clamping open-ended values.

Definition at line 316 of file igtlMacro.h.

#define igtlSetConstObjectMacro (   name,
  type 
)
Value:
virtual void Set##name (const type* _arg) \
  { \
    igtlDebugMacro("setting " << #name " to " << _arg ); \
    if (this->m_##name != _arg) \
      { \
      this->m_##name = _arg; \
      } \
  }

Set const pointer to object; uses Object reference counting methodology. Creates method Set"name"() (e.g., SetPoints()). Note that using smart pointers requires using real pointers when setting input, but returning smart pointers on output.

Definition at line 356 of file igtlMacro.h.

#define igtlSetDecoratedInputMacro (   name,
  type,
  number 
)
Value:
igtlSetInputMacro(name, SimpleDataObjectDecorator<type>, number); \
  igtlGetInputMacro(name, SimpleDataObjectDecorator<type>, number); \
  virtual void Set##name(const type &_arg) \
  { \
    typedef SimpleDataObjectDecorator< type > DecoratorType; \
    igtlDebugMacro("setting input " #name " to " << _arg); \
    const DecoratorType * oldInput = \
      static_cast< const DecoratorType * >( \
        this->ProcessObject::GetInput(number) ); \
    if( oldInput && oldInput->Get() == _arg ) \
      { \
      return; \
      } \
    typename DecoratorType::Pointer newInput = DecoratorType::New(); \
    newInput->Set( _arg ); \
    this->Set##name##Input( newInput ); \
  }

Set a decorated input. This defines the Set"name"() method. It invokes SetInputMacro() and GetInputMacro() for the decorated object

Definition at line 168 of file igtlMacro.h.

#define igtlSetDecoratedObjectInputMacro (   name,
  type,
  number 
)
Value:
igtlSetInputMacro(name, DataObjectDecorator<type>, number); \
  igtlGetInputMacro(name, DataObjectDecorator<type>, number); \
  virtual void Set##name(const type *_arg) \
  { \
    typedef DataObjectDecorator< type > DecoratorType; \
    igtlDebugMacro("setting input " #name " to " << _arg); \
    const DecoratorType * oldInput = \
      static_cast< const DecoratorType * >( \
        this->ProcessObject::GetInput(number) ); \
    if( oldInput && oldInput->Get() == _arg ) \
      { \
      return; \
      } \
    typename DecoratorType::Pointer newInput = DecoratorType::New(); \
    newInput->Set( _arg ); \
    this->Set##name##Input( newInput ); \
  }

Set a decorated input that derives from igtl::Object, but not from igtl::DataObject. This defines the Set"name"() method. It invokes SetInputMacro() and GetInputMacro() for the decorated object

Definition at line 191 of file igtlMacro.h.

#define igtlSetEnumMacro (   name,
  type 
)
Value:
virtual void Set##name (const type _arg) \
  { \
    igtlDebugMacro("setting " #name " to " << static_cast<long>(_arg)); \
    if (this->m_##name != _arg) \
      { \
      this->m_##name = _arg; \
      } \
  }

Set built-in type. Creates member Set"name"() (e.g., SetVisibility()); This should be use when the type is an enum. It is use to avoid warnings on some compilers with non specified enum types passed to igtlDebugMacro.

Definition at line 259 of file igtlMacro.h.

#define igtlSetInputMacro (   name,
  type,
  number 
)
Value:
virtual void Set##name##Input(const type *_arg) \
  { \
    igtlDebugMacro("setting input " #name " to " << _arg); \
    if (_arg != static_cast<type *>(this->ProcessObject::GetInput( number ))) \
      { \
      this->ProcessObject::SetNthInput( number, const_cast<type *>(_arg) ); \
      } \
  } \
  virtual void SetInput##number(const type *_arg) \
  { \
    igtlDebugMacro("setting input " #number " to " << _arg); \
    if (_arg != static_cast<type *>(this->ProcessObject::GetInput( number ))) \
      { \
      this->ProcessObject::SetNthInput( number, const_cast<type *>(_arg) ); \
      } \
  }

Set an input. This defines the Set"name"Input() method

Definition at line 129 of file igtlMacro.h.

#define igtlSetMacro (   name,
  type 
)
Value:
virtual void Set##name (const type _arg) \
  { \
    igtlDebugMacro("setting " #name " to " << _arg); \
    if (this->m_##name != _arg) \
      { \
      this->m_##name = _arg; \
      } \
  }

Set built-in type. Creates member Set"name"() (e.g., SetVisibility());

Definition at line 213 of file igtlMacro.h.

#define igtlSetObjectMacro (   name,
  type 
)
Value:
virtual void Set##name (type* _arg) \
  { \
    igtlDebugMacro("setting " << #name " to " << _arg ); \
    if (this->m_##name != _arg) \
      { \
      this->m_##name = _arg; \
      } \
  }

Set pointer to object; uses Object reference counting methodology. Creates method Set"name"() (e.g., SetPoints()). Note that using smart pointers requires using real pointers when setting input, but returning smart pointers on output.

Definition at line 331 of file igtlMacro.h.

#define igtlSetStringMacro (   name)
Value:
virtual void Set##name (const char* _arg) \
  { \
    if ( _arg && (_arg == this->m_##name) ) { return;} \
    if (_arg) \
      { \
      this->m_##name = _arg;\
      } \
     else \
      { \
      this->m_##name = ""; \
      } \
  } \
  virtual void Set##name (const std::string & _arg) \
  { \
    this->Set##name( _arg.c_str() ); \
  } \

Set character string. Creates member Set"name"() (e.g., SetFilename(char *)). The macro assumes that the class member (name) is declared a type std::string.

Definition at line 284 of file igtlMacro.h.

#define igtlSetVectorMacro (   name,
  type,
  count 
)
Value:
virtual void Set##name(type data[]) \
  { \
    unsigned int i; \
    for (i=0; i<count; i++) { if ( data[i] != this->m_##name[i] ) { break; }} \
    if ( i < count ) \
      { \
      for (i=0; i<count; i++) { this->m_##name[i] = data[i]; }\
      } \
  }

General set vector macro creates a single method that copies specified number of values into object. Examples: void SetColor(c,3)

Definition at line 398 of file igtlMacro.h.

#define igtlStaticConstMacro (   name,
  type,
  value 
)    static const type name = value

Macro to initialize static constants. This is used frequently to replace the use of enum's within a class. Some compilers do not allow an enum of one class to be passed as template argument to another class. Other uses of this macro as possible.

This is based (verbatim) on the BOOST_STATIC_CONSTANT macro. The original Boost documentation is below.

BOOST_STATIC_CONSTANT workaround --------------------------------------- // On compilers which don't allow in-class initialization of static integral constant members, we must use enums as a workaround if we want the constants to be available at compile-time. This macro gives us a convenient way to declare such constants.

Definition at line 119 of file igtlMacro.h.

#define igtlSuperclassTraitMacro (   traitnameType)    typedef typename Superclass::traitnameType traitnameType;

Macro used to redefine a type from the superclass.

Definition at line 149 of file igtlMacro.h.

#define igtlTypeMacro (   thisClass,
  superclass 
)
Value:
virtual const char *GetNameOfClass() const \
        {return #thisClass;}

Macro used to add standard methods to all classes, mainly type information.

Definition at line 489 of file igtlMacro.h.

#define igtlWarningMacro (   x)
Value:
{ if ( 1/*::igtl::Object::GetGlobalWarningDisplay()*/)  \
    { ::igtl::OStringStream igtlmsg; \
      igtlmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \
             << this->GetNameOfClass() << " (" << this << "): " x  \
             << "\n\n"; \
      std::cerr << igtlmsg.str(); /*::igtl::OutputWindowDisplayWarningText(igtlmsg.str().c_str());*/} \
}

This macro is used to print warning information (i.e., unusual circumstance but not necessarily fatal.) Example usage looks like: igtlWarningMacro(<< "this is warning info" << this->SomeVariable);

Definition at line 534 of file igtlMacro.h.


Generated at Mon May 2 2011 03:56:13 for OpenIGTLink by doxygen 1.7.3 written by Dimitri van Heesch, © 1997-2000