[Paraview-developers] Problem with Strongly Typed Enums in ParaView Plugin

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Sun Feb 16 11:47:42 EST 2014


I wouldn't be surprised if strongly typed enums are not supported by
the wrapping code. Just use regular enums (without the 'class' ),
those should work.

Utkarsh

On Sat, Feb 15, 2014 at 12:55 PM, Siavash Ameli <sameli at hawk.iit.edu> wrote:
> Hello,
>
> I am writing a filter and I declare strongly typed enums in the header of my
> filter. Something like:
>
> // MyFilter.h
> enum class MyTypes
> {
>     ONE = 0,
>     TWO,
>     THREE
> };
>
> ...
>
> class MyFilter : vtkDataSetAlgorithm {...};
>
> I am compiling the code by including (${PARAVIEW_USE_FILE}) in order to
> generate a ParaView plugin. If I do "not" use ADD_PARAVIEW_PLUGIN, the code
> compiles fine with no error. However, if I use ADD_PARAVIEW_PLUGIN as
> following:
>
> ADD_PARAVIEW_PLUGIN(
>          MyFilterPlugin
>          "1.0"
>          DOCUMENTATION_DIR       /MyPath/doc
>          SERVER_MANAGER_XML      /MyPath/MyFilter.xml
>          GUI_RESOURCE_FILES      /MyPath/MyFilter.xml
>          SERVER_MANAGER_SOURCES  /MyPath/MyFilter.cxx)
>
> then I get the following error:
>
> -- Generate module: MyFilterPlugin
> [ 62%] CS Wrapping - generating MyFilterClientServer.cxx
> syntax error
> In /MyPath/MyFilter.h:34:
> syntax error.
> make[2]: *** [MyFilterClientServer.cxx] Error 1
> make[1]: *** [CMakeFiles/MyFilterPlugin.dir/all] Error 2
> make: *** [all] Error 2
>
> By removing the enum class, the code compiles fine with no error in
> ParaView. Is it a bug or am I missing something here?
>
> Thanks.
>
> -Siavash
>
> ---------------------------
> Siavash Ameli
> Graduate Student Researcher
> Mechanical Eng. UC Berkeley
>
>
>
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
>


More information about the Paraview-developers mailing list