/ *   
 
   *   P R O J E C T :   N y A R T o o l k i t C S ( E x t e n s i o n ) 
 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
   *   T h e   N y A R T o o l k i t C S   i s   C #   e d i t i o n   A R T o o l K i t   c l a s s   l i b r a r y . 
 
   *   C o p y r i g h t   ( C ) 2 0 0 8 - 2 0 0 9   R y o   I i z u k a 
 
   * 
 
   *   T h i s   p r o g r a m   i s   f r e e   s o f t w a r e :   y o u   c a n   r e d i s t r i b u t e   i t   a n d / o r   m o d i f y 
 
   *   i t   u n d e r   t h e   t e r m s   o f   t h e   G N U   G e n e r a l   P u b l i c   L i c e n s e   a s   p u b l i s h e d   b y 
 
   *   t h e   F r e e   S o f t w a r e   F o u n d a t i o n ,   e i t h e r   v e r s i o n   3   o f   t h e   L i c e n s e ,   o r 
 
   *   ( a t   y o u r   o p t i o n )   a n y   l a t e r   v e r s i o n . 
 
   *   
 
   *   T h i s   p r o g r a m   i s   d i s t r i b u t e d   i n   t h e   h o p e   t h a t   i t   w i l l   b e   u s e f u l , 
 
   *   b u t   W I T H O U T   A N Y   W A R R A N T Y ;   w i t h o u t   e v e n   t h e   i m p l i e d   w a r r a n t y   o f 
 
   *   M E R C H A N T A B I L I T Y   o r   F I T N E S S   F O R   A   P A R T I C U L A R   P U R P O S E .     S e e   t h e 
 
   *   G N U   G e n e r a l   P u b l i c   L i c e n s e   f o r   m o r e   d e t a i l s . 
 
   * 
 
   *   Y o u   s h o u l d   h a v e   r e c e i v e d   a   c o p y   o f   t h e   G N U   G e n e r a l   P u b l i c   L i c e n s e 
 
   *   a l o n g   w i t h   t h i s   p r o g r a m .     I f   n o t ,   s e e   < h t t p : / / w w w . g n u . o r g / l i c e n s e s / > . 
 
   *   
 
   *   F o r   f u r t h e r   i n f o r m a t i o n   p l e a s e   c o n t a c t . 
 
   * 	 h t t p : / / n y a t l a . j p / n y a t o o l k i t / 
 
   * 	 < a i r m a i l ( a t ) e b o n y . p l a l a . o r . j p >   o r   < n y a t l a ( a t ) n y a t l a . j p > 
 
   *   
 
   * / 
 
 u s i n g   S y s t e m ; 
 
 u s i n g   S y s t e m . D i a g n o s t i c s ; 
 
 u s i n g   S y s t e m . T h r e a d i n g ; 
 
 u s i n g   j p . n y a t l a . n y a r t o o l k i t . c s . c o r e ; 
 
 
 
 n a m e s p a c e   j p . n y a t l a . n y a r t o o l k i t . c s . r p f 
 
 
 
 { 
 
         / * * 
 
           *   Y0000Xn00000g0Y00^Tgk0I D 0000XW0~0Y00
 
           *   S0n0000o00000j0n0g00000$R[0^Tgj00000k0OUD0T0[0f003 y_k0P}g0ԏtSW0~0Y00
 
           *   S0n0000000_(uY00h00Y萵000g0ؚ|^j0;uP Nc"}I{L0g0M0~0Y00
 
           *   
 
           *   FOW00kVY萵000k0OUD0T0[00h00000000n0RSL0oW0D0n0g00[k0o0P}g000000
 
           *   Y00j0i0n0[V{L0_k0j00~0Y00
 
           *   @ a u t h o r   n y a t l a 
 
           * 
 
           * / 
 
         p u b l i c   c l a s s   A S y n c I d M a r k e r T a b l e 
 
         { 
 
 	         p u b l i c   i n t e r f a c e   I R e s u l t L i s t e n e r 
 
 	         { 
 
                         v o i d   O n D e t e c t ( b o o l   i _ r e s u l t ,   l o n g   i _ s e r i a l ,   i n t   i _ d i r ,   d o u b l e   i _ w i d t h ,   l o n g   i d ) ; 
 
 	         } 
 
 	         R a w b i t S e r i a l I d T a b l e   _ m k l i b ; 
 
 	         I R e s u l t L i s t e n e r   _ l i s t e n e r ; 
 
                 c l a s s   A s y n c T h r e a d 
 
 	         { 
 
 	 	         p r i v a t e   A S y n c I d M a r k e r T a b l e   _ p a r e n t ; 
 
 	 	         p r i v a t e   l o n g   _ s e r i a l ; 
 
 	 	         p r i v a t e   N y A R R g b R a s t e r   _ s o u r c e ; 
 
 	 	         p u b l i c   A s y n c T h r e a d ( A S y n c I d M a r k e r T a b l e   i _ p a r e n t , l o n g   i _ s e r i a l , N y A R R g b R a s t e r   i _ r a s t e r ) 
 
 	 	         { 
 
 	 	 	         t h i s . _ p a r e n t = i _ p a r e n t ; 
 
 	 	 	         t h i s . _ s e r i a l = i _ s e r i a l ; 
 
 	 	 	         t h i s . _ s o u r c e = i _ r a s t e r ; 
 
 	 	         } 
 
 	 	         p u b l i c   v o i d   r u n ( ) 
 
 	 	         { 
 
 	                     t r y   { 
 
 	                             T h r e a d . S l e e p ( 3 0 0 0 ) ; 
 
                 	             R a w b i t S e r i a l I d T a b l e . I d e n t i f y I d R e s u l t   r e t = n e w   R a w b i t S e r i a l I d T a b l e . I d e n t i f y I d R e s u l t ( ) ; 
 
                                     b o o l   r e s ; 
 
 	                             l o c k ( t h i s . _ p a r e n t . _ m k l i b ) { 
 
 	                 	             N y A R D o u b l e P o i n t 2 d [ ]   v x = N y A R D o u b l e P o i n t 2 d . c r e a t e A r r a y ( 4 ) ; 
 
 	                 	             / / SBf~000
 
 	                 	             v x [ 0 ] . x = 0 ;   v x [ 0 ] . y = 0 ; 
 
 	                 	             v x [ 1 ] . x = 9 9 ; v x [ 1 ] . y = 0 ; 
 
 	                 	             v x [ 2 ] . x = 9 9 ; v x [ 2 ] . y = 9 9 ; 
 
 	                 	             v x [ 3 ] . x = 0 ;   v x [ 3 ] . y = 9 9 ; 
 
 	                 	             r e s = t h i s . _ p a r e n t . _ m k l i b . i d e n t i f y I d ( v x , t h i s . _ s o u r c e , r e t ) ; 
 
 	                             } 
 
 	                             t h i s . _ p a r e n t . c a l l L i s t e n e r ( r e s , t h i s . _ s e r i a l , r e t . a r t k _ d i r e c t i o n , r e t . m a r k e r _ w i d t h , r e t . i d ) ; 
 
 	                         }   c a t c h   ( E x c e p t i o n   e ) { 
 
 	 	 	 	         C o n s o l e . E r r o r . W r i t e L i n e ( e . S t a c k T r a c e ) ; 
 
 	 	 	         } 
 
         	 	 	 
 
 	 	         } 
 
 	         } 
 
 	         p u b l i c   A S y n c I d M a r k e r T a b l e ( I R e s u l t L i s t e n e r   i _ l i s t e n e r ) 
 
 	         { 
 
 	 	         t h i s . _ m k l i b = n e w   R a w b i t S e r i a l I d T a b l e ( 1 ) ; 	 
 
 	 	         t h i s . _ m k l i b . a d d A n y I t e m ( " A N Y   I D " , 4 0 ) ; 
 
 	 	         t h i s . _ l i s t e n e r = i _ l i s t e n e r ; 
 
 	         } 
 
                 p r i v a t e   v o i d   c a l l L i s t e n e r ( b o o l   i _ r e s u l t ,   l o n g   i _ s e r i a l ,   i n t   i _ d i r ,   d o u b l e   i _ w i d t h ,   l o n g   i _ i d ) 
 
 	         { 
 
 	 	         / / O N / O F F 0000d0Q00j0000
 
 	 	         t h i s . _ l i s t e n e r . O n D e t e c t ( i _ r e s u l t ,   i _ s e r i a l ,   i _ d i r ,   i _ w i d t h , i _ i d ) ; 
 
 	         } 
 
 	         / * * 
 
 	           *   S0n000000k0d0D0f00^Tgk0XO<0QW0~0Y00S0n000000o00000j0n0g00%R0000g0I D 000$R[0W0f00
 
 	           *   	Ny_k0iS_j0000h0D i r e c t i o n 0ԏtSY00`0Q0g0Y00
 
 	           *   @ p a r a m   i _ t a r g e t 
 
 	           *   @ r e t u r n 
 
 	           *   @ t h r o w s   N y A R E x c e p t i o n   
 
 	           * / 
 
 	         p u b l i c   v o i d   r e q u e s t A s y n c M a r k e r D e t e c t ( N y A R R e a l i t y   i _ r e a l i t y , N y A R R e a l i t y S o u r c e   i _ s o u r c e , N y A R R e a l i t y T a r g e t   i _ t a r g e t ) 
 
 	         { 
 
 	 	         / / 00000K00;uP000j0i00S_Y00h0M0o000000K00g0o0j0O00S0S0g0TgW0f0S_W0f0000W0f0K000000k0_M0!nW0~0Y00
 
 
 
 	 	         / / 1 0 0 x 1 0 0 n0W0R0`0W0f00R a s t e r 0\O00
 
 	 	         N y A R R g b R a s t e r   r a s t e r = n e w   N y A R R g b R a s t e r ( 1 0 0 , 1 0 0 , N y A R B u f f e r T y p e . I N T 1 D _ X 8 R 8 G 8 B 8 _ 3 2 ) ; 
 
 	 	         i _ r e a l i t y . g e t R g b P a t t 2 d ( i _ s o u r c e ,   i _ t a r g e t . r e f T a r g e t V e r t e x ( ) , 1 ,   r a s t e r ) ; 
 
 	 	         / / 000W0_0000h000000n0I D 00000x0_M0!nY00
 
 	 	         T h r e a d   t = n e w   T h r e a d ( n e w   A s y n c T h r e a d ( t h i s , i _ t a r g e t . g e t S e r i a l I d ( ) , r a s t e r ) . r u n ) ; 
 
                         t . S t a r t ( ) ; 
 
 	 	         r e t u r n ; 
 
 	         } 
 
         } 
 
 } 