[Paraview] Another Syntax Error - ParaView Plugins

Paul Edwards paul.m.edwards at gmail.com
Wed Feb 24 04:41:26 EST 2010


Sorry, just re-read your post - I see that you attached the header file for
the file you included.  Try this:

#ifndef IVTK_SAMPLE_FILTER
#define IVTK_SAMPLE_FILTER

//BTX
#include "vtkObjectFactory.h"
//ETX
#include "vtkSimpleImageToImageFilter.h"
//BTX
#include "xtkBox.h"
//ETX

class VTK_IMAGING_EXPORT ivtkSampleImageFilter : public
vtkSimpleImageToImageFilter {
  public:
  static ivtkSampleImageFilter* New();

  vtkTypeMacro( ivtkSampleImageFilter, vtkSimpleImageToImageFilter);
  protected:
  ivtkSampleImageFilter();
  ivtkSampleImageFilter(const ivtkSampleImageFilter&) {};
  void operator=(const ivtkSampleImageFilter&) {};

  //override from vtkImageToImageFilter
  virtual void SimpleExecute(vtkImageData* inp, vtkImageData* out);

    vtkImageData*    vtkResultImage;
//BTX
  vtkITKFilter_H_Macro;
  /// custom Filter function ///
  template <typename ImageType>
  void ApplyFilter(vtkImageData* vtkInput);
//ETX
};
#endif

That might work but I haven't really looked to see what your macro is
expanding out to.

Regards,
Paul


On 24 February 2010 09:29, Paul Edwards <paul.m.edwards at gmail.com> wrote:

> I don't really understand what you are doing but one obvious thing from the
> header is that the BTX/ETX is around the wrong way:
>
> //ETX
> #include "itkImage.h"
> //BTX
>
> should be:
>
> //BTX
> #include "itkImage.h"
> //ETX
>
> I didn't even realise that the the parser work for templates though...
>
> Regards,
> Paul
>
> On 24 February 2010 08:55, Christian Werner <
> christian.werner at rwth-aachen.de> wrote:
>
>> Hello!
>>
>> I am writng a plugin for my paraview. I already succeeded doing this with
>> another filter but this one drives me crazy. I keep getting these
>>
>> "*** SYNTAX ERROR found in parsing the header file
>> /home/christian/programming/pv-plugins/Transformation/ivtkSampleFilter.h
>> before line 8 ***
>>
>> messages, no matter where I put these //BTX //ETX. This is my header:
>>
>>
>> #ifndef IVTK_SAMPLE_FILTER
>> #define IVTK_SAMPLE_FILTER
>>
>> #include "vtkObjectFactory.h"
>> #include "vtkSimpleImageToImageFilter.h"
>> #include "xtkBox.h"
>>
>> class VTK_IMAGING_EXPORT ivtkSampleImageFilter : public
>> vtkSimpleImageToImageFilter {
>>   public:
>>   static ivtkSampleImageFilter* New();
>>
>>   vtkTypeMacro( ivtkSampleImageFilter, vtkSimpleImageToImageFilter);
>>   protected:
>>   ivtkSampleImageFilter();
>>   ivtkSampleImageFilter(const ivtkSampleImageFilter&) {};
>>   void operator=(const ivtkSampleImageFilter&) {};
>>
>>   //override from vtkImageToImageFilter
>>   virtual void SimpleExecute(vtkImageData* inp, vtkImageData* out);
>>
>>   //BTX
>>   vtkImageData*    vtkResultImage;
>>   //ETX
>>   vtkITKFilter_H_Macro;
>>   /// custom Filter function ///
>>   template <typename ImageType>
>>   void ApplyFilter(vtkImageData* vtkInput);
>> };
>> #endif
>>
>> It also complains if I comment out my #include "xtkBox.h", or put some
>> //BTX//ETX all around other places. It keeps coming with the error message
>> as if I did not even edit the right file. (I do, I checked that... :)
>>
>> I call a macro later in the header which is defined in the xtkBox.h but
>> the compiler does not even care if it is defined or not. Anyway, for
>> completeness I attached this xtkBox.h.
>>
>> Does anyone see what I am missing?
>>
>>
>> Best regards,
>> Chrsitian
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100224/cdfee363/attachment.htm>


More information about the ParaView mailing list