47 #ifndef _MIRA_VISUALIZATION3DVIEW_H_ 48 #define _MIRA_VISUALIZATION3DVIEW_H_ 74 (
"Description",
"3D view for channel data")
75 (
"Category" ,
"Visualization")
76 (
"Visualization",
"mira::Visualization3D"))
93 template <
typename Reflector>
97 r.property(
"Camera Mode", mCameraMode,
98 setter(&Visualization3DView::setCameraMode,
this),
99 "The view mode of the camera", PERSPECTIVE,
102 r.property(
"Camera", mCameraSettings,
"Camera view", Camera());
104 r.property(
"Background", mBackgroundMode,
setter(&Visualization3DView::setBackgroundMode,
this),
"Background mode", BACKGROUND_GRADIENT,
106 r.property(
"Background Color", mBackgroundColor1,
setter(&Visualization3DView::setBackgroundColor1,
this),
"Solid background color / Top gradient color", Ogre::ColourValue(0.78f,0.86f,1.0f) );
107 r.property(
"Background Gradient Color", mBackgroundColor2,
setter(&Visualization3DView::setBackgroundColor2,
this),
"Bottom gradient color", Ogre::ColourValue(0.90f,0.94f,1.0f) );
109 r.property(
"Render Mode", mRenderMode,
110 setter(&Visualization3DView::setRenderMode,
this),
111 "The view mode of the camera", NORMAL,
114 r.property(
"Stereo Mode", mStereoMode,
115 setter(&Visualization3DView::setStereoMode,
this),
116 "The view mode of the camera", NONE,
118 r.property(
"Stereo Eye Distance", mStereoEyeDistance,
"in meter, >0 for cross view, <0 for parallel view", 0.2f);
120 r.property(
"Show Bounding Boxes", mShowBoundingBoxes,
setter(&Visualization3DView::showBoundingBoxes,
this),
"Show bounding boxes of all objects (for debugging)",
false);
127 r.property(
"SaveContentMinPictureSize", mSaveContentMinPictureSize,
128 "Minimum width or height of the image saved by rendering the viewport at an appropriate resolution.", 2048);
187 virtual void setCamera(
const Camera& camera);
189 virtual Ogre::Camera*
acquireCamera(boost::function<
void()> lostCameraCallback = boost::function<
void()>());
205 void setupVisualizations();
211 void populateDefaultVisualizations();
212 void createDefaultVisualization(
const std::string& className,
const std::string& displayName);
243 void setCameraMode(CameraMode mode);
245 void setBackgroundMode(BackgroundMode mode);
246 void setBackgroundColor1(Ogre::ColourValue color);
247 void setBackgroundColor2(Ogre::ColourValue color);
248 void showBoundingBoxes(
bool show=
true);
250 void setRenderMode(RenderMode mode);
251 void setStereoMode(StereoMode mode);
255 ChannelProperty<float> mIntrinsicParamsChannel;
257 CameraMode mCameraMode;
258 Camera mCameraSettings;
260 bool mCameraAcquired;
261 boost::function<void()> mLostCameraCallback;
263 BackgroundMode mBackgroundMode;
264 Ogre::ColourValue mBackgroundColor1;
265 Ogre::ColourValue mBackgroundColor2;
267 RenderMode mRenderMode;
268 StereoMode mStereoMode;
269 float mStereoEyeDistance;
271 bool mShowBoundingBoxes;
273 Ogre::ColourValue mLightColor;
277 boost::mutex mListenerMutex;
278 std::set<InteractionListener3D*> mListeners;
280 uint mSaveContentMinPictureSize;
virtual void moveDownVisualization(Visualization *vis)
Change order of visualizations in the view, move the specified visualization down.
The interface of a Visualization3DSite.
Definition: Visualization3D.h:84
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
Abstract base class for all derived visualizations, namely Visualization3D and Visualization2D.
Definition: Visualization.h:88
virtual std::set< InteractionListener3D * > getInteractionListeners()
Provides a special setter, that simply sets the value of the member to the given value AND calls a us...
friend class RenderQueueSorter
Definition: Visualization3DView.h:203
PropertyHint enumeration(const std::string &values)
Sets the attribute "enumeration".
Definition: PropertyHint.h:306
Class for 2D, 3D and N-dimensional points.
#define MIRA_REFLECT_BASE(reflector, BaseClass)
Macro that can be used to reflect the base class easily.
Definition: ReflectorInterface.h:912
virtual void registerInteractionListener(InteractionListener3D *listener)
Class object which supports some kind of class reflection.
Definition: Class.h:97
Setter< T > setter(void(*f)(const T &))
Creates a Setter for global or static class methods taking the argument by const reference.
Definition: GetterSetter.h:443
virtual QImage captureContent()
Returns the content of the editor part as QImage.
const RGB White(1.0f, 1.0f, 1.0f)
void destroyVisualizations()
virtual const std::string & getFixedFrame() const
Definition: Visualization3DView.h:176
virtual void setCamera(const Camera &camera)
void reflect(Reflector &r)
Definition: Visualization3DView.h:94
virtual Ogre::Camera * acquireCamera(boost::function< void()> lostCameraCallback=boost::function< void()>())
Requests the camera of the visualization site.
Declaration of Visualization3D and related classes.
virtual const Camera & getCamera() const
Obtains the current camera settings (position, orientation, etc.) of the views own camera...
void changeAmbientLight()
PropertyHint limits(const T &min, const T &max)
Sets both attributes "minimum" and "maximum" to the specified values.
Definition: PropertyHint.h:275
#define MIRA_META_OBJECT(classIdentifier, MetaInfo)
Use this MACRO instead of MIRA_OBJECT if you like to add meta information to your class...
Definition: FactoryMacros.h:204
virtual void setCameraFrame(const TransformProperty &frame)
Use this class to represent time durations.
Definition: Time.h:106
virtual void update(Duration dt)
Is called by this class within the update timer event to update the view.
virtual const std::string & getCameraFrame() const
Definition: Visualization3DView.h:180
friend class RenderModeTechniqueMod
Definition: Visualization3DView.h:202
virtual const Class & supportedVisualizationToolClass() const
Derived visualization views may return the base class of their supported tools.
virtual void addVisualization(Visualization *vis)
Adds an existing visualization to this view.
Listener for mouse events on movable objects in a 3D view.
Definition: InteractionListener3D.h:66
PropertyHint minimum(const T &min)
Sets the attribute "minimum" to the specified value.
Definition: PropertyHint.h:243
virtual void moveUpVisualization(Visualization *vis)
Change order of visualizations in the view, move the specified visualization up.
Setter< T > setterNotify(T &member, boost::function< void()> notifyFn)
Creates a setter that simply sets the value of the specified member to the given value AND calls a us...
Definition: SetterNotify.h:86
PropertyHint step(const T &step)
Sets the attribute "step" to the specified value.
Definition: PropertyHint.h:265
virtual void removeInteractionListener(InteractionListener3D *listener)
Non intrusive reflect for OGRE color class.
virtual void releaseCamera()
Releases a camera that previously was acquired.
virtual QWidget * createVisualizationPart()
QGLWidget * getGLRenderWidget()
Returns the GLWidget where this view renders its content (may be NULL if the view is uninitialized) ...
Declaration of VisualizationView and VisualizationViewTransformable.
virtual void changeLightDirection()
3D view of a scene that may contain different visualization objects which show the actual content of ...
Definition: Visualization3DView.h:70
virtual const Class & supportedVisualizationClass() const
Derived visualization views must return the base class of their supported visualizations.
virtual Ogre::SceneManager * getSceneManager()
friend class UI
Definition: Visualization3DView.h:198
virtual void saveContentToFile()
virtual void addTool(VisualizationTool *tool)
Adds an existing tool to this view.