17#ifndef __gui_mrview_tool_connectome_node_h__
18#define __gui_mrview_tool_connectome_node_h__
42 void assign_mesh (
MR::Surface::Mesh& in) { clear_mesh(); mesh.reset (
new Node::Mesh (in)); }
43 void render_mesh()
const {
if (!mesh)
return; mesh->render(); }
44 void clear_mesh() {
if (mesh)
delete mesh.release(); }
46 const Eigen::Vector3f& get_com()
const {
return centre_of_mass; }
47 size_t get_volume()
const {
return volume; }
49 void set_name (
const std::string& i) { name = i; }
50 const std::string& get_name()
const {
return name; }
51 void set_size (
const float i) { size = i; }
52 float get_size()
const {
return size; }
53 void set_colour (
const Eigen::Array3f& i) { colour = i; pixmap.fill (QColor (i[0] * 255.0f, i[1] * 255.0f, i[2] * 255.0f)); }
54 const Eigen::Array3f& get_colour()
const {
return colour; }
55 const QPixmap get_pixmap()
const {
return pixmap; }
56 void set_alpha (
const float i) { alpha = i; }
57 float get_alpha()
const {
return alpha; }
58 void set_visible (
const bool i) { visible = i; }
59 bool is_visible()
const {
return visible; }
61 bool to_draw()
const {
return (visible && (alpha > 0.0f) && (size > 0.0f)); }
64 const Eigen::Vector3f centre_of_mass;
70 Eigen::Array3f colour;
80 Mesh (
const Mesh&) =
delete;
92 std::unique_ptr<Mesh> mesh;
Array & operator=(const MR::Helper::ConstRow< ImageType > &row)