Use MPOLYGON to establish topological relationships to quickly find overlapping annotations and entities
Ordinary search implementation, algorithmically has a time complexity of n*n
Using MPOLYGON, the complexity can be reduced to n
1. Find overlapping dimension
(xdrx_begin)
(xdrx_initssget "\nSelect overlapping dimension <Exit>:")
(setq ss
(xdrx_ssget '
((0 .
"dim*")))) (setq mt
(xdrx_entity_getproperty ss
"textbox")) (setq mp
(xdrx_curve
->mpolygon mt
)) (setq cp
(xdrx_getpropertyvalue mp
"haschildloop" t
)) )
(xdrx_curve->mpolygon (xdge::entity:make cp))
)
)
(xdrx_object_release cp)
(xdrx_entity_delete mp)
(xdrx_end)
)
2. Find overlapping entities
(xdrx_begin)
(xdrx_initssget "\nSelect overlapping entities <Exit>:")
(setq mt
(xdrx_entity_getproperty ss
"boundingbox")) (setq mp
(xdrx_curve
->mpolygon mt
)) (setq cp
(xdrx_getpropertyvalue mp
"haschildloop" t
)) )
(xdrx_curve->mpolygon (xdge::entity:make cp))
)
)
(xdrx_object_release cp)
(xdrx_entity_delete mp)
(xdrx_end)
)