Hi,

I'm wondering about Object::CreateAnother vs. Object::Clone.
CreateAnother seems to be for creating an instance of a class from an
existing instance, without having to know the exact type, and *without*
copying the state of the existing instance. And Clone is for creating an
instance *with* copying the state.

But poking around a bit, I see the FEM module seems to use CreateAnother
like Clone.Otherwise the only place I see CreateAnother reimplemented is
in itkBSplineDeformableTransform.h, where the comment says maybe Clone
should be used. Is that a mistake, or am I missing something?

e.g.

Modules/Numerics/FEM/include/itkFEMElement2DC0LinearLineStress:49:

  /** CreateAnother method will clone the existing instance of this
type,
   * including its internal member variables. */
  virtual::itk::LightObject::Pointer CreateAnother(void) const;

and the implementation does clone the state.

Thanks,
Michael

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-developers

Reply via email to