Navigation

Operators and Keywords

Function List:

C++ API

graphics.cc File Reference

#include <cctype>
#include <cfloat>
#include <cstdlib>
#include <algorithm>
#include <list>
#include <map>
#include <set>
#include <string>
#include <sstream>
#include "file-ops.h"
#include "file-stat.h"
#include "cmd-edit.h"
#include "defun.h"
#include "display.h"
#include "error.h"
#include "graphics.h"
#include "input.h"
#include "ov.h"
#include "oct-obj.h"
#include "oct-map.h"
#include "ov-fcn-handle.h"
#include "parse.h"
#include "toplev.h"
#include "unwind-prot.h"
#include "graphics-props.cc"

Include dependency graph for graphics.cc:


Classes

class  gnuplot_backend
class  callback_event
class  function_event
class  set_event

Defines

#define CHECK_ARRAY_EQUAL(T, F, A)
#define GO_BODY(TYPE)

Functions

graphics_handle gcf (void)
graphics_handle gca (void)
Matrix xform_matrix (void)
ColumnVector xform_vector (void)
ColumnVector xform_vector (double x, double y, double z)
ColumnVector transform (const Matrix &m, double x, double y, double z)
Matrix xform_scale (double x, double y, double z)
Matrix xform_translate (double x, double y, double z)
void scale (Matrix &m, double x, double y, double z)
void translate (Matrix &m, double x, double y, double z)
void xform (ColumnVector &v, const Matrix &m)
void scale (ColumnVector &v, double x, double y, double z)
void translate (ColumnVector &v, double x, double y, double z)
void normalize (ColumnVector &v)
double dot (const ColumnVector &v1, const ColumnVector &v2)
double norm (const ColumnVector &v)
ColumnVector cross (const ColumnVector &v1, const ColumnVector &v2)
Matrix unit_cube (void)
ColumnVector cam2xform (const Array< double > &m)
RowVector xform2cam (const ColumnVector &v)
void get_children_limits (double &min_val, double &max_val, double &min_pos, const Matrix &kids, char limit_type)
double force_in_range (const double x, const double lower, const double upper)
void cross_product (double x1, double y1, double z1, double x2, double y2, double z2, double &x, double &y, double &z)
 DEFUN (ishandle, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ishandle (@var{h})\n\ Return true if @var{h} is a graphics handle and false otherwise.\n\ @end deftypefn")
 DEFUN (set, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} set (@var{h}, @var{p}, @var{v}, @dots{})\n\ Set the named property value or vector @var{p} to the value @var{v}\n\ for the graphics handle @var{h}.\n\ @end deftypefn")
 DEFUN (get, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} get (@var{h}, @var{p})\n\ Return the named property @var{p} from the graphics handle @var{h}.\n\ If @var{p} is omitted, return the complete property list for @var{h}.\n\ If @var{h} is a vector, return a cell array including the property\n\ values or lists respectively.\n\ @end deftypefn")
 DEFUN (__get__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __get__ (@var{h})\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (__go_figure__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_figure__ (@var{fignum})\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (__go_axes__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_axes__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (__go_line__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_line__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (__go_text__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_text__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (__go_image__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_image__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (__go_surface__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_surface__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (__go_patch__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_patch__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (__go_hggroup__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_hggroup__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (__go_delete__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_delete__ (@var{h})\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (__go_axes_init__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_axes_init__ (@var{h}, @var{mode})\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (__go_handles__,,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_handles__ ()\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (__go_figure_handles__,,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_figure_handles__ ()\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (__go_execute_callback__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_execute_callback__ (@var{h}, @var{name})\n\ @deftypefnx {Built-in Function} {} __go_execute_callback__ (@var{h}, @var{name}, @var{param})\n\ Undocumented internal function.\n\ @end deftypefn")
 DEFUN (available_backends,,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} available_backends ()\n\ Return a cell array of registered graphics backends.\n\ @end deftypefn")
 DEFUN (drawnow, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} drawnow ()\n\ @deftypefnx {Built-in Function} {} drawnow (\"expose\")\n\ @deftypefnx {Built-in Function} {} drawnow (@var{term}, @var{file}, @var{mono}, @var{debug_file})\n\ Update figure windows and their children. The event queue is flushed and\n\ any callbacks generated are executed. With the optional argument\n\ @code{\"expose\"}, only graphic objects are updated and no other events or\n\ callbacks are processed.\n\ The third calling form of @code{drawnow} is for debugging and is\n\ undocumented.\n\ @end deftypefn")
 DEFUN (addlistener, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} addlistener (@var{h}, @var{prop}, @var{fcn})\n\ Register @var{fcn} as listener for the property @var{prop} of the graphics\n\ object @var{h}. Property listeners are executed (in order of registration)\n\ when the property is set. The new value is already available when the\n\ listeners are executed.\n\ \n\ @var{prop} must be a string naming a valid property in @var{h}.\n\ \n\ @var{fcn} can be a function handle, a string or a cell array whose first\n\ element is a function handle. If @var{fcn} is a function handle, the\n\ corresponding function should accept at least 2 arguments, that will be\n\ set to the object handle and the empty matrix respectively. If @var{fcn}\n\ is a string, it must be any valid octave expression. If @var{fcn} is a cell\n\ array, the first element must be a function handle with the same signature\n\ as described above. The next elements of the cell array are passed\n\ as additional arguments to the function.\n\ \n\ Example:\n\ \n\ @example\n\ @group\n\ function my_listener (h, dummy, p1)\n\ fprintf (\"my_listener called with p1=%s\\n\", p1);\n\ endfunction\n\ \n\ addlistener (gcf, \"position\", @{@@my_listener, \"my string\"@})\n\ @end group\n\ @end example\n\ \n\ @end deftypefn")
 DEFUN (dellistener, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} dellistener (@var{h}, @var{prop}, @var{fcn})\n\ Remove the registration of @var{fcn} as a listener for the property\n\ @var{prop} of the graphics object @var{h}. The function @var{fcn} must\n\ be the same variable (not just the same value), as was passed to the\n\ original call to @code{addlistener}.\n\ \n\ If @var{fcn} is not defined then all listener functions of @var{prop}\n\ are removed.\n\ \n\ Example:\n\ \n\ @example\n\ @group\n\ function my_listener (h, dummy, p1)\n\ fprintf (\"my_listener called with p1=%s\\n\", p1);\n\ endfunction\n\ \n\ c = @{@@my_listener, \"my string\"@};\n\ addlistener (gcf, \"position\", c);\n\ dellistener (gcf, \"position\", c);\n\ @end group\n\ @end example\n\ \n\ @end deftypefn")
 DEFUN (addproperty, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} addproperty (@var{name}, @var{h}, @var{type}, [@var{arg}, @dots{}])\n\ Create a new property named @var{name} in graphics object @var{h}.\n\ @var{type} determines the type of the property to create. @var{args}\n\ usually contains the default value of the property, but additional\n\ arguments might be given, depending on the type of the property.\n\ \n\ The supported property types are:\n\ \n\ @table @code\n\ @item string\n\ A string property. @var{arg} contains the default string value.\n\ @item any\n\ An un-typed property. This kind of property can hold any octave\n\ value. @var{args} contains the default value.\n\ @item radio\n\ A string property with a limited set of accepted values. The first\n\ argument must be a string with all accepted values separated by\n\ a vertical bar ('|'). The default value can be marked by enclosing\n\ it with a '@{' '@}' pair. The default value may also be given as\n\ an optional second string argument.\n\ @item boolean\n\ A boolean property. This property type is equivalent to a radio\n\ property with \"on|off\" as accepted values. @var{arg} contains\n\ the default property value.\n\ @item double\n\ A scalar double property. @var{arg} contains the default value.\n\ @item handle\n\ A handle property. This kind of property holds the handle of a\n\ graphics object. @var{arg} contains the default handle value.\n\ When no default value is given, the property is initialized to\n\ the empty matrix.\n\ @item data\n\ A data (matrix) property. @var{arg} contains the default data\n\ value. When no default value is given, the data is initialized to\n\ the empty matrix.\n\ @item color\n\ A color property. @var{arg} contains the default color value.\n\ When no default color is given, the property is set to black.\n\ An optional second string argument may be given to specify an\n\ additional set of accepted string values (like a radio property).\n\ @end table\n\ \n\ @var{type} may also be the concatenation of a core object type and\n\ a valid property name for that object type. The property created\n\ then has the same characteristics as the referenced property (type,\n\ possible values, hidden state@dots{}). This allows to clone an existing\n\ property into the graphics object @var{h}.\n\ \n\ Examples:\n\ \n\ @example\n\ @group\n\ addproperty (\"my_property\", gcf, \"string\", \"a string value\");\n\ addproperty (\"my_radio\", gcf, \"radio\", \"val_1|val_2|@{val_3@}\");\n\ addproperty (\"my_style\", gcf, \"linelinestyle\", \"--\");\n\ @end group\n\ @end example\n\ \n\ @end deftypefn")
octave_value get_property_from_handle (double handle, const std::string &property, const std::string &func)
bool set_property_in_handle (double handle, const std::string &property, const octave_value &arg, const std::string &func)

Define Documentation

#define CHECK_ARRAY_EQUAL ( T,
F,
 ) 

Value:

{ \
              if (data.numel () == 1) \
                return data.F ## scalar_value () == \
                  v.F ## scalar_value (); \
              else  \
                { \
                  /* Keep copy of array_value to allow sparse/bool arrays */ \
                  /* that are converted, to not be deallocated early */ \
                  const A m1 = data.F ## array_value (); \
                  const T* d1 = m1.data (); \
                  const A m2 = v.F ## array_value (); \
                  const T* d2 = m2.data ();\
                  \
                  bool flag = true; \
                  \
                  for (int i = 0; flag && i < data.numel (); i++) \
                    if (d1[i] != d2[i]) \
                      flag = false; \
                  \
                  return flag; \
                } \
            }

#define GO_BODY ( TYPE   ) 

Value:

gh_manager::autolock guard; \
 \
  octave_value retval; \
 \
  if (args.length () > 0) \
    retval = make_graphics_object (#TYPE, args); \
  else \
    print_usage (); \
 \
  return retval


Function Documentation

ColumnVector cam2xform ( const Array< double > &  m  )  [inline]

ColumnVector cross ( const ColumnVector v1,
const ColumnVector v2 
) [inline]

void cross_product ( double  x1,
double  y1,
double  z1,
double  x2,
double  y2,
double  z2,
double x,
double y,
double z 
) [inline]

DEFUN ( addproperty  ,
args   
)

DEFUN ( dellistener  ,
args   
)

DEFUN ( addlistener  ,
args   
)

DEFUN ( drawnow  ,
args   
)

DEFUN ( available_backends   ) 

DEFUN ( __go_execute_callback__  ,
args   
)

DEFUN ( __go_figure_handles__   ) 

DEFUN ( __go_handles__   ) 

DEFUN ( __go_axes_init__  ,
args   
)

DEFUN ( __go_delete__  ,
args   
)

DEFUN ( __go_hggroup__  ,
args   
)

DEFUN ( __go_patch__  ,
args   
)

DEFUN ( __go_surface__  ,
args   
)

DEFUN ( __go_image__  ,
args   
)

DEFUN ( __go_text__  ,
args   
)

DEFUN ( __go_line__  ,
args   
)

DEFUN ( __go_axes__  ,
args   
)

DEFUN ( __go_figure__  ,
args   
)

DEFUN ( __get__  ,
args   
)

DEFUN ( get  ,
args   
)

DEFUN ( set  ,
args   
)

DEFUN ( ishandle  ,
args   
)

double dot ( const ColumnVector v1,
const ColumnVector v2 
) [inline]

double force_in_range ( const double  x,
const double  lower,
const double  upper 
) [inline]

graphics_handle gca ( void   ) 

graphics_handle gcf ( void   ) 

void get_children_limits ( double min_val,
double max_val,
double min_pos,
const Matrix kids,
char  limit_type 
)

octave_value get_property_from_handle ( double  handle,
const std::string property,
const std::string func 
)

double norm ( const ColumnVector v  )  [inline]

void normalize ( ColumnVector v  )  [inline]

void scale ( ColumnVector v,
double  x,
double  y,
double  z 
) [inline]

void scale ( Matrix m,
double  x,
double  y,
double  z 
) [inline]

bool set_property_in_handle ( double  handle,
const std::string property,
const octave_value arg,
const std::string func 
)

ColumnVector transform ( const Matrix m,
double  x,
double  y,
double  z 
) [inline]

void translate ( ColumnVector v,
double  x,
double  y,
double  z 
) [inline]

void translate ( Matrix m,
double  x,
double  y,
double  z 
) [inline]

Matrix unit_cube ( void   )  [inline]

void xform ( ColumnVector v,
const Matrix m 
) [inline]

RowVector xform2cam ( const ColumnVector v  )  [inline]

Matrix xform_matrix ( void   )  [inline]

Matrix xform_scale ( double  x,
double  y,
double  z 
) [inline]

Matrix xform_translate ( double  x,
double  y,
double  z 
) [inline]

ColumnVector xform_vector ( double  x,
double  y,
double  z 
) [inline]

ColumnVector xform_vector ( void   )  [inline]