Orfeo Toolbox  3.16
Classes | Namespaces | Macros
itkFEMMacro.h File Reference

Definitions of macros used in FEM code. More...

Go to the source code of this file.

Classes

class  itk::fem::INITClass
 Class that is used in FEM_CLASS_INIT macro. More...

Namespaces

namespace  itk
 Hashtable class, used to implement the hashed associative containers itk_hash_set, itk_hash_map, itk_hash_multiset, and itk_hash_multimap.
namespace  itk::fem
 Contains finite element modeling (FEM) classes and support routines.

Macros

#define FEM_ABSTRACT_CLASS(thisClass, parentClass)
 If defined, FEM classes will use smart pointers.
#define FEM_CLASS(thisClass, parentClass)
 Defines typedefs for pointers to class.
#define FEM_CLASS_INIT(thisClass)   static INITClass Initializer_##thisClass(thisClass::CLID());
 Perform any initialization tasks for a class.
#define FEM_CLASS_REGISTER(thisClass)
 Register the specified class with FEMObjectFactory.

Detailed Description

Definitions of macros used in FEM code.

itkFEMMacro.h defines macros that allow simple and consistent FEM code creation. Use these macros whenever posible (always)!

Definition in file itkFEMMacro.h.


Macro Definition Documentation

#define FEM_ABSTRACT_CLASS (   thisClass,
  parentClass 
)
Value:
public: \ \
typedef thisClass Self; \ \
typedef parentClass Superclass; \ \
typedef Self* Pointer; \ \
typedef const Self* ConstPointer; \
private:

If defined, FEM classes will use smart pointers.

Define this macro if you want to compile the FEM classes so that they use itk's SmartPointer object instead of standard c++ pointers. If defined, FEM classes will include routines for drawing on the device context.

Define this macro if you want to compile the FEM Element and Node classes so that they include Draw() virtual member function. Calling this function draws the element or node on the specified windows device context.

Note:
This only works on Windows systems and requires MFC classes. If you need to define this macro, make sure that you define it both when compiling the FEM library as well as when you're using it, because class declarations depend on it.
See also:
Element::Draw() This must be included before itk includes windows.h, otherwise nobody can ever use MFC again. Including it here also ensures that all FEM classes that require MFC, automatically get it, as long as they include this file.

Defines typedefs for pointers to class.

This macro should be called immediately after the { in class declaration. It defines Self, Superclass, Pointer and ConstPointer typedef members in a class. It also includes all the necessary typedefs for compatibility when SmartPointer classes are used (itkTypeMacro).

Parameters:
thisClassName of the class that is being declared.
parentClassName of the class from which the current class is being derived. If this is the base class that is not derived from anything, let parentClass=thisClass.
Note:
Use this macro only for abstract classes that can't be instantiated. Otherwise use FEM_CLASS macro.

Definition at line 97 of file itkFEMMacro.h.

#define FEM_CLASS (   thisClass,
  parentClass 
)
Value:
/* Pointers.... */ \
FEM_ABSTRACT_CLASS(thisClass,parentClass) \
public: \ \
virtual Baseclass::Pointer Clone() const \
{ return new Self(*this); } \ \
static Pointer New() \
{ return new Self(); } \ \
static Baseclass::Pointer NewB() \
{ return New(); } \ \
static int CLID(void); \ \
virtual int ClassID() const \
{ return CLID(); } \
private:

Defines typedefs for pointers to class.

This macro should be called immediately after the { in class declaration. It first calls the FEM_ABSTRACT_CLASS macro. In addition it defines the Clone() function, CLID member that holds the class ID for FEMObjectFactory. Also, the New() static member is defined, as required, for compatibility with SmartPointer classes (itkNewMacro is called).

Parameters:
thisClassName of the class that is being declared.
parentClassName of the class from which the current class is being derived.
Note:
Macro assumes that the Baseclass typedef is already present and specifies the base class from which the current class is derived. The Baseclass typedef is used as a return value of a Clone() function.

Definition at line 145 of file itkFEMMacro.h.

#define FEM_CLASS_INIT (   thisClass)    static INITClass Initializer_##thisClass(thisClass::CLID());

Perform any initialization tasks for a class.

This macro creates a static object of INITClass class that references thisClass::CLID static member in a constructor. This insures that any initialization code for CLID is always executed, and thisClass is properly registered with FEMObjectFactory.

Parameters:
thisClassName of the class that needs to be initialized.
Note:
Call this macro in .h file after class declaration and within itk::fem namespace.

Definition at line 248 of file itkFEMMacro.h.

#define FEM_CLASS_REGISTER (   thisClass)
Value:
int thisClass::CLID(void) \
{ static const int CLID_ = FEMObjectFactory<thisClass::Baseclass>::Register( thisClass::NewB, #thisClass); \
return CLID_; }

Register the specified class with FEMObjectFactory.

Registering is required for every class that the object factory will later be able to create. The class must contain static const int member CLID and must define or inherit Baseclass typedef. This is automatic if FEM_CLASS macro was used when declaring a class. CLID is initialized to a value assigned by the FEMObjectFactory.

This macro provides the definition for CLID static member function of a class. This function can't be defined inline.

Parameters:
thisClassName of the class that needs to be registered with FEMObjectFactory.
Note:
Call this macro after the class definition is complete in .cxx file but still within itk::fem namespace.

Definition at line 207 of file itkFEMMacro.h.


Generated at Sun Feb 3 2013 00:59:38 for Orfeo Toolbox with doxygen 1.8.1.1