-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reworked geometry memory management #259
Conversation
brayns/common/geometry/Cone.h
Outdated
{ | ||
_centerRadius = radius; | ||
center = c; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use init list
brayns/common/geometry/Cylinder.h
Outdated
Cylinder(const Vector3f c, const Vector3f u, const float r, | ||
const float ts = 0.f, const Vector2f v = Vector2f(0.f, 0.f)) | ||
{ | ||
center = c; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito
brayns/common/geometry/Sphere.h
Outdated
Sphere(const Vector3f c, float r, float ts = 0.f, | ||
const Vector2f v = Vector2f(0.f, 0.f)) | ||
{ | ||
center = c; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito
brayns/common/scene/Scene.cpp
Outdated
} | ||
|
||
size_t material = NB_SYSTEM_MATERIALS + 7; | ||
|
||
// Sphere | ||
{ | ||
_spheres[material].push_back( | ||
SpherePtr(new Sphere(Vector3f(0.25f, 0.26f, 0.30f), 0.25f))); | ||
addSphere(material, Sphere(Vector3f(0.25f, 0.26f, 0.30f), 0.25f)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brace-initializers {} should work too, so you can omit the redundant Sphere()
brayns/common/scene/Scene.cpp
Outdated
{ | ||
++material; | ||
addCylinder(material, Cylinder(Vector3f(0.25f, 0.126f, 0.75f), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito
brayns/common/scene/Scene.cpp
Outdated
{ | ||
++material; | ||
addCone(material, Cone(Vector3f(0.75f, 0.01f, 0.25f), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito. Actually also for Vector3f
@@ -621,4 +605,68 @@ bool Scene::empty() const | |||
return _spheres.empty() && _cylinders.empty() && _cones.empty() && | |||
_trianglesMeshes.empty(); | |||
} | |||
|
|||
uint64_t Scene::addSphere(const size_t materialId, const Sphere& sphere) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could consider using Sphere&&. i guess usually things will be moved it here
brayns/io/MorphologyLoader.cpp
Outdated
TrianglesMeshMap& _trianglesMeshes; | ||
MaterialsMap& _materials; | ||
Boxf& _worldBounds; | ||
void add(const size_t materialId, const Sphere& sphere) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use addSphere etc. here also to be consistent with Scene?
No description provided.