[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Pkg-octave-devel] Compiling Octaviz in unstable



Hi, 

I have problems compiling Octaviz in unstable:

$ apt-get source octaviz
$ cd octaviz-0.4.0/
$ dpkg-buildpackage -rfakeroot -us -uc


This breaks with the following error (the last two lines are important):
======================================================================
Building Utility vtkImageBlend.oct...
In file included
from /usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../include/c
++/4.0.3/backward/strstream:51,
                 from /usr/include/vtk/vtkIOStream.h:32,
                 from /usr/include/vtk/vtkSystemIncludes.h:40,
                 from /usr/include/vtk/vtkIndent.h:24,
                 from /usr/include/vtk/vtkObjectBase.h:43,
                 from /usr/include/vtk/vtkCommand.h:47,
                 from ../Common/octaviz.h:114,
                 from ../Common/OctavizCommon.h:5,
                 from vtkImageBlend.cc:3:
/usr/lib/gcc/i486-linux-gnu/4.0.3/../../../../include/c
++/4.0.3/backward/backward_warning.h:32:2: warning: #warning This file
includes at least one deprecated or antiquated header. Please consider
using one of the 32 headers found in section 17.4.1.2 of the C++
standard. Examples include substituting the <X> header for the <X.h>
header for C++ includes, or <iostream> instead of the deprecated header
<iostream.h>. To disable this warning use -Wno-deprecated.
vtkImageBlend.cc: In function ‘bool FSvtkImageBlend_gnu_v3(const
octave_shlib&)’:
vtkImageBlend.cc:10: error: unknown escape sequence '\c'
vtkImageBlend.cc:10: error: unknown escape sequence '\c'
======================================================================

(As the file vtkImageBlend.cc is generated, I attach it for easier
discussion). The problem seems to be some "\code" strings in the
comment; however, these strings come from 
usr/include/vtk/vtkImageBlend.h
and this file hasn't changed since the sarge release.

Any ideas?

Regards
	Thomas
// Octave wrapper for vtkImageBlend object
//
#include "OctavizCommon.h"
#define VTK_STREAMS_FWD_ONLY
#include "vtkImageBlend.h"

void populate_help_mapvtkImageBlend( std::map<std::string,std::string> &help_map );


