gz/rendering/ogre2/Ogre2BoundingBoxCamera.hh
Go to the documentation of this file.
Definition: gz/rendering/base/BaseBoundingBoxCamera.hh:39
2D or 3D Bounding box. It stores the position / orientation / size info of the box and its label
Definition: gz/rendering/BoundingBox.hh:42
BoundingBox camera used to detect 2d / 3d bounding boxes of labeled objects in the scene.
Definition: gz/rendering/ogre2/Ogre2BoundingBoxCamera.hh:48
Ogre2BoundingBoxCamera()
Constructor.
virtual RenderTargetPtr RenderTarget() const override
Get a pointer to the render target.
void BoundingBoxes3D()
Compute the 3D bounding boxes.
void MarkVisibleBoxes()
Mark the visible boxes by checking the ogre ids map and mark the ogre id which appears in the map.
virtual ~Ogre2BoundingBoxCamera()
Destructor.
virtual void PreRender() override
Prepare this object and any of its children for rendering. This should be called for each object in a...
void CreateRenderTexture()
Create dummy render texture. Needed to satisfy inheritance and to set image's dims.
virtual void PostRender() override
Preforms any necessary final rendering work. Once rendering is complete the camera will alert any lis...
virtual BoundingBoxType Type() const override
Get the BoundingBox Type (Visible / Full)
virtual void DrawBoundingBox(unsigned char *_data, const math::Color &_color, const BoundingBox &_box) const override
Draw a bounding box on the given image.
virtual const std::vector< BoundingBox > & BoundingBoxData() const override
Get the BoundingBox data.
void ConvertToScreenCoord(Ogre::Vector3 &_minVertex, Ogre::Vector3 &_maxVertex) const
Convert from clip coord (after projection) to screen coord.
virtual void Destroy() override
Destroy the camera.
virtual ignition::common::ConnectionPtr ConnectNewBoundingBoxes(std::function< void(const std::vector< BoundingBox > &)>) override
Connect to the new BoundingBox info.
void DrawLine(unsigned char *_data, const math::Vector2i &_point1, const math::Vector2i &_point2, const ignition::math::Color &_color) const
Draw line between any 2 points in the image data buffer Algorithm: https://en.wikipedia....
void FullBoundingBoxes()
Compute the full bounding boxes by projecting all mesh vertices of each object, then get the min & ma...
virtual void SetBoundingBoxType(BoundingBoxType _type) override
Set BoundingBox Type (Visible / Full)
void CreateBoundingBoxTexture()
Create texture to hold ogre Ids to calculate the boundaries of each ogre id mask.
virtual void Render() override
Renders the current scene using this camera. This function assumes PreRender() has already been calle...
void MeshMinimalBox(const Ogre::MeshPtr _mesh, const Ogre::Matrix4 &_viewMatrix, const Ogre::Matrix4 &_projMatrix, Ogre::Vector3 &_minVertex, Ogre::Vector3 &_maxVertex, const Ogre::Vector3 &_position, const Ogre::Quaternion &_orientation, const Ogre::Vector3 &_scale)
Get minimal bounding box of the mesh by projecting the 3d vertices of the vertex buffer to 2d,...
void VisibleBoundingBoxes()
Compute the visible bounding boxes by looping over pixels of the ogre Ids map, to get the boundaries ...
Ogre2.x implementation of the scene class.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:59
BoundingBoxType
BoundingBox types for Visible / Full 2D Boxes / 3D Boxes.
Definition: gz/rendering/BoundingBoxCamera.hh:38