Back to index

texmacs  1.0.7.15
superpose_boxes.cpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : superpose.cpp
00004 * DESCRIPTION: Superpositions of arrays of boxes
00005 * COPYRIGHT  : (C) 2005  Henri Lesourd
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #include "Boxes/composite.hpp"
00013 #include "Boxes/construct.hpp"
00014 
00015 /******************************************************************************
00016 * The superpose_box representation
00017 ******************************************************************************/
00018 
00019 struct superpose_box_rep: public concrete_composite_box_rep {
00020   superpose_box_rep (path ip, array<box> bs, bool bfl):
00021     concrete_composite_box_rep (ip, bs, bfl) {}
00022   operator tree ();
00023   int reindex (int i, int item, int n);
00024 };
00025 
00026 superpose_box_rep::operator tree () {
00027   int i, n= N(bs);
00028   tree t (TUPLE, n+1);
00029   t[0]= "superpose";
00030   for (i=0; i<n; i++) t[i+1]= (tree) bs[i];
00031   return t;
00032 }
00033 
00034 int
00035 superpose_box_rep::reindex (int i, int item, int n) {
00036   (void) item; (void) n;
00037   return i;
00038 }
00039 
00040 /******************************************************************************
00041 * User interface
00042 ******************************************************************************/
00043 
00044 box
00045 superpose_box (path ip, array<box> bs, bool bfl) {
00046   return tm_new<superpose_box_rep> (ip, bs, bfl);
00047 }