8#ifndef LIMBO_PARSERS_GDSII_GDSDB_GDSOBJECTS_H
9#define LIMBO_PARSERS_GDSII_GDSDB_GDSOBJECTS_H
11#include <boost/geometry.hpp>
13#include <boost/geometry/geometries/adapted/boost_polygon.hpp>
14#include <boost/geometry/geometries/geometries.hpp>
25namespace gtl = boost::polygon;
26namespace bg = boost::geometry;
275 template <
typename Iterator>
276 void set(Iterator first, Iterator last) {this->assign(first, last);}
589 void addPolygon(
int layer,
int datatype, std::vector<point_type>
const& vPoint);
597 void addPath(
int layer,
int datatype,
int pathtype,
int width,
int bgnextn,
int endextn, std::vector<point_type>
const& vPoint);
608 void addText(
int layer,
int datatype,
int texttype, std::string
const& str,
point_type const& position,
int width,
int presentation,
double angle,
double magnification,
int strans);
623 void addCellArray(std::string
const& sname,
int columns,
int rows,
int spacing[2], std::vector<point_type>
const& vPosition,
double angle,
double magnification,
int strans);
632 std::vector<std::pair< ::GdsParser::GdsRecords::EnumType, GdsObject*> >
const&
objects()
const {
return m_vObject;}
634 std::vector<std::pair< ::GdsParser::GdsRecords::EnumType, GdsObject*> >&
objects() {
return m_vObject;}
740namespace boost {
namespace geometry {
namespace traits {
747struct tag<
GdsParser::GdsDB::GdsRectangle > :
public tag<GdsParser::GdsDB::GdsRectangle::base_ext_type>
765struct tag<
GdsParser::GdsDB::GdsPolygon > :
public tag<GdsParser::GdsDB::GdsPolygon::base_ext_type>
781namespace boost {
namespace polygon {
788 typedef rectangle_concept type;
797 typedef polygon_concept type;
GdsCellArray(GdsCellArray const &rhs)
std::vector< point_type > & positions()
GdsCellArray()
default constructor
void setMagnification(double m)
GdsObject base_type
base type
void setRefCell(std::string const &r)
double m_magnification
magnification
std::vector< point_type > m_vPosition
array of positions
std::string const & refCell() const
std::string m_refCell
reference cell
std::vector< point_type > const & positions() const
double magnification() const
int m_columns
number of columns
void setSpacing(unsigned int idx, coordinate_type s)
~GdsCellArray()
destructor
coordinate_type spacing(unsigned int idx) const
GdsCellArray & operator=(GdsCellArray const &rhs)
coordinate_type m_spacing[2]
spacing of x and y
void addPath(int layer, int datatype, int pathtype, int width, int bgnextn, int endextn, std::vector< point_type > const &vPoint)
void addText(int layer, int datatype, int texttype, std::string const &str, point_type const &position, int width, int presentation, double angle, double magnification, int strans)
std::vector< object_entry_type > m_vObject
gdsii objects with types
GdsObject base_type
base type
std::vector< std::pair< ::GdsParser::GdsRecords::EnumType, GdsObject * > > & objects()
std::vector< std::pair< ::GdsParser::GdsRecords::EnumType, GdsObject * > > const & objects() const
void setName(std::string const &n)
std::string const & name() const
void addCellReference(std::string const &sname, point_type const &position, double angle, double magnification, int strans)
GdsCell()
default constructor
void destroy()
destroy objects in m_vObject
GdsCell & operator=(GdsCell const &rhs)
void copy(GdsCell const &rhs)
void addPolygon(int layer, int datatype, std::vector< point_type > const &vPoint)
GdsCell(GdsCell const &rhs)
std::pair< ::GdsParser::GdsRecords::EnumType, GdsObject * > object_entry_type
use pair of GDSII record and GDSII object to describe each object entry
void addCellArray(std::string const &sname, int columns, int rows, int spacing[2], std::vector< point_type > const &vPosition, double angle, double magnification, int strans)
std::string m_name
cell name
void setPosition(point_type const &p)
point_type m_position
position
GdsCellReference(GdsCellReference const &rhs)
std::string const & refCell() const
double m_magnification
magnification
std::string m_refCell
string to reference cell
GdsCellReference()
default constructor
~GdsCellReference()
destructor
void setMagnification(double m)
point_type const & position() const
GdsCellReference & operator=(GdsCellReference const &rhs)
GdsObject base_type
base type
void setRefCell(std::string const &r)
GdsCell extractCellRef(GdsDB const &gdsDB, GdsCell const &srcCell) const
double magnification() const
double m_precision
precision
GdsCell & addCell(std::string const &name="")
add a cell and return the reference to the new cell
GdsCell * getCell(std::string const &cellName)
given cell name and return the pointer to the cell, return NULL if not found
std::vector< GdsCell > m_vCell
cell array
std::string m_header
header
GdsCell const * getCell(std::string const &cellName) const
given cell name and return the pointer to the cell, return NULL if not found
std::string const & libname() const
std::vector< GdsCell > & cells()
GdsObject base_type
base type
GdsCell extractCell(std::string const &cellName) const
extract a cell into a new cell with flatten hierarchies
std::string const & header() const
std::string m_libname
name of library
void setPrecision(double p)
std::map< std::string, unsigned int > m_mCellName2Idx
map from cell name to index
GdsDB & operator=(GdsDB const &rhs)
void setLibname(std::string const &n)
std::vector< GdsCell > const & cells() const
void setHeader(std::string const &h)
GdsCell & addCell(GdsCell const &cell)
add a cell
int coordinate_type
coordinate types
GdsObject & operator=(GdsObject const &rhs)
assignment
gtl::interval_data< coordinate_type > interval_type
interval type
gtl::point_data< double > float_point_type
float point type to avoid numerical issue
gtl::polygon_90_set_data< coordinate_type > polygon_set_type
polygon set type
GdsObject(GdsObject const &rhs)
copy constructor
virtual ~GdsObject()
destructor
gtl::point_data< coordinate_type > point_type
gtl::polygon_data< coordinate_type > polygon_type
polygon type
GdsObject()
default constructor
gtl::rectangle_data< coordinate_type > rectangle_type
rectangle type
coordinate_type bgnExtn() const
void set(Iterator first, Iterator last)
set path
GdsShape base_type
base type
GdsPath(GdsPath const &rhs)
coordinate_type m_endextn
end point extension
coordinate_type width() const
void setWidth(coordinate_type w)
GdsPath()
default constructor
bg::model::linestring< GdsShape::point_type > base_ext_type
use a linestring to describe path
coordinate_type m_bgnextn
begin point extension
coordinate_type endExtn() const
GdsPolygon toPolygon() const
convert from path to polygon description
coordinate_type m_width
path width
void setBgnExtn(coordinate_type e)
GdsPath & operator=(GdsPath const &rhs)
void setEndExtn(coordinate_type e)
GdsPolygon(GdsPolygon const &rhs)
GdsPolygon & operator=(GdsPolygon const &rhs)
GdsPolygon()
default constructor
GdsShape base_type
base type
gtl::polygon_data< GdsShape::coordinate_type > base_ext_type
use polygon_data as polygon type
GdsRectangle(GdsRectangle const &rhs)
GdsRectangle & operator=(GdsRectangle const &rhs)
GdsRectangle()
default constructor
GdsShape base_type
base type
~GdsRectangle()
destructor
gtl::rectangle_data< int > base_ext_type
rectangle type
GdsShape & operator=(GdsShape const &rhs)
GdsObject base_type
base type
GdsShape()
default constructor
GdsShape(GdsShape const &rhs)
void setPresentation(int p)
double magnification() const
GdsText(GdsText const &rhs)
GdsText()
default constructor
void setMagnification(double m)
void setText(std::string const &t)
int m_presentation
presentation
point_type const & position() const
void setPosition(point_type const &p)
GdsShape base_type
base type
std::string const & text() const
GdsText & operator=(GdsText const &rhs)
std::string m_text
text string
double m_magnification
magnification
point_type m_position
position
namespace for Limbo.GdsParser.GdsDB
namespace for Limbo.GdsParser