1 ///////////////////////////////////////////////////////////////////////////////
2 // BSD 3-Clause License
3 //
4 // Copyright (c) 2019, Nefelus Inc
5 // All rights reserved.
6 //
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions are met:
9 //
10 // * Redistributions of source code must retain the above copyright notice, this
11 //   list of conditions and the following disclaimer.
12 //
13 // * Redistributions in binary form must reproduce the above copyright notice,
14 //   this list of conditions and the following disclaimer in the documentation
15 //   and/or other materials provided with the distribution.
16 //
17 // * Neither the name of the copyright holder nor the names of its
18 //   contributors may be used to endorse or promote products derived from
19 //   this software without specific prior written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 // POSSIBILITY OF SUCH DAMAGE.
32 
33 #include "definFill.h"
34 
35 #include <ctype.h>
36 #include <stdio.h>
37 #include <stdlib.h>
38 
39 #include "db.h"
40 #include "dbShape.h"
41 #include "utl/Logger.h"
42 namespace odb {
43 
definFill()44 definFill::definFill()
45 {
46   _cur_layer = NULL;
47 }
48 
~definFill()49 definFill::~definFill()
50 {
51 }
52 
init()53 void definFill::init()
54 {
55   definBase::init();
56   _cur_layer = NULL;
57 }
58 
fillBegin(const char * layer,bool needs_opc,int mask_number)59 void definFill::fillBegin(const char* layer, bool needs_opc, int mask_number)
60 {
61   _cur_layer = _tech->findLayer(layer);
62 
63   if (_cur_layer == NULL) {
64     _logger->warn(
65         utl::ODB, 95, "error: undefined layer ({}) referenced", layer);
66     ++_errors;
67   }
68   _mask_number = mask_number;
69   _needs_opc = needs_opc;
70 }
71 
fillRect(int x1,int y1,int x2,int y2)72 void definFill::fillRect(int x1, int y1, int x2, int y2)
73 {
74   x1 = dbdist(x1);
75   y1 = dbdist(y1);
76   x2 = dbdist(x2);
77   y2 = dbdist(y2);
78   dbFill::create(_block, _needs_opc, _mask_number, _cur_layer, x1, y1, x2, y2);
79 }
80 
fillPolygon(std::vector<Point> &)81 void definFill::fillPolygon(std::vector<Point>& /* unused: points */)
82 {
83 }
84 
fillEnd()85 void definFill::fillEnd()
86 {
87 }
88 
89 }  // namespace odb
90