5 #ifndef CNOID_BASE_SCENE_WIDGET_H
6 #define CNOID_BASE_SCENE_WIDGET_H
8 #include <cnoid/SceneGraph>
9 #include <cnoid/Widget>
11 #include "exportdecl.h"
15 class ExtensionManager;
19 class SceneWidgetEvent;
20 class SceneWidgetEventHandler;
21 class SceneWidgetRoot;
23 class InteractiveCameraTransform;
36 void setModeSyncEnabled(
bool on);
44 void renderScene(
bool doImmediately =
false);
46 [[deprecated(
"Use renderScene(true).")]]
47 void draw() { renderScene(
true); }
51 void setEditMode(
bool on);
52 bool isEditMode()
const;
57 static int issueUniqueCustomModeId();
61 int activeCustomMode()
const;
66 Vector3 lastClickedPoint()
const;
72 void setViewpointOperationMode(ViewpointOperationMode mode);
73 ViewpointOperationMode viewpointOperationMode()
const;
78 bool isBuiltinCameraCurrent()
const;
79 bool isBuiltinCamera(
SgCamera* camera)
const;
82 void startBuiltinCameraViewChange(
const Vector3& center);
83 void rotateBuiltinCameraView(
double dPitch,
double dYaw);
84 void translateBuiltinCameraView(
const Vector3& dp_local);
86 bool unproject(
double x,
double y,
double z,
Vector3& out_projected)
const;
96 void setVisiblePolygonElements(
int elementFlags);
97 int visiblePolygonElements()
const;
99 void setHighlightingEnabled(
bool on);
100 bool isHighlightingEnabled()
const;
102 void setCollisionLineVisibility(
bool on);
103 bool collisionLineVisibility()
const;
105 void setHeadLightIntensity(
double value);
106 void setWorldLightIntensity(
double value);
107 void setWorldLightAmbient(
double value);
108 void setFloorGridSpan(
double value);
109 void setFloorGridInterval(
double value);
110 void setLineWidth(
double value);
111 void setPointSize(
double value);
112 void setNormalLength(
double value);
114 void setHeadLightEnabled(
bool on);
115 void setHeadLightLightingFromBack(
bool on);
116 void setWorldLight(
bool on);
117 void setAdditionalLights(
bool on);
118 void setFloorGrid(
bool on);
119 void setNormalVisualization(
bool on);
120 void setCoordinateAxes(
bool on);
121 void setShowFPS(
bool on);
123 void setBackgroundColor(
const Vector3& color);
125 void setColor(
const Vector4& color);
128 void setFieldOfView(
double value);
129 void setHeight(
double value);
130 void setNear(
double value);
131 void setFar(
double value);
141 void setCursor(
const QCursor cursor);
144 void showContextMenuAtPointerPosition();
147 void showConfigDialog();
148 QVBoxLayout* configDialogVBox();
150 bool saveImage(
const std::string& filename);
152 void setScreenSize(
int width,
int height);
154 void updateIndicator(
const std::string& text);
155 QWidget* indicator();
157 bool storeState(
Archive& archive);
158 bool restoreState(
const Archive& archive);
160 SignalProxy<void(
bool isFocused)> sigWidgetFocusChanged();