示例#1
0
    def _init_primitives_trans(self):
        self.init_primitives()  # must be implemented in every subclass
        dr_origin = DSimplePolygon([DPoint(0, 0)])
        if (self.DCplxTrans_init is not None):
            # constructor trans displacement
            dCplxTrans_temp = DCplxTrans(1, 0, False,
                                         self.DCplxTrans_init.disp)
            for element in self.primitives.values():
                element.make_trans(dCplxTrans_temp)
            dr_origin.transform(dCplxTrans_temp)
            self._update_connections(dCplxTrans_temp)
            self._update_alpha(dCplxTrans_temp)

            # rest of the constructor trans functions
            dCplxTrans_temp = self.DCplxTrans_init.dup()
            dCplxTrans_temp.disp = DPoint(0, 0)
            for element in self.primitives.values():
                element.make_trans(dCplxTrans_temp)
            dr_origin.transform(dCplxTrans_temp)
            self._update_connections(dCplxTrans_temp)
            self._update_alpha(dCplxTrans_temp)

        dCplxTrans_temp = DCplxTrans(1, 0, False, self.origin)
        for element in self.primitives.values():
            element.make_trans(dCplxTrans_temp)  # move to the origin
        self._update_connections(dCplxTrans_temp)
        self._update_alpha(dCplxTrans_temp)
        self.origin += dr_origin.point(0)

        # FOLLOWING CYCLE GIVES WRONG INFO ABOUT FILLED AND ERASED AREAS
        for element in self.primitives.values():
            self.metal_region += element.metal_region
            self.empty_region += element.empty_region
 def _init_regions_trans( self ):
     self.init_regions()         # must be implemented in every subclass
     dr_origin = DSimplePolygon( [DPoint(0,0)] )
     if( self.DCplxTrans_init is not None ):
         # constructor trans displacement
         dCplxTrans_temp = DCplxTrans( 1,0,False, self.DCplxTrans_init.disp )
         self.make_trans( dCplxTrans_temp )
         dr_origin.transform( dCplxTrans_temp )
         
         # rest of the constructor trans functions
         dCplxTrans_temp = self.DCplxTrans_init.dup()
         dCplxTrans_temp.disp = DPoint(0,0)
         self.make_trans( dCplxTrans_temp )
         dr_origin.transform( dCplxTrans_temp )                  
         
     # translation to the old origin (self.connections are alredy contain proper values)
     self.make_trans( DCplxTrans( 1,0,False, self.origin ) ) # move to the origin
     self.origin += dr_origin.point( 0 )
示例#3
0
 def init_primitives_gnd_trans( self ):
     dr_origin = DSimplePolygon( [DPoint(0,0)] )
     if( self.DCplxTrans_init is not None ):
         # constructor trans displacement
         dCplxTrans_temp = DCplxTrans( 1,0,False, self.DCplxTrans_init.disp )
         for element in self.primitives_gnd.values():
             element.make_trans( dCplxTrans_temp )
         dr_origin.transform( dCplxTrans_temp )
         
         # rest of the constructor trans functions
         dCplxTrans_temp = self.DCplxTrans_init.dup()
         dCplxTrans_temp.disp = DPoint(0,0)
         for element in self.primitives_gnd.values():
             element.make_trans( dCplxTrans_temp )
         dr_origin.transform( dCplxTrans_temp )
     
     dCplxTrans_temp = DCplxTrans( 1,0,False, self.origin )
     for element in self.primitives_gnd.values():    
         element.make_trans( dCplxTrans_temp ) # move to the origin