DEFUN_DLD ( vtkImageBlend, args, nargout, 
  "vtkImageBlend \n\
  \n\
   vtkImageBlend takes L, LA, RGB, or RGBA images as input and blends them \n\
   according to the alpha values and/or the opacity setting for each input.\n\
  \n\
   The spacing, origin, extent, and number of components of the output are\n\
   the same as those for the first input.  If the input has an alpha\n\
   component, then this component is copied unchanged into the output.\n\
   In addition, if the first input has either one component or two\n\
   components i.e. if it is either L (greyscale) or LA (greyscale + alpha)\n\
   then all other inputs must also be L or LA.\n\
  \n\
   Different blending modes are available:\n\
  \n\
   \em Normal (default) : \n\
   This is the standard blending mode used by OpenGL and other graphics\n\
   packages.  The output always has the same number of components\n\
   and the same extent as the first input.  The alpha value of the first\n\
   input is not used in the blending computation, instead it is copied\n\
   directly to the output.\n\
  \n\
   \code\n\
   output <- input[0]\n\
   foreach input i {\n\
     foreach pixel px {\n\
       r <- input[i](px)(alpha) * opacity[i]\n\
       f <- (255 - r)\n\
       output(px) <- output(px) * f + input(px) * r\n\
     }\n\
   }\n\
   \endcode\n\
  \n\
   \em Compound : \n\
   Images are compounded together and each component is scaled by the sum of\n\
   the alpha/opacity values. Use the CompoundThreshold method to set \n\
   specify a threshold in compound mode. Pixels with opacity*alpha less\n\
   or equal than this threshold are ignored.\n\
   The alpha value of the first input, if present, is NOT copied to the alpha \n\
   value of the output.  The output always has the same number of components\n\
   and the same extent as the first input.\n\
  \n\
   \code\n\
   output <- 0\n\
   foreach pixel px {\n\
     sum <- 0\n\
     foreach input i {\n\
       r <- input[i](px)(alpha) * opacity(i)\n\
       sum <- sum + r\n\
       if r > threshold {\n\
         output(px) <- output(px) + input(px) * r\n\
       }\n\
     }\n\
     output(px) <- output(px) / sum\n\
   }\n\
   \endcode")
{
  octave_value retval;
  static std::map<std::string,std::string> help_map;
  static bool help_populated = false;
  if ( !help_populated ) 
    {
    populate_help_mapvtkImageBlend( help_map );
    help_populated = true;
    }

  int nargin  = args.length ();

  if ( nargin < 1 )
    {
    vtkObjectBase *new_vtk_object = vtkImageBlend::New();
    retval = octave_value( new vtk_object( new_vtk_object, true ) );
    return retval;
    }

  if ( nargin == 1 )
    {
    // This can only be the "New" command
    if ( !args(0).is_string() )
      {
      error("If a single parameter is passed, then it has to be \"New\" or \"List\".");
      return retval;
      }
    if ( args(0).string_value() == "New" )
      {
      vtkObjectBase *new_vtk_object = vtkImageBlend::New();
      retval = octave_value( new vtk_object( new_vtk_object, true ) );
      return retval;
      }
    if ( args(0).string_value() == "List" )
      {
      octave_stdout << help_map["List"] << std::endl;
      return retval;
      }
    error("If a single parameter is passed, then it has to be \"New\" or \"List\".");
    return retval;
    }
  // The second parameter has to be a string command
  if ( !args(1).is_string() )
    {
    error("Second parameter has to be a string command.");
    return retval;
	  }


  // If it is not the command New, the first parameter has to be a vtk_object
  // or a method name followed by a string Help
  if ( ( args(0).type_id() != vtk_object::static_type_id() ) &&
       ( args(1).string_value() != "Help" ) )
    {
    error("First parameter has to be a vtk_object or the command \"New\". If the first parameter is a method name, then the second has to be Help");
    return retval;
    }

    if ( args(1).string_value() == "Help" )
    {
    octave_stdout << help_map[args(0).string_value()] << std::endl;
    return retval;
    }

  vtkImageBlend *vtk_pointer = reinterpret_cast<vtkImageBlend*>( args(0).uint_value() );
  std::string method_name = args(1).string_value();
  int    error_flag;
  error_flag = 0; error_flag = error_flag;

  if ( ( method_name == "GetClassName" ) && ( nargin == 2 ) )
    {

/* const char *GetClassName (); */
    const char    *temp20;
    error_flag = 0;

    if (!error_flag)
      {
      temp20 = (vtk_pointer)->GetClassName();
      if (temp20)
        {
        retval = (char*)temp20;
        }
      return retval;
      }
    }
  if ( ( method_name == "IsA" ) && ( nargin == 3 ) )
    {

/* int IsA (const char *name); */
    char    *temp0;
    int      temp20;
    error_flag = 0;

    char tmp_string0[1024];
    strcpy(tmp_string0,args(2).string_value().c_str()); 
    temp0 = tmp_string0;
    if (!error_flag)
      {
      temp20 = (vtk_pointer)->IsA(temp0);
      retval = temp20;
      return retval;
      }
    }
  if ( ( method_name == "NewInstance" ) && ( nargin == 2 ) )
    {

/* vtkImageBlend *NewInstance (); */
    vtkImageBlend  *temp20;
    error_flag = 0;

    if (!error_flag)
      {
      temp20 = (vtk_pointer)->NewInstance();
      vtkObjectBase *tmp_ptr = (vtkObjectBase*)(temp20);
      retval = octave_value( new vtk_object(tmp_ptr) );
      return retval;
      }
    }
  if ( ( method_name == "SafeDownCast" ) && ( nargin == 3 ) )
    {

/* vtkImageBlend *SafeDownCast (vtkObject* o); */
    vtkObject  *temp0;
    vtkImageBlend  *temp20;
    error_flag = 0;

    if ( args(2).type_id() != vtk_object::static_type_id() ) error_flag = 1;
    else temp0 = reinterpret_cast<vtkObject*>( args(2).uint_value() );
    if (!error_flag)
      {
      temp20 = (vtk_pointer)->SafeDownCast(temp0);
      vtkObjectBase *tmp_ptr = (vtkObjectBase*)(temp20);
      retval = octave_value( new vtk_object(tmp_ptr) );
      return retval;
      }
    }
  if ( ( method_name == "SetOpacity" ) && ( nargin == 4 ) )
    {

/* void SetOpacity (int idx, double opacity); */
    int      temp0;
    double   temp1;
    error_flag = 0;

    if ( !args(2).is_real_type() ) error_flag = 1;
    else temp0 = args(2).int_value();
    if ( !args(3).is_real_type() ) error_flag = 1;
    else temp1 = args(3).double_value();
    if (!error_flag)
      {
      vtk_pointer->SetOpacity(temp0,temp1);
      return retval;
      }
    }
  if ( ( method_name == "GetOpacity" ) && ( nargin == 3 ) )
    {

/* double GetOpacity (int idx); */
    int      temp0;
    double   temp20;
    error_flag = 0;

    if ( !args(2).is_real_type() ) error_flag = 1;
    else temp0 = args(2).int_value();
    if (!error_flag)
      {
      temp20 = (vtk_pointer)->GetOpacity(temp0);
      retval = temp20;
      return retval;
      }
    }
  if ( ( method_name == "SetStencil" ) && ( nargin == 3 ) )
    {

/* virtual void SetStencil (vtkImageStencilData *); */
    vtkImageStencilData  *temp0;
    error_flag = 0;

    if ( args(2).type_id() != vtk_object::static_type_id() ) error_flag = 1;
    else temp0 = reinterpret_cast<vtkImageStencilData*>( args(2).uint_value() );
    if (!error_flag)
      {
      vtk_pointer->SetStencil(temp0);
      return retval;
      }
    }
  if ( ( method_name == "GetStencil" ) && ( nargin == 2 ) )
    {

/* vtkImageStencilData *GetStencil (); */
    vtkImageStencilData  *temp20;
    error_flag = 0;

    if (!error_flag)
      {
      temp20 = (vtk_pointer)->GetStencil();
      vtkObjectBase *tmp_ptr = (vtkObjectBase*)(temp20);
      retval = octave_value( new vtk_object(tmp_ptr) );
      return retval;
      }
    }
  if ( ( method_name == "SetBlendMode" ) && ( nargin == 3 ) )
    {

/* void SetBlendMode (int ); */
    int      temp0;
    error_flag = 0;

    if ( !args(2).is_real_type() ) error_flag = 1;
    else temp0 = args(2).int_value();
    if (!error_flag)
      {
      vtk_pointer->SetBlendMode(temp0);
      return retval;
      }
    }
  if ( ( method_name == "GetBlendModeMinValue" ) && ( nargin == 2 ) )
    {

/* int GetBlendModeMinValue (); */
    int      temp20;
    error_flag = 0;

    if (!error_flag)
      {
      temp20 = (vtk_pointer)->GetBlendModeMinValue();
      retval = temp20;
      return retval;
      }
    }
  if ( ( method_name == "GetBlendModeMaxValue" ) && ( nargin == 2 ) )
    {

/* int GetBlendModeMaxValue (); */
    int      temp20;
    error_flag = 0;

    if (!error_flag)
      {
      temp20 = (vtk_pointer)->GetBlendModeMaxValue();
      retval = temp20;
      return retval;
      }
    }
  if ( ( method_name == "GetBlendMode" ) && ( nargin == 2 ) )
    {

/* int GetBlendMode (); */
    int      temp20;
    error_flag = 0;

    if (!error_flag)
      {
      temp20 = (vtk_pointer)->GetBlendMode();
      retval = temp20;
      return retval;
      }
    }
  if ( ( method_name == "SetBlendModeToNormal" ) && ( nargin == 2 ) )
    {

/* void SetBlendModeToNormal (); */
    error_flag = 0;

    if (!error_flag)
      {
      vtk_pointer->SetBlendModeToNormal();
      return retval;
      }
    }
  if ( ( method_name == "SetBlendModeToCompound" ) && ( nargin == 2 ) )
    {

/* void SetBlendModeToCompound (); */
    error_flag = 0;

    if (!error_flag)
      {
      vtk_pointer->SetBlendModeToCompound();
      return retval;
      }
    }
  if ( ( method_name == "GetBlendModeAsString" ) && ( nargin == 2 ) )
    {

/* const char *GetBlendModeAsString (void ); */
    const char    *temp20;
    error_flag = 0;

    if (!error_flag)
      {
      temp20 = (vtk_pointer)->GetBlendModeAsString();
      if (temp20)
        {
        retval = (char*)temp20;
        }
      return retval;
      }
    }
  if ( ( method_name == "SetCompoundThreshold" ) && ( nargin == 3 ) )
    {

/* void SetCompoundThreshold (double ); */
    double   temp0;
    error_flag = 0;

    if ( !args(2).is_real_type() ) error_flag = 1;
    else temp0 = args(2).double_value();
    if (!error_flag)
      {
      vtk_pointer->SetCompoundThreshold(temp0);
      return retval;
      }
    }
  if ( ( method_name == "GetCompoundThreshold" ) && ( nargin == 2 ) )
    {

/* double GetCompoundThreshold (); */
    double   temp20;
    error_flag = 0;

    if (!error_flag)
      {
      temp20 = (vtk_pointer)->GetCompoundThreshold();
      retval = temp20;
      return retval;
      }
    }

  if ( error_flag )
    {
    error("Method was found but arguments were wrong.");
    return retval;
    }

  // Check superclass methods.
  retval = feval("vtkImageMultipleInputFilter",args, nargout); 
  // Reduce the result list to a scalar (if it is a single result)
  while ( retval.is_list() && retval.length() == 1 )
    {
    octave_value_list list = retval.list_value();
    retval = list(0);
    }




  return retval;
}

