RAMSES Documentation  27.0.130
Information for RAMSES users and developers
DcsmContentControl.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // Copyright (C) 2019 BMW AG
3 // -------------------------------------------------------------------------
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 // -------------------------------------------------------------------------
8 
9 #ifndef RAMSES_DCSMCONTENTCONTROL_H
10 #define RAMSES_DCSMCONTENTCONTROL_H
11 
15 
16 namespace ramses
17 {
18  class RamsesRenderer;
19  class RamsesFramework;
20  class IDcsmContentControlEventHandler;
21  class IRendererEventHandler;
22  class DcsmStatusMessage;
23 
70  {
71  public:
83  status_t addContentCategory(Category category, displayId_t display, const CategoryInfoUpdate& categoryInformation);
84 
92 
108  status_t requestContentReady(ContentID contentID, uint64_t timeOut);
109 
126 
145 
165 
178  status_t setCategoryInfo(Category categoryId, const CategoryInfoUpdate& categoryInfo, AnimationInformation timingInfo);
179 
196 
221  status_t assignContentToDisplayBuffer(ContentID contentID, displayBufferId_t displayBuffer, int32_t renderOrder = 0);
222 
240 
262 
289 
303 
304  /*
305  * @brief Trigger renderer to test if given pick event with coordinates intersects with any instances
306  * of ramses::PickableObject contained in given content's scene. If so, the intersected PickableObjects are
307  * reported to the ramses::DcsmContentControl (see ramses::IDcsmContentControlEventHandler::objectsPicked) using their user IDs
308  * given at creation time (see ramses::Scene::createPickableObject).
309  *
310  * @details \section Coordinates
311  * Coordinates normalized to range <-1, 1> where (-1, -1) is bottom left corner of the buffer where content is mapped to
312  * and (1, 1) is top right corner.
313  * If the content to test is rendered directly to framebuffer then display size should be used,
314  * i.e. (-1, -1) is bottom left corner of the display and (1, 1) top right corner of display.
315  * If the content is mapped to an offscreen buffer and rendered as a texture mapped
316  * on a mesh in another content, the given coordinates need to be mapped to the offscreen buffer
317  * dimensions in the same way.
318  * For example if the content's offscreen buffer is mapped on a 2D quad placed somewhere on screen
319  * then the coordinates provided need to be within the region of the 2D quad, i.e. (-1, -1) at bottom left corner of the quad and (1, 1) at top right corner.
320  *
321  * @param contentID Content to check for intersected PickableObjects.
322  * @param bufferNormalizedCoordX Normalized X pick coordinate within buffer size (see \ref Coordinates).
323  * @param bufferNormalizedCoordY Normalized Y pick coordinate within buffer size (see \ref Coordinates).
324  * @return StatusOK for success, otherwise the returned status can be used
325  * to resolve error message using getStatusMessage().
326  */
327  status_t handlePickEvent(ContentID contentID, float bufferNormalizedCoordX, float bufferNormalizedCoordY);
328 
339  status_t update(uint64_t timeStampNow, IDcsmContentControlEventHandler& eventHandler);
340 
351 
353  DcsmContentControl() = delete;
354 
357 
364 
366  class DcsmContentControlImpl& m_impl;
367 
368  private:
370  friend class RamsesRendererImpl;
371 
373  virtual ~DcsmContentControl();
374 
376  explicit DcsmContentControl(DcsmContentControlImpl&);
377  };
378 }
379 
380 #endif
#define RAMSES_API
Definition: APIExport.h:35
Update of information about a DCSM category. Contains information like changes in size....
Definition: CategoryInfoUpdate.h:29
DcsmContentControl provides way to interact with both Dcsm (as consumer) and renderer content control...
Definition: DcsmContentControl.h:70
status_t showContent(ContentID contentID, AnimationInformation timingInfo)
Shows the content. The content must be ready to be shown - see ramses::DcsmContentControl::requestCon...
status_t unlinkData(ContentID consumerContentID, dataConsumerId_t consumerId)
Removes an existing link between data provider and consumer (linkData) or offscreen buffer and consum...
status_t setCategoryInfo(Category categoryId, const CategoryInfoUpdate &categoryInfo, AnimationInformation timingInfo)
Sets new category info for given category.
status_t hideContent(ContentID contentID, AnimationInformation timingInfo)
Hides the content. The content must be shown.
status_t removeContentCategory(Category category)
Remove a content category.
DcsmContentControl()=delete
Deleted default constructor.
status_t requestContentReady(ContentID contentID, uint64_t timeOut)
Requests that the provided content is ready to show.
status_t linkContentToTextureConsumer(ContentID contentID, ContentID consumerContentID, dataConsumerId_t consumerId)
Creates a data link between given content as texture and a consumer data slot defined in Ramses scene...
status_t releaseContent(ContentID contentID, AnimationInformation timingInfo)
Stops using content.
status_t assignContentToDisplayBuffer(ContentID contentID, displayBufferId_t displayBuffer, int32_t renderOrder=0)
Redirects rendering output of a content to a display buffer.
status_t linkData(ContentID providerContentID, dataProviderId_t providerId, ContentID consumerContentID, dataConsumerId_t consumerId)
Creates a data link between data slots defined in Ramses scene.
status_t handlePickEvent(ContentID contentID, float bufferNormalizedCoordX, float bufferNormalizedCoordY)
status_t addContentCategory(Category category, displayId_t display, const CategoryInfoUpdate &categoryInformation)
Add a content category.
status_t linkOffscreenBuffer(displayBufferId_t offscreenBufferId, ContentID consumerContentID, dataConsumerId_t consumerId)
Creates a data link between offscreen buffer and a consumer data slot defined in Ramses scene.
DcsmContentControl & operator=(const DcsmContentControl &other)=delete
Deleted copy assignment.
class DcsmContentControlImpl & m_impl
Implementation.
Definition: DcsmContentControl.h:366
DcsmContentControl(const DcsmContentControl &)=delete
Deleted copy constructor.
status_t update(uint64_t timeStampNow, IDcsmContentControlEventHandler &eventHandler)
Do one update cycle which flushes any pending commands, dispatches events from both Dcsm and renderer...
status_t sendContentStatus(ContentID contentID, DcsmStatusMessage const &message)
Send a message to the provider of the content assigned to this content control.
status_t acceptStopOffer(ContentID contentID, AnimationInformation timingInfo)
Stops using given content and accepts the request from provider.
The base class of a message to be sent from DCSM consumer to provider.
Definition: DcsmStatusMessage.h:28
Callback handler interface for events emitted by ramses::DcsmContentControl.
Definition: IDcsmContentControlEventHandler.h:32
The StatusObject provides status message handling.
Definition: StatusObject.h:22
Helper class to create strongly typed values out of various types.
Definition: StronglyTypedValue.h:23
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition: AnimatedProperty.h:15
uint32_t status_t
Status is a handle to the result of an API call.
Definition: RamsesFrameworkTypes.h:26
constexpr ramses::ContentID consumerContentID
Definition: main.cpp:77
constexpr ramses::ContentID providerContentID
Definition: main.cpp:76
Definition: DcsmApiTypes.h:152