18 #ifndef __DOLFIN_X3DOM_H 19 #define __DOLFIN_X3DOM_H 26 #include <boost/multi_array.hpp> 28 #include <dolfin/geometry/Point.h> 73 std::array<double, 2> get_viewport_size()
const;
76 void set_diffuse_color(std::array<double, 3> rgb);
79 std::array<double, 3> get_diffuse_color()
const;
82 void set_emissive_color(std::array<double, 3> rgb);
85 std::array<double, 3> get_emissive_color()
const;
88 void set_specular_color(std::array<double, 3> rgb);
91 std::array<double, 3> get_specular_color()
const;
94 void set_background_color(std::array<double, 3> rgb);
97 std::array<double, 3> get_background_color()
const;
100 void set_ambient_intensity(
double intensity);
103 double get_ambient_intensity()
const;
106 void set_shininess(
double shininess);
109 double get_shininess()
const;
112 void set_transparency(
double transparency);
115 double get_transparency()
const;
120 void set_color_map(
const std::vector<double>& color_data);
124 std::vector<double> get_color_map()
const;
127 boost::multi_array<float, 2> get_color_map_array()
const;
130 void set_x3d_stats(
bool show);
133 bool get_x3d_stats()
const;
136 void set_menu_display(
bool show);
139 bool get_menu_display()
const;
145 static void check_rgb(std::array<double, 3>& rgb);
149 static void check_value_range(
double value,
double lower,
double upper);
155 std::array<double, 2> _size;
159 std::array<double, 3> _diffuse_color, _emissive_color, _specular_color,
163 double _ambient_intensity, _shininess, _transparency;
166 boost::multi_array<float, 2> _color_map;
169 bool _show_x3d_stats;
198 static std::string str(
const Mesh& mesh,
202 static std::string str(
const Function& u,
206 static std::string html(
const Mesh& mesh,
211 static std::string html(
const Function& u,
217 build_x3dom_tree(pugi::xml_document& xml_doc,
223 build_x3dom_tree(pugi::xml_document& xml_doc,
232 enum Viewpoint {top, bottom, left, right, back, front, default_view};
235 static void x3dom(pugi::xml_document& xml_doc,
const Mesh& mesh,
236 const std::vector<double>& vertex_values,
237 const std::vector<double>& facet_values,
241 static void html(pugi::xml_document& xml_doc,
const Mesh& mesh,
242 const std::vector<double>& vertex_values,
243 const std::vector<double>& facet_values,
247 static pugi::xml_node add_html_preamble(pugi::xml_node& xml_node);
251 static void add_x3dom_doctype(pugi::xml_node& xml_node);
255 static void add_html_doctype(pugi::xml_node& xml_node);
258 static pugi::xml_node add_x3d_node(pugi::xml_node& xml_node,
259 std::array<double, 2> size,
263 static void add_x3dom_data(pugi::xml_node& xml_node,
const Mesh& mesh,
264 const std::vector<double>& vertex_values,
265 const std::vector<double>& facet_values,
270 static void add_mesh_data(pugi::xml_node& xml_node,
const Mesh& mesh,
271 const std::vector<double>& vertex_values,
272 const std::vector<double>& facet_values,
278 static void add_viewpoint_nodes(pugi::xml_node& xml_scene,
279 const Point p,
double d,
280 bool show_viewpoint_buttons);
283 static void add_viewpoint_node(pugi::xml_node& xml_scene,
289 static void add_menu_display(pugi::xml_node& xml_node,
const Mesh& mesh,
293 static void add_menu_tab_button(pugi::xml_node& xml_node, std::string name,
297 static pugi::xml_node create_menu_content_node(pugi::xml_node& xml_node,
298 std::string name,
bool show);
301 static void add_menu_options_tab(pugi::xml_node& xml_node);
304 static void add_menu_options_option(pugi::xml_node& xml_node,
308 static void add_menu_summary_tab(pugi::xml_node& xml_node,
312 static void add_menu_color_tab(pugi::xml_node& xml_node);
315 static void add_menu_warp_tab(pugi::xml_node& xml_node);
318 static void add_menu_viewpoint_tab(pugi::xml_node& xml_node);
321 static void add_menu_viewpoint_button(pugi::xml_node& xml_node,
326 static std::pair<Point, double> mesh_centre_and_distance(
const Mesh& mesh);
329 static std::set<int> surface_vertex_indices(
const Mesh& mesh);
332 static void get_function_values(
const Function& u,
333 std::vector<double>& vertex_values,
334 std::vector<double>& facet_values);
338 static void build_mesh_data(std::vector<int>& topology,
339 std::vector<double>& geometry,
340 std::vector<double>& value_data,
342 const std::vector<double>& vertex_values,
343 const std::vector<double>& facet_values,
347 static std::string array_to_string3(std::array<double, 3> x);
350 static std::string
to_string(pugi::xml_document& xml_doc,
std::string to_string(const double *x, std::size_t n)
Return string representation of given array.
Definition: utils.cpp:42
Representation
X3DOM representation type.
Definition: X3DOM.h:59
Class data to store X3DOM view parameters.
Definition: X3DOM.h:51
Definition: Function.h:65
GlobalParameters parameters
The global parameter database.
Definition: GlobalParameters.cpp:32