Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes | Protected Attributes
grid_rep Class Reference

#include <grid.hpp>

Inheritance diagram for grid_rep:
Inheritance graph
[legend]
Collaboration diagram for grid_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 grid_rep ()
 grid_rep (array< SI > subd2, array< string > col2, point o)
virtual ~grid_rep ()
virtual void set_aspect (tree aspect)
virtual operator tree ()=0
virtual array< grid_curveget_curves (point lim1, point lim2, bool b=false)=0
virtual array< grid_curveget_curves_around (point p, double delta, frame f)
virtual point find_closest_point (point p, point pmin, point pmax)=0
virtual point find_point_around (point p, double delta, frame f)

Public Attributes

int ref_count

Protected Attributes

array< SIsubd
array< stringcol
point center

Detailed Description

Definition at line 34 of file grid.hpp.


Constructor & Destructor Documentation

grid_rep::grid_rep ( ) [inline]

Definition at line 40 of file grid.hpp.

{}
grid_rep::grid_rep ( array< SI subd2,
array< string col2,
point  o 
) [inline]

Definition at line 41 of file grid.hpp.

                                                                :
    subd(subd2), col(col2), center(o) {}
virtual grid_rep::~grid_rep ( ) [inline, virtual]

Definition at line 43 of file grid.hpp.

{}

Member Function Documentation

virtual point grid_rep::find_closest_point ( point  p,
point  pmin,
point  pmax 
) [pure virtual]

Implemented in logarithmic_rep, polar_rep, cartesian_rep, and empty_grid_rep.

Here is the caller graph for this function:

point grid_rep::find_point_around ( point  p,
double  delta,
frame  f 
) [virtual]

Definition at line 76 of file grid.cpp.

                                                           {
  point p2= f (p);
  point pmin, pmax;
  pmin= f[point (p2[0]-delta, p2[1]-delta)];
  pmax= f[point (p2[0]+delta, p2[1]+delta)];
  return find_closest_point (p, pmin, pmax);
}

Here is the call graph for this function:

virtual array<grid_curve> grid_rep::get_curves ( point  lim1,
point  lim2,
bool  b = false 
) [pure virtual]

Implemented in logarithmic_rep, polar_rep, cartesian_rep, and empty_grid_rep.

Here is the caller graph for this function:

array< grid_curve > grid_rep::get_curves_around ( point  p,
double  delta,
frame  f 
) [virtual]

Reimplemented in cartesian_rep.

Definition at line 67 of file grid.cpp.

                                                           {
  point p2= f (p);
  point pmin, pmax;
  pmin= f[point (p2[0]-delta, p2[1]-delta)];
  pmax= f[point (p2[0]+delta, p2[1]+delta)];
  return get_curves (pmin, pmax, true);
}

Here is the call graph for this function:

virtual grid_rep::operator tree ( ) [pure virtual]
void grid_rep::set_aspect ( tree  aspect) [virtual]

Definition at line 21 of file grid.cpp.

                                 {
  subd= array<SI> (2);
  subd[0]= 0;
  subd[1]= 1;
  col= array<string> (2);
  col[0]= "#808080";
  col[1]= "#c0c0c0";
  if (is_tuple (aspect)) {
    int i;
    bool b= false;
    subd= array<SI> (N(aspect));
    col= array<string> (N(aspect));
    for (i=0; i<N(aspect); i++) {
       if (is_tuple (aspect[i], "axes", 1)) {
         subd[i]= 0;
         b= true;
       }
       else {
         subd[i]= as_int (aspect[i][0]);
       }
       col[i]= as_string (aspect[i][1]);
    }
    if (!b) {
      array<SI> subd0 (1);
      array<string> col0 (1);
      subd0[0]= 0;
      col0[0]= "#e0e0ff";
      subd= subd0 << subd;
      col= col0 << col;
    }
    do {
      b= true;
      for (i=1; i<N(subd); i++)
         if (subd[i-1]>subd[i]) {
           SI j;
           string c;
           j= subd[i-1];subd[i-1]= subd[i];subd[i]= j;
           c= col[i-1];col[i-1]= col[i];col[i]= c;
           b= false;
         }
    }
    while (!b);
  }
}

Here is the call graph for this function:


Member Data Documentation

point grid_rep::center [protected]

Definition at line 38 of file grid.hpp.

array<string> grid_rep::col [protected]

Definition at line 37 of file grid.hpp.

int abstract_struct::ref_count [inherited]

Definition at line 142 of file basic.hpp.

array<SI> grid_rep::subd [protected]

Definition at line 36 of file grid.hpp.


The documentation for this class was generated from the following files: