Comments (2)
That's right, this test fails:
TEST(Test, Test) {
lc::QuadTree<lc::entity::CADEntity_CSPtr> qt;
qt.insert(std::make_shared<lc::entity::Line>(lc::geo::Coordinate(-5000, -5000),
lc::geo::Coordinate(5000, 5000),
std::make_shared<lc::Layer>())
);
ASSERT_EQ(0, qt.retrieve(lc::geo::Area(lc::geo::Coordinate(1, -1), lc::geo::Coordinate(5000, -5000))).size()); //Returns 1 element
}
from librecad_3.
In context of quad tree this is correct. The quad tree doesn't care about exact coordinates but it just finds the area's that include (even partially) in the requested area.
Since the bounding box of the lines falls over the boundig box of the requested area the line is included.
For painting it matters such that element's really outside of a quad will not be retreived, but even taht depends.
For example if you have 10 elements in a quad tree, no matter what you do, you will always retrieve them all. If you have 1000 they will be pushed down the quad tree levels and store them at finer granularity.
This could even optmise painting during canvas moving. Because you could easely request all entities up to some level X and you will only get a maximum number of entities but nothing below that (if it applies).
For the painter is doesn't matter much in some conditions. We need to be carefull not to optimise to much because sometimes it can be faster to just paint it rather than to find out if we need to paint it. The quad tree just helps with it... We do have some more exact routines that can find all entities within a bounding box, thet just take a lot more time to calculate.
For OpenGL it could even slow things down because with OpenGL you can keep everything in memory (I hope :) ) and as such it's properly faster to let the GPU handle it.
In addition, both the painter and kernel can use there own implementation to speed up operations if they wish...
Hope that makes sense...
from librecad_3.
Related Issues (20)
- [openSUSE] How to compile LibreCAD3 with system installed tinyspline? HOT 3
- Dependency rapidjson should be added to build instructions HOT 9
- Is posible compile Librecad_3 using Mingw in Windows 10? HOT 4
- make -j 4 make: *** No targets specified and no makefile found. Stop. HOT 3
- Failed to build: error: no return statement in function returning non-void HOT 2
- Failed to build CMakeFiles/luacmdinterface.dir/main.cpp.o: in function CairoStore::image_create HOT 1
- Visual Programming for interconnect to others programs.
- DGN v7 file support HOT 1
- DimensionLinear Alignment
- LibreCAD3 works but it display some issues in terminal HOT 1
- ‘class tinyspline::BSpline’ has no member named ‘data’ HOT 2
- Segmentation fault in GL_Font::readyFont HOT 1
- why not libdxfrw as a git submodule? HOT 1
- Segmentation fault in lcunittest
- Can't open newly created 2D .dxf file HOT 1
- cmake is detecting lua 5.4 instead of 5.3 HOT 2
- LibreCAD_3 Whether you plan to support 3D? HOT 4
- Lua 5.3.6
- Define `main` branch as default instead of `master` HOT 2
- Status of the project HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from librecad_3.