Open3D (C++ API)
0.17.0
|
#include <O3DVisualizer.h>
Data Structures | |
struct | DrawObject |
struct | Impl |
struct | UIState |
Public Types | |
enum class | Shader { STANDARD , UNLIT , NORMALS , DEPTH } |
enum class | TickResult { NO_CHANGE , REDRAW } |
Public Member Functions | |
O3DVisualizer (const std::string &title, int width, int height) | |
virtual | ~O3DVisualizer () |
void | AddAction (const std::string &name, std::function< void(O3DVisualizer &)> callback) |
void | SetBackground (const Eigen::Vector4f &bg_color, std::shared_ptr< geometry::Image > bg_image=nullptr) |
void | SetShader (Shader shader) |
void | AddGeometry (const std::string &name, std::shared_ptr< geometry::Geometry3D > geom, const rendering::MaterialRecord *material=nullptr, const std::string &group="", double time=0.0, bool is_visible=true) |
Adds a legacy geometry to the Visualizer. More... | |
void | AddGeometry (const std::string &name, std::shared_ptr< t::geometry::Geometry > tgeom, const rendering::MaterialRecord *material=nullptr, const std::string &group="", double time=0.0, bool is_visible=true) |
void | AddGeometry (const std::string &name, std::shared_ptr< rendering::TriangleMeshModel > tgeom, const rendering::MaterialRecord *material=nullptr, const std::string &group="", double time=0.0, bool is_visible=true) |
Adds a triangle mesh model to the Visualizer. More... | |
void | RemoveGeometry (const std::string &name) |
Removes the named geometry from the Visualizer. More... | |
void | UpdateGeometry (const std::string &name, std::shared_ptr< t::geometry::Geometry > tgeom, uint32_t update_flags) |
void | ShowGeometry (const std::string &name, bool show) |
Show/hide the named geometry. More... | |
DrawObject | GetGeometry (const std::string &name) const |
Returns Visualizer's internal DrawObject for the named geometry. More... | |
rendering::MaterialRecord | GetGeometryMaterial (const std::string &name) const |
void | ModifyGeometryMaterial (const std::string &name, const rendering::MaterialRecord *material) |
void | Add3DLabel (const Eigen::Vector3f &pos, const char *text) |
Adds a label with text text at the 3D position pos . More... | |
void | Clear3DLabels () |
Clears all 3D labels created with Add3DLabel More... | |
void | SetupCamera (float fov, const Eigen::Vector3f ¢er, const Eigen::Vector3f &eye, const Eigen::Vector3f &up) |
void | SetupCamera (const camera::PinholeCameraIntrinsic &intrinsic, const Eigen::Matrix4d &extrinsic) |
void | SetupCamera (const Eigen::Matrix3d &intrinsic, const Eigen::Matrix4d &extrinsic, int intrinsic_width_px, int intrinsic_height_px) |
void | ResetCameraToDefault () |
void | ShowSettings (bool show) |
void | ShowSkybox (bool show) |
void | SetIBL (const std::string &path) |
void | SetIBLIntensity (float intensity) |
void | ShowAxes (bool show) |
void | ShowGround (bool show) |
void | SetGroundPlane (rendering::Scene::GroundPlane plane) |
void | EnableSunFollowsCamera (bool enable) |
void | EnableBasicMode (bool enable) |
void | EnableWireframeMode (bool enable) |
void | SetPointSize (int point_size) |
void | SetLineWidth (int line_width) |
void | EnableGroup (const std::string &group, bool enable) |
void | SetMouseMode (gui::SceneWidget::Controls mode) |
std::vector< O3DVisualizerSelections::SelectionSet > | GetSelectionSets () const |
double | GetAnimationFrameDelay () const |
void | SetAnimationFrameDelay (double secs) |
double | GetAnimationTimeStep () const |
void | SetAnimationTimeStep (double time_step) |
double | GetAnimationDuration () const |
void | SetAnimationDuration (double sec) |
double | GetCurrentTime () const |
void | SetCurrentTime (double t) |
bool | GetIsAnimating () const |
void | SetAnimating (bool is_animating) |
void | SetOnAnimationFrame (std::function< void(O3DVisualizer &, double)> cb) |
void | SetOnAnimationTick (std::function< TickResult(O3DVisualizer &, double, double)> cb) |
void | ExportCurrentImage (const std::string &path) |
UIState | GetUIState () const |
rendering::Open3DScene * | GetScene () const |
void | StartRPCInterface (const std::string &address, int timeout) |
Starts the RPC interface. See io/rpc/ZMQReceiver for the parameters. More... | |
void | StopRPCInterface () |
Public Member Functions inherited from open3d::visualization::gui::Window | |
Window (const std::string &title, int flags=0) | |
Window (const std::string &title, int width, int height, int flags=0) | |
Window (const std::string &title, int x, int y, int width, int height, int flags=0) | |
virtual | ~Window () |
const Theme & | GetTheme () const |
visualization::rendering::Renderer & | GetRenderer () const |
Rect | GetOSFrame () const |
void | SetOSFrame (const Rect &r) |
const char * | GetTitle () const |
void | SetTitle (const char *title) |
void | SizeToFit () |
void | SetSize (const Size &size) |
Sets the size of the window in pixels. Includes menubar on Linux. More... | |
Size | GetSize () const |
Rect | GetContentRect () const |
float | GetScaling () const |
Returns the scaling factor from OS pixels to device pixels. More... | |
Point | GlobalToWindowCoord (int global_x, int global_y) |
Returns the global point (in OS pixels) in window local coordinates. More... | |
bool | IsVisible () const |
void | Show (bool vis=true) |
void | Close () |
void | SetNeedsLayout () |
Instructs the window to relayout before the next draw. More... | |
void | PostRedraw () |
void | SetTopmost (bool topmost) |
void | RaiseToTop () const |
bool | IsActiveWindow () const |
void | SetFocusWidget (Widget *w) |
Sets. More... | |
void | AddChild (std::shared_ptr< Widget > w) |
void | SetOnMenuItemActivated (Menu::ItemId item_id, std::function< void()> callback) |
void | SetOnTickEvent (std::function< bool()> callback) |
void | SetOnClose (std::function< bool()> callback) |
void | SetOnKeyEvent (std::function< bool(const KeyEvent &)> callback) |
void | ShowDialog (std::shared_ptr< Dialog > dlg) |
void | CloseDialog () |
Closes the dialog. More... | |
void | ShowMessageBox (const char *title, const char *message) |
void | DestroyWindow () |
virtual void | OnMenuItemSelected (Menu::ItemId item_id) |
virtual void | OnDragDropped (const char *path) |
void | ShowMenu (bool show) |
int | GetMouseMods () const |
std::string | GetWebRTCUID () const |
void | OnDraw () |
void | OnResize () |
void | OnMouseEvent (const MouseEvent &e) |
void | OnKeyEvent (const KeyEvent &e) |
void | OnTextInput (const TextInputEvent &e) |
void | OnTickEvent (const TickEvent &e) |
WindowSystem::OSWindow | GetOSWindow () const |
Protected Member Functions | |
void | Layout (const gui::LayoutContext &context) |
Protected Member Functions inherited from open3d::visualization::gui::Window | |
virtual Size | CalcPreferredSize () |
LayoutContext | GetLayoutContext () |
const std::vector< std::shared_ptr< Widget > > & | GetChildren () const |
Additional Inherited Members | |
Static Public Attributes inherited from open3d::visualization::gui::Window | |
static const int | FLAG_HIDDEN = (1 << 0) |
static const int | FLAG_TOPMOST = (1 << 1) |
open3d::visualization::visualizer::O3DVisualizer::O3DVisualizer | ( | const std::string & | title, |
int | width, | ||
int | height | ||
) |
|
virtual |
void open3d::visualization::visualizer::O3DVisualizer::Add3DLabel | ( | const Eigen::Vector3f & | pos, |
const char * | text | ||
) |
Adds a label with text text
at the 3D position pos
.
void open3d::visualization::visualizer::O3DVisualizer::AddAction | ( | const std::string & | name, |
std::function< void(O3DVisualizer &)> | callback | ||
) |
void open3d::visualization::visualizer::O3DVisualizer::AddGeometry | ( | const std::string & | name, |
std::shared_ptr< geometry::Geometry3D > | geom, | ||
const rendering::MaterialRecord * | material = nullptr , |
||
const std::string & | group = "" , |
||
double | time = 0.0 , |
||
bool | is_visible = true |
||
) |
Adds a legacy geometry to the Visualizer.
void open3d::visualization::visualizer::O3DVisualizer::AddGeometry | ( | const std::string & | name, |
std::shared_ptr< rendering::TriangleMeshModel > | tgeom, | ||
const rendering::MaterialRecord * | material = nullptr , |
||
const std::string & | group = "" , |
||
double | time = 0.0 , |
||
bool | is_visible = true |
||
) |
Adds a triangle mesh model to the Visualizer.
void open3d::visualization::visualizer::O3DVisualizer::AddGeometry | ( | const std::string & | name, |
std::shared_ptr< t::geometry::Geometry > | tgeom, | ||
const rendering::MaterialRecord * | material = nullptr , |
||
const std::string & | group = "" , |
||
double | time = 0.0 , |
||
bool | is_visible = true |
||
) |
Adds a t-geometry to the Visualizer, only DrawableGeometries are supported.
void open3d::visualization::visualizer::O3DVisualizer::Clear3DLabels | ( | ) |
Clears all 3D labels created with Add3DLabel
void open3d::visualization::visualizer::O3DVisualizer::EnableBasicMode | ( | bool | enable | ) |
void open3d::visualization::visualizer::O3DVisualizer::EnableGroup | ( | const std::string & | group, |
bool | enable | ||
) |
void open3d::visualization::visualizer::O3DVisualizer::EnableSunFollowsCamera | ( | bool | enable | ) |
void open3d::visualization::visualizer::O3DVisualizer::EnableWireframeMode | ( | bool | enable | ) |
void open3d::visualization::visualizer::O3DVisualizer::ExportCurrentImage | ( | const std::string & | path | ) |
double open3d::visualization::visualizer::O3DVisualizer::GetAnimationDuration | ( | ) | const |
double open3d::visualization::visualizer::O3DVisualizer::GetAnimationFrameDelay | ( | ) | const |
double open3d::visualization::visualizer::O3DVisualizer::GetAnimationTimeStep | ( | ) | const |
double open3d::visualization::visualizer::O3DVisualizer::GetCurrentTime | ( | ) | const |
O3DVisualizer::DrawObject open3d::visualization::visualizer::O3DVisualizer::GetGeometry | ( | const std::string & | name | ) | const |
Returns Visualizer's internal DrawObject for the named geometry.
MaterialRecord open3d::visualization::visualizer::O3DVisualizer::GetGeometryMaterial | ( | const std::string & | name | ) | const |
bool open3d::visualization::visualizer::O3DVisualizer::GetIsAnimating | ( | ) | const |
Open3DScene * open3d::visualization::visualizer::O3DVisualizer::GetScene | ( | ) | const |
std::vector< O3DVisualizerSelections::SelectionSet > open3d::visualization::visualizer::O3DVisualizer::GetSelectionSets | ( | ) | const |
O3DVisualizer::UIState open3d::visualization::visualizer::O3DVisualizer::GetUIState | ( | ) | const |
|
protectedvirtual |
Lays out all the widgets in the window. If all children of the window are layouts, this function does not need to be overridden.
Reimplemented from open3d::visualization::gui::Window.
void open3d::visualization::visualizer::O3DVisualizer::ModifyGeometryMaterial | ( | const std::string & | name, |
const rendering::MaterialRecord * | material | ||
) |
void open3d::visualization::visualizer::O3DVisualizer::RemoveGeometry | ( | const std::string & | name | ) |
Removes the named geometry from the Visualizer.
void open3d::visualization::visualizer::O3DVisualizer::ResetCameraToDefault | ( | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetAnimating | ( | bool | is_animating | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetAnimationDuration | ( | double | sec | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetAnimationFrameDelay | ( | double | secs | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetAnimationTimeStep | ( | double | time_step | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetBackground | ( | const Eigen::Vector4f & | bg_color, |
std::shared_ptr< geometry::Image > | bg_image = nullptr |
||
) |
void open3d::visualization::visualizer::O3DVisualizer::SetCurrentTime | ( | double | t | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetGroundPlane | ( | rendering::Scene::GroundPlane | plane | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetIBL | ( | const std::string & | path | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetIBLIntensity | ( | float | intensity | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetLineWidth | ( | int | line_width | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetMouseMode | ( | gui::SceneWidget::Controls | mode | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetOnAnimationFrame | ( | std::function< void(O3DVisualizer &, double)> | cb | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetOnAnimationTick | ( | std::function< TickResult(O3DVisualizer &, double, double)> | cb | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetPointSize | ( | int | point_size | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetShader | ( | Shader | shader | ) |
void open3d::visualization::visualizer::O3DVisualizer::SetupCamera | ( | const camera::PinholeCameraIntrinsic & | intrinsic, |
const Eigen::Matrix4d & | extrinsic | ||
) |
void open3d::visualization::visualizer::O3DVisualizer::SetupCamera | ( | const Eigen::Matrix3d & | intrinsic, |
const Eigen::Matrix4d & | extrinsic, | ||
int | intrinsic_width_px, | ||
int | intrinsic_height_px | ||
) |
void open3d::visualization::visualizer::O3DVisualizer::SetupCamera | ( | float | fov, |
const Eigen::Vector3f & | center, | ||
const Eigen::Vector3f & | eye, | ||
const Eigen::Vector3f & | up | ||
) |
void open3d::visualization::visualizer::O3DVisualizer::ShowAxes | ( | bool | show | ) |
void open3d::visualization::visualizer::O3DVisualizer::ShowGeometry | ( | const std::string & | name, |
bool | show | ||
) |
Show/hide the named geometry.
void open3d::visualization::visualizer::O3DVisualizer::ShowGround | ( | bool | show | ) |
void open3d::visualization::visualizer::O3DVisualizer::ShowSettings | ( | bool | show | ) |
void open3d::visualization::visualizer::O3DVisualizer::ShowSkybox | ( | bool | show | ) |
void open3d::visualization::visualizer::O3DVisualizer::StartRPCInterface | ( | const std::string & | address, |
int | timeout | ||
) |
Starts the RPC interface. See io/rpc/ZMQReceiver for the parameters.
void open3d::visualization::visualizer::O3DVisualizer::StopRPCInterface | ( | ) |
void open3d::visualization::visualizer::O3DVisualizer::UpdateGeometry | ( | const std::string & | name, |
std::shared_ptr< t::geometry::Geometry > | tgeom, | ||
uint32_t | update_flags | ||
) |
Updates update_flags
attributes of named geometry with the matching attributes from tgeom