QuadTreeIndex new_index = m_quadtree.nodes.size();
Debug("-------------- Generating Quadtree Node %d (parent %d, type %d) ----------------------", new_index, parent, type);
m_quadtree.nodes.push_back(QuadTreeNode{QUADTREE_EMPTY, QUADTREE_EMPTY, QUADTREE_EMPTY, QUADTREE_EMPTY, parent, type, 0, 0, -1});
QuadTreeIndex new_index = m_quadtree.nodes.size();
Debug("-------------- Generating Quadtree Node %d (parent %d, type %d) ----------------------", new_index, parent, type);
m_quadtree.nodes.push_back(QuadTreeNode{QUADTREE_EMPTY, QUADTREE_EMPTY, QUADTREE_EMPTY, QUADTREE_EMPTY, parent, type, 0, 0, -1});
void Document::OverlayQuadChildren(QuadTreeIndex orig_parent, QuadTreeIndex parent, QuadTreeNodeChildren type)
{
void Document::OverlayQuadChildren(QuadTreeIndex orig_parent, QuadTreeIndex parent, QuadTreeNodeChildren type)
{
QuadTreeIndex new_index = m_quadtree.nodes.size();
Debug("-------------- Generating Quadtree Node %d (orig %d parent %d, type %d) ----------------------", new_index, orig_parent, parent, type);
m_quadtree.nodes.push_back(QuadTreeNode{QUADTREE_EMPTY, QUADTREE_EMPTY, QUADTREE_EMPTY, QUADTREE_EMPTY, orig_parent, type, 0, 0, -1});
QuadTreeIndex new_index = m_quadtree.nodes.size();
Debug("-------------- Generating Quadtree Node %d (orig %d parent %d, type %d) ----------------------", new_index, orig_parent, parent, type);
m_quadtree.nodes.push_back(QuadTreeNode{QUADTREE_EMPTY, QUADTREE_EMPTY, QUADTREE_EMPTY, QUADTREE_EMPTY, orig_parent, type, 0, 0, -1});
unsigned Document::Add(ObjectType type, const Rect & bounds, unsigned data_index, QuadTreeIndex qti)
{
unsigned Document::Add(ObjectType type, const Rect & bounds, unsigned data_index, QuadTreeIndex qti)
{
m_objects.types.push_back(type);
m_objects.bounds.push_back(bounds);
m_objects.data_indices.push_back(data_index);
m_objects.types.push_back(type);
m_objects.bounds.push_back(bounds);
m_objects.data_indices.push_back(data_index);
+ #ifdef TRANSFORM_BEZIERS_TO_PATH
+ for (unsigned i = 0; i < m_objects.paths.size(); ++i)
+ {
+ Path & p = m_objects.paths[i];
+ p.m_bounds.x = transform.a * p.m_bounds.x + transform.e;
+ p.m_bounds.y = transform.d * p.m_bounds.y + transform.f;
+ p.m_bounds.w *= transform.a;
+ p.m_bounds.h *= transform.d;
+ }
+ return;
+ #endif
+
- TransformXYPair(m_objects.bounds[i].x, m_objects.bounds[i].y, transform);
- m_objects.bounds[i].w *= transform.a;
- m_objects.bounds[i].h *= transform.d;
+ if (type == NUMBER_OF_OBJECT_TYPES || m_objects.types[i] == type)
+ {
+ TransformXYPair(m_objects.bounds[i].x, m_objects.bounds[i].y, transform);
+ m_objects.bounds[i].w *= transform.a;
+ m_objects.bounds[i].h *= transform.d;
+ }
}
}
void Document::TranslateObjects(const Real & dx, const Real & dy, ObjectType type)
{
#ifdef TRANSFORM_BEZIERS_TO_PATH
}
}
void Document::TranslateObjects(const Real & dx, const Real & dy, ObjectType type)
{
#ifdef TRANSFORM_BEZIERS_TO_PATH
for (unsigned i = 0; i < m_count; ++i)
{
if (type == NUMBER_OF_OBJECT_TYPES || m_objects.types[i] == type)
for (unsigned i = 0; i < m_count; ++i)
{
if (type == NUMBER_OF_OBJECT_TYPES || m_objects.types[i] == type)