27#ifndef EASY3D_VIEWER_OFFSCREEN_H
28#define EASY3D_VIEWER_OFFSCREEN_H
31#include <easy3d/viewer/viewer.h>
84 bool render(
const std::string& file_name,
float scaling = 1.0f,
int samples = 4,
int back_ground = 1,
bool expand =
true)
const;
136 virtual Model*
add_model(
const std::string& file_name,
bool create_default_drawables =
true);
157 Model*
add_model(std::shared_ptr<Model> model,
bool create_default_drawables =
true);
171 const std::vector< std::shared_ptr<Model> >&
models()
const;
208 const std::vector<std::shared_ptr<Drawable> >&
drawables()
const;
A perspective or orthographic camera.
Definition camera.h:113
The base class for drawable objects. A drawable represent a set of points, line segments,...
Definition drawable.h:58
The base class of renderable 3D models.
Definition model.h:50
Offscreen rendering.
Definition offscreen.h:51
bool render(const std::string &file_name, float scaling=1.0f, int samples=4, int back_ground=1, bool expand=true) const
Render the current scene into an image file. Supported image format: png, jpg, bmp,...
Definition offscreen.cpp:50
const easy3d::vec4 & background_color() const
Query the background color of the offscreen renderer.
Definition offscreen.cpp:75
void clear_scene()
Delete all visual contents of the offscreen renderer (all models and drawables).
Definition offscreen.cpp:122
bool delete_drawable(Drawable *drawable)
Definition offscreen.cpp:112
Model * current_model() const
Query the active model.
Definition offscreen.cpp:102
const std::vector< std::shared_ptr< Drawable > > & drawables() const
Query the drawables managed by this offscreen renderer.
Definition offscreen.cpp:117
const std::vector< std::shared_ptr< Model > > & models() const
Query the models managed by this offscreen renderer.
Definition offscreen.cpp:97
void resize(int w, int h)
Set/Change the size of the offscreen renderer.
Definition offscreen.cpp:55
void set_background_color(const easy3d::vec4 &color)
Set the background color of the offscreen renderer.
Definition offscreen.cpp:70
bool delete_model(Model *model)
Delete a model. The memory of the model will be released and its existing drawables also be deleted.
Definition offscreen.cpp:92
virtual Model * add_model(const std::string &file_name, bool create_default_drawables=true)
Add a model from a file to the offscreen renderer. On success, the offscreen renderer will be in char...
Definition offscreen.cpp:80
Camera * camera()
Returns the camera used by the offscreen renderer. See Camera.
Definition offscreen.cpp:40
int height() const
Returns the height of the offscreen renderer.
Definition offscreen.cpp:65
int width() const
Returns the width of the offscreen renderer.
Definition offscreen.cpp:60
Drawable * add_drawable(std::shared_ptr< Drawable > drawable)
Add a drawable to the offscreen renderer. On success, the offscreen renderer will be in charge of its...
Definition offscreen.cpp:107
The built-in Easy3D viewer.
Definition viewer.h:63
int samples() const
Query the actual samples of the viewer.
Definition viewer.h:160
Definition collider.cpp:182