Rerun C++ SDK
Loading...
Searching...
No Matches
rerun::archetypes::TextDocument Struct Reference

Archetype: A text element intended to be displayed in its own text box. More...

#include <rerun/archetypes/text_document.hpp>

Public Types

using IndicatorComponent = rerun::components::IndicatorComponent< IndicatorComponentName >
 Indicator component, used to identify the archetype when converting to a list of components.
 

Public Member Functions

 TextDocument (TextDocument &&other)=default
 
 TextDocument (const TextDocument &other)=default
 
TextDocumentoperator= (const TextDocument &other)=default
 
TextDocumentoperator= (TextDocument &&other)=default
 
 TextDocument (rerun::components::Text _text)
 
TextDocument with_text (const rerun::components::Text &_text) &&
 Contents of the text document.
 
TextDocument with_many_text (const Collection< rerun::components::Text > &_text) &&
 This method makes it possible to pack multiple text in a single component batch.
 
TextDocument with_media_type (const rerun::components::MediaType &_media_type) &&
 The Media Type of the text.
 
TextDocument with_many_media_type (const Collection< rerun::components::MediaType > &_media_type) &&
 This method makes it possible to pack multiple media_type in a single component batch.
 
Collection< ComponentColumncolumns (const Collection< uint32_t > &lengths_)
 Partitions the component data into multiple sub-batches.
 
Collection< ComponentColumncolumns ()
 Partitions the component data into unit-length sub-batches.
 

Static Public Member Functions

static TextDocument update_fields ()
 Update only some specific fields of a TextDocument.
 
static TextDocument clear_fields ()
 Clear all the fields of a TextDocument.
 

Public Attributes

std::optional< ComponentBatchtext
 Contents of the text document.
 
std::optional< ComponentBatchmedia_type
 The Media Type of the text.
 

Static Public Attributes

static constexpr const char IndicatorComponentName []
 
static constexpr const char ArchetypeName [] = "rerun.archetypes.TextDocument"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_text
 ComponentDescriptor for the text field.
 
static constexpr auto Descriptor_media_type
 ComponentDescriptor for the media_type field.
 

Detailed Description

Archetype: A text element intended to be displayed in its own text box.

Supports raw text and markdown.

Example

Markdown text document

image

#include <rerun.hpp>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_text_document");
rec.spawn().exit_on_failure();
rec.log("text_document", rerun::TextDocument("Hello, TextDocument!"));
rec.log(
"markdown",
rerun::TextDocument(R"#(# Hello Markdown!
[Click here to see the raw text](recording://markdown:Text).
Basic formatting:
| **Feature** | **Alternative** |
| ----------------- | --------------- |
| Plain | |
| *italics* | _italics_ |
| **bold** | __bold__ |
| ~~strikethrough~~ | |
| `inline code` | |
----------------------------------
## Support
- [x] [Commonmark](https://commonmark.org/help/) support
- [x] GitHub-style strikethrough, tables, and checkboxes
- Basic syntax highlighting for:
- [x] C and C++
- [x] Python
- [x] Rust
- [ ] Other languages
## Links
You can link to [an entity](recording://markdown),
a [specific instance of an entity](recording://markdown[#0]),
or a [specific component](recording://markdown:Text).
Of course you can also have [normal https links](https://github.com/rerun-io/rerun), e.g. <https://rerun.io>.
## Image
![A random image](https://picsum.photos/640/480))#")
);
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:60
Archetype: A text element intended to be displayed in its own text box.
Definition text_document.hpp:77
TextDocument with_media_type(const rerun::components::MediaType &_media_type) &&
The Media Type of the text.
Definition text_document.hpp:150
static MediaType markdown()
text/markdown
Definition media_type.hpp:39

Member Function Documentation

◆ with_many_text()

TextDocument rerun::archetypes::TextDocument::with_many_text ( const Collection< rerun::components::Text > &  _text) &&
inline

This method makes it possible to pack multiple text in a single component batch.

This only makes sense when used in conjunction with columns. with_text should be used when logging a single row's worth of data.

◆ with_media_type()

TextDocument rerun::archetypes::TextDocument::with_media_type ( const rerun::components::MediaType _media_type) &&
inline

The Media Type of the text.

For instance:

  • text/plain
  • text/markdown

If omitted, text/plain is assumed.

◆ with_many_media_type()

TextDocument rerun::archetypes::TextDocument::with_many_media_type ( const Collection< rerun::components::MediaType > &  _media_type) &&
inline

This method makes it possible to pack multiple media_type in a single component batch.

This only makes sense when used in conjunction with columns. with_media_type should be used when logging a single row's worth of data.

◆ columns() [1/2]

Collection< ComponentColumn > rerun::archetypes::TextDocument::columns ( const Collection< uint32_t > &  lengths_)

Partitions the component data into multiple sub-batches.

Specifically, this transforms the existing ComponentBatch data into ComponentColumns instead, via ComponentBatch::partitioned.

This makes it possible to use RecordingStream::send_columns to send columnar data directly into Rerun.

The specified lengths must sum to the total length of the component batch.

◆ columns() [2/2]

Collection< ComponentColumn > rerun::archetypes::TextDocument::columns ( )

Partitions the component data into unit-length sub-batches.

This is semantically similar to calling columns with std::vector<uint32_t>(n, 1), where n is automatically guessed.

Member Data Documentation

◆ media_type

std::optional<ComponentBatch> rerun::archetypes::TextDocument::media_type

The Media Type of the text.

For instance:

  • text/plain
  • text/markdown

If omitted, text/plain is assumed.

◆ IndicatorComponentName

constexpr const char rerun::archetypes::TextDocument::IndicatorComponentName[]
staticconstexpr
Initial value:
=
"rerun.components.TextDocumentIndicator"

◆ Descriptor_text

constexpr auto rerun::archetypes::TextDocument::Descriptor_text
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "text", Loggable<rerun::components::Text>::Descriptor.component_name
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition text_document.hpp:97

ComponentDescriptor for the text field.

◆ Descriptor_media_type

constexpr auto rerun::archetypes::TextDocument::Descriptor_media_type
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "media_type",
Loggable<rerun::components::MediaType>::Descriptor.component_name
)

ComponentDescriptor for the media_type field.


The documentation for this struct was generated from the following file: