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>
44 typedef gtl::point_data<coordinate_type> point_type;
182 typedef base_type::point_type point_type;
263 template <
typename Iterator>
264 void set(Iterator first, Iterator last) {this->assign(first, last);}
575 void addPolygon(
int layer,
int datatype, std::vector<point_type>
const& vPoint);
581 void addPath(
int layer,
int datatype,
int pathtype,
int width, std::vector<point_type>
const& vPoint);
592 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);
598 void addCellReference(std::string
const& sname, point_type
const& position,
double angle,
double magnification,
int strans);
607 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);
616 std::vector<std::pair< ::GdsParser::GdsRecords::EnumType, GdsObject*> >
const&
objects()
const {
return m_vObject;}
618 std::vector<std::pair< ::GdsParser::GdsRecords::EnumType, GdsObject*> >&
objects() {
return m_vObject;}
724 namespace boost {
namespace geometry {
namespace traits {
731 struct tag<
GdsParser::GdsDB::GdsRectangle > :
public tag<GdsParser::GdsDB::GdsRectangle::base_ext_type>
739 typedef GdsParser::GdsDB::GdsRectangle::point_type type;
749 struct tag<
GdsParser::GdsDB::GdsPolygon > :
public tag<GdsParser::GdsDB::GdsPolygon::base_ext_type>
757 typedef GdsParser::GdsDB::GdsObject::point_type type;
765 namespace boost {
namespace polygon {
772 typedef rectangle_concept type;
781 typedef polygon_concept type;
coordinate_type m_width
path width
void setHeader(std::string const &h)
std::string const & refCell() const
std::string m_refCell
string to reference cell
gtl::rectangle_data< int > base_ext_type
rectangle type
coordinate_type m_spacing[2]
spacing of x and y
GdsObject()
default constructor
void addPolygon(int layer, int datatype, std::vector< point_type > const &vPoint)
void setPosition(point_type const &p)
gtl::rectangle_data< coordinate_type > rectangle_type
rectangle type
double m_magnification
magnification
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::string m_text
text string
std::vector< point_type > & positions()
GdsCell extractCellRef(GdsDB const &gdsDB, GdsCell const &srcCell) const
void setWidth(coordinate_type w)
void setRefCell(std::string const &r)
GdsObject base_type
base type
point_type const & position() const
std::string const & header() const
gtl::polygon_data< coordinate_type > polygon_type
polygon type
~GdsRectangle()
destructor
bg::model::linestring< GdsShape::point_type > base_ext_type
use a linestring to describe path
double magnification() const
std::string const & libname() const
GdsPath()
default constructor
void setRefCell(std::string const &r)
GdsShape base_type
base type
GdsObject base_type
base type
double m_magnification
magnification
std::string m_libname
name of library
double m_magnification
magnification
GdsCellArray & operator=(GdsCellArray const &rhs)
void setSpacing(unsigned int idx, coordinate_type s)
GdsRectangle & operator=(GdsRectangle const &rhs)
GdsPolygon toPolygon() const
convert from path to polygon description
GdsShape()
default constructor
GdsObject base_type
base type
std::pair< ::GdsParser::GdsRecords::EnumType, GdsObject * > object_entry_type
use pair of GDSII record and GDSII object to describe each object entry
void addPath(int layer, int datatype, int pathtype, int width, std::vector< point_type > const &vPoint)
GdsCellArray()
default constructor
std::vector< std::pair< ::GdsParser::GdsRecords::EnumType, GdsObject * > > const & objects() const
point_type m_position
position
GdsCellReference & operator=(GdsCellReference const &rhs)
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)
GdsCell extractCell(std::string const &cellName) const
extract a cell into a new cell with flatten hierarchies
GdsCell & addCell(std::string const &name="")
add a cell and return the reference to the new cell
GdsShape base_type
base type
void addCellReference(std::string const &sname, point_type const &position, double angle, double magnification, int strans)
GdsDB & operator=(GdsDB const &rhs)
std::string m_refCell
reference cell
coordinate_type spacing(unsigned int idx) const
GdsCellReference()
default constructor
void setPresentation(int p)
gtl::polygon_data< GdsShape::coordinate_type > base_ext_type
use polygon_data as polygon type
std::vector< GdsCell > const & cells() const
void set(Iterator first, Iterator last)
set path
void setPosition(point_type const &p)
void setPrecision(double p)
std::vector< point_type > const & positions() const
std::vector< GdsCell > & cells()
double magnification() const
GdsShape & operator=(GdsShape const &rhs)
~GdsCellArray()
destructor
double magnification() const
point_type m_position
position
std::map< std::string, unsigned int > m_mCellName2Idx
map from cell name to index
void destroy()
destroy objects in m_vObject
void setName(std::string const &n)
namespace for Limbo.GdsParser
coordinate_type width() const
GdsText & operator=(GdsText const &rhs)
void setText(std::string const &t)
void setLibname(std::string const &n)
void setMagnification(double m)
GdsPath & operator=(GdsPath const &rhs)
GdsPolygon()
default constructor
std::vector< GdsCell > m_vCell
cell array
gtl::interval_data< coordinate_type > interval_type
interval type
GdsShape base_type
base type
GdsRectangle()
default constructor
std::vector< object_entry_type > m_vObject
gdsii objects with types
gtl::polygon_90_set_data< coordinate_type > polygon_set_type
polygon set type
std::vector< point_type > m_vPosition
array of positions
GdsText()
default constructor
void setMagnification(double m)
double m_precision
precision
void copy(GdsCell const &rhs)
GdsPolygon & operator=(GdsPolygon const &rhs)
int m_columns
number of columns
std::vector< std::pair< ::GdsParser::GdsRecords::EnumType, GdsObject * > > & objects()
GdsObject & operator=(GdsObject const &rhs)
assignment
std::string m_header
header
virtual ~GdsObject()
destructor
GdsCell()
default constructor
GdsObject base_type
base type
GdsObject base_type
base type
std::string m_name
cell name
GdsShape base_type
base type
GdsCell const * getCell(std::string const &cellName) const
given cell name and return the pointer to the cell, return NULL if not found
GdsCell & operator=(GdsCell const &rhs)
void setMagnification(double m)
~GdsCellReference()
destructor
int m_presentation
presentation
int coordinate_type
coordinate types
std::string const & refCell() const
point_type const & position() const
std::string const & text() const
std::string const & name() const