[Paraview] TransformFilter problems

Paul Edwards paul.m.edwards at gmail.com
Tue Jun 10 10:29:18 EDT 2008


All I do is set the transform in the constructor and I just want to
use a transform as a filter....

I must be doing something wrong as I just realised that I was not
freeing the vtkCylindricalTransform - now I also get a seg fault after
the warning:

8<---------------------------------------------------
Warning: In /home/paul/workspace/ParaView3/VTK/Filtering/vtkDataObject.cxx,
line 908
vtkMultiBlockDataSet (0x17371a0): Attempted to ShallowCopy from null.


ERROR: In /home/paul/workspace/ParaView3/VTK/Common/vtkObject.cxx, line 160
vtkObject (0x41de550): Trying to delete object with non-zero reference count.


Generic Warning: In
/home/paul/workspace/ParaView3/VTK/Common/vtkObjectBase.cxx, line 76
Trying to delete object with non-zero reference count.


Segmentation fault
--------------------------------------------------->8

Here is the code:

8<---------------------------------------------------
#ifndef __vtkXYZTransformFilter_h
#define __vtkXYZTransformFilter_h

#include "vtkTransformFilter.h"

class vtkCylindricalTransform;

class VTK_EXPORT vtkXYZTransformFilter : public vtkTransformFilter
{
public:
  static vtkXYZTransformFilter* New();
  vtkTypeRevisionMacro(vtkXYZTransformFilter, vtkTransformFilter);
  void PrintSelf(ostream& os, vtkIndent indent);

protected:
  vtkXYZTransformFilter();
  ~vtkXYZTransformFilter();

private:
  vtkXYZTransformFilter(const vtkXYZTransformFilter&);  // Not implemented.
  void operator=(const vtkXYZTransformFilter&);  // Not implemented.

  vtkCylindricalTransform* Transform;
};

#endif
--------------------------------------------------->8

... and source ...

8<---------------------------------------------------
#include "vtkXYZTransformFilter.h"

#include "vtkObjectFactory.h"
#include "vtkTransform.h"
#include "vtkCylindricalTransform.h"

vtkCxxRevisionMacro(vtkXYZTransformFilter, "$Revision: 0.1 $");
vtkStandardNewMacro(vtkXYZTransformFilter);

vtkXYZTransformFilter::vtkXYZTransformFilter()
{
	this->Transform = vtkCylindricalTransform::New();
	this->SetTransform(this->Transform);
}

vtkXYZTransformFilter::~vtkXYZTransformFilter()
{
	delete Transform;
}

void vtkXYZTransformFilter::PrintSelf(ostream& os, vtkIndent indent)
{
  this->Superclass::PrintSelf(os,indent);
}
--------------------------------------------------->8


2008/6/10 Berk Geveci <berk.geveci at kitware.com>:
> Can you post the source code for the transform filter? It is somehow
> failing (returning 0) during RequestDataObject() (which may be in the
> superclass). Do you have that method implemented by any chance?
>
> -berk
>
> On Tue, Jun 10, 2008 at 8:06 AM, Paul Edwards <paul.m.edwards at gmail.com> wrote:
>> I am trying to use a subclass of TransformFilter in one other Filters
>> (subclass of vtkMultiBlockDataSetAlgorithm) in the RequestData method.
>>  The RequestData looks like this:
>>
>> 8<----------------------------------------------------------
>> int vtkFilter::RequestData(vtkInformation* info,
>>                vtkInformationVector** vector,
>>                vtkInformationVector* outputVector)
>> {
>>        vtkInformation* outInfo = outputVector->GetInformationObject(0);
>>        vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::SafeDownCast(
>>            outInfo0->Get(vtkMultiBlockDataSet::DATA_OBJECT()));
>>
>>        vtkSmartPointer<vtkMyMultiBlockDataSetReader> reader =
>> vtkSmartPointer<vtkMyMultiBlockDataSetReader>::New();
>>        // setup reader here...
>>        // .....
>>        vtkSmartPointer<vtkXYZTransformFilter> transform =
>> vtkSmartPointer<vtkXYZTransformFilter>::New();
>>        transform->SetInput(reader->GetOutput());
>>        transform->Update();
>>        output->ShallowCopy(transform->GetOutput());
>>        return 1;
>> }
>> ---------------------------------------------------------->8
>>
>> This filter above will work without the transform and the transform
>> works as a filter in paraview but when I have it as above I get the
>> following error:
>>
>> 8<----------------------------------------------------------
>> ERROR: In /home/paul/workspace/ParaView3/VTK/Filtering/vtkExecutive.cxx,
>> line 757
>> vtkStreamingDemandDrivenPipeline (0x4a7b1b0): Algorithm
>> vtkXYZTransformFilter(0x4a0c7a0) returned failure for request:
>> vtkInformation (0x4a7a9a0)
>>  Debug: Off
>>  Modified Time: 202678
>>  Reference Count: 1
>>  Registered Events: (none)
>>  Request: REQUEST_DATA_OBJECT
>>  FORWARD_DIRECTION: 0
>>  FROM_OUTPUT_PORT: 0
>>  ALGORITHM_AFTER_FORWARD: 1
>>
>> ERROR: In /home/paul/workspace/ParaView3/VTK/Filtering/vtkExecutive.cxx,
>> line 757
>> vtkStreamingDemandDrivenPipeline (0x4a7b1b0): Algorithm
>> vtkXYZTransformFilter(0x4a0c7a0) returned failure for request:
>> vtkInformation (0x4a7a9a0)
>>  Debug: Off
>>  Modified Time: 202710
>>  Reference Count: 1
>>  Registered Events: (none)
>>  Request: REQUEST_DATA_OBJECT
>>  FORWARD_DIRECTION: 0
>>  FROM_OUTPUT_PORT: 0
>>  ALGORITHM_AFTER_FORWARD: 1
>>
>> Warning: In /home/paul/workspace/ParaView3/VTK/Filtering/vtkDataObject.cxx,
>> line 908
>> vtkMultiBlockDataSet (0x173da00): Attempted to ShallowCopy from null.
>> ---------------------------------------------------------->8
>>
>> Can anyone see what I am doing wrong?
>>
>> Thanks in advance,
>> Paul
>> _______________________________________________
>> ParaView mailing list
>> ParaView at paraview.org
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>


More information about the ParaView mailing list