← Back to team overview

dolfin team mailing list archive

Re: [Branch ~dolfin-core/dolfin/trunk] Rev 6755: Add missing #ifdefs for VTK, should fix buildbot

 

The buildbot is still complaining. It seems that we are using some
features that are not available in older VTK versions. What should be
the minimum required VTK version?

Johannes

On Tue, Jun 26, 2012 at 1:30 PM,  <noreply@xxxxxxxxxxxxx> wrote:
> ------------------------------------------------------------
> revno: 6755
> committer: Anders Logg <logg@glaurung>
> branch nick: trunk-logg
> timestamp: Tue 2012-06-26 13:29:13 +0200
> message:
>  Add missing #ifdefs for VTK, should fix buildbot
> modified:
>  dolfin/plot/plot.cpp
>
>
> --
> lp:dolfin
> https://code.launchpad.net/~dolfin-core/dolfin/trunk
>
> Your team DOLFIN Core Team is subscribed to branch lp:dolfin.
> To unsubscribe from this branch go to https://code.launchpad.net/~dolfin-core/dolfin/trunk/+edit-subscription
>
> === modified file 'dolfin/plot/plot.cpp'
> --- dolfin/plot/plot.cpp        2012-06-22 11:27:35 +0000
> +++ dolfin/plot/plot.cpp        2012-06-26 11:29:13 +0000
> @@ -39,6 +39,7 @@
>
>  using namespace dolfin;
>
> +#ifdef HAS_VTK
>  // Template function for getting already instantiated VTKPlotter for
>  // the given object. If none is found, a new one is created and added
>  // to the cache.
> @@ -66,7 +67,7 @@
>   int width, height;
>   plotter->get_window_size(width, height);
>
> -  // FIXME: This approach might need some tweaking. It tiles the winows in a
> +  // FIXME: This approach might need some tweaking. It tiles the winows in a
>   // 2 x 2 pattern on the screen. Might not look good with more than 4 plot
>   // windows
>   plotter->set_window_position((num_old_plots%2)*width,
> @@ -78,16 +79,15 @@
>
>   return VTKPlotter::plotter_cache.back();
>  }
> -//-----------------------------------------------------------------------------
> +#endif
> +
>  // Template function for plotting objects
>  template <typename T>
>  void plot_object(boost::shared_ptr<const T> t,
>     boost::shared_ptr<const Parameters> parameters)
>  {
>  #ifndef HAS_VTK
> -  dolfin_error("plot.cpp",
> -               "plot object",
> -              "Plotting disbled. Dolfin has been compiled without VTK support");
> +  warning("Plotting disbled. DOLFIN has been compiled without VTK support");
>  #else
>
>   // Get plotter from cache
> @@ -102,6 +102,7 @@
>
>  #endif
>  }
> +
>  //-----------------------------------------------------------------------------
>  void dolfin::plot(const Function& function,
>                   std::string title, std::string mode)
> @@ -161,7 +162,7 @@
>                   boost::shared_ptr<const Mesh> mesh,
>                   boost::shared_ptr<const Parameters> parameters)
>  {
> -  boost::shared_ptr<const ExpressionWrapper>
> +  boost::shared_ptr<const ExpressionWrapper>
>     e(new ExpressionWrapper(expression, mesh));
>   plot_object(e, parameters);
>  }
> @@ -328,13 +329,24 @@
>  //-----------------------------------------------------------------------------
>  void dolfin::interactive()
>  {
> -  if (VTKPlotter::plotter_cache.size() == 0) {
> +#ifdef HAS_VTK
> +
> +  if (VTKPlotter::plotter_cache.size() == 0)
> +  {
>     warning("No plots have been shown yet. Ignoring call to interactive().");
> -  } else {
> +  }
> +  else
> +  {
>     // Call interactive on every plotter
>     for (uint i = 0; i < VTKPlotter::plotter_cache.size(); ++i) {
>       VTKPlotter::plotter_cache[i]->interactive();
>     }
>   }
> +
> +#else
> +
> +  warning("Plotting disbled. DOLFIN has been compiled without VTK support");
> +
> +#endif
>  }
>  //-----------------------------------------------------------------------------
>
>