[Insight-developers] problems in itkFilterMeshToMesh

Ting Chen chenting@graphics.cis.upenn.edu
Tue, 9 Jan 2001 20:37:18 -0600


I am try to build a Filter class derive from the class itkFilterMeshToMesh.
but when I complie the code, I got the following error message:
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(32) : error C2995:
'FilterMeshToMesh<TInputMesh,TOutputMesh>::FilterMeshToMesh<TInputMesh,TOutp
utMesh>' : template function has already been defined
        d:\insight\insight\code\common\itkfiltermeshtomesh.h(78) : see
declaration of
'FilterMeshToMesh<TInputMesh,TOutputMesh>::FilterMeshToMesh<TInputMesh,TOutp
utMesh>'
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(44) : error C2995:
'SetInput' : template function has already been defined
        d:\insight\insight\code\common\itkfiltermeshtomesh.h(69) : see
declaration of 'SetInput'
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(62) : error C2995:
'GetInput' : template function has already been defined
        d:\insight\insight\code\common\itkfiltermeshtomesh.h(74) : see
declaration of 'GetInput'
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(75) : error C2995:
'GetInput' : template function has already been defined
        d:\insight\insight\code\common\itkfiltermeshtomesh.h(75) : see
declaration of 'GetInput'
d:\insight\insight\code\common\itkfiltermeshtomesh.txx(87) : error C2995:
'PrintSelf' : template function has already been defined
        d:\insight\insight\code\common\itkfiltermeshtomesh.h(82) : see
declaration of 'PrintSelf'

The code in itkFilterMeshToMesh.h (use SetInput as example):
  typedef TInputMesh InputMeshType;
  typedef typename InputMeshType::Pointer InputMeshPointer;

  /**
   * Set the mesh input of this process object.
   */
  void SetInput(InputMeshType *input);


itkFilterMeshToMesh.txx :
template <class TInputMesh, class TOutputMesh>
void
FilterMeshToMesh<TInputMesh,TOutputMesh>
::SetInput(TInputMesh *input)
{
  this->ProcessObject::SetNthInput(0, input);
}

It seems the complier think InputMeshType and TInputMesh are different.
So how to solve the problem?

Another question is: did any anybody try to include vnl_matrix object in
their class? I always got error messages when I tried to do so.