![]() |
Orfeo Toolbox
3.16
|
Base class for all classes that define the FEM system. More...
#include <itkFEMLightObject.h>
Inheritance diagram for itk::fem::FEMLightObject:
Collaboration diagram for itk::fem::FEMLightObject:Public Types | |
| typedef Self | Baseclass |
| typedef const Self * | ConstPointer |
| typedef Self * | Pointer |
| typedef FEMLightObject | Self |
| typedef FEMLightObject | Superclass |
Public Member Functions | |
| FEMLightObject () | |
| FEMLightObject (const FEMLightObject &o) | |
| virtual | ~FEMLightObject () |
| virtual int | ClassID () const =0 |
| virtual Baseclass::Pointer | Clone () const =0 |
| virtual void | Read (std::istream &f, void *info) |
| virtual void | Write (std::ostream &f) const |
Static Public Member Functions | |
| static FEMLightObject::Pointer | CreateFromStream (std::istream &f, void *info) |
| static void | SkipWhiteSpace (std::istream &f) |
Public Attributes | |
| int | GN |
Static Public Attributes | |
| static const std::string | whitespaces =" \t\n\r" |
Base class for all classes that define the FEM system.
Base class for all classes that define FEM system (Elements, Nodes...). Every FEM object requires a global number that can be used to find that object. It is also required that the object can be written to and read from a file (stream). This functionality is implemented inside FEMLightObject class.
Definition at line 38 of file itkFEMLightObject.h.
Store the base class typedef for easy access from derived classes. FEM_CLASS macro also expects this for the FEMOF...
Definition at line 62 of file itkFEMLightObject.h.
| typedef const Self* itk::fem::FEMLightObject::ConstPointer |
Const pointer or SmartPointer to an object.
Definition at line 49 of file itkFEMLightObject.h.
| typedef Self* itk::fem::FEMLightObject::Pointer |
Pointer or SmartPointer to an object.
Definition at line 49 of file itkFEMLightObject.h.
If we're not using smart pointers then we make the the Superclass equal to FEMLightObject, just to be able to use the FEM_ABSTRACT_CLASS macro.Standard Self typedef.
Definition at line 49 of file itkFEMLightObject.h.
Standard Superclass typedef.
Definition at line 49 of file itkFEMLightObject.h.
|
inline |
Default constructor
Definition at line 142 of file itkFEMLightObject.h.
|
inlinevirtual |
Virtual destructor
Definition at line 147 of file itkFEMLightObject.h.
|
inline |
Copy constructor must be available for the FEM objects...
Definition at line 152 of file itkFEMLightObject.h.
References GN.
|
pure virtual |
Returns the class ID of the object. This function is used to determine the class of the object without having to use the dynamic_cast operator.
Implemented in itk::fem::Element::Node, itk::fem::ImageMetricLoad< TMoving, TFixed >, itk::fem::FiniteDifferenceFunctionLoad< TMoving, TFixed >, itk::fem::LoadGravConst, itk::fem::LoadBCMFC, itk::fem::LoadElement, itk::fem::LoadEdge, itk::fem::LoadNode, itk::fem::LoadTest< TClass >, itk::fem::Element2DC0LinearTriangularMembrane, itk::fem::Element2DC0LinearTriangularStrain, itk::fem::Element2DC0LinearTriangularStress, itk::fem::Element2DC0QuadraticTriangularStrain, itk::fem::Element2DC0QuadraticTriangularStress, itk::fem::Element2DC1Beam, itk::fem::LoadLandmark, itk::fem::MaterialLinearElasticity, itk::fem::LoadPoint, itk::fem::Element2DC0LinearLineStress, itk::fem::Element2DC0LinearQuadrilateralMembrane, itk::fem::Element2DC0LinearQuadrilateralStrain, itk::fem::Element2DC0LinearQuadrilateralStress, itk::fem::Element3DC0LinearHexahedronMembrane, itk::fem::Element3DC0LinearHexahedronStrain, itk::fem::Element3DC0LinearTetrahedronMembrane, itk::fem::Element3DC0LinearTetrahedronStrain, and itk::fem::LoadBC.
Referenced by Write().
|
pure virtual |
Duplicates the currect object. This function must be implemented by every derived class to create an exact copy of an object. The function returns a pointer to a base class.
Implemented in itk::fem::Element::Node, itk::fem::ImageMetricLoad< TMoving, TFixed >, itk::fem::FiniteDifferenceFunctionLoad< TMoving, TFixed >, itk::fem::LoadGravConst, itk::fem::LoadBCMFC, itk::fem::LoadElement, itk::fem::LoadEdge, itk::fem::LoadNode, itk::fem::LoadTest< TClass >, itk::fem::Element2DC0LinearTriangularMembrane, itk::fem::Element2DC0LinearTriangularStrain, itk::fem::Element2DC0LinearTriangularStress, itk::fem::Element2DC0QuadraticTriangularStrain, itk::fem::Element2DC0QuadraticTriangularStress, itk::fem::Element2DC1Beam, itk::fem::LoadLandmark, itk::fem::MaterialLinearElasticity, itk::fem::LoadPoint, itk::fem::Element2DC0LinearLineStress, itk::fem::Element2DC0LinearQuadrilateralMembrane, itk::fem::Element2DC0LinearQuadrilateralStrain, itk::fem::Element2DC0LinearQuadrilateralStress, itk::fem::Element3DC0LinearHexahedronMembrane, itk::fem::Element3DC0LinearHexahedronStrain, itk::fem::Element3DC0LinearTetrahedronMembrane, itk::fem::Element3DC0LinearTetrahedronStrain, and itk::fem::LoadBC.
Referenced by itk::fem::Generate2DRectilinearMesh(), and itk::fem::Generate3DRectilinearMesh().
|
static |
Read object of any derived type from stream.
This static function creates an object of a class, which is derived from FEMLightObject. The class of object is first determined from the stream, then the object of that class is constructed using the FEMObjectFactory. Finally the data for this object is read from the stream, by calling the Read() member function.
Read and create object of any derived class from stream
Catch possible exceptions while reading object's data from stream
Return a pointer to a newly created object if all was OK Technically everithing should be fine here (a!=0), but we check again, just in case.
Something went wrong. Reset the stream position to where it was before reading the object.
Definition at line 77 of file itkFEMLightObject.cxx.
References itk::fem::FEMObjectFactory< FEMLightObject >::ClassName2ID(), itk::fem::FEMObjectFactory< FEMLightObject >::Create(), Read(), SkipWhiteSpace(), and whitespaces.
Referenced by itk::fem::Solver::Read().
|
virtual |
Read an object data from input stream. Call this member to initialize the data members in the current object by reading data from provided input stream. Derived classes should first call the the parent's read function, to initialize the data from parent. Note that you must manually create the object of desired type using the FEMObjectFactory before you can call read function (this is pretty obvious). In this class only the global number is read from file. Derived classes may require some additional info in order to perform the reading. Pack this info in an object and pass a pointer to it in the info parameter. If you need runtime typechecking, use a polymorphic class and dynamic_cast operator inside the implementation of Read.
Here we just read the global number from the stream. This should be the first function called when reading object data.
Read and set the global object number
Reimplemented in itk::fem::Element::Node, itk::fem::LoadLandmark, itk::fem::ElementStd< 3, 2 >, itk::fem::ElementStd< 2, 2 >, itk::fem::ElementStd< 8, 3 >, itk::fem::ElementStd< 6, 2 >, itk::fem::ElementStd< 4, 3 >, itk::fem::ElementStd< 4, 2 >, itk::fem::LoadBCMFC, itk::fem::LoadGravConst, itk::fem::LoadBC, itk::fem::Element2DC1Beam, itk::fem::LoadElement, itk::fem::Element1DStress< Element2DC0LinearLine >, itk::fem::Element2DMembrane< Element2DC0LinearQuadrilateral >, itk::fem::Element2DMembrane< Element2DC0LinearTriangular >, itk::fem::Element2DStrain< Element2DC0QuadraticTriangular >, itk::fem::Element2DStrain< Element2DC0LinearQuadrilateral >, itk::fem::Element2DStrain< Element2DC0LinearTriangular >, itk::fem::Element2DStress< Element2DC0QuadraticTriangular >, itk::fem::Element2DStress< Element2DC0LinearQuadrilateral >, itk::fem::Element2DStress< Element2DC0LinearTriangular >, itk::fem::Element3DMembrane< Element3DC0LinearHexahedron >, itk::fem::Element3DMembrane< Element3DC0LinearTetrahedron >, itk::fem::Element3DStrain< Element3DC0LinearHexahedron >, itk::fem::Element3DStrain< Element3DC0LinearTetrahedron >, itk::fem::LoadTest< TClass >, itk::fem::LoadNode, itk::fem::LoadEdge, and itk::fem::MaterialLinearElasticity.
Definition at line 33 of file itkFEMLightObject.cxx.
References GN, and SkipWhiteSpace().
Referenced by CreateFromStream(), itk::fem::MaterialLinearElasticity::Read(), itk::fem::LoadNode::Read(), itk::fem::LoadElement::Read(), itk::fem::LoadBC::Read(), itk::fem::LoadBCMFC::Read(), and itk::fem::Element::Node::Read().
|
static |
Helper function that skips all the whitespace and comments in an input stream.
Definition at line 189 of file itkFEMLightObject.cxx.
Referenced by CreateFromStream(), itk::fem::MaterialLinearElasticity::Read(), itk::fem::LoadEdge::Read(), itk::fem::LoadNode::Read(), itk::fem::LoadElement::Read(), itk::fem::LoadBC::Read(), itk::fem::LoadGravConst::Read(), Read(), itk::fem::LoadBCMFC::Read(), itk::fem::LoadLandmark::Read(), itk::fem::Element::Node::Read(), and itk::fem::FEMRegistrationFilter< TMovingImage, TFixedImage >::ReadConfigFile().
|
virtual |
Write an object to the output stream. Call this member to write the data members in the current object to the output stream. Here we also need to know which derived class we actually are, so that we can write the class name. The class name is obtained by calling the virtual ClassID() member function and passing the result to the FEMObjectFactory.
Implementations of Write member funtion in derived classes should first call the parent's implementation of Write and finaly write whatever they need.
Here we just write the class name and GN. This should be the first function called when writing object data, so every derived class should first call the parent's write function. The Write function in base (this one) class knows which class is being written by calling the virtual ClassID() function and can write the class name properly.
Reimplemented in itk::fem::Element::Node, itk::fem::LoadLandmark, itk::fem::ElementStd< 3, 2 >, itk::fem::ElementStd< 2, 2 >, itk::fem::ElementStd< 8, 3 >, itk::fem::ElementStd< 6, 2 >, itk::fem::ElementStd< 4, 3 >, itk::fem::ElementStd< 4, 2 >, itk::fem::LoadBCMFC, itk::fem::LoadGravConst, itk::fem::LoadBC, itk::fem::Element2DC1Beam, itk::fem::Element1DStress< Element2DC0LinearLine >, itk::fem::Element2DMembrane< Element2DC0LinearQuadrilateral >, itk::fem::Element2DMembrane< Element2DC0LinearTriangular >, itk::fem::Element2DStrain< Element2DC0QuadraticTriangular >, itk::fem::Element2DStrain< Element2DC0LinearQuadrilateral >, itk::fem::Element2DStrain< Element2DC0LinearTriangular >, itk::fem::Element2DStress< Element2DC0QuadraticTriangular >, itk::fem::Element2DStress< Element2DC0LinearQuadrilateral >, itk::fem::Element2DStress< Element2DC0LinearTriangular >, itk::fem::Element3DMembrane< Element3DC0LinearHexahedron >, itk::fem::Element3DMembrane< Element3DC0LinearTetrahedron >, itk::fem::Element3DStrain< Element3DC0LinearHexahedron >, itk::fem::Element3DStrain< Element3DC0LinearTetrahedron >, itk::fem::LoadElement, itk::fem::LoadTest< TClass >, itk::fem::LoadNode, itk::fem::LoadEdge, and itk::fem::MaterialLinearElasticity.
Definition at line 57 of file itkFEMLightObject.cxx.
Referenced by itk::fem::MaterialLinearElasticity::Write(), itk::fem::LoadNode::Write(), itk::fem::LoadElement::Write(), itk::fem::LoadBC::Write(), itk::fem::LoadBCMFC::Write(), and itk::fem::Element::Node::Write().
| int itk::fem::FEMLightObject::GN |
Global number of an object (ID of an object) In general the ID's are required to be unique only within a specific type of derived classes (Elements, Nodes, ...) If the GN is not required, it can be ignored. (normally you need the GN when writing or reading objects to/from stream.
Definition at line 163 of file itkFEMLightObject.h.
Referenced by FEMLightObject(), itk::fem::Generate2DRectilinearMesh(), itk::fem::Generate3DRectilinearMesh(), Read(), itk::fem::LoadNode::Write(), itk::fem::LoadBC::Write(), and Write().
|
static |
Const string of all whitespace characters. This string is used by SkipWhiteSpace function.
Definition at line 133 of file itkFEMLightObject.h.
Referenced by CreateFromStream(), and itk::fem::MaterialLinearElasticity::Read().