-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port DNA (getting started) example to C++ #3963
Changes from all commits
3605dd7
bf31ef7
b759db6
755ae7c
47e4739
be56fcc
fc03b02
2deaabe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
add_subdirectory(clock) | ||
add_subdirectory(minimal) | ||
add_subdirectory(dna) | ||
|
||
add_custom_target(examples) | ||
add_dependencies(examples example_minimal) | ||
add_dependencies(examples example_clock) | ||
add_dependencies(examples example_dna) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
# If you use the example outside of the Rerun SDK you need to specify | ||
# where the rerun_c build is to be found by setting the `RERUN_CPP_URL` variable. | ||
# This can be done by passing `-DRERUN_CPP_URL=<path to rerun_sdk_cpp zip>` to cmake. | ||
if(DEFINED RERUN_REPOSITORY) | ||
add_executable(example_dna main.cpp) | ||
set_default_warning_settings(example_dna) | ||
else() | ||
project(example_dna LANGUAGES CXX) | ||
|
||
add_executable(example_dna main.cpp) | ||
|
||
# Set the path to the rerun_c build. | ||
set(RERUN_CPP_URL CACHE STRING "URL to the rerun_cpp zip.") | ||
|
||
# Download the rerun_sdk | ||
include(FetchContent) | ||
FetchContent_Declare(rerun_sdk DOWNLOAD_EXTRACT_TIMESTAMP YES URL ${RERUN_CPP_URL}) | ||
FetchContent_MakeAvailable(rerun_sdk) | ||
|
||
# Rerun requires at least C++17, but you can use an evern newer version. | ||
set_property(TARGET example_dna PROPERTY CXX_STANDARD 17) | ||
endif() | ||
|
||
# Link against rerun_sdk. | ||
target_link_libraries(example_dna PRIVATE rerun_sdk) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
title: Helix | ||
python: https://github.com/rerun-io/rerun/tree/latest/examples/python/dna/main.py | ||
rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/dna/src/main.rs | ||
# TODO(#3962): Update Link | ||
cpp: https://github.com/rerun-io/rerun/tree/main/examples/cpp/dna/main.cpp | ||
tags: [3d, api-example] | ||
description: "Simple example of logging point and line primitives to draw a 3D helix." | ||
thumbnail: https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/480w.png | ||
thumbnail_dimensions: [480, 285] | ||
demo: true | ||
--- | ||
|
||
<picture> | ||
<source media="(max-width: 480px)" srcset="https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/480w.png"> | ||
<source media="(max-width: 768px)" srcset="https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/768w.png"> | ||
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/1024w.png"> | ||
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/1200w.png"> | ||
<img src="https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/full.png" alt=""> | ||
</picture> | ||
|
||
Simple example of logging point and line primitives to draw a 3D helix. | ||
|
||
|
||
To build it from a checkout of the repository (requires a Rust toolchain): | ||
```bash | ||
cmake . | ||
cmake --build . --target example_dna | ||
./examples/cpp/dna/dna | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: Helix | ||
python: https://github.com/rerun-io/rerun/tree/latest/examples/python/dna/main.py | ||
rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/dna/src/main.rs | ||
# TODO(#3962): Update Link | ||
cpp: https://github.com/rerun-io/rerun/tree/main/examples/cpp/dna/main.cpp | ||
tags: [3d, api-example] | ||
description: "Simple example of logging point and line primitives to draw a 3D helix." | ||
thumbnail: https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/480w.png | ||
thumbnail_dimensions: [480, 285] | ||
demo: true | ||
--- | ||
|
||
<picture> | ||
<source media="(max-width: 480px)" srcset="https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/480w.png"> | ||
<source media="(max-width: 768px)" srcset="https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/768w.png"> | ||
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/1024w.png"> | ||
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/1200w.png"> | ||
<img src="https://static.rerun.io/helix/f4c375546fa9d24f7cd3a1a715ebf75b2978817a/full.png" alt=""> | ||
</picture> | ||
|
||
Simple example of logging point and line primitives to draw a 3D helix. | ||
|
||
```bash | ||
cargo run --release | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not new in this PR, but it's a bit confusing that the example is called both
dna
andHelix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helix is the better name imho. DNA sounds like we're doing actual medical visualization