2026-05-11 22:19:12 +02:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
KLayout Layout Viewer
|
|
|
|
|
Copyright (C) 2006-2026 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_layDensityMapDialog
|
|
|
|
|
#define HDR_layDensityMapDialog
|
|
|
|
|
|
|
|
|
|
#include "ui_DensityMapDialog.h"
|
|
|
|
|
|
|
|
|
|
#include "layLayoutView.h"
|
|
|
|
|
#include "layBrowser.h"
|
|
|
|
|
#include "layMarker.h"
|
|
|
|
|
|
|
|
|
|
namespace lay
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
class DensityMapDialog
|
|
|
|
|
: public lay::Browser,
|
|
|
|
|
private Ui::DensityMapDialog
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
DensityMapDialog (lay::Dispatcher *root, lay::LayoutViewBase *view);
|
|
|
|
|
~DensityMapDialog ();
|
|
|
|
|
|
|
|
|
|
public slots:
|
2026-05-18 22:25:43 +02:00
|
|
|
void layer_mode_changed (int);
|
|
|
|
|
void region_mode_changed (int);
|
2026-05-11 22:19:12 +02:00
|
|
|
void accept ();
|
2026-05-18 22:25:43 +02:00
|
|
|
void apply ();
|
2026-05-11 22:19:12 +02:00
|
|
|
|
|
|
|
|
private:
|
2026-05-18 22:25:43 +02:00
|
|
|
struct DensityMapParameters
|
|
|
|
|
{
|
|
|
|
|
DensityMapParameters ()
|
|
|
|
|
: pixel_size (100.0), threads (1)
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
// Collects all cv_index/layer index pairs used for input
|
|
|
|
|
std::vector<std::pair<unsigned int, unsigned int> > input_layers;
|
|
|
|
|
|
|
|
|
|
// The region to compute the density map from
|
|
|
|
|
db::DBox region;
|
|
|
|
|
|
|
|
|
|
// The pixel size
|
|
|
|
|
double pixel_size;
|
|
|
|
|
|
|
|
|
|
// The number of threads to use
|
|
|
|
|
int threads;
|
|
|
|
|
};
|
|
|
|
|
|
2026-05-11 22:19:12 +02:00
|
|
|
// implementation of the lay::Plugin interface
|
|
|
|
|
virtual bool configure (const std::string &name, const std::string &value);
|
|
|
|
|
|
|
|
|
|
// implementation of the lay::Plugin interface
|
|
|
|
|
void menu_activated (const std::string &symbol);
|
|
|
|
|
|
2026-05-18 22:25:43 +02:00
|
|
|
void make_density_map ();
|
|
|
|
|
void compute_density_map (const DensityMapParameters &par);
|
|
|
|
|
|
2026-05-11 22:19:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|