|
scimesh 0.3.4
Headless CPU-only 3D software renderer for scientific mesh visualization
|
A batch of independent line segments drawn with a fixed screen-space width. More...
#include <lines.h>
Public Member Functions | |
| bool | compute_bounding_box (Vec3 &min_bound, Vec3 &max_bound) const |
| Compute the bounding box of all segment endpoints. | |
| size_t | size () const |
| Number of segments in this layer. | |
| bool | empty () const |
| Whether this layer holds no segments to draw. | |
| Color | color_or (size_t i, const Color &fallback) const |
Color of segment i, falling back to fallback when the layer holds no colors at all. | |
Public Attributes | |
| std::vector< Vec3 > | from |
| Segment start points, in world space. | |
| std::vector< Vec3 > | to |
Segment end points, in world space (one per entry in from). | |
| std::vector< Color > | colors |
One color per segment; may be empty (then the renderer uses RenderOptions::default_color) or shorter than from (the last entry is reused for the remaining segments). | |
| float | width = 1.0f |
| Line width in screen pixels (default: 1.0). | |
| bool | depth_test = true |
| Whether to test the lines against the depth buffer (default: true). | |
| bool | lit = false |
| Whether to apply lighting to the lines (default: false). | |
| bool | affects_bounds = true |
| Whether this layer contributes to the bounding box of its scene (default: true). | |
A batch of independent line segments drawn with a fixed screen-space width.
A line layer belongs to a Scene (see Scene::add_lines()) and is drawn by the Renderer in the same pass as the meshes: same camera, same depth buffer, so lines can be occluded by meshes and vice versa. Segments whose colors have an alpha value below 1 are drawn in the blended pass, back-to-front, exactly like translucent triangles.
Line layers are deliberately not meshes:
Compute the bounding box of all segment endpoints.
Both the from and the to points are considered, the width of the segments is a screen-space property and does not affect the box.
| [out] | min_bound | Lower corner of the box (unchanged when empty). |
| [out] | max_bound | Upper corner of the box (unchanged when empty). |
|
inline |
|
inline |
Whether this layer contributes to the bounding box of its scene (default: true).
Line layers usually are the content of a figure (graph or connectome edges, streamlines, tracts), so they define the extent that the camera has to cover, exactly like the meshes of the scene do. Set this to false for a layer that is decoration, e.g. a leader line pointing at a label outside the anatomy, or an axis cross: such a layer is then ignored by Scene::compute_bounding_box() and can never push the camera away from the data.
Note that a scene without any mesh is framed by its line layers even if they all opted out, because there would otherwise be no geometry to derive a camera from, see Scene::compute_bounding_box().
| std::vector<Color> scimesh::LineLayer::colors |
One color per segment; may be empty (then the renderer uses RenderOptions::default_color) or shorter than from (the last entry is reused for the remaining segments).
| std::vector<Vec3> scimesh::LineLayer::from |
| std::vector<Vec3> scimesh::LineLayer::to |
| float scimesh::LineLayer::width = 1.0f |