Class: Contrek::Concurrent::Shape

Inherits:
Object
  • Object
show all
Defined in:
lib/contrek/finder/concurrent/shape.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeShape

Returns a new instance of Shape.



8
9
10
11
12
13
14
# File 'lib/contrek/finder/concurrent/shape.rb', line 8

def initialize
  @parent_shape = nil
  @merged_to_shape = nil
  @parent_inner_polyline = nil
  @children_shapes = []
  @reassociation_skip = false
end

Instance Attribute Details

#children_shapesObject (readonly)

Returns the value of attribute children_shapes.



6
7
8
# File 'lib/contrek/finder/concurrent/shape.rb', line 6

def children_shapes
  @children_shapes
end

#inner_polylinesObject

Returns the value of attribute inner_polylines.



4
5
6
# File 'lib/contrek/finder/concurrent/shape.rb', line 4

def inner_polylines
  @inner_polylines
end

#merged_to_shapeObject

Returns the value of attribute merged_to_shape.



4
5
6
# File 'lib/contrek/finder/concurrent/shape.rb', line 4

def merged_to_shape
  @merged_to_shape
end

#outer_polylineObject

Returns the value of attribute outer_polyline.



4
5
6
# File 'lib/contrek/finder/concurrent/shape.rb', line 4

def outer_polyline
  @outer_polyline
end

#parent_inner_polylineObject

Returns the value of attribute parent_inner_polyline.



4
5
6
# File 'lib/contrek/finder/concurrent/shape.rb', line 4

def parent_inner_polyline
  @parent_inner_polyline
end

#parent_shapeObject (readonly)

Returns the value of attribute parent_shape.



6
7
8
# File 'lib/contrek/finder/concurrent/shape.rb', line 6

def parent_shape
  @parent_shape
end

#reassociation_skipObject

Returns the value of attribute reassociation_skip.



4
5
6
# File 'lib/contrek/finder/concurrent/shape.rb', line 4

def reassociation_skip
  @reassociation_skip
end

Class Method Details

.init_by(set_outer_polyline, set_inner_polylines) ⇒ Object



16
17
18
19
20
21
# File 'lib/contrek/finder/concurrent/shape.rb', line 16

def self.init_by(set_outer_polyline, set_inner_polylines)
  s = Shape.new
  s.outer_polyline = set_outer_polyline
  s.inner_polylines = set_inner_polylines
  s
end

Instance Method Details

#clear_inner!Object



23
24
25
# File 'lib/contrek/finder/concurrent/shape.rb', line 23

def clear_inner!
  @inner_polylines.clear
end

#infoObject



33
34
35
# File 'lib/contrek/finder/concurrent/shape.rb', line 33

def info
  "Shape (outer_polyline = #{outer_polyline.named}, children count = #{@children_shapes.size}"
end

#set_parent_shape(shape) ⇒ Object



27
28
29
30
31
# File 'lib/contrek/finder/concurrent/shape.rb', line 27

def set_parent_shape(shape)
  @parent_shape&.children_shapes&.delete(self)
  @parent_shape = shape
  shape.children_shapes << self if shape
end