void populate_help_mapvtkImageBlend( std::map<std::string,std::string> &help_map ) 
{
  help_map["List"] = "GetClassName\nIsA\nNewInstance\nSafeDownCast\nSetOpacity\nGetOpacity\nSetStencil\nGetStencil\nSetBlendMode\nGetBlendModeMinValue\nGetBlendModeMaxValue\nGetBlendMode\nSetBlendModeToNormal\nSetBlendModeToCompound\nGetBlendModeAsString\nSetCompoundThreshold\nGetCompoundThreshold\n";
  help_map["SetOpacity"] = " Set the opacity of an input image: the alpha values of the image are\n\
   multiplied by the opacity.  The opacity of image idx=0 is ignored.";
  help_map["GetOpacity"] = " Set the opacity of an input image: the alpha values of the image are\n\
   multiplied by the opacity.  The opacity of image idx=0 is ignored.";
  help_map["SetStencil"] = " Set a stencil to apply when blending the data.";
  help_map["GetStencil"] = " Set a stencil to apply when blending the data.";
  help_map["SetBlendMode"] = " Set the blend mode";
  help_map["GetBlendModeMinValue"] = " Set the blend mode";
  help_map["GetBlendModeMaxValue"] = " Set the blend mode";
  help_map["GetBlendMode"] = " Set the blend mode";
  help_map["SetBlendModeToNormal"] = " Set the blend mode";
  help_map["SetBlendModeToCompound"] = " Set the blend mode";
  help_map["GetBlendModeAsString"] = " Set the blend mode";
  help_map["SetCompoundThreshold"] = " Specify a threshold in compound mode. Pixels with opacity*alpha less\n\
   or equal the threshold are ignored.";
  help_map["GetCompoundThreshold"] = " Specify a threshold in compound mode. Pixels with opacity*alpha less\n\
   or equal the threshold are ignored.";
}



Reply to: