8#ifndef IGL_VIEWERDATA_H
9#define IGL_VIEWERDATA_H
12#include "../igl_inline.h"
13#include "../colormap.h"
99 const Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& R,
100 const Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& G,
101 const Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& B,
102 const Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& A);
105 const Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& R,
106 const Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& G,
107 const Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>& B);
117 const Eigen::VectorXd & D,
141 const Eigen::MatrixXd& P,
142 const Eigen::MatrixXd& C);
167 IGL_INLINE void add_edges (
const Eigen::MatrixXd& P1,
const Eigen::MatrixXd& P2,
const Eigen::MatrixXd& C);
174 const Eigen::MatrixXd& P,
175 const Eigen::MatrixXd&
V,
176 const Eigen::MatrixXd& C);
202 const Eigen::Vector3d& ambient,
203 const Eigen::Vector3d& diffuse,
204 const Eigen::Vector3d& specular);
207 const Eigen::Vector4d& ambient,
208 const Eigen::Vector4d& diffuse,
209 const Eigen::Vector4d& specular);
257 Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>
texture_R;
259 Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>
texture_G;
261 Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>
texture_B;
263 Eigen::Matrix<unsigned char,Eigen::Dynamic,Eigen::Dynamic>
texture_A;
347 const Eigen::MatrixXd& positions,
348 const std::vector<std::string>& strings
365#include "../serialize.h"
368 namespace serialization
418 serialization(
false, obj,
const_cast<std::vector<char>&
>(buffer));
424#ifndef IGL_STATIC_LIBRARY
425# include "ViewerData.cpp"
Coverts mesh data inside a igl::ViewerData class in an OpenGL compatible format The class includes a ...
Definition MeshGL.h:24
@ DIRTY_ALL
Definition MeshGL.h:48
Basic class of the 3D mesh viewer.
Definition ViewerCore.h:27
Object being drawn (i.e., mesh and its accessories) by the ViewerCore.
Definition ViewerData.h:39
bool double_sided
Enable double-sided lighting on faces.
Definition ViewerData.h:300
void clear()
Empty all fields.
Eigen::MatrixXd points
Points plotted over the scene (Every row contains 6 doubles in the following format P_x,...
Definition ViewerData.h:275
void set_colormap(const Eigen::MatrixXd &CM)
Not to be confused with set_colors, this creates a texture that will be referenced to pseudocolor acc...
void normal_matcap()
Generate a normal image matcap.
void updateGL(const igl::opengl::ViewerData &data, const bool invert_normals, igl::opengl::MeshGL &meshgl)
Update the meshgl object.
void uniform_colors(const Eigen::Vector3d &ambient, const Eigen::Vector3d &diffuse, const Eigen::Vector3d &specular)
Assigns uniform colors to all faces/vertices.
std::vector< std::string > face_labels_strings
Text strings of labels at faces.
Definition ViewerData.h:289
Eigen::MatrixXd V_material_specular
Per vertex specular color.
Definition ViewerData.h:247
void set_edges(const Eigen::MatrixXd &P, const Eigen::MatrixXi &E, const Eigen::MatrixXd &C)
Sets edges given a list of edge vertices and edge indices.
Eigen::MatrixXd V
Vertices of the current mesh (V x 3)
Definition ViewerData.h:223
bool invert_normals
Invert mesh normals.
Definition ViewerData.h:303
void set_edges_from_vector_field(const Eigen::MatrixXd &P, const Eigen::MatrixXd &V, const Eigen::MatrixXd &C)
Sets edges given a list of points and eminating vectors.
void update_labels(igl::opengl::MeshGL::TextGL &GL_labels, const Eigen::MatrixXd &positions, const std::vector< std::string > &strings)
Update contents from a 'Data' instance.
void set_uv(const Eigen::MatrixXd &UV_V, const Eigen::MatrixXi &UV_F)
Set per-corner UV coordinates.
uint32_t dirty
Marks dirty buffers that need to be uploaded to OpenGL.
Definition ViewerData.h:294
void set_texture(const Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &R, const Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &G, const Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &B, const Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &A)
Set the texture associated with the mesh.
unsigned int show_faces
Definition ViewerData.h:311
float shininess
Shape material shininess.
Definition ViewerData.h:332
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > texture_G
Texture green colors.
Definition ViewerData.h:259
igl::opengl::MeshGL meshgl
OpenGL representation of the mesh.
Definition ViewerData.h:338
Eigen::Matrix< float, 4, 1, Eigen::DontAlign > label_color
Color of labels.
Definition ViewerData.h:328
Eigen::MatrixXd V_material_ambient
Per vertex ambient color.
Definition ViewerData.h:243
float label_size
Size of lables.
Definition ViewerData.h:324
void add_points(const Eigen::MatrixXd &P, const Eigen::MatrixXd &C)
Add points given a list of point vertices.
Eigen::MatrixXd V_normals
One normal per vertex.
Definition ViewerData.h:240
std::vector< std::string > vertex_labels_strings
Text strings of labels at vertices.
Definition ViewerData.h:287
void set_uv(const Eigen::MatrixXd &UV)
Set per-vertex UV coordinates.
Eigen::MatrixXd V_material_diffuse
Per vertex diffuse color.
Definition ViewerData.h:245
void compute_normals()
Computes the normals of the mesh.
void set_texture(const Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &R, const Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &G, const Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > &B)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void add_label(const Eigen::VectorXd &P, const std::string &str)
Sets / Adds text labels at the given positions in 3D.
bool face_based
Enable per-face or per-vertex properties.
Definition ViewerData.h:297
void set_mesh(const Eigen::MatrixXd &V, const Eigen::MatrixXi &F)
Set the current mesh.
Eigen::MatrixXd F_material_diffuse
Per face diffuse color.
Definition ViewerData.h:234
unsigned int use_matcap
Definition ViewerData.h:317
void set_face_based(bool newvalue)
Change whether drawing per-vertex or per-face; invalidating cache if necessary.
Eigen::MatrixXd vertex_labels_positions
Text positions of vertices.
Definition ViewerData.h:281
void clear_points()
Clear the point data.
void set_vertices(const Eigen::MatrixXd &V)
Set just the vertices.
void set_labels(const Eigen::MatrixXd &P, const std::vector< std::string > &str)
Sets / Adds text labels at the given positions in 3D.
unsigned int show_overlay_depth
Definition ViewerData.h:314
float line_width
line_width is NOT SUPPORTED on Mac OS and Windows
Definition ViewerData.h:322
Eigen::Matrix< float, 4, 1, Eigen::DontAlign > line_color
Color of lines.
Definition ViewerData.h:326
void set_data(const Eigen::VectorXd &D, double caxis_min, double caxis_max, igl::ColorMapType cmap=igl::COLOR_MAP_TYPE_VIRIDIS, int num_steps=21)
Set pseudo-color-able scalar data associated with the mesh.
Eigen::MatrixXd face_labels_positions
Text positions of faces.
Definition ViewerData.h:283
unsigned int show_custom_labels
Definition ViewerData.h:309
unsigned int show_texture
Definition ViewerData.h:315
void copy_options(const ViewerCore &from, const ViewerCore &to)
Copy visualization options from one viewport to another.
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > texture_R
Texture red colors.
Definition ViewerData.h:257
Eigen::MatrixXd F_material_specular
Per face specular color.
Definition ViewerData.h:236
void set_colors(const Eigen::MatrixXd &C)
Set the diffuse color of the mesh.
int id
Unique identifier.
Definition ViewerData.h:335
void add_edges(const Eigen::MatrixXd &P1, const Eigen::MatrixXd &P2, const Eigen::MatrixXd &C)
Add edges given a list of edge start and end positions and colors.
void clear_labels()
Clear the label data.
Eigen::MatrixXd labels_positions
Text positions of labels.
Definition ViewerData.h:285
void grid_texture()
Generates a default grid texture (without uvs)
Eigen::MatrixXi F
Faces of the mesh (F x 3)
Definition ViewerData.h:225
Eigen::MatrixXd V_uv
UV vertices.
Definition ViewerData.h:251
Eigen::MatrixXi F_uv
optional faces for UVs
Definition ViewerData.h:253
void set_normals(const Eigen::MatrixXd &N)
Set the normals of a mesh.
void set_points(const Eigen::MatrixXd &P, const Eigen::MatrixXd &C)
Sets points given a list of point vertices.
unsigned int show_overlay
Definition ViewerData.h:313
std::vector< std::string > labels_strings
Text strings of labels.
Definition ViewerData.h:291
void set_visible(bool value, unsigned int core_id=1)
Set whether this object is visible.
unsigned int show_vertex_labels
Definition ViewerData.h:316
float point_size
Point size / line width.
Definition ViewerData.h:320
Eigen::MatrixXd F_normals
One normal per face.
Definition ViewerData.h:229
unsigned int show_face_labels
Definition ViewerData.h:310
void clear_edges()
Clear the edge data.
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > texture_B
Texture blue colors.
Definition ViewerData.h:261
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > texture_A
Texture alpha values.
Definition ViewerData.h:263
void uniform_colors(const Eigen::Vector4d &ambient, const Eigen::Vector4d &diffuse, const Eigen::Vector4d &specular)
This is an overloaded member function, provided for convenience. It differs from the above function o...
unsigned int show_lines
Definition ViewerData.h:312
void set_data(const Eigen::VectorXd &D, igl::ColorMapType cmap=igl::COLOR_MAP_TYPE_VIRIDIS, int num_steps=21)
This is an overloaded member function, provided for convenience. It differs from the above function o...
unsigned int is_visible
Visualization options Each option is a binary mask specifying on which viewport each option is set.
Definition ViewerData.h:308
Eigen::MatrixXd F_material_ambient
Per face ambient color.
Definition ViewerData.h:232
Eigen::MatrixXd lines
Lines plotted over the scene (Every row contains 9 doubles in the following format S_x,...
Definition ViewerData.h:270
#define IGL_INLINE
Definition igl_inline.h:15
void serialization(bool s, igl::opengl::ViewerCore &obj, std::vector< char > &buffer)
Definition ViewerCore.h:244
void deserialize(igl::opengl::ViewerCore &obj, const std::vector< char > &buffer)
Definition ViewerCore.h:286
void serialize(const igl::opengl::ViewerCore &obj, std::vector< char > &buffer)
Definition ViewerCore.h:280
ColorMapType
Definition colormap.h:19
@ COLOR_MAP_TYPE_VIRIDIS
Definition colormap.h:25
#define SERIALIZE_MEMBER(Object)
Definition serialize.h:68