mirror of https://github.com/KLayout/klayout.git
WIP: some little refactoring.
This commit is contained in:
parent
d762074bc0
commit
9a4cd629fc
|
|
@ -35,6 +35,9 @@
|
||||||
#include "dbEdgePairs.h"
|
#include "dbEdgePairs.h"
|
||||||
#include "dbEdges.h"
|
#include "dbEdges.h"
|
||||||
#include "dbTexts.h"
|
#include "dbTexts.h"
|
||||||
|
#include "dbCellMapping.h"
|
||||||
|
#include "dbLayerMapping.h"
|
||||||
|
#include "dbLayoutUtils.h"
|
||||||
#include "tlTimer.h"
|
#include "tlTimer.h"
|
||||||
#include "tlLog.h"
|
#include "tlLog.h"
|
||||||
#include "tlInternational.h"
|
#include "tlInternational.h"
|
||||||
|
|
@ -1171,6 +1174,60 @@ Layout::topological_sort ()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Layout::copy_tree_shapes (const db::Layout &source_layout, const db::CellMapping &cm)
|
||||||
|
{
|
||||||
|
if (this == &source_layout) {
|
||||||
|
throw tl::Exception (tl::to_string (tr ("Cannot copy shapes within the same layout")));
|
||||||
|
}
|
||||||
|
|
||||||
|
db::ICplxTrans trans (source_layout.dbu () / dbu ());
|
||||||
|
|
||||||
|
db::LayerMapping lm;
|
||||||
|
lm.create_full (*this, source_layout);
|
||||||
|
|
||||||
|
db::copy_shapes (*this, source_layout, trans, cm.source_cells (), cm.table (), lm.table ());
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Layout::copy_tree_shapes (const db::Layout &source_layout, const db::CellMapping &cm, const db::LayerMapping &lm)
|
||||||
|
{
|
||||||
|
if (this == &source_layout) {
|
||||||
|
throw tl::Exception (tl::to_string (tr ("Cannot copy shapes within the same layout")));
|
||||||
|
}
|
||||||
|
|
||||||
|
db::ICplxTrans trans (source_layout.dbu () / dbu ());
|
||||||
|
|
||||||
|
db::copy_shapes (*this, source_layout, trans, cm.source_cells (), cm.table (), lm.table ());
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Layout::move_tree_shapes (db::Layout &source_layout, const db::CellMapping &cm)
|
||||||
|
{
|
||||||
|
if (this == &source_layout) {
|
||||||
|
throw tl::Exception (tl::to_string (tr ("Cannot copy shapes within the same layout")));
|
||||||
|
}
|
||||||
|
|
||||||
|
db::ICplxTrans trans (source_layout.dbu () / dbu ());
|
||||||
|
|
||||||
|
db::LayerMapping lm;
|
||||||
|
lm.create_full (*this, source_layout);
|
||||||
|
|
||||||
|
db::move_shapes (*this, source_layout, trans, cm.source_cells (), cm.table (), lm.table ());
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Layout::move_tree_shapes (db::Layout &source_layout, const db::CellMapping &cm, const db::LayerMapping &lm)
|
||||||
|
{
|
||||||
|
if (this == &source_layout) {
|
||||||
|
throw tl::Exception (tl::to_string (tr ("Cannot copy shapes within the same layout")));
|
||||||
|
}
|
||||||
|
|
||||||
|
db::ICplxTrans trans (source_layout.dbu () / dbu ());
|
||||||
|
|
||||||
|
db::move_shapes (*this, source_layout, trans, cm.source_cells (), cm.table (), lm.table ());
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Layout::is_valid_cell_index (cell_index_type ci) const
|
Layout::is_valid_cell_index (cell_index_type ci) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,8 @@ class Region;
|
||||||
class Edges;
|
class Edges;
|
||||||
class EdgePairs;
|
class EdgePairs;
|
||||||
class Texts;
|
class Texts;
|
||||||
|
class CellMapping;
|
||||||
|
class LayerMapping;
|
||||||
|
|
||||||
template <class Coord> class generic_repository;
|
template <class Coord> class generic_repository;
|
||||||
typedef generic_repository<db::Coord> GenericRepository;
|
typedef generic_repository<db::Coord> GenericRepository;
|
||||||
|
|
@ -1257,6 +1259,34 @@ public:
|
||||||
*/
|
*/
|
||||||
void delete_layer (unsigned int n);
|
void delete_layer (unsigned int n);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Copies the shapes of certain cells from the given source layout into this layout
|
||||||
|
*
|
||||||
|
* The affected cells are derived from the cell mapping object.
|
||||||
|
*/
|
||||||
|
void copy_tree_shapes (const db::Layout &source_layout, const db::CellMapping &cm);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Copies the shapes of certain cells from the given source layout into this layout using the given layer mapping
|
||||||
|
*
|
||||||
|
* The affected cells are derived from the cell mapping object.
|
||||||
|
*/
|
||||||
|
void copy_tree_shapes (const db::Layout &source_layout, const db::CellMapping &cm, const db::LayerMapping &lm);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Moves the shapes of certain cells from the given source layout into this layout
|
||||||
|
*
|
||||||
|
* The affected cells are derived from the cell mapping object.
|
||||||
|
*/
|
||||||
|
void move_tree_shapes (db::Layout &source_layout, const db::CellMapping &cm);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Moves the shapes of certain cells from the given source layout into this layout using the given layer mapping
|
||||||
|
*
|
||||||
|
* The affected cells are derived from the cell mapping object.
|
||||||
|
*/
|
||||||
|
void move_tree_shapes (db::Layout &source_layout, const db::CellMapping &cm, const db::LayerMapping &lm);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return true, if the cell index is a valid one
|
* @brief Return true, if the cell index is a valid one
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue