Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tf_systemPy.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of Tissue Forge.
3 * Copyright (c) 2022-2024 T.J. Sego
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 ******************************************************************************/
19
25#ifndef _SOURCE_LANGS_PY_TF_SYSTEMPY_H_
26#define _SOURCE_LANGS_PY_TF_SYSTEMPY_H_
27
28#include "tf_py.h"
29
31#include <rendering/tfArrowRenderer.h>
32
33#include <list>
34#include <unordered_map>
35
36
37namespace TissueForge::py {
38
39
40 CPPAPI_FUNC(void) print_performance_counters();
41
56 CPPAPI_FUNC(HRESULT) screenshot(const std::string &filePath);
57
74 CPPAPI_FUNC(HRESULT) screenshot(const std::string &filePath, const bool &decorate, const FVector3 &bgcolor);
75
77 CPPAPI_FUNC(bool) camera_is_lagging();
78
81
84
87
89 CPPAPI_FUNC(float) camera_get_lagging();
90
92 CPPAPI_FUNC(HRESULT) camera_set_lagging(const float &lagging);
93
94 CPPAPI_FUNC(bool) context_has_current();
95 CPPAPI_FUNC(HRESULT) context_make_current();
96 CPPAPI_FUNC(HRESULT) context_release();
97
106 CPPAPI_FUNC(HRESULT) camera_move_to(const FVector3 &eye, const FVector3 &center, const FVector3 &up);
107
116 CPPAPI_FUNC(HRESULT) camera_move_to(const FVector3 &center, const FQuaternion &rotation, const float &zoom);
117
124
130 CPPAPI_FUNC(HRESULT) camera_view_top();
131
137 CPPAPI_FUNC(HRESULT) camera_view_left();
138
145
151 CPPAPI_FUNC(HRESULT) camera_view_back();
152
159
165 CPPAPI_FUNC(HRESULT) camera_reset();
166
167 /* Rotate the camera from the previous (screen) mouse position to the
168 current (screen) position */
169 CPPAPI_FUNC(HRESULT) camera_rotate_mouse(const iVector2 &mousePos);
170
171 /* Translate the camera from the previous (screen) mouse position to
172 the current (screen) mouse position */
173 CPPAPI_FUNC(HRESULT) camera_translate_mouse(const iVector2 &mousePos);
174
181
188
195
202
209
216
223
229 CPPAPI_FUNC(HRESULT) camera_rotate_up();
230
237
244
250 CPPAPI_FUNC(HRESULT) camera_roll_left();
251
258
264 CPPAPI_FUNC(HRESULT) camera_zoom_in();
265
271 CPPAPI_FUNC(HRESULT) camera_zoom_out();
272
273 /* Rotate the camera from the previous (screen) mouse position to the
274 current (screen) position */
275 CPPAPI_FUNC(HRESULT) camera_init_mouse(const iVector2 &mousePos);
276
277 /* Translate the camera by the delta amount of (NDC) mouse position.
278 Note that NDC position must be in [-1, -1] to [1, 1]. */
279 CPPAPI_FUNC(HRESULT) camera_translate_by(const FVector2 &trans);
280
289 CPPAPI_FUNC(HRESULT) camera_zoom_by(const float &delta);
290
297 CPPAPI_FUNC(HRESULT) camera_zoom_to(const float &distance);
298
308 CPPAPI_FUNC(HRESULT) camera_rotate_to_axis(const FVector3 &axis, const float &distance);
309
318 CPPAPI_FUNC(HRESULT) camera_rotate_to_euler_angle(const FVector3 &angles);
319
328 CPPAPI_FUNC(HRESULT) camera_rotate_by_euler_angle(const FVector3 &angles);
329
335 CPPAPI_FUNC(FVector3) camera_center();
336
343
349 CPPAPI_FUNC(float) camera_zoom();
350
357
359 CPPAPI_FUNC(const bool) get_rendering_3d_bonds();
360
362 CPPAPI_FUNC(void) set_rendering_3d_bonds(const bool &_flag);
363
365 CPPAPI_FUNC(void) toggle_rendering_3d_bonds();
366
368 CPPAPI_FUNC(const bool) get_rendering_3d_angles();
369
371 CPPAPI_FUNC(void) set_rendering_3d_angles(const bool &_flag);
372
374 CPPAPI_FUNC(void) toggle_rendering_3d_angles();
375
377 CPPAPI_FUNC(const bool) get_rendering_3d_dihedrals();
378
380 CPPAPI_FUNC(void) set_rendering_3d_dihedrals(const bool &_flag);
381
383 CPPAPI_FUNC(void) toggle_rendering_3d_dihedrals();
384
386 CPPAPI_FUNC(void) set_rendering_3d_all(const bool &_flag);
387
389 CPPAPI_FUNC(void) toggle_rendering_3d_all();
390
392 CPPAPI_FUNC(FloatP_t) get_line_width();
393
395 CPPAPI_FUNC(HRESULT) set_line_width(const FloatP_t &lineWidth);
396
398 CPPAPI_FUNC(FloatP_t) get_line_width_min();
399
401 CPPAPI_FUNC(FloatP_t) get_line_width_max();
402
409
416 CPPAPI_FUNC(HRESULT) set_ambient_color(const FVector3 &color);
417
425 CPPAPI_FUNC(HRESULT) set_ambient_color(const FVector3 &color, const unsigned int &srFlag);
426
433
440 CPPAPI_FUNC(HRESULT) set_diffuse_color(const FVector3 &color);
441
449 CPPAPI_FUNC(HRESULT) set_diffuse_color(const FVector3 &color, const unsigned int &srFlag);
450
457
464 CPPAPI_FUNC(HRESULT) set_specular_color(const FVector3 &color);
465
473 CPPAPI_FUNC(HRESULT) set_specular_color(const FVector3 &color, const unsigned int &srFlag);
474
480 CPPAPI_FUNC(float) get_shininess();
481
488 CPPAPI_FUNC(HRESULT) set_shininess(const float &shininess);
489
497 CPPAPI_FUNC(HRESULT) set_shininess(const float &shininess, const unsigned int &srFlag);
498
504 CPPAPI_FUNC(FVector3) get_grid_color();
505
512 CPPAPI_FUNC(HRESULT) set_grid_color(const FVector3 &color);
513
520
527 CPPAPI_FUNC(HRESULT) set_scene_box_color(const FVector3 &color);
528
535
542 CPPAPI_FUNC(HRESULT) set_light_direction(const FVector3& lightDir);
543
551 CPPAPI_FUNC(HRESULT) set_light_direction(const FVector3& lightDir, const unsigned int &srFlag);
552
558 CPPAPI_FUNC(FVector3) get_light_color();
559
566 CPPAPI_FUNC(HRESULT) set_light_color(const FVector3 &color);
567
575 CPPAPI_FUNC(HRESULT) set_light_color(const FVector3 &color, const unsigned int &srFlag);
576
583
590 CPPAPI_FUNC(HRESULT) set_background_color(const FVector3 &color);
591
598 CPPAPI_FUNC(bool) decorated();
599
606 CPPAPI_FUNC(HRESULT) decorate_scene(const bool &decorate);
607
614 CPPAPI_FUNC(bool) showing_discretization();
615
622 CPPAPI_FUNC(HRESULT) show_discretization(const bool &show);
623
630
637 CPPAPI_FUNC(HRESULT) set_discretizationColor(const FVector3 &color);
638
639 /* Update screen size after the window has been resized */
640 CPPAPI_FUNC(HRESULT) view_reshape(const iVector2 &windowSize);
641
642 CPPAPI_FUNC(std::string) performance_counters();
643
649 CPPAPI_FUNC(std::unordered_map<std::string, bool>) cpu_info();
650
656 CPPAPI_FUNC(std::unordered_map<std::string, bool>) compile_flags();
657
663 CPPAPI_FUNC(std::unordered_map<std::string, std::string>) gl_info();
664
670 CPPAPI_FUNC(std::string) egl_info();
671
672 CPPAPI_FUNC(PyObject*) image_data();
673
680 CPPAPI_FUNC(bool) is_terminal_interactive();
681
688 CPPAPI_FUNC(bool) is_jupyter_notebook();
689
690 CPPAPI_FUNC(PyObject*) jwidget_init(PyObject *args, PyObject *kwargs);
691 CPPAPI_FUNC(PyObject*) jwidget_run(PyObject *args, PyObject *kwargs);
692
696 CPPAPI_FUNC(std::vector<std::string>) color_mapper_names();
697
710 CPPAPI_FUNC(int) add_render_arrow(rendering::ArrowData *arrow);
711
727 CPPAPI_FUNC(std::pair<int, rendering::ArrowData*>) add_render_arrow(
728 const FVector3 &position,
729 const FVector3 &components,
730 const rendering::Style &style,
731 const float &scale=1.0
732 );
733
742 CPPAPI_FUNC(HRESULT) remove_render_arrow(const int &arrowId);
743
749 CPPAPI_FUNC(rendering::ArrowData*) get_render_arrow(const int &arrowId);
750
751};
752
753#endif // _SOURCE_LANGS_PY_TF_SYSTEMPY_H_
Definition tfQuaternion.h:35
Tissue Forge Python language support.
Definition tf_bindPy.h:36
FVector3 get_light_color()
Get the light color.
bool camera_is_lagging()
void set_rendering_3d_dihedrals(const bool &_flag)
HRESULT camera_rotate_right()
Rotate the camera right.
FVector3 get_specular_color()
Get specular color.
HRESULT camera_move_to(const FVector3 &eye, const FVector3 &center, const FVector3 &up)
Set the camera view parameters.
HRESULT camera_view_top()
Move the camera to view the domain from the top.
void toggle_rendering_3d_all()
HRESULT camera_view_back()
Move the camera to view the domain from the back.
HRESULT camera_roll_left()
Roll the camera left.
rendering::ArrowData * get_render_arrow(const int &arrowId)
Gets a vector visualization specification.
float camera_zoom()
Get the current camera zoom.
HRESULT set_ambient_color(const FVector3 &color)
Set the ambient color.
HRESULT camera_zoom_to(const float &distance)
Zoom the camera to a distance.
HRESULT set_line_width(const FloatP_t &lineWidth)
HRESULT set_discretizationColor(const FVector3 &color)
Set the color of the discretization grid.
FVector3 get_light_direction()
Get the light direction.
FVector3 get_background_color()
Get the background color.
HRESULT camera_rotate_up()
Rotate the camera up.
FVector3 get_scene_box_color()
Get the scene box color.
void set_rendering_3d_angles(const bool &_flag)
HRESULT camera_reset()
Reset the camera.
std::unordered_map< std::string std::string > gl_info()
Get OpenGL info.
HRESULT camera_view_right()
Move the camera to view the domain from the right.
HRESULT camera_translate_down()
Translate the camera down.
HRESULT camera_translate_right()
Translate the camera right.
HRESULT set_diffuse_color(const FVector3 &color)
Set the diffuse color.
HRESULT camera_translate_left()
Translate the camera left.
FVector3 get_ambient_color()
Get the ambient color.
FloatP_t get_line_width_min()
std::vector< std::string > color_mapper_names()
Get all available color mapper names.
HRESULT camera_rotate_by_euler_angle(const FVector3 &angles)
Rotate the camera by a set of Euler angles.
FloatP_t get_line_width_max()
HRESULT camera_set_lagging(const float &lagging)
HRESULT remove_render_arrow(const int &arrowId)
Removes a vector visualization specification.
bool decorated()
Test whether the rendered scene is decorated.
HRESULT set_specular_color(const FVector3 &color)
Set the specular color.
HRESULT camera_zoom_by(const float &delta)
Zoom the camera by an increment in distance.
HRESULT camera_zoom_out()
Zoom the camera out.
void toggle_rendering_3d_bonds()
HRESULT screenshot(const std::string &filePath)
Save a screenshot of the current scene.
HRESULT camera_zoom_in()
Zoom the camera in.
float get_shininess()
Get the shininess.
HRESULT camera_view_front()
Move the camera to view the domain from the front.
FVector3 camera_center()
Get the current camera view center position.
HRESULT set_scene_box_color(const FVector3 &color)
Set the scene box color.
HRESULT camera_roll_right()
Rotate the camera right.
void set_rendering_3d_bonds(const bool &_flag)
HRESULT camera_disable_lagging()
HRESULT camera_rotate_to_axis(const FVector3 &axis, const float &distance)
Rotate the camera to a point from the view center a distance along an axis.
HRESULT camera_rotate_left()
Rotate the camera left.
bool showing_discretization()
Test whether discretization is current shown.
HRESULT decorate_scene(const bool &decorate)
Set flag to draw/not draw scene decorators (e.g., grid)
const bool get_rendering_3d_angles()
HRESULT camera_view_bottom()
Move the camera to view the domain from the bottm.
FVector3 get_grid_color()
Get the grid color.
FloatP_t get_line_width()
HRESULT set_light_color(const FVector3 &color)
Set the light color.
FVector3 get_diffuse_color()
Get the diffuse color.
HRESULT camera_view_left()
Move the camera to view the domain from the left.
struct rendering::UniverseRenderer * get_renderer()
Get the universe renderer.
bool is_terminal_interactive()
Test whether Tissue Forge is running in an interactive terminal.
const bool get_rendering_3d_dihedrals()
HRESULT set_grid_color(const FVector3 &color)
Set the grid color.
HRESULT camera_rotate_to_euler_angle(const FVector3 &angles)
Rotate the camera to a set of Euler angles.
float camera_get_lagging()
FVector3 get_discretizationColor()
Get the current color of the discretization grid.
HRESULT set_light_direction(const FVector3 &lightDir)
Set the light direction.
std::unordered_map< std::string bool > cpu_info()
Get CPU info.
HRESULT camera_translate_up()
Translate the camera up.
HRESULT camera_translate_backward()
Translate the camera backward.
HRESULT camera_toggle_lagging()
std::unordered_map< std::string bool > compile_flags()
Get compiler flags of this installation.
HRESULT camera_rotate_down()
Rotate the camera down.
HRESULT camera_translate_forward()
Translate the camera forward.
int add_render_arrow(rendering::ArrowData *arrow)
Adds a vector visualization specification.
void toggle_rendering_3d_angles()
HRESULT show_discretization(const bool &show)
Set flag to draw/not draw discretization.
std::string egl_info()
Get EGL info.
FQuaternion camera_rotation()
Get the current camera rotation.
void toggle_rendering_3d_dihedrals()
HRESULT set_shininess(const float &shininess)
Set the shininess.
void set_rendering_3d_all(const bool &_flag)
HRESULT set_background_color(const FVector3 &color)
Set the background color.
const bool get_rendering_3d_bonds()
bool is_jupyter_notebook()
Test whether Tissue Forge is running in a Jupyter notebook.
HRESULT camera_enable_lagging()
HRESULT show()
Shows any windows that were specified in the config. Does not start the universe time propagation unl...
Vector visualization specification.
Definition tfArrowRenderer.h:46
The Tissue Forge style type.
Definition tfStyle.h:46
Definition tfUniverseRenderer.h:115
int32_t HRESULT
Definition tf_port.h:255