
/*

  KLayout Layout Viewer
  Copyright (C) 2006-2016 Matthias Koefferlein

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*/


#ifndef HDR_layRedrawLayerInfo
#define HDR_layRedrawLayerInfo

#include <vector>
#include "dbTrans.h"
#include "dbPropertiesRepository.h"
#include "layParsedLayerSource.h"

namespace lay {

struct LayerProperties;

/**
 *  @brief A helper struct to describe one entry in the redraw queue
 */
struct RedrawLayerInfo
{
  RedrawLayerInfo (const lay::LayerProperties &lp);

  /**
   *  @brief Enable redrawing
   *
   *  If this flag is true (the default), redrawing is enabled. Otherwise this layer is skipped.
   */
  bool enabled;

  /**
   *  @brief Visible layer
   *
   *  If this flag is true, the layer is visible. Visible layers are drawn with 
   *  higher priority than the invisible ones. This flag is set by the constructor.
   */
  bool visible;

  /**
   *  @brief Cell frame layer
   *
   *  If this flag is true, this layer is supposed to draw cell frames.
   *  It is set by the constructor if the source is a wildcard layer.
   */
  bool cell_frame;

  /**
   *  @brief The layer index
   *
   *  The logical layer to draw. If this member is <0 and the cellview_index is <0, it is an invalid layer,
   *  which is ignored. If the cellview_index is >=0, it denotes a "cell frame" pseudo
   *  layer. It is set by the constructor.
   */
  int layer_index;

  /**
   *  @brief The cellview index
   *
   *  Set layer_index for details about the interpretation of this member.
   *  This member is set by the constructor.
   */
  int cellview_index;

  /**
   *  @brief A set of transformations applied for this layer
   *
   *  This member is set by the constructor.
   */
  std::vector<db::CplxTrans> trans;

  /**
   *  @brief The hierarchy levels drawn
   *
   *  This member is set by the constructor.
   */
  lay::HierarchyLevelSelection hier_levels;

  /**
   *  @brief The property selection applicable for this layer
   *
   *  This member is set by the constructor.
   */
  std::set <db::properties_id_type> prop_sel;

  /** 
   *  @brief Invert the property selection
   *
   *  This member is set by the constructor.
   */
  bool inverse_prop_sel;
};

}

#endif
