text: 
  /*=========================================================================
  
    Program:   Visualization Toolkit
    Module:    $RCSfile$
  
    Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
    All rights reserved.
    See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
  
       This software is distributed WITHOUT ANY WARRANTY; without even
       the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
       PURPOSE.  See the above copyright notice for more information.
  
  =========================================================================*/
  /*-------------------------------------------------------------------------
    Copyright 2009 Sandia Corporation.
    Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
    the U.S. Government retains certain rights in this software.
  -------------------------------------------------------------------------*/
  
  // .NAME vtkMatlabMexAdapter - This is a utility class to convert VTK array
  //  data to and from the Matlab mxArray format.  It is used with the Matlab
  //  Mex and Matlab Engine interfaces.
  //
  // .SECTION Description
  //
  //  The default behavior of each function is to perform a deep copy of the 
  //  data.  Set the ShallowCopy argument to true to use the block of memory 
  //  that has already been allocated by either VTK or Matlab.  The result of 
  //  a shallow copy will produce the transpose of the data in the new system, 
  //  because VTK uses row major ordering and Matlab uses column major ordering 
  //  for data.
  //
  // .SECTION See Also
  //  vtkMatlabEngineInterface vtkMatlabEngineFilter
  //
  // .SECTION Thanks
  //  Developed by Thomas Otahal at Sandia National Laboratories.
  //
  
  
  #ifndef __vtkMatlabMexAdapter
  #define __vtkMatlabMexAdapter
  
  #include "mex.h" // Needed for Matlab mex.h mxArray
  #include "matrix.h" // Needed for Matlab matrix.h mxArray
  #include "vtkObject.h"
  
  class vtkInformation;
  class vtkInformationVector;
  class vtkDataArray;
  class vtkArray;
  class vtkGraph;
  class vtkTable;
  
  class VTK_GRAPHICS_EXPORT vtkMatlabMexAdapter : public vtkObject
  {
  
  public:
  
    vtkTypeRevisionMacro(vtkMatlabMexAdapter, vtkObject);
  
    void PrintSelf(ostream& os, vtkIndent indent);
  
    static vtkMatlabMexAdapter *New();
  
  //BTX
    // Description:
    // Create a mxArray copy of a vtkDataArray (Allocates memory by default)
    static mxArray* vtkDataArrayToMxArray(vtkDataArray* aa, bool ShallowCopy = false);
  
    // Description:
    // Create a vtkDataArray copy of a Matlab mxArray (Allocates memory by default)
    static vtkDataArray* mxArrayTovtkDataArray(const mxArray* mxa, bool ShallowCopy = false);
  
    // Description:
    // Create a mxArray copy of a vtkArray (Allocates memory by default)
    static mxArray* vtkArrayToMxArray(vtkArray* va);
  
    // Description:
    // Create a vtkArray copy of a mxArray (Allocates memory by default)
    static vtkArray* mxArrayTovtkArray(mxArray* mxa);
  
    // Description:
    // Create a mxArray copy of a vtkGraph (Allocates memory by default)
    // The result is an n by n connectivity matrix, where n is the number
    // of nodes in the graph.
    static mxArray* vtkGraphToMxArray(vtkGraph* ga);
  
    // Description:
    // Create a vtkGraph copy of a mxArray (Allocates memory by default)
    // Input mxArray should be a n by n connectivity matrix, where n is 
    // the number of nodes in the graph.
    static vtkGraph* mxArrayTovtkGraph(mxArray* mxa);
  
    // Description:
    // Match Matlab and VTK data types for conversion.
    static mxClassID GetMatlabDataType(vtkDataArray* da);
  
    // Description:
    // Match Matlab and VTK data types for conversion.
    static vtkDataArray* GetVTKDataType(mxClassID cid);
  //ETX
  
  protected:
  
    vtkMatlabMexAdapter() {};
    ~vtkMatlabMexAdapter() {};
  
  private:
  
    vtkMatlabMexAdapter(const vtkMatlabMexAdapter&); // Not implemented
    void operator=(const vtkMatlabMexAdapter&); // Not implemented
  
  };
  
  #endif
  
  