|
@@ -98,7 +98,7 @@ module CPEE
|
|
|
|
|
|
#check if new frame overlaps others if it does, delete overlapped frames
|
|
#check if new frame overlaps others if it does, delete overlapped frames
|
|
data_hash["data"].each do | c |
|
|
data_hash["data"].each do | c |
|
|
- if doOverlap(c['lx'], c['ly'], c['rx'], c['ry'], @p[1].value.to_i, @p[2].value.to_i, (@p[1].value.to_i + @p[3].value.to_i - 1), (@p[2].value.to_i + @p[4].value.to_i - 1))
|
|
|
|
|
|
+ if CPEE::Frames::doOverlap(c['lx'], c['ly'], c['rx'], c['ry'], @p[1].value.to_i, @p[2].value.to_i, (@p[1].value.to_i + @p[3].value.to_i - 1), (@p[2].value.to_i + @p[4].value.to_i - 1))
|
|
data_hash["data"].delete(c)
|
|
data_hash["data"].delete(c)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
@@ -143,7 +143,7 @@ module CPEE
|
|
|
|
|
|
#check if new frame overlaps others if it does, delete overlapped frames
|
|
#check if new frame overlaps others if it does, delete overlapped frames
|
|
data_hash["data"].each do | c |
|
|
data_hash["data"].each do | c |
|
|
- if doOverlap(c['lx'], c['ly'], c['rx'], c['ry'], @p[1].value.to_i, @p[2].value.to_i, (@p[1].value.to_i + @p[3].value.to_i - 1), (@p[2].value.to_i + @p[4].value.to_i - 1))
|
|
|
|
|
|
+ if CPEE::Frames::doOverlap(c['lx'], c['ly'], c['rx'], c['ry'], @p[1].value.to_i, @p[2].value.to_i, (@p[1].value.to_i + @p[3].value.to_i - 1), (@p[2].value.to_i + @p[4].value.to_i - 1))
|
|
data_hash["data"].delete(c)
|
|
data_hash["data"].delete(c)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
@@ -195,7 +195,7 @@ module CPEE
|
|
data_hash = JSON::parse(file)
|
|
data_hash = JSON::parse(file)
|
|
|
|
|
|
data_hash["data"].each do | c |
|
|
data_hash["data"].each do | c |
|
|
- if doOverlap(c['lx'], c['ly'], c['rx'], c['ry'], @p[0].value.to_i, @p[1].value.to_i, (@p[0].value.to_i + 1), (@p[1].value.to_i + 1))
|
|
|
|
|
|
+ if CPEE::Frames::doOverlap(c['lx'], c['ly'], c['rx'], c['ry'], @p[0].value.to_i, @p[1].value.to_i, (@p[0].value.to_i + 1), (@p[1].value.to_i + 1))
|
|
data_hash["data"].delete(c)
|
|
data_hash["data"].delete(c)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
@@ -204,14 +204,14 @@ module CPEE
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
- def doOverlap(l1x, l1y, r1x, r1y, l2x, l2y, r2x, r2y)
|
|
|
|
|
|
+ def self::doOverlap(l1x, l1y, r1x, r1y, l2x, l2y, r2x, r2y)
|
|
if l1x > r2x || l2x > r1x
|
|
if l1x > r2x || l2x > r1x
|
|
- return false;
|
|
|
|
|
|
+ return false
|
|
end
|
|
end
|
|
if l1y > r2y || l2y > r1y
|
|
if l1y > r2y || l2y > r1y
|
|
- return false;
|
|
|
|
|
|
+ return false
|
|
end
|
|
end
|
|
- return true;
|
|
|
|
|
|
+ return true
|
|
end
|
|
end
|
|
|
|
|
|
class Delete < Riddl::Implementation
|
|
class Delete < Riddl::Implementation
|