file_path
stringlengths
21
207
content
stringlengths
5
1.02M
size
int64
5
1.02M
lang
stringclasses
9 values
avg_line_length
float64
1.33
100
max_line_length
int64
4
993
alphanum_fraction
float64
0.27
0.93
omniverse-code/kit/include/omni/ui/FontHelper.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "Api.h" #include <memory> OMNIUI_NAMESPACE_OPEN_SCOPE class FontAtlasTexture; class Widget; struct FontHelperPrivate; /** * @brief The helper class for the widgets that are working with fonts. */ class OMNIUI_CLASS_API FontHelper { protected: OMNIUI_API FontHelper(); OMNIUI_API virtual ~FontHelper(); /** * @brief Push the font to the underlying windowing system if the font is available. It's in protected to make it * available to devired classes. */ OMNIUI_API void _pushFont(const Widget& widget, bool overresolution = false); /** * @brief Push the font to the underlying windowing system if the font is available. It's in protected to make it * available to devired classes. */ OMNIUI_API void _pushFont(float fontSize); /** * @brief Remove the font from the underlying windowing system if the font was pushed. */ OMNIUI_API void _popFont() const; /** * @brief Checks the style, and save the font if necessary. We don't want this object to be derived from widget, so * we pass the widget as argument. * * @param widget the object we want to get the font style from. */ void _updateFont(const Widget& widget, bool overresolution = false); /** * @brief Save the font if necessary. */ void _updateFont(float fontSize, float scale, bool hasFontSizeStyle); /** * @brief Save the font if necessary. */ void _updateFont(const char* font, float fontSize, float scale, bool hasFontSizeStyle, bool overresolution = false); private: std::unique_ptr<FontHelperPrivate> m_prv; }; OMNIUI_NAMESPACE_CLOSE_SCOPE
2,144
C
27.223684
120
0.698228
omniverse-code/kit/include/omni/ui/HGrid.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "Api.h" #include "Grid.h" OMNIUI_NAMESPACE_OPEN_SCOPE /** * @brief Shortcut for Grid{eLeftToRight}. The grid grows from left to right with the widgets placed. * * @see Grid */ class OMNIUI_CLASS_API HGrid : public Grid { OMNIUI_OBJECT(HGrid) public: OMNIUI_API ~HGrid() override; protected: /** * @brief Construct a grid that grow from left to right with the widgets placed. */ OMNIUI_API HGrid(); }; OMNIUI_NAMESPACE_CLOSE_SCOPE
935
C
23.631578
101
0.729412
omniverse-code/kit/include/omni/ui/Object.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include <omni/ui/ContainerScope.h> // The OMNIUI_OBJECT macro must appear in the public section of a class definition of all the objects that use // other services provided by UI Framework system. It implements two public methods: create and castShared. // We need to specify the class name because we need to have the text representation of it in getTypeName. #define OMNIUI_OBJECT_(currentType, overrideText) \ public: \ /* A little shortcut to get the current class type */ \ using This = currentType; \ \ /** Create the widget and put it as a child of the top item of ContainerStack. */ \ /* It's very useful to have the new object already attached to the layout. */ \ template <typename... Args> \ static std::shared_ptr<This> create(Args&&... args) \ { \ /* Cannot use std::make_shared because the constructor is protected */ \ std::shared_ptr<This> ptr{ new This{ std::forward<Args>(args)... } }; \ \ ContainerStack::instance().addChildToTop(std::static_pointer_cast<Widget>(ptr)); \ \ return ptr; \ } \ /* version that accepts a destructor and passes it to the shared_ptr */ \ template<class Destructor, typename... Args> \ static std::shared_ptr<This> createWithDestructor(Destructor destructor, Args&&... args) \ { \ /* Cannot use std::make_shared because the constructor is protected */ \ std::shared_ptr<This> ptr{ new This{ std::forward<Args>(args)... }, std::forward<Destructor>(destructor) }; \ \ ContainerStack::instance().addChildToTop(std::static_pointer_cast<Widget>(ptr)); \ \ return ptr; \ } \ \ /** Returns this as a shared pointer */ \ template <typename T = This> \ std::shared_ptr<T> castShared() \ { \ return std::static_pointer_cast<T>(this->shared_from_this()); \ } \ \ /** Return the name of the current type. We use it to resolve the styles. */ \ virtual const std::string& getTypeName() const overrideText \ { \ static const std::string typeName{ #currentType }; \ return typeName; \ } \ \ private: #define OMNIUI_OBJECT(currentType) OMNIUI_OBJECT_(currentType, override) #define OMNIUI_OBJECT_BASE(currentType) OMNIUI_OBJECT_(currentType, )
6,172
C
96.984125
120
0.299903
omniverse-code/kit/include/omni/ui/ItemModelHelper.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "AbstractItemModel.h" #include "Widget.h" OMNIUI_NAMESPACE_OPEN_SCOPE class AbstractItemModel; /** * @brief The ItemModelHelper class provides the basic functionality for item widget classes. * * TODO: It's very similar to ValueModelHelper. We need to template it. It's not templated now because we need a good * solution for pybind11. Pybind11 doesn't like templated classes. */ class OMNIUI_CLASS_API ItemModelHelper { public: OMNIUI_API virtual ~ItemModelHelper(); /** * @brief Called by the model when the model value is changed. The class should react to the changes. * * @param item The item in the model that is changed. If it's NULL, the root is chaged. */ OMNIUI_API virtual void onModelUpdated(const std::shared_ptr<const AbstractItemModel::AbstractItem>& item) = 0; /** * @brief Set the current model. */ OMNIUI_API virtual void setModel(const std::shared_ptr<AbstractItemModel>& model); /** * @brief Returns the current model. */ OMNIUI_API virtual const std::shared_ptr<AbstractItemModel>& getModel() const; protected: OMNIUI_API ItemModelHelper(const std::shared_ptr<AbstractItemModel>& model); private: std::shared_ptr<AbstractItemModel> m_model = {}; }; OMNIUI_NAMESPACE_CLOSE_SCOPE
1,771
C
29.033898
117
0.726143
omniverse-code/kit/include/omni/ui/ZStack.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "Api.h" #include "Stack.h" OMNIUI_NAMESPACE_OPEN_SCOPE /** * @brief Shortcut for Stack{eBackToFront}. The widgets are placed sorted in a Z-order in top right corner with suitable * sizes. * * @see Stack */ class OMNIUI_CLASS_API ZStack : public Stack { OMNIUI_OBJECT(ZStack) public: OMNIUI_API ~ZStack() override; protected: /** * @brief Construct a stack with the widgets placed in a Z-order with sorting from background to foreground. */ OMNIUI_API ZStack(); }; OMNIUI_NAMESPACE_CLOSE_SCOPE
999
C
24.641025
120
0.734735
omniverse-code/kit/include/omni/ui/ComboBox.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "FontHelper.h" #include "ItemModelHelper.h" OMNIUI_NAMESPACE_OPEN_SCOPE class AbstractItemModel; /** * @brief The ComboBox widget is a combined button and a drop-down list. * * A combo box is a selection widget that displays the current item and can pop up a list of selectable items. * * The ComboBox is implemented using the model-view pattern. The model is the central component of this system. The root * of the item model should contain the index of currently selected items, and the children of the root include all the * items of the combo box. */ class OMNIUI_CLASS_API ComboBox : public Widget, public ItemModelHelper, public FontHelper { OMNIUI_OBJECT(ComboBox) public: OMNIUI_API ~ComboBox() override; /** * @brief Reimplemented the method to indicate the width hint that represents the preferred size of the widget. * Currently this widget can't be smaller than the size of the ComboBox square. * * @see Widget::setComputedContentWidth */ OMNIUI_API void setComputedContentWidth(float width) override; /** * @brief Reimplemented the method to indicate the height hint that represents the preferred size of the widget. * Currently this widget can't be smaller than the size of the ComboBox square. * * @see Widget::setComputedContentHeight */ OMNIUI_API void setComputedContentHeight(float height) override; /** * @brief Reimplemented. Something happened with the style or with the parent style. We need to update the saved * font. */ OMNIUI_API void onStyleUpdated() override; /** * @brief Reimplemented the method from ItemModelHelper that is called when the model is changed. * * @param item The item in the model that is changed. If it's NULL, the root is chaged. */ OMNIUI_API void onModelUpdated(const std::shared_ptr<const AbstractItemModel::AbstractItem>& item) override; /** * @brief Determines if it's necessary to hide the text of the ComboBox. */ OMNIUI_PROPERTY(bool, arrowOnly, DEFAULT, false, READ, isArrowOnly, WRITE, setArrowOnly); protected: /** * @brief Construct ComboBox * * @param model The model that determines if the button is checked. */ OMNIUI_API ComboBox(const std::shared_ptr<AbstractItemModel>& model = {}); /** * @brief Reimplemented the rendering code of the widget. * * @see Widget::_drawContent */ OMNIUI_API void _drawContent(float elapsedTime) override; private: // The cached state of the ComboBox allows to query the model only if it's changed. int64_t m_currentIndex = 0; std::vector<std::string> m_items; }; OMNIUI_NAMESPACE_CLOSE_SCOPE
3,211
C
32.113402
120
0.710682
omniverse-code/kit/include/omni/ui/Separator.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "FontHelper.h" #include "MenuItem.h" OMNIUI_NAMESPACE_OPEN_SCOPE /** * @brief The Separator class provides blank space. * * Normally, it's used to create separator line in the UI elements */ class OMNIUI_CLASS_API Separator : public MenuItem, public FontHelper { OMNIUI_OBJECT(Separator) public: OMNIUI_API ~Separator() override; /** * @brief It's called when the style is changed. It should be propagated to children to make the style cached and * available to children. */ OMNIUI_API void cascadeStyle() override; protected: /** * @brief Construct Separator */ OMNIUI_API Separator(const std::string& text = ""); /** * @brief Reimplemented the rendering code of the widget. * * @see Widget::_drawContent */ OMNIUI_API void _drawContent(float elapsedTime) override; private: void _drawContentCompatibility(float elapsedTime); /** * @brief Resolves padding from style and from the underlying draw system. */ void _resolvePaddingCompatibility(float& paddingX, float& paddingY) const; }; OMNIUI_NAMESPACE_CLOSE_SCOPE
1,606
C
24.919354
117
0.708593
omniverse-code/kit/include/omni/ui/OffsetLine.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "FreeShape.h" OMNIUI_NAMESPACE_OPEN_SCOPE /** * @brief The free widget is the widget that is independent of the layout. It * draws the line stuck to the bounds of other widgets. */ class OMNIUI_CLASS_API OffsetLine : public FreeLine { OMNIUI_OBJECT(OffsetLine) public: /** * @brief The offset to the direction of the line normal. * */ OMNIUI_PROPERTY(float, offset, DEFAULT, 0.0f, READ, getOffset, WRITE, setOffset); /** * @brief The offset from the bounds of the widgets this line is stuck to. * */ OMNIUI_PROPERTY(float, boundOffset, DEFAULT, 0.0f, READ, getBoundOffset, WRITE, setBoundOffset); protected: /** * @brief Initialize the the shape with bounds limited to the positions of the given widgets. * * @param start The bound corder is in the border of this given widget. * @param end The bound corder is in the border of this given widget. */ OMNIUI_API OffsetLine(std::shared_ptr<Widget> start, std::shared_ptr<Widget> end); /** * @brief Reimplemented the rendering code of the shape. * * @see Widget::_drawContent */ OMNIUI_API void _drawContent(float elapsedTime) override; }; OMNIUI_NAMESPACE_CLOSE_SCOPE
1,709
C
29.535714
100
0.702165
omniverse-code/kit/include/omni/ui/FloatSlider.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "AbstractSlider.h" OMNIUI_NAMESPACE_OPEN_SCOPE /** * @brief The slider is the classic widget for controlling a bounded value. It lets the user move a slider handle along * a horizontal groove and translates the handle's position into a float value within the legal range. */ class OMNIUI_CLASS_API FloatSlider : public AbstractSlider { OMNIUI_OBJECT(FloatSlider) public: /** * @brief Reimplemented the method from ValueModelHelper that is called when the model is changed. */ OMNIUI_API void onModelUpdated() override; /** * @brief Get the format string for the given value. The number should be in the format of `0.0` and the length of * the formed string should be minimal. */ static const char* getFormatString(double value, uint32_t maxSymbols = 5); /** * @brief This property holds the slider's minimum value. */ OMNIUI_PROPERTY(double, min, DEFAULT, 0.0f, READ, getMin, WRITE, setMin); /** * @brief This property holds the slider's maximum value. */ OMNIUI_PROPERTY(double, max, DEFAULT, 1.0f, READ, getMax, WRITE, setMax); /** * @brief This property controls the steping speed on the drag */ OMNIUI_PROPERTY(float, step, DEFAULT, 0.01f, READ, getStep, WRITE, setStep); /** * @brief This property overrides automatic formatting if needed */ OMNIUI_PROPERTY(std::string, format, DEFAULT, "", READ, getFormat, WRITE, setFormat); /** * @brief This property holds the slider value's float precision */ OMNIUI_PROPERTY(uint32_t, precision, DEFAULT, 5, READ, getPrecision, WRITE, setPrecision); protected: /** * @brief Construct FloatSlider */ OMNIUI_API FloatSlider(const std::shared_ptr<AbstractValueModel>& model = {}); /** * @brief the ration calculation is requiere to draw the Widget as Gauge, it is calculated with Min/Max & Value */ virtual float _getValueRatio() override; private: /** * @brief Reimplemented. _drawContent sets everything up including styles and fonts and calls this method. */ void _drawUnderlyingItem() override; /** * @brief It has to run a very low level function to call the widget. */ virtual bool _drawUnderlyingItem(double* value, double min, double max); // The cached state of the slider. double m_valueCache; }; OMNIUI_NAMESPACE_CLOSE_SCOPE
2,881
C
31.382022
119
0.694898
omniverse-code/kit/include/omni/ui/RadioCollection.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "Api.h" #include "ValueModelHelper.h" #include <functional> #include <memory> #include <vector> OMNIUI_NAMESPACE_OPEN_SCOPE class RadioButton; /** * @brief Radio Collection is a class that groups RadioButtons and coordinates their state. * * It makes sure that the choice is mutually exclusive, it means when the user selects a radio button, any previously * selected radio button in the same collection becomes deselected. * * @see RadioButton */ class OMNIUI_CLASS_API RadioCollection : public ValueModelHelper { public: OMNIUI_API ~RadioCollection(); // We need it to make sure it's created as a shared pointer. template <typename... Args> static std::shared_ptr<RadioCollection> create(Args&&... args) { /* make_shared doesn't work because the constructor is protected: */ /* auto ptr = std::make_shared<This>(std::forward<Args>(args)...); */ /* TODO: Find the way to use make_shared */ return std::shared_ptr<RadioCollection>{ new RadioCollection{ std::forward<Args>(args)... } }; } /** * @brief Called by the model when the model value is changed. The class should react to the changes. * * Reimplemented from ValueModelHelper */ OMNIUI_API void onModelUpdated() override; protected: /** * @brief Constructs RadioCollection */ OMNIUI_API RadioCollection(const std::shared_ptr<AbstractValueModel>& model); private: friend class RadioButton; /** * @brief this methods add a radio button to the collection, generally it is called directly by the button itself * when the collection is setup on the button */ OMNIUI_API void _addRadioButton(const std::shared_ptr<RadioButton>& button); /** * @brief Called then the user clicks one of the buttons in this collection. */ OMNIUI_API void _clicked(const RadioButton* button); // The list of the radio button that are part of this collection. // // RadioButton keeps the shared pointer to this collection, and here the collection keeps the pointer to the // RadioButton. To avoid circular dependency, we use weak pointers from this side because of the Python API. We // never require the user to keep a Python object and do all the work that is related to the object's life. It means // the user can create UI like this, and the created objects will not be immediately removed with Python garbage // collector: // // with ui.HStack(): // ui.Label("Hello") // ui.Label("World") // // The RadioCollection is not a widget, and to make sure the collection will not be removed right after it's // created, we use shared pointers in RadioButtons and not here, which makes them the owners of the collection. std::vector<std::weak_ptr<RadioButton>> m_radioButtons; }; OMNIUI_NAMESPACE_CLOSE_SCOPE
3,362
C
34.03125
120
0.701666
omniverse-code/kit/include/omni/ui/Style.h
// Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #include "Api.h" #include "StyleContainer.h" #include <memory> OMNIUI_NAMESPACE_OPEN_SCOPE class Container; /** * @brief A singleton that controls the global style of the session. */ class OMNIUI_CLASS_API Style { public: /** * @brief Get the instance of this singleton object. */ OMNIUI_API static Style& getInstance(); OMNIUI_API virtual ~Style(); // A singletom pattern Style(Style const&) = delete; void operator=(Style const&) = delete; /** * @brief Returns the default root style. It's the style that is preselected when no alternative is specified. */ OMNIUI_API std::shared_ptr<StyleContainer> const& getDefaultStyle() const; /** * @brief Set the default root style. It's the style that is preselected when no alternative is specified. */ OMNIUI_API void setDefaultStyle(std::shared_ptr<StyleContainer> const& v); /** * @brief Set the default root style. It's the style that is preselected when no alternative is specified. */ OMNIUI_API void setDefaultStyle(StyleContainer&& style); /** * @brief Connect the widget to the default root style. */ void connectToGlobalStyle(const std::shared_ptr<Widget>& widget); private: Style(); std::shared_ptr<Container> m_rootStyleWidget; }; OMNIUI_NAMESPACE_CLOSE_SCOPE
1,800
C
25.485294
114
0.7
omniverse-code/kit/include/omni/ui/Triangle.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "Alignment.h" #include "Shape.h" OMNIUI_NAMESPACE_OPEN_SCOPE struct TriangleStyleSnapshot; /** * @brief The Triangle widget provides a colored triangle to display. */ class OMNIUI_CLASS_API Triangle : public Shape { OMNIUI_OBJECT(Triangle) public: OMNIUI_API ~Triangle() override; /** * @brief This property holds the alignment of the triangle when the fill policy is ePreserveAspectFit or * ePreserveAspectCrop. * By default, the triangle is centered. */ OMNIUI_PROPERTY(Alignment, alignment, DEFAULT, Alignment::eRightCenter, READ, getAlignment, WRITE, setAlignment); protected: /** * @brief Constructs Triangle */ OMNIUI_API Triangle(); /** * @brief Reimplemented the rendering code of the shape. * * @see Widget::_drawContent */ OMNIUI_API void _drawShape(float elapsedTime, float x, float y, float width, float height) override; /** * @brief Reimplemented the draw shadow of the shape. */ OMNIUI_API void _drawShadow( float elapsedTime, float x, float y, float width, float height, uint32_t shadowColor, float dpiScale, ImVec2 shadowOffset, float shadowThickness, uint32_t shadowFlag) override; }; OMNIUI_NAMESPACE_CLOSE_SCOPE
1,801
C
25.115942
117
0.686841
omniverse-code/kit/include/omni/ui/ImageWithProvider.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "Alignment.h" #include "ImageProvider/ImageProvider.h" #include "Widget.h" #include <mutex> OMNIUI_NAMESPACE_OPEN_SCOPE /** * @brief The Image widget displays an image. * * The source of the image is specified as a URL using the source property. By default, specifying the width and height * of the item causes the image to be scaled to that size. This behavior can be changed by setting the fill_mode * property, allowing the image to be stretched or scaled instead. The property alignment controls where to align the * scaled image. */ class OMNIUI_CLASS_API ImageWithProvider : public Widget { OMNIUI_OBJECT(ImageWithProvider) public: enum class FillPolicy : uint8_t { eStretch = 0, ePreserveAspectFit, ePreserveAspectCrop }; OMNIUI_API ~ImageWithProvider() override; OMNIUI_API void destroy() override; /** * @brief Reimplemented. Called when the style or the parent style is changed. */ OMNIUI_API void onStyleUpdated() override; /** * @brief Force call `ImageProvider::prepareDraw` to ensure the next draw * call the image is loaded. It can be used to load the image for a hidden * widget or to set the rasterization resolution. */ OMNIUI_API void prepareDraw(float width, float height); /** * @brief This property holds the alignment of the image when the fill policy is ePreserveAspectFit or * ePreserveAspectCrop. * By default, the image is centered. */ OMNIUI_PROPERTY(Alignment, alignment, DEFAULT, Alignment::eCenter, READ, getAlignment, WRITE, setAlignment); /** * @brief Define what happens when the source image has a different size than the item. */ OMNIUI_PROPERTY(FillPolicy, fillPolicy, DEFAULT, FillPolicy::ePreserveAspectFit, READ, getFillPolicy, WRITE, setFillPolicy, NOTIFY, setFillPolicyChangedFn); /** * @brief Prevents image blurring when it's placed to fractional position (like x=0.5, y=0.5) */ OMNIUI_PROPERTY(bool, pixelAligned, DEFAULT, false, READ, getPixelAligned, WRITE, setPixelAligned); // TODO: Image rotation // TODO: Right now, it's useless because we load the image in the background, and when the object is created, the // texture is not loaded. There is no way to wait for the texture. We need to add a method to force load. And we // will be able to use texture dimensions as a read-only property. It will help us to achieve protected: /** * @brief Construct image with given ImageProvider. If the ImageProvider is nullptr, it gets the image URL from * styling. */ OMNIUI_API ImageWithProvider(std::shared_ptr<ImageProvider> imageProvider); /** * @brief Construct image with given url. If the url is empty, it gets the image URL from styling. */ OMNIUI_API ImageWithProvider(const std::string& url = {}); /** * @brief Reimplemented the rendering code of the widget. * * @see Widget::_drawContent */ OMNIUI_API void _drawContent(float elapsedTime) override; private: // The mutex for the texture operations, because we load the texture in the background. std::mutex m_textureMutex; void _populateImageProvidersFromStyles(); std::shared_ptr<ImageProvider>& _createImageProviderFromUrl(const char* url); void _calcTextureIndex(); // Returns true if the url from the style is changed since the image is loaded. bool _hasStyleUrlChanged() const; // Flag to check all the textures if it's necessary to reload them. bool m_texturesLoaded = false; // It is the cache of preloaded textures. We need it because we can switch the texture depending on the widget style // state. It can be a separate texture for hovered, disabled, selected, etc. widget. To switch the texture fast, we // preload them for all the states. To be sure that the same texture is not loaded twice, we keep them in a separate // vector, and we keep the index of the texture per style state. To know which texture is already loaded, we keep // the map name to the texture index. // Index of the texture per style state std::array<size_t, static_cast<size_t>(StyleContainer::State::eCount)> m_styleStateToTextureDataIndex; // Resolved style. We need it to know if style shade is changed. It's void* // to indicate that it can't be used as a string andit can only be used to // check if the style became dirty. std::array<const void*, static_cast<size_t>(StyleContainer::State::eCount)> m_styleStateToResolvedStyle; // Index of the texture per filename std::unordered_map<std::string, size_t> m_imageUrlToTextureDataIndex; bool m_updateStyleImages = true; bool m_overrideStyleImages = false; // Texture data for all the loaded textures struct TextureData { // Removes it from the GPU. ~TextureData(); // Flag to reload the texture. bool loadingStarted = false; // We delete TextureData when the use count reaches zero. size_t counter = 0; std::shared_ptr<ImageProvider> imageProvider = nullptr; }; std::vector<std::unique_ptr<TextureData>> m_textureDataArray; std::vector<std::shared_ptr<ImageProvider>> m_createdImageProviders; }; OMNIUI_NAMESPACE_CLOSE_SCOPE
5,988
C
35.742331
120
0.685371
omniverse-code/kit/include/omni/ui/Profile.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include <carb/profiler/Profile.h> // Enable top-level Window zones by default. #define OMNIUI_PROFILE_ENABLE // Extra zones for recursive Widget layout and drawing functions, causes performance slowdown so disabled by default. // Recommend using the profiler maxZoneDepth option if enabled. // #define OMNIUI_PROFILE_VERBOSE #ifdef OMNIUI_PROFILE_ENABLE # define OMNIUI_PROFILE_ZONE(zoneName, ...) CARB_PROFILE_ZONE(1, zoneName, ##__VA_ARGS__) # define OMNIUI_PROFILE_FUNCTION CARB_PROFILE_FUNCTION(1) # define OMNIUI_PROFILE_WIDGET_FUNCTION \ CARB_PROFILE_ZONE(1, "[%s] %s '%s'", this->getTypeName().c_str(), CARB_PRETTY_FUNCTION, this->getName().c_str()) #else # define OMNIUI_PROFILE_ZONE(...) # define OMNIUI_PROFILE_FUNCTION # define OMNIUI_PROFILE_WIDGET_FUNCTION #endif #ifdef OMNIUI_PROFILE_VERBOSE # define OMNIUI_PROFILE_VERBOSE_ZONE OMNIUI_PROFILE_ZONE # define OMNIUI_PROFILE_VERBOSE_FUNCTION OMNIUI_PROFILE_FUNCTION # define OMNIUI_PROFILE_VERBOSE_WIDGET_FUNCTION OMNIUI_PROFILE_WIDGET_FUNCTION #else # define OMNIUI_PROFILE_VERBOSE_ZONE(...) # define OMNIUI_PROFILE_VERBOSE_FUNCTION # define OMNIUI_PROFILE_VERBOSE_WIDGET_FUNCTION #endif
1,730
C
42.274999
120
0.726012
omniverse-code/kit/include/omni/ui/windowmanager/IWindowCallbackManager.h
#pragma once #include <carb/Framework.h> #include <carb/Interface.h> #include <carb/events/EventsUtils.h> #include <carb/events/IEvents.h> #include <carb/profiler/Profile.h> namespace omni { namespace kit { class IAppWindow; } namespace ui { namespace windowmanager { enum class DockPreference : uint32_t { eDisabled, eMain, eRight, eLeft, eRightTop, eRightBottom, eLeftBottom }; /** * Interface to implement for event listener. */ class IEventListener : public carb::IObject { public: virtual void onDraw(float elapsedTime) = 0; }; using IEventListenerPtr = carb::ObjectPtr<IEventListener>; struct WindowSet; class IWindowCallback : public carb::IObject { public: virtual const char* getTitle() = 0; virtual uint32_t getWidth() = 0; virtual uint32_t getHeight() = 0; virtual DockPreference getDockPreference() = 0; virtual WindowSet* getWindowSet() = 0; virtual omni::kit::IAppWindow* getAppWindow() = 0; virtual void draw(float elapsedTime) = 0; }; using IWindowCallbackPtr = carb::ObjectPtr<IWindowCallback>; class IWindowCallbackManager { public: CARB_PLUGIN_INTERFACE("omni::ui::windowmanager::IWindowCallbackManager", 0, 3) virtual IWindowCallback* createWindowCallbackPtr( const char* title, uint32_t width, uint32_t height, DockPreference dockPreference, IEventListener* listener) = 0; IWindowCallbackPtr createWindowCallback( const char* title, uint32_t width, uint32_t height, DockPreference dockPreference, IEventListener* listener) { return stealObject(this->createWindowCallbackPtr(title, width, height, dockPreference, listener)); } virtual void removeWindowCallback(IWindowCallback* windowCallback) = 0; virtual size_t getWindowCallbackCount() = 0; virtual IWindowCallback* getWindowCallbackAt(size_t index) = 0; inline void drawWindows(float elapsedTime); inline IWindowCallback* findWindowCallbackByName(const char* name); virtual WindowSet* createWindowSet() = 0; virtual void destroyWindowSet(WindowSet* windowSet) = 0; virtual WindowSet* getDefaultWindowSet() = 0; virtual void attachWindowSetToAppWindow(WindowSet* windowSet, omni::kit::IAppWindow* appWindow) = 0; virtual WindowSet* getWindowSetByAppWindow(omni::kit::IAppWindow* appWindow) = 0; virtual omni::kit::IAppWindow* getAppWindowFromWindowSet(WindowSet* windowSet) = 0; virtual size_t getWindowSetCount() = 0; virtual WindowSet* getWindowSetAt(size_t index) = 0; virtual IWindowCallback* createWindowSetCallbackPtr(WindowSet* windowSet, const char* title, uint32_t width, uint32_t height, DockPreference dockPreference, IEventListener* listener) = 0; IWindowCallbackPtr createWindowSetCallback(WindowSet* windowSet, const char* title, uint32_t width, uint32_t height, DockPreference dockPreference, IEventListener* listener) { return stealObject(this->createWindowSetCallbackPtr(windowSet, title, width, height, dockPreference, listener)); } IWindowCallbackPtr createAppWindowCallback(omni::kit::IAppWindow* appWindow, const char* title, uint32_t width, uint32_t height, DockPreference dockPreference, IEventListener* listener) { WindowSet* windowSet = this->getWindowSetByAppWindow(appWindow); if (!windowSet) { CARB_LOG_WARN("createAppWindowCallback: No window set attached to supplied app window!"); return IWindowCallbackPtr(); } return stealObject(this->createWindowSetCallbackPtr(windowSet, title, width, height, dockPreference, listener)); } virtual void addWindowSetCallback(WindowSet* windowSet, IWindowCallback* windowCallback) = 0; virtual void removeWindowSetCallback(WindowSet* windowSet, IWindowCallback* windowCallback) = 0; void removeAppWindowCallback(omni::kit::IAppWindow* appWindow, IWindowCallback* windowCallback) { WindowSet* windowSet = this->getWindowSetByAppWindow(appWindow); if (!windowSet) { CARB_LOG_WARN("removeAppWindowCallback: No window set attached to supplied app window!"); return; } this->removeWindowSetCallback(windowSet, windowCallback); } void moveCallbackToAppWindow(IWindowCallback* windowCallback, omni::kit::IAppWindow* newAppWindow) { WindowSet* newWindowSet = this->getWindowSetByAppWindow(newAppWindow); if (!newWindowSet) { CARB_LOG_WARN("moveCallbackToAppWindow: No window set attached to supplied app window!"); return; } WindowSet* oldWindowSet = windowCallback->getWindowSet(); this->removeWindowSetCallback(oldWindowSet, windowCallback); this->addWindowSetCallback(newWindowSet, windowCallback); } virtual size_t getWindowSetCallbackCount(WindowSet* windowSet) = 0; virtual IWindowCallback* getWindowSetCallbackAt(WindowSet* windowSet, size_t index) = 0; inline void drawWindowSet(WindowSet* windowSet, float elapsedTime); inline IWindowCallback* findWindowSetCallbackByName(WindowSet* windowSet, const char* name); }; inline void IWindowCallbackManager::drawWindows(float elapsedTime) { WindowSet* windowSet = getDefaultWindowSet(); drawWindowSet(windowSet, elapsedTime); } inline IWindowCallback* IWindowCallbackManager::findWindowCallbackByName(const char* name) { WindowSet* windowSet = getDefaultWindowSet(); return findWindowSetCallbackByName(windowSet, name); } inline void IWindowCallbackManager::drawWindowSet(WindowSet* windowSet, float elapsedTime) { size_t windowCallbackCount = getWindowSetCallbackCount(windowSet); omni::ui::windowmanager::IWindowCallback* editorMenuCallback = nullptr; for (size_t idx = 0; idx < windowCallbackCount; ++idx) { omni::ui::windowmanager::IWindowCallback* windowCallback = getWindowSetCallbackAt(windowSet, idx); if (windowCallback) { if (!editorMenuCallback && strcmp(windowCallback->getTitle(), "[editor_menu_hookup]") == 0) { // HACK, draw [editor_menu_hookup] last so MainWindow menu goes before it editorMenuCallback = windowCallback; continue; } CARB_PROFILE_ZONE(1, "'%s' ext window[new]", windowCallback->getTitle()); windowCallback->draw(elapsedTime); } } if (editorMenuCallback) { CARB_PROFILE_ZONE(1, "[editor_menu_hookup] ext window[new]", editorMenuCallback->getTitle()); editorMenuCallback->draw(elapsedTime); } } inline IWindowCallback* IWindowCallbackManager::findWindowSetCallbackByName(WindowSet* windowSet, const char* name) { size_t nameLen = strlen(name); size_t windowCallbackCount = getWindowSetCallbackCount(windowSet); for (size_t idx = 0; idx < windowCallbackCount; ++idx) { omni::ui::windowmanager::IWindowCallback* windowCallback = getWindowSetCallbackAt(windowSet, idx); if (windowCallback && (strncmp(windowCallback->getTitle(), name, nameLen) == 0)) { return windowCallback; } } return nullptr; } } // windowmanager } // ui } // omni
7,954
C
35.159091
121
0.647222
omniverse-code/kit/include/omni/ui/windowmanager/WindowManagerUtils.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "IWindowCallbackManager.h" #include <carb/settings/ISettings.h> #include <functional> namespace omni { namespace ui { namespace windowmanager { class LambdaEventListener : public IEventListener { public: LambdaEventListener(const std::function<void(float)>& fn) : m_fn(fn) { } void onDraw(float elapsedTime) override { if (m_fn) m_fn(elapsedTime); } private: std::function<void(float)> m_fn; CARB_IOBJECT_IMPL }; inline IWindowCallbackPtr createWindowCallback(IWindowCallbackManager* windowCallbackManager, const char* title, uint32_t width, uint32_t height, DockPreference dockPreference, const std::function<void(float)>& onDrawFn) { return windowCallbackManager->createWindowCallback( title, width, height, dockPreference, carb::stealObject(new LambdaEventListener(onDrawFn)).get()); } inline IWindowCallbackPtr createWindowSetCallback(WindowSet* windowSet, IWindowCallbackManager* windowCallbackManager, const char* title, uint32_t width, uint32_t height, DockPreference dockPreference, const std::function<void(float)>& onDrawFn) { return windowCallbackManager->createWindowSetCallback( windowSet, title, width, height, dockPreference, carb::stealObject(new LambdaEventListener(onDrawFn)).get()); } inline IWindowCallbackPtr createAppWindowCallback(omni::kit::IAppWindow* appWindow, IWindowCallbackManager* windowCallbackManager, const char* title, uint32_t width, uint32_t height, DockPreference dockPreference, const std::function<void(float)>& onDrawFn) { return windowCallbackManager->createAppWindowCallback( appWindow, title, width, height, dockPreference, carb::stealObject(new LambdaEventListener(onDrawFn)).get()); } inline bool removeWindowCallbackFromDefaultManager(IWindowCallback* windowCallback) { IWindowCallbackManager* uiWindowManager = carb::getCachedInterface<IWindowCallbackManager>(); if (windowCallback && uiWindowManager) { uiWindowManager->removeWindowCallback(windowCallback); return true; } return false; } } } }
3,377
C
35.717391
117
0.577436
omniverse-code/kit/include/omni/ui/windowmanager/WindowManagerBindingsPython.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #include "IWindowCallbackManager.h" #include "WindowManagerUtils.h" #include <carb/BindingsPythonUtils.h> #include <carb/Framework.h> DISABLE_PYBIND11_DYNAMIC_CAST(omni::ui::windowmanager::IWindowCallback) DISABLE_PYBIND11_DYNAMIC_CAST(omni::ui::windowmanager::IWindowCallbackManager) namespace omni { namespace kit { class IAppWindow { }; } namespace ui { namespace windowmanager { struct WindowSet { }; class PythonEventListener : public IEventListener { public: PythonEventListener(const std::function<void(float)>& fn) : m_fn(fn) { } void onDraw(float dt) override { carb::callPythonCodeSafe(m_fn, dt); } private: std::function<void(float)> m_fn; CARB_IOBJECT_IMPL }; inline void definePythonModule(py::module& m) { m.doc() = "pybind11 omni.ui.windowmanager bindings"; py::class_<WindowSet>(m, "WindowSet"); py::class_<IWindowCallback, IWindowCallbackPtr>(m, "IWindowCallback", R"( IWindowCallback object. )") .def("get_title", &IWindowCallback::getTitle) .def("get_width", &IWindowCallback::getWidth) .def("get_height", &IWindowCallback::getHeight) .def("get_dock_preference", &IWindowCallback::getDockPreference) .def("get_window_set", &IWindowCallback::getWindowSet, py::return_value_policy::reference) .def("get_app_window", &IWindowCallback::getAppWindow, py::return_value_policy::reference) .def("draw", &IWindowCallback::draw) /**/; m.def("acquire_window_callback_manager_interface", []() { return carb::getCachedInterface<omni::ui::windowmanager::IWindowCallbackManager>(); }, py::return_value_policy::reference) /**/; py::class_<IWindowCallbackManager>(m, "IWindowCallbackManager") .def("create_window_callback", [](IWindowCallbackManager* self, const char* title, uint32_t width, uint32_t height, DockPreference dockPreference, const std::function<void(float)>& onDrawFn) { return self->createWindowCallback( title, width, height, dockPreference, carb::stealObject(new PythonEventListener(onDrawFn)).get()); }, py::return_value_policy::reference) .def("remove_window_callback", &IWindowCallbackManager::removeWindowCallback) .def("get_window_callback_count", &IWindowCallbackManager::getWindowCallbackCount) .def("get_window_callback_at", &IWindowCallbackManager::getWindowCallbackAt, py::return_value_policy::reference) .def("create_window_set", &IWindowCallbackManager::createWindowSet, py::return_value_policy::reference) .def("destroy_window_set", &IWindowCallbackManager::destroyWindowSet) .def("get_default_window_set", &IWindowCallbackManager::getDefaultWindowSet) .def("attach_window_set_to_app_window", &IWindowCallbackManager::attachWindowSetToAppWindow) .def("get_window_set_by_app_window", &IWindowCallbackManager::getWindowSetByAppWindow, py::return_value_policy::reference) .def("get_app_window_from_window_set", &IWindowCallbackManager::getAppWindowFromWindowSet, py::return_value_policy::reference) .def("get_window_set_count", &IWindowCallbackManager::getWindowSetCount) .def("get_window_set_at", &IWindowCallbackManager::getWindowSetAt, py::return_value_policy::reference) .def("create_window_set_callback", [](IWindowCallbackManager* self, WindowSet* windowSet, const char* title, uint32_t width, uint32_t height, DockPreference dockPreference, const std::function<void(float)>& onDrawFn) { return self->createWindowSetCallback(windowSet, title, width, height, dockPreference, carb::stealObject(new PythonEventListener(onDrawFn)).get()); }, py::return_value_policy::reference) .def("create_app_window_callback", [](IWindowCallbackManager* self, omni::kit::IAppWindow* appWindow, const char* title, uint32_t width, uint32_t height, DockPreference dockPreference, const std::function<void(float)>& onDrawFn) { return self->createAppWindowCallback(appWindow, title, width, height, dockPreference, carb::stealObject(new PythonEventListener(onDrawFn)).get()); }, py::return_value_policy::reference) .def("add_window_set_callback", &IWindowCallbackManager::addWindowSetCallback) .def("remove_window_set_callback", &IWindowCallbackManager::removeWindowSetCallback) .def("remove_app_window_callback", &IWindowCallbackManager::removeAppWindowCallback) .def("move_callback_to_app_window", &IWindowCallbackManager::moveCallbackToAppWindow) .def("get_window_set_callback_count", &IWindowCallbackManager::getWindowSetCallbackCount) .def("get_window_set_callback_at", &IWindowCallbackManager::getWindowSetCallbackAt, py::return_value_policy::reference) /**/; } } } }
5,566
C
41.496183
120
0.68074
omniverse-code/kit/include/omni/ui/ImageProvider/AssetsState.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include <carb/assets/IAssets.h> #include <carb/filesystem/IFileSystem.h> #include <carb/imaging/IImaging.h> #include <carb/svg/Svg.h> #include <carb/tokens/ITokens.h> #include <carb/tokens/TokensUtils.h> #include <omni/renderer/utils/AssetsManagement.h> #include <unordered_set> namespace omni { namespace ui { /** * @brief Helper class to store asset-related interfaces and entities. * The main entity is an asset pool, which is supposed to be single for the whole omni.ui. * As omni.ui do not have solid enter/exit pattern as e.g. Carbonite plugins do, reference * counting mechanism is implemented to make sure we don't leak resources. * Each time reference count is 0, the asset pool is released. When reference count goes * positive, asset pool is recreated. */ class AssetsState { public: carb::filesystem::IFileSystem* fs = nullptr; carb::tokens::ITokens* tokens = nullptr; carb::assets::IAssets* assets = nullptr; carb::imaging::IImaging* imaging = nullptr; carb::svg::Svg* svg = nullptr; omni::renderer::utils::AssetsManager* assetsManager = nullptr; carb::assets::Pool assetPool = carb::assets::kInvalidPool; bool isInitialized = false; bool releaseHookRegistered = false; AssetsState() { fs = carb::getCachedInterface<carb::filesystem::IFileSystem>(); tokens = carb::getCachedInterface<carb::tokens::ITokens>(); assets = carb::getCachedInterface<carb::assets::IAssets>(); imaging = carb::getCachedInterface<carb::imaging::IImaging>(); svg = carb::getCachedInterface<carb::svg::Svg>(); carb::getFramework()->addReleaseHook(assets, sAssetsReleased, this); releaseHookRegistered = true; } ~AssetsState() { // As this object is expected to be static, we use regular assert assert(counter == 0); if (carb::getFramework()) { if (releaseHookRegistered) carb::getFramework()->removeReleaseHook(assets, sAssetsReleased, this); } } static void sAssetsReleased(void*, void* user) { static_cast<AssetsState*>(user)->assetsReleased(); } void assetsReleased() { fs = nullptr; tokens = nullptr; assets = nullptr; imaging = nullptr; svg = nullptr; assetPool = carb::assets::kInvalidPool; if (assetsManager) { assetsManager->notifyShutdown(); } carb::getFramework()->removeReleaseHook(nullptr, sAssetsReleased, this); releaseHookRegistered = false; } carb::extras::Path getAssetPath(const std::string& sourceUrl) { carb::extras::Path imagePath; if (sourceUrl.compare(0, 10, "omniverse:") == 0 || sourceUrl.compare(0, 5, "http:") == 0 || sourceUrl.compare(0, 6, "https:") == 0 || sourceUrl.compare(0, 5, "file:") == 0 || sourceUrl.compare(0, 2, "//") == 0 || sourceUrl[0] == '$') { // It's URL imagePath = sourceUrl; } else if (sourceUrl[0] == '/') { // If the first symbol is '/', it's direct path in Linux. Windows should accept it as path in the current // drive. #if CARB_PLATFORM_WINDOWS // Get drive name from app directory and append imagePath. imagePath = carb::extras::Path{ "${drive}" }.join(sourceUrl); #else imagePath = sourceUrl; #endif } else if (sourceUrl.length() > 2 && sourceUrl[1] == ':') { // If the second symbol is ':', it's direct path in Windows. #if CARB_PLATFORM_WINDOWS imagePath = sourceUrl; #else // TODO: What should we do if we have Windows path on Linux? ATM the drive is removed from the path. imagePath = sourceUrl.substr(2); #endif } else { // It's relative path. We consider it's relative to the application directory. imagePath = carb::extras::Path{ "${kit}" }.join(sourceUrl); } imagePath = carb::tokens::resolveString(tokens, static_cast<const char*>(imagePath)); return imagePath; } void startup() { if (!isInitialized) { assetsManager = new omni::renderer::utils::AssetsManager; assetPool = assets->createPool("omni.ui ImageProviders"); isInitialized = true; } } void shutdown() { if (isInitialized) { // The framework could be shutting down at this point. Re-acquire IAssets to see if it matches. if (carb::getFramework() && assets) { carb::AcquireInterfaceOptions aio{}; aio.sizeofThis = sizeof(aio); aio.clientName = g_carbClientName; aio.desc = carb::assets::IAssets::getInterfaceDesc(); aio.flags = (carb::AcquireInterfaceFlags)(carb::fAIFNoInitialize | carb::fAIFOptional); auto newAssets = (carb::assets::IAssets*)carb::getFramework()->internalAcquireInterface(aio); if (newAssets == assets) { assets->destroyPool(assetPool); } } assetPool = carb::assets::kInvalidPool; delete assetsManager; assetsManager = nullptr; isInitialized = false; } } // We need this ref counting because omni.ui doesn't have clear shutdown routine, // and we need a way to free asset pool resources size_t counter = 0; void incPoolRef() { ++counter; if (assetPool == carb::assets::kInvalidPool) { startup(); } } void decPoolRef() { if (counter > 0) { --counter; if (counter == 0) { shutdown(); } } else { CARB_LOG_ERROR("Asset state manager: asymmetric ref counting detected!"); } } }; AssetsState& getAssetsState(); } }
6,507
C
31.378109
142
0.598125
omniverse-code/kit/include/omni/ui/ImageProvider/ByteImageProvider.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "ImageProvider.h" namespace omni { namespace kit { namespace renderer { class IImGuiRenderer; } } namespace ui { class OMNIUI_CLASS_API ByteImageProvider : public ImageProvider { public: OMNIUI_API ByteImageProvider(); OMNIUI_API virtual ~ByteImageProvider(); /** * @brief Sets byte data that the image provider will turn into an image. * @param bytes Data bytes. * @param size Tuple of image size, (width, height). * @param stride Number of bytes between rows of data bytes. Value kAutoCalculateStride could be used to * auto-calculate stride based on format, given data bytes have no gaps. * @param format Image format. */ OMNIUI_API virtual void setBytesData(const uint8_t* bytes, carb::Uint2 size, size_t stride = kAutoCalculateStride, carb::Format format = carb::Format::eRGBA8_UNORM); OMNIUI_API virtual void setMipMappedBytesData(const uint8_t* const* mipMapBytes, size_t* mipMapStrides, size_t mipMapCount, carb::Uint2 size, carb::Format format = carb::Format::eRGBA8_UNORM); OMNIUI_API virtual void setMipMappedBytesData(const uint8_t* bytes, carb::Uint2 size, size_t stride, carb::Format format = carb::Format::eRGBA8_UNORM, size_t maxMipLevels = SIZE_MAX); OMNIUI_API virtual void setBytesDataFromGPU(const uint8_t* bytes, carb::Uint2 size, size_t stride = kAutoCalculateStride, carb::Format format = carb::Format::eRGBA8_UNORM); OMNIUI_API void prepareDraw(float widgetWidth, float widgetHeight) override; protected: friend class GpuResourcesCache; void _updateImage(const uint8_t* const* mipMapBuffers, size_t* mipMapStrides, size_t mipMapCount, carb::Uint2 size, carb::Format format, bool fromGpu = false); OMNIUI_API void _releaseImage() override; OMNIUI_API bool mergeTextureOptions(TextureOptions& textureOptions) const override; OMNIUI_API bool setTextureOptions(TextureOptions textureOptions) override; omni::kit::renderer::TextureGpuData* m_textureGpuData = nullptr; omni::kit::renderer::TextureGpuReference m_imageGpuDescRef = {}; omni::kit::renderer::IImGuiRenderer* m_imGuiRenderer = nullptr; struct ObsoleteTexture; std::unique_ptr<ObsoleteTexture> m_obsoleteTexture; std::unique_ptr<TextureOptions> m_textureOptions; }; } }
3,403
C
32.048543
108
0.604761
omniverse-code/kit/include/omni/ui/ImageProvider/DynamicTextureProvider.h
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "ByteImageProvider.h" namespace omni { namespace ui { class OMNIUI_CLASS_API DynamicTextureProvider : public ByteImageProvider { public: /** * @brief Construct DynamicTextureProvider. * @param textureName Name of dynamic texture which will be updated from setBytesData. */ OMNIUI_API DynamicTextureProvider(const std::string& textureName); OMNIUI_API virtual ~DynamicTextureProvider() override; protected: OMNIUI_API bool _setManagedResource(GpuResource* gpuResource) override; OMNIUI_API bool mergeTextureOptions(TextureOptions& textureOptions) const override; std::string m_textureUri; }; } }
1,113
C
24.906976
90
0.760108
omniverse-code/kit/include/omni/ui/ImageProvider/VectorImageProvider.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "RasterImageProvider.h" namespace omni { namespace ui { class OMNIUI_CLASS_API VectorImageProvider : public ImageProvider { public: OMNIUI_API VectorImageProvider(std::string url = {}); OMNIUI_API ~VectorImageProvider(); /** * @brief Sets the vector image URL. Asset loading doesn't happen immediately, but rather is started the next time * widget is visible, in prepareDraw call. */ OMNIUI_API virtual void setSourceUrl(const char* url); /** * @brief Returns vector image URL. */ OMNIUI_API virtual std::string getSourceUrl() const; /** * @brief This function needs to be called every frame to make sure asset loading is moving forward, and resources * are properly allocated. */ OMNIUI_API void prepareDraw(float widgetWidth, float widgetHeight) override; /** * @brief Sets the maximum number of mip map levels allowed. */ OMNIUI_API virtual void setMaxMipLevels(size_t maxMipLevels); /** * @brief Returns the maximum number of mip map levels allowed. */ OMNIUI_API virtual size_t getMaxMipLevels() const; protected: std::string m_sourceVectorUrl; bool m_sourceVectorUrlChanged = false; mutable std::mutex m_sourceVectorUrlMutex; size_t m_maxMipLevels = 3; mutable std::mutex m_maxMipLevelsMutex; bool _rasterizeSVG(const std::string& filePath, int width, int height); std::string m_cacheKey; }; } }
1,938
C
26.309859
118
0.705366
omniverse-code/kit/include/omni/ui/ImageProvider/ImageProvider.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "../Object.h" #include "../Property.h" #include <carb/Types.h> #include <carb/container/IntrusiveList.h> #include <carb/tasking/TaskingTypes.h> #include <omni/kit/renderer/IRenderer.h> #include <mutex> namespace omni { namespace ui { constexpr const size_t kAutoCalculateStride = (size_t)-1; class OMNIUI_CLASS_API ImageProvider { protected: using GpuResource = rtx::resourcemanager::RpResource; using TextureOptions = omni::kit::renderer::IRendererTextureOptions; public: OMNIUI_API ImageProvider(); OMNIUI_API virtual ~ImageProvider(); /** * @brief Returns reference which could be used to draw ImGui images with. */ OMNIUI_API virtual void* getImGuiReference(); /** * @brief Returns true if ImGui reference is valid, false otherwise. */ OMNIUI_API virtual bool isReferenceValid() { return m_imGuiReference != nullptr; } /** * @brief Gets image width. */ OMNIUI_API size_t getWidth() { return m_imageSize.x; } /** * @brief Gets image height. */ OMNIUI_API size_t getHeight() { return m_imageSize.y; } /** * @brief Gets tuple (width, height). */ OMNIUI_API carb::Uint2 getSize() { return m_imageSize; } /** * @brief Gets image format. */ OMNIUI_API carb::Format getFormat() { return m_imageFormat; } /** * @brief Function that should be called when the widget is being prepared to be drawn. Lazy load of image * contents may happen there, depending on the image provider logic. * @param widgetWidth Computed width of the widget. * @param widgetHeight Computed height of the widget. */ OMNIUI_API virtual void prepareDraw(float widgetWidth, float widgetHeight); /** * @brief Sets non-managed image data directly. * @param imGuiReference Opaque pointer to the data used in the ImGuiRenderer. * @param size Size tuple (width, height) of the image data. * @param format Pixel format of the image data. * @param rpRsrc The GpuResource to be associated with the image data. The GpuResource is not checked for data compatibility, can be nullptr. */ OMNIUI_API void setImageData(void* imGuiReference, carb::Uint2 size, carb::Format format, GpuResource* gpuRsrc = nullptr); /** * @brief Sets image data directly from an GpuResource. * @param rpRsrc The GpuResource to be used for data. * @return A boolean value whether the image-data was set. * On success the GpuResource will have been retained, otherwise not. */ OMNIUI_API bool setImageData(GpuResource& gpuRsrc); OMNIUI_API bool setImageData(GpuResource& gpuRsrc, uint64_t presentationKey); /** * @brief Shuts down the image provider system */ OMNIUI_API static void shutdown(); /** * @brief Shuts down the image provider system */ OMNIUI_API GpuResource* getManagedResource(); protected: /** * @brief Release the managed image data, called from setImageData */ OMNIUI_API virtual void _releaseImage() { } void _shutdown(); OMNIUI_API virtual bool _setManagedResource(GpuResource* rpRsrc); OMNIUI_API virtual bool mergeTextureOptions(TextureOptions& textureOptions) const; OMNIUI_API virtual bool setTextureOptions(TextureOptions textureOptions); void* m_imGuiReference = nullptr; carb::Uint2 m_imageSize = {}; carb::Format m_imageFormat = carb::Format::eRGBA8_UNORM; size_t m_imageMipCount = 1; bool m_isShutdown = false; omni::kit::renderer::IRenderer* m_kitRenderer = nullptr; GpuResource* m_managedRsrc = nullptr; uint64_t m_presentationKey = 0; carb::tasking::SharedFuture<gpu::GfResult> m_future; bool m_hasFuture = false; public: // Must be public so it can be accessed outside of the class carb::container::IntrusiveListLink<ImageProvider> m_link; }; template <typename T, typename... Args> static std::shared_ptr<T> create(Args&&... args) { std::shared_ptr<T> ptr{ new T{ std::forward<Args>(args)... } }; return ptr; } template <typename T, typename Deleter, typename... Args> static std::shared_ptr<T> createWithDeleter(Deleter&& deleter, Args&&... args) { return std::shared_ptr<T>{ new T{ std::forward<Args>(args)... }, std::forward<Deleter>(deleter) }; } } }
4,939
C
25.276596
145
0.668759
omniverse-code/kit/include/omni/ui/ImageProvider/RasterImageProvider.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "ImageProvider.h" namespace carb { namespace settings { struct ISettings; } } namespace omni { namespace ui { class OMNIUI_CLASS_API RasterImageProvider : public ImageProvider { public: OMNIUI_API RasterImageProvider(std::string = {}); OMNIUI_API ~RasterImageProvider(); /** * @brief Sets the raster image URL. Asset loading doesn't happen immediately, but rather is started the next time * widget is visible, in prepareDraw call. */ OMNIUI_API virtual void setSourceUrl(const char* url); /** * @brief Returns vector image URL. */ OMNIUI_API virtual std::string getSourceUrl() const; /** * @brief This function needs to be called every frame to make sure asset loading is moving forward, and resources * are properly allocated. */ OMNIUI_API void prepareDraw(float widgetWidth, float widgetHeight) override; /** * @brief Sets the maximum number of mip map levels allowed. */ OMNIUI_API virtual void setMaxMipLevels(size_t maxMipLevels); /** * @brief Returns the maximum number of mip map levels allowed. */ OMNIUI_API virtual size_t getMaxMipLevels() const; protected: void _shutdown(); struct TextureData; carb::settings::ISettings* m_settings = nullptr; int32_t m_shutdownIterMax = 0; std::string m_sourceRasterUrl; bool m_sourceRasterUrlChanged = false; mutable std::mutex m_sourceRasterUrlMutex; std::unique_ptr<TextureData> m_textureData; bool m_assetLoading = false; std::string m_cacheKey; size_t m_maxMipLevels = 3; mutable std::mutex m_maxMipLevelsMutex; time_t _getModTime(const std::string& assetPathString); std::string _getCacheKey(const std::string& filePath); /** * @brief Function to trigger asset loading. Asset loading is non-blocking, so the image won't be available * immediately after _loadAsset is called - instead the image resources will be recreated eventually in * one of the subsequent _pollAsset calls when snapshot will be ready. */ void _loadAsset(const std::string& assetPathString); /** * @brief Function to check asset loading status. If asset snapshot is not ready, do nothing. When it is ready, * proceed to create image resources from the loaded asset. */ void _pollAsset(); void _releaseAsset(); void _waitAsset(); }; } }
2,887
C
27.038835
118
0.699342
omniverse-code/kit/include/omni/ui/bind/DocStyleContainer.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_StyleContainer \ "The StyleContainer class encapsulates the look and feel of a GUI.\n" \ "It's a place holder for the future work to support CSS style description. StyleContainer supports various properties, pseudo-states, and subcontrols that make it possible to customize the look of widgets. It can only be edited by merging with another style.\n" #define OMNIUI_PYBIND_DOC_StyleContainer_valid "Check if the style contains anything.\n" #define OMNIUI_PYBIND_DOC_StyleContainer_merge "Merges another style to this style. The given style is strongest.\n" #define OMNIUI_PYBIND_DOC_StyleContainer_getStyleStateGroupIndex \ "Find the style state group by type and name. It's pretty slow, so it shouldn't be used in the draw cycle.\n" #define OMNIUI_PYBIND_DOC_StyleContainer_getCachedTypes "Get all the types in this StyleContainer.\n" #define OMNIUI_PYBIND_DOC_StyleContainer_getCachedNames \ "Get all the names related to the type in this StyleContainer.\n" #define OMNIUI_PYBIND_DOC_StyleContainer_getCachedStates \ "Get all the available states in the given index in this StyleContainer.\n" #define OMNIUI_PYBIND_DOC_StyleContainer_resolveStyleProperty \ "Find the given property in the data structure using the style state group index. If the property is not found, it continues finding in cascading and parent blocks. The style state group index can be obtained with getStyleStateGroupIndex.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `T :`\n" \ " StyleFloatProperty or StyleColorProperty\n" \ "\n" \ " `U :`\n" \ " float or uint32_t\n" #define OMNIUI_PYBIND_DOC_StyleContainer_defaultStyle "Preset with a default style.\n" #define OMNIUI_PYBIND_DOC_StyleContainer_getNameToPropertyMapping \ "Get the the mapping between property and its string.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `T :`\n" \ " StyleFloatProperty, StyleEnumProperty, StyleColorProperty, StyleStringProperty or State\n" #define OMNIUI_PYBIND_DOC_StyleContainer_getPropertyEnumeration \ "Get the Property from the string.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `T :`\n" \ " StyleFloatProperty, StyleEnumProperty, StyleColorProperty or StyleStringProperty\n" #define OMNIUI_PYBIND_DOC_StyleContainer__parseScopeString \ "Perses a string that looks like \"Widget::name:state\", split it to the parts and return the parts.\n"
6,645
C
87.613332
265
0.324454
omniverse-code/kit/include/omni/ui/bind/DocMainWindow.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_MainWindow \ "The MainWindow class represents Main Window for the Application, draw optional MainMenuBar and StatusBar.\n" \ "\n" #define OMNIUI_PYBIND_DOC_MainWindow_mainMenuBar "The main MenuBar for the application.\n" #define OMNIUI_PYBIND_DOC_MainWindow_mainFrame "This represents Styling opportunity for the Window background.\n" #define OMNIUI_PYBIND_DOC_MainWindow_statusBarFrame \ "The StatusBar Frame is empty by default and is meant to be filled by other part of the system.\n" #define OMNIUI_PYBIND_DOC_MainWindow_cppStatusBarEnabled "Workaround to reserve space for C++ status bar.\n" #define OMNIUI_PYBIND_DOC_MainWindow_showForeground "When show_foreground is True, MainWindow prevents other windows from showing.\n" #define OMNIUI_PYBIND_DOC_MainWindow_MainWindow \ "Construct the main window, add it to the underlying windowing system, and makes it appear.\n"
1,610
C
46.382352
133
0.675155
omniverse-code/kit/include/omni/ui/bind/DocAbstractItemModel.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_AbstractItemModel \ "The central component of the item widget. It is the application's dynamic data structure, independent of the user interface, and it directly manages the nested data. It follows closely model-view pattern. It's abstract, and it defines the standard interface to be able to interoperate with the components of the model-view architecture. It is not supposed to be instantiated directly. Instead, the user should subclass it to create a new model.\n" \ "The item model doesn't return the data itself. Instead, it returns the value model that can contain any data type and supports callbacks. Thus the client of the model can track the changes in both the item model and any value it holds.\n" \ "From any item, the item model can get both the value model and the nested items. Therefore, the model is flexible to represent anything from color to complicated tree-table construction.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_getItemChildren \ "Returns the vector of items that are nested to the given parent item.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `id :`\n" \ " The item to request children from. If it's null, the children of root will be returned.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_canItemHaveChildren \ "Returns true if the item can have children. In this way the delegate usually draws +/- icon.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `id :`\n" \ " The item to request children from. If it's null, the children of root will be returned.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_appendChildItem \ "Creates a new item from the value model and appends it to the list of the children of the given item.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_removeItem \ "Removes the item from the model.\n" \ "There is no parent here because we assume that the reimplemented model deals with its data and can figure out how to remove this item.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_getItemValueModelCount \ "Returns the number of columns this model item contains.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_getItemValueModel \ "Get the value model associated with this item.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `item :`\n" \ " The item to request the value model from. If it's null, the root value model will be returned.\n" \ "\n" \ " `index :`\n" \ " The column number to get the value model.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_beginEdit \ "Called when the user starts the editing. If it's a field, this method is called when the user activates the field and places the cursor inside.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_endEdit \ "Called when the user finishes the editing. If it's a field, this method is called when the user presses Enter or selects another field for editing. It's useful for undo/redo.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_dropAccepted \ "Called to determine if the model can perform drag and drop to the given item. If this method returns false, the widget shouldn't highlight the visual element that represents this item.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_dropAccepted01 \ "Called to determine if the model can perform drag and drop of the given string to the given item. If this method returns false, the widget shouldn't highlight the visual element that represents this item.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_drop \ "Called when the user droped one item to another.\n" \ "Small explanation why the same default value is declared in multiple places. We use the default value to be compatible with the previous API and especially with Stage 2.0. Thr signature in the old Python API is:\n" \ "def drop(self, target_item, source)\n" \ "drop(self, target_item, source)\n" \ "PyAbstractItemModel::drop\n" \ "AbstractItemModel.drop\n" \ "pybind11::class_<AbstractItemModel>.def(\"drop\")\n" \ "AbstractItemModel\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_drop01 "Called when the user droped a string to the item.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_getDragMimeData \ "Returns Multipurpose Internet Mail Extensions (MIME) for drag and drop.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_subscribe \ "Subscribe the ItemModelHelper widget to the changes of the model.\n" \ "We need to use regular pointers because we subscribe in the constructor of the widget and unsubscribe in the destructor. In constructor smart pointers are not available. We also don't allow copy and move of the widget.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_unsubscribe \ "Unsubscribe the ItemModelHelper widget from the changes of the model.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_addItemChangedFn \ "Adds the function that will be called every time the value changes.\n" \ "The id of the callback that is used to remove the callback.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_removeItemChangedFn \ "Remove the callback by its id.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `id :`\n" \ " The id that addValueChangedFn returns.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_addBeginEditFn \ "Adds the function that will be called every time the user starts the editing.\n" \ "The id of the callback that is used to remove the callback.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_removeBeginEditFn \ "Remove the callback by its id.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `id :`\n" \ " The id that addBeginEditFn returns.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_addEndEditFn \ "Adds the function that will be called every time the user finishes the editing.\n" \ "The id of the callback that is used to remove the callback.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_removeEndEditFn \ "Remove the callback by its id.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `id :`\n" \ " The id that addEndEditFn returns.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_processBeginEditCallbacks \ "Called by the widget when the user starts editing. It calls beginEdit and the callbacks.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_processEndEditCallbacks \ "Called by the widget when the user finishes editing. It calls endEdit and the callbacks.\n" #define OMNIUI_PYBIND_DOC_AbstractItemModel_AbstractItemModel "Constructs AbstractItemModel.\n"
14,195
C
87.724999
454
0.362663
omniverse-code/kit/include/omni/ui/bind/DocColorStore.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_ColorStore \ "A singleton that stores all the UI Style color properties of omni.ui.\n" \ "\n" #define OMNIUI_PYBIND_DOC_ColorStore_getInstance "Get the instance of this singleton object.\n"
804
C
46.352938
120
0.655473
omniverse-code/kit/include/omni/ui/bind/BindMultiDragField.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindMultiField.h" #include "DocMultiDragField.h" #include "DocMultiFloatDragField.h" #include "DocMultiIntDragField.h" // clang-format off #define OMNIUI_PYBIND_INIT_MultiFloatDragField \ OMNIUI_PYBIND_INIT_AbstractMultiField \ OMNIUI_PYBIND_INIT_CAST(min, setMin, double) \ OMNIUI_PYBIND_INIT_CAST(max, setMax, double) \ OMNIUI_PYBIND_INIT_CAST(step, setStep, float) #define OMNIUI_PYBIND_INIT_MultiIntDragField \ OMNIUI_PYBIND_INIT_AbstractMultiField \ OMNIUI_PYBIND_INIT_CAST(min, setMin, int32_t) \ OMNIUI_PYBIND_INIT_CAST(max, setMax, int32_t) \ OMNIUI_PYBIND_INIT_CAST(step, setStep, float) #define OMNIUI_PYBIND_KWARGS_DOC_MultiDragField \ "\n `min : `\n " \ OMNIUI_PYBIND_DOC_MultiDragField_min \ "\n `max : `\n " \ OMNIUI_PYBIND_DOC_MultiDragField_max \ "\n `step : `\n " \ OMNIUI_PYBIND_DOC_MultiDragField_step \ OMNIUI_PYBIND_KWARGS_DOC_AbstractMultiField #define OMNIUI_PYBIND_KWARGS_DOC_MultiFloatDragField \ OMNIUI_PYBIND_KWARGS_DOC_MultiDragField #define OMNIUI_PYBIND_KWARGS_DOC_MultiIntDragField \ OMNIUI_PYBIND_KWARGS_DOC_MultiDragField // clang-format on
2,919
C
65.363635
120
0.412813
omniverse-code/kit/include/omni/ui/bind/BindAbstractField.h
// Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindUtils.h" #include "BindWidget.h" #include "DocAbstractField.h" #define OMNIUI_PYBIND_INIT_AbstractField OMNIUI_PYBIND_INIT_Widget #define OMNIUI_PYBIND_KWARGS_DOC_AbstractField OMNIUI_PYBIND_KWARGS_DOC_Widget
677
C
38.882351
78
0.802068
omniverse-code/kit/include/omni/ui/bind/DocStack.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Stack \ "The Stack class lines up child widgets horizontally, vertically or sorted in a Z-order.\n" \ "\n" #define OMNIUI_PYBIND_DOC_Stack_Direction \ "This type is used to determine the direction of the layout. If the Stack's orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack's orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack's orientation is eTopToBottom, the widgets are placed in a vertical column, from top to bottom. If the Stack's orientation is eBottomToTop, the widgets are placed in a vertical column, from bottom to top. If the Stack's orientation is eBackToFront, the widgets are placed sorted in a Z-order in top right corner. If the Stack's orientation is eFrontToBack, the widgets are placed sorted in a Z-order in top right corner, the first widget goes to front.\n" #define OMNIUI_PYBIND_DOC_Stack_addChild \ "Reimplemented adding a widget to this Stack. The Stack class can contain multiple widgets.\n" #define OMNIUI_PYBIND_DOC_Stack_clear "Reimplemented removing all the child widgets from this Stack.\n" #define OMNIUI_PYBIND_DOC_Stack_setComputedContentWidth \ "Reimplemented the method to indicate the width hint that represents the preferred size of the widget. Currently this widget can't be smaller than the minimal size of the child widgets.\n" #define OMNIUI_PYBIND_DOC_Stack_setComputedContentHeight \ "Reimplemented the method to indicate the height hint that represents the preferred size of the widget. Currently this widget can't be smaller than the minimal size of the child widgets.\n" #define OMNIUI_PYBIND_DOC_Stack_cascadeStyle \ "It's called when the style is changed. It should be propagated to children to make the style cached and available to children.\n" #define OMNIUI_PYBIND_DOC_Stack_setVisiblePreviousFrame "Change dirty bits when the visibility is changed.\n" #define OMNIUI_PYBIND_DOC_Stack_contentClipping \ "Determines if the child widgets should be clipped by the rectangle of this Stack.\n" #define OMNIUI_PYBIND_DOC_Stack_spacing "Sets a non-stretchable space in pixels between child items of this layout.\n" #define OMNIUI_PYBIND_DOC_Stack_direction \ "Determines the type of the layout. It can be vertical, horizontal and front-to-back.\n" #define OMNIUI_PYBIND_DOC_Stack_sendMouseEventsToBack \ "When children of a Z-based stack overlap mouse events are normally sent to the topmost one. Setting this property true will invert that behavior, sending mouse events to the bottom-most child.\n" #define OMNIUI_PYBIND_DOC_Stack_Stack \ "Constructor.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `direction :`\n" \ " Determines the orientation of the Stack.\n"
4,688
C
71.13846
747
0.539889
omniverse-code/kit/include/omni/ui/bind/DocMultiIntDragField.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_MultiIntDragField \ "MultiIntDragField is the widget that has a sub widget (IntDrag) per model item.\n" \ "It's handy to use it for multi-component data, like for example, int3.\n" #define OMNIUI_PYBIND_DOC_MultiIntDragField_MultiIntDragField \ "Constructs MultiIntDragField.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `model :`\n" \ " The widget's model. If the model is not assigned, the default model is created.\n"
1,721
C
70.749997
120
0.396862
omniverse-code/kit/include/omni/ui/bind/DocZStack.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_ZStack \ "Shortcut for Stack{eBackToFront}. The widgets are placed sorted in a Z-order in top right corner with suitable sizes.\n" #define OMNIUI_PYBIND_DOC_ZStack_ZStack \ "Construct a stack with the widgets placed in a Z-order with sorting from background to foreground.\n"
932
C
53.88235
125
0.641631
omniverse-code/kit/include/omni/ui/bind/BindFloatDrag.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindFloatSlider.h" #include "BindUtils.h" #include "DocFloatDrag.h" // clang-format off #define OMNIUI_PYBIND_INIT_FloatDrag \ OMNIUI_PYBIND_INIT_FloatSlider #define OMNIUI_PYBIND_KWARGS_DOC_FloatDrag \ OMNIUI_PYBIND_KWARGS_DOC_FloatSlider // clang-format on
897
C
41.761903
120
0.638796
omniverse-code/kit/include/omni/ui/bind/DocSimpleNumericModel.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_SimpleNumericModel \ "A very simple value model that holds a single number. It's still an abstract class. It's necessary to reimplement\n" \ "setValue(std::string value)\n" \ "\n" #define OMNIUI_PYBIND_DOC_SimpleNumericModel_min "This property holds the model's minimum value.\n" #define OMNIUI_PYBIND_DOC_SimpleNumericModel_max "This property holds the model's maximum value.\n" #define OMNIUI_PYBIND_DOC_SimpleNumericModel_getValueAsBool "Get the value as bool.\n" #define OMNIUI_PYBIND_DOC_SimpleNumericModel_getValueAsFloat "Get the value as double.\n" #define OMNIUI_PYBIND_DOC_SimpleNumericModel_getValueAsInt "Get the value as int64_t.\n" #define OMNIUI_PYBIND_DOC_SimpleNumericModel_getValueAsString "Get the value as string.\n" #define OMNIUI_PYBIND_DOC_SimpleNumericModel_setValue "Set the bool value. It will convert bool to the model's typle.\n" #define OMNIUI_PYBIND_DOC_SimpleNumericModel_setValue01 \ "Set the double value. It will convert double to the model's typle.\n" #define OMNIUI_PYBIND_DOC_SimpleNumericModel_setValue2 \ "Set the int64_t value. It will convert int64_t to the model's typle.\n"
1,926
C
42.795454
123
0.658359
omniverse-code/kit/include/omni/ui/bind/BindGrid.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindStack.h" #include "DocGrid.h" // clang-format off #define OMNIUI_PYBIND_INIT_Grid \ OMNIUI_PYBIND_INIT_Stack \ OMNIUI_PYBIND_INIT_CAST(column_width, setColumnWidth, float) \ OMNIUI_PYBIND_INIT_CAST(row_height, setRowHeight, float) \ OMNIUI_PYBIND_INIT_CAST(column_count, setColumnCount, uint32_t) \ OMNIUI_PYBIND_INIT_CAST(row_count, setRowCount, uint32_t) \ #define OMNIUI_PYBIND_KWARGS_DOC_Grid \ "\n `column_width : `\n " \ OMNIUI_PYBIND_DOC_Grid_columnWidth \ "\n `row_height : `\n " \ OMNIUI_PYBIND_DOC_Grid_rowHeight \ "\n `column_count : `\n " \ OMNIUI_PYBIND_DOC_Grid_columnCount \ "\n `row_count : `\n " \ OMNIUI_PYBIND_DOC_Grid_rowCount \ OMNIUI_PYBIND_KWARGS_DOC_Stack // clang-format on
2,388
C
71.393937
120
0.36809
omniverse-code/kit/include/omni/ui/bind/BindFloatSlider.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindAbstractSlider.h" #include "BindUtils.h" #include "DocFloatSlider.h" // clang-format off #define OMNIUI_PYBIND_INIT_FloatSlider \ OMNIUI_PYBIND_INIT_AbstractSlider \ OMNIUI_PYBIND_INIT_CAST(min, setMin, float) \ OMNIUI_PYBIND_INIT_CAST(max, setMax, float) \ OMNIUI_PYBIND_INIT_CAST(step, setStep, float) \ OMNIUI_PYBIND_INIT_CAST(format, setFormat, std::string) \ OMNIUI_PYBIND_INIT_CAST(precision, setPrecision, uint32_t) #define OMNIUI_PYBIND_KWARGS_DOC_FloatSlider \ "\n `min : float`\n " \ OMNIUI_PYBIND_DOC_FloatSlider_min \ "\n `max : float`\n " \ OMNIUI_PYBIND_DOC_FloatSlider_max \ "\n `step : float`\n " \ OMNIUI_PYBIND_DOC_FloatSlider_step \ "\n `format : str`\n " \ OMNIUI_PYBIND_DOC_FloatSlider_format \ "\n `precision : uint32_t`\n " \ OMNIUI_PYBIND_DOC_FloatSlider_precision \ OMNIUI_PYBIND_KWARGS_DOC_AbstractSlider // clang-format on
2,740
C
75.138887
120
0.364599
omniverse-code/kit/include/omni/ui/bind/DocAbstractMultiField.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_AbstractMultiField \ "AbstractMultiField is the abstract class that has everything to create a custom widget per model item.\n" \ "The class that wants to create multiple widgets per item needs to reimplement the method _createField.\n" #define OMNIUI_PYBIND_DOC_AbstractMultiField_setComputedContentWidth \ "Reimplemented the method to indicate the width hint that represents the preferred size of the widget. Currently this widget can't be smaller than the size of the text.\n" #define OMNIUI_PYBIND_DOC_AbstractMultiField_setComputedContentHeight \ "Reimplemented the method to indicate the height hint that represents the preferred size of the widget. Currently this widget can't be smaller than the size of the text.\n" #define OMNIUI_PYBIND_DOC_AbstractMultiField_onStyleUpdated \ "Reimplemented. Something happened with the style or with the parent style. We need to gerenerate the cache.\n" #define OMNIUI_PYBIND_DOC_AbstractMultiField_onModelUpdated \ "Reimplemented. Called by the model when the model value is changed.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `item :`\n" \ " The item in the model that is changed. If it's NULL, the root is chaged.\n" #define OMNIUI_PYBIND_DOC_AbstractMultiField_columnCount "The max number of fields in a line.\n" #define OMNIUI_PYBIND_DOC_AbstractMultiField_hSpacing \ "Sets a non-stretchable horizontal space in pixels between child fields.\n" #define OMNIUI_PYBIND_DOC_AbstractMultiField_vSpacing \ "Sets a non-stretchable vertical space in pixels between child fields.\n" #define OMNIUI_PYBIND_DOC_AbstractMultiField_AbstractMultiField "Constructor.\n"
3,170
C
62.419999
176
0.523344
omniverse-code/kit/include/omni/ui/bind/DocFloatDrag.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_FloatDrag \ "The drag widget that looks like a field but it's possible to change the value with dragging.\n" \ "\n" #define OMNIUI_PYBIND_DOC_FloatDrag_FloatDrag "Construct FloatDrag.\n"
779
C
44.88235
120
0.672657
omniverse-code/kit/include/omni/ui/bind/DocScrollingFrame.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_ScrollingFrame \ "The ScrollingFrame class provides the ability to scroll onto another widget.\n" \ "ScrollingFrame is used to display the contents of a child widget within a frame. If the widget exceeds the size of the frame, the frame can provide scroll bars so that the entire area of the child widget can be viewed. The child widget must be specified with addChild().\n" #define OMNIUI_PYBIND_DOC_ScrollingFrame_setComputedContentWidth \ "Reimplemented the method to indicate the width hint that represents the preferred size of the widget. Currently this widget can't be smaller than the minimal size of the child widgets.\n" #define OMNIUI_PYBIND_DOC_ScrollingFrame_setComputedContentHeight \ "Reimplemented the method to indicate the height hint that represents the preferred size of the widget. Currently this widget can't be smaller than the minimal size of the child widgets.\n" #define OMNIUI_PYBIND_DOC_ScrollingFrame_scrollX \ "The horizontal position of the scroll bar. When it's changed, the contents will be scrolled accordingly.\n" #define OMNIUI_PYBIND_DOC_ScrollingFrame_scrollY \ "The vertical position of the scroll bar. When it's changed, the contents will be scrolled accordingly.\n" #define OMNIUI_PYBIND_DOC_ScrollingFrame_scrollXMax "The max position of the horizontal scroll bar.\n" #define OMNIUI_PYBIND_DOC_ScrollingFrame_scrollYMax "The max position of the vertical scroll bar.\n" #define OMNIUI_PYBIND_DOC_ScrollingFrame_horizontalScrollBarPolicy \ "This property holds the policy for the horizontal scroll bar.\n" #define OMNIUI_PYBIND_DOC_ScrollingFrame_verticalScrollBarPolicy \ "This property holds the policy for the vertical scroll bar.\n" #define OMNIUI_PYBIND_DOC_ScrollingFrame_ScrollingFrame "Construct ScrollingFrame.\n"
2,759
C
57.723403
278
0.657847
omniverse-code/kit/include/omni/ui/bind/BindLabel.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindUtils.h" #include "BindWidget.h" #include "DocLabel.h" // clang-format off #define OMNIUI_PYBIND_INIT_Label \ OMNIUI_PYBIND_INIT_Widget \ OMNIUI_PYBIND_INIT_CAST(alignment, setAlignment, Alignment) \ OMNIUI_PYBIND_INIT_CAST(word_wrap, setWordWrap, bool) \ OMNIUI_PYBIND_INIT_CAST(elided_text, setElidedText, bool) \ OMNIUI_PYBIND_INIT_CAST(elided_text_str, setElidedTextStr, std::string) \ OMNIUI_PYBIND_INIT_CAST(hide_text_after_hash, setHideTextAfterHash, bool) // clang-format off #define OMNIUI_PYBIND_KWARGS_DOC_Label \ "\n `alignment : `\n " \ OMNIUI_PYBIND_DOC_Label_alignment \ "\n `word_wrap : `\n " \ OMNIUI_PYBIND_DOC_Label_wordWrap \ "\n `elided_text : `\n " \ OMNIUI_PYBIND_DOC_Label_elidedText \ "\n `elided_text_str : `\n " \ OMNIUI_PYBIND_DOC_Label_elidedTextStr \ "\n `hide_text_after_hash : `\n " \ OMNIUI_PYBIND_DOC_Label_hideTextAfterHash \ OMNIUI_PYBIND_KWARGS_DOC_Widget // clang-format on
2,754
C
71.499998
120
0.378722
omniverse-code/kit/include/omni/ui/bind/DocMenuItem.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_MenuItem \ "A MenuItem represents the items the Menu consists of.\n" \ "MenuItem can be inserted only once in the menu.\n" #define OMNIUI_PYBIND_DOC_MenuItem_setComputedContentWidth \ "Reimplemented the method to indicate the width hint that represents the preferred size of the widget.\n" #define OMNIUI_PYBIND_DOC_MenuItem_setComputedContentHeight \ "Reimplemented the method to indicate the height hint that represents the preferred size of the widget.\n" #define OMNIUI_PYBIND_DOC_MenuItem_cascadeStyle \ "It's called when the style is changed. It should be propagated to children to make the style cached and available to children.\n" #define OMNIUI_PYBIND_DOC_MenuItem_MenuItem "Construct MenuItem.\n"
1,548
C
52.413791
134
0.613695
omniverse-code/kit/include/omni/ui/bind/DocMultiStringField.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_MultiStringField \ "MultiStringField is the widget that has a sub widget (StringField) per model item.\n" \ "It's handy to use it for string arrays.\n" #define OMNIUI_PYBIND_DOC_MultiStringField_MultiStringField "Constructor.\n"
824
C
47.529409
120
0.680825
omniverse-code/kit/include/omni/ui/bind/BindSpacer.h
// Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindUtils.h" #include "BindWidget.h" #include "DocSpacer.h" #define OMNIUI_PYBIND_INIT_Spacer OMNIUI_PYBIND_INIT_Widget #define OMNIUI_PYBIND_KWARGS_DOC_Spacer OMNIUI_PYBIND_KWARGS_DOC_Widget
656
C
37.647057
77
0.795732
omniverse-code/kit/include/omni/ui/bind/DocEllipse.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Ellipse \ "The Ellipse widget provides a colored ellipse to display.\n" \ "\n" #define OMNIUI_PYBIND_DOC_Ellipse_Ellipse "Constructs Ellipse.\n"
772
C
44.470586
120
0.63601
omniverse-code/kit/include/omni/ui/bind/DocCollapsableFrame.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_CollapsableFrame \ "CollapsableFrame is a frame widget that can hide or show its content. It has two states expanded and collapsed. When it's collapsed, it looks like a button. If it's expanded, it looks like a button and a frame with the content. It's handy to group properties, and temporarily hide them to get more space for something else.\n" \ "\n" #define OMNIUI_PYBIND_DOC_CollapsableFrame_addChild "Reimplemented. It adds a widget to m_body.\n" #define OMNIUI_PYBIND_DOC_CollapsableFrame_setComputedContentWidth \ "Reimplemented the method to indicate the width hint that represents the preferred size of the widget. Currently this widget can't be smaller than the minimal size of the child widgets.\n" #define OMNIUI_PYBIND_DOC_CollapsableFrame_setComputedContentHeight \ "Reimplemented the method to indicate the height hint that represents the preferred size of the widget. Currently this widget can't be smaller than the minimal size of the child widgets.\n" #define OMNIUI_PYBIND_DOC_CollapsableFrame_BuildHeader \ "Set dynamic header that will be created dynamiclly when it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.\n" #define OMNIUI_PYBIND_DOC_CollapsableFrame_collapsed "The state of the CollapsableFrame.\n" #define OMNIUI_PYBIND_DOC_CollapsableFrame_title "The header text.\n" #define OMNIUI_PYBIND_DOC_CollapsableFrame_alignment \ "This property holds the alignment of the label in the default header. By default, the contents of the label are left-aligned and vertically-centered.\n" #define OMNIUI_PYBIND_DOC_CollapsableFrame_CollapsableFrame \ "Constructs CollapsableFrame.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `text :`\n" \ " The text for the caption of the frame.\n"
3,509
C
70.632652
333
0.504987
omniverse-code/kit/include/omni/ui/bind/DocFontHelper.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_FontHelper \ "The helper class for the widgets that are working with fonts.\n" \ "\n"
706
C
49.499996
120
0.627479
omniverse-code/kit/include/omni/ui/bind/DocInspector.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Inspector \ "Inspector is the helper to check the internal state of the widget. It's not recommended to use it for the routine UI.\n" \ "\n" #define OMNIUI_PYBIND_DOC_Inspector_getChildren "Get the children of the given Widget.\n" #define OMNIUI_PYBIND_DOC_Inspector_getResolvedStyle "Get the resolved style of the given Widget.\n" #define OMNIUI_PYBIND_DOC_Inspector_beginComputedWidthMetric \ "Start counting how many times Widget::setComputedWidth is called\n" #define OMNIUI_PYBIND_DOC_Inspector_bumpComputedWidthMetric "Increases the number Widget::setComputedWidth is called\n" #define OMNIUI_PYBIND_DOC_Inspector_endComputedWidthMetric \ "Start counting how many times Widget::setComputedWidth is called and return the number\n" #define OMNIUI_PYBIND_DOC_Inspector_beginComputedHeightMetric \ "Start counting how many times Widget::setComputedHeight is called\n" #define OMNIUI_PYBIND_DOC_Inspector_bumpComputedHeightMetric \ "Increases the number Widget::setComputedHeight is called\n" #define OMNIUI_PYBIND_DOC_Inspector_endComputedHeightMetric \ "Start counting how many times Widget::setComputedHeight is called and return the number\n" #define OMNIUI_PYBIND_DOC_Inspector_getStoredFontAtlases \ "Provides the information about font atlases\n"
2,230
C
46.468084
127
0.632287
omniverse-code/kit/include/omni/ui/bind/DocPropertyCallback.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_PropertyCallback \ "Callback containers that is used with OMNIUI_PROPERTY macro.\n" \ "\n"
706
C
49.499996
120
0.637394
omniverse-code/kit/include/omni/ui/bind/DocContainerStack.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_ContainerStack \ "Singleton object that holds the stack of containers. We use it to automatically add widgets to the top container when the widgets are created.\n" \ "\n" #define OMNIUI_PYBIND_DOC_ContainerStack_push \ "Push the container to the top of the stack. All the newly created widgets will be added to this container.\n" #define OMNIUI_PYBIND_DOC_ContainerStack_pop "Removes the container from the stack. The previous one will be active.\n" #define OMNIUI_PYBIND_DOC_ContainerStack_addChildToTop "Add the given widget to the top container.\n" #define OMNIUI_PYBIND_DOC_ContainerStack_instance "The only instance of the singleton.\n"
1,326
C
48.148146
152
0.671946
omniverse-code/kit/include/omni/ui/bind/DocHGrid.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_HGrid \ "Shortcut for Grid{eLeftToRight}. The grid grows from left to right with the widgets placed.\n" #define OMNIUI_PYBIND_DOC_HGrid_HGrid "Construct a grid that grow from left to right with the widgets placed.\n"
791
C
48.499997
120
0.695322
omniverse-code/kit/include/omni/ui/bind/DocIntDrag.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_IntDrag \ "The drag widget that looks like a field but it's possible to change the value with dragging.\n" \ "\n" #define OMNIUI_PYBIND_DOC_IntDrag_step \ "This property controls the steping speed on the drag, its float to enable slower speed, but of course the value on the Control are still integer.\n" #define OMNIUI_PYBIND_DOC_IntDrag_IntDrag \ "Constructs IntDrag.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `model :`\n" \ " The widget's model. If the model is not assigned, the default model is created.\n"
1,928
C
67.892855
153
0.388485
omniverse-code/kit/include/omni/ui/bind/DocWindowHandle.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_WindowHandle \ "WindowHandle is a handle object to control any of the windows in Kit. It can be created any time, and if it's destroyed, the source window doesn't disappear.\n" \ "\n" #define OMNIUI_PYBIND_DOC_WindowHandle_getTitle "The title of the window.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_getPositionX "The position of the window in points.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_setPositionX "Set the position of the window in points.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_getPositionY "The position of the window in points.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_setPositionY "Set the position of the window in points.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_getWidth "The width of the window in points.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_setWidth "Set the width of the window in points.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_getHeight "The height of the window in points.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_setHeight "Set the height of the window in points.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_isVisible "Returns whether the window is visible.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_setVisible \ "Set the visibility of the windows. It's the way to hide the window.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_isDockTabBarVisible "Checks if the current docking space has the tab bar.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_setDockTabBarVisible \ "Sets the visibility of the current docking space tab bar. Unlike disabled, invisible tab bar can be shown with a little triangle in top left corner of the window.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_isDockTabBarEnabled \ "Checks if the current docking space is disabled. The disabled docking tab bar can't be shown by the user.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_setDockTabBarEnabled \ "Sets the visibility of the current docking space tab bar. The disabled docking tab bar can't be shown by the user.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_undock "Undock the window and make it floating.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_dockIn \ "Dock the window to the existing window. It can split the window to two parts or it can convert the window to a docking tab.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_getDockOrder "The position of the window in the dock.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_setDockOrder "Set the position of the window in the dock.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_isDocked "True if this window is docked. False otherwise.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_getDockId "Returns ID of the dock node this window is docked to.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_focus \ "Brings the window to the top. If it's a docked window, it makes the window currently visible in the dock.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_isSelectedInDock \ "Return true is the window is the current window in the docking area.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_notifyAppWindowChange \ "Notifies the UI window that the AppWindow it attached to has changed.\n" #define OMNIUI_PYBIND_DOC_WindowHandle_WindowHandle \ "Create a handle with the given ID.\n" \ "Only Workspace can create this object.\n"
4,514
C
44.60606
170
0.638901
omniverse-code/kit/include/omni/ui/bind/DocComboBox.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_ComboBox \ "The ComboBox widget is a combined button and a drop-down list.\n" \ "A combo box is a selection widget that displays the current item and can pop up a list of selectable items.\n" \ "The ComboBox is implemented using the model-view pattern. The model is the central component of this system. The root of the item model should contain the index of currently selected items, and the children of the root include all the items of the combo box.\n" #define OMNIUI_PYBIND_DOC_ComboBox_setComputedContentWidth \ "Reimplemented the method to indicate the width hint that represents the preferred size of the widget. Currently this widget can't be smaller than the size of the ComboBox square.\n" #define OMNIUI_PYBIND_DOC_ComboBox_setComputedContentHeight \ "Reimplemented the method to indicate the height hint that represents the preferred size of the widget. Currently this widget can't be smaller than the size of the ComboBox square.\n" #define OMNIUI_PYBIND_DOC_ComboBox_onStyleUpdated \ "Reimplemented. Something happened with the style or with the parent style. We need to update the saved font.\n" #define OMNIUI_PYBIND_DOC_ComboBox_onModelUpdated \ "Reimplemented the method from ItemModelHelper that is called when the model is changed.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `item :`\n" \ " The item in the model that is changed. If it's NULL, the root is chaged.\n" #define OMNIUI_PYBIND_DOC_ComboBox_arrowOnly "Determines if it's necessary to hide the text of the ComboBox.\n" #define OMNIUI_PYBIND_DOC_ComboBox_ComboBox \ "Construct ComboBox.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `model :`\n" \ " The model that determines if the button is checked.\n"
3,915
C
77.319998
266
0.426054
omniverse-code/kit/include/omni/ui/bind/BindAbstractValueModel.h
// Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindUtils.h" #include "DocAbstractValueModel.h" #include "DocSimpleBoolModel.h" #include "DocSimpleFloatModel.h" #include "DocSimpleIntModel.h" #include "DocSimpleNumericModel.h" #include "DocSimpleStringModel.h" // Protected section is not exported #define OMNIUI_PYBIND_DOC_AbstractValueModel__valueChanged \ "Called when any data of the model is changed. It will notify the subscribed widgets." #define OMNIUI_PYBIND_INIT_AbstractValueModel #define OMNIUI_PYBIND_KWARGS_DOC_AbstractValueModel
1,025
C
40.039998
120
0.755122
omniverse-code/kit/include/omni/ui/bind/DocRasterHelper.h
// Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_RasterHelper \ "The \"RasterHelper\" class is used to manage the draw lists or raster images. This class is responsible for rasterizing (or baking) the UI, which involves adding information about widgets to the cache. Once the UI has been baked, the draw list cache can be used to quickly re-render the UI without having to iterate over the widgets again. This is useful because it allows the UI to be rendered more efficiently, especially in cases where the widgets have not changed since the last time the UI was rendered. The \"RasterHelper\" class provides methods for modifying the cache and rendering the UI from the cached information.\n" \ "\n" #define OMNIUI_PYBIND_DOC_RasterHelper_rasterPolicy "Determine how the content of the frame should be rasterized.\n" #define OMNIUI_PYBIND_DOC_RasterHelper_invalidateRaster "This method regenerates the raster image of the widget, even if the widget's content has not changed. This can be used with both the eOnDemand and eAuto raster policies, and is used to update the content displayed in the widget. Note that this operation may be resource-intensive, and should be used sparingly.\n" #define OMNIUI_PYBIND_DOC_RasterHelper_RasterHelper "Constructor.\n"
2,299
C
98.999996
636
0.588082
omniverse-code/kit/include/omni/ui/bind/DocWorkspace.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Workspace "Workspace object provides access to the windows in Kit.\n" #define OMNIUI_PYBIND_DOC_Workspace_getDpiScale "Returns current DPI Scale.\n" #define OMNIUI_PYBIND_DOC_Workspace_getWindows \ "Returns the list of windows ordered from back to front.\n" \ "If the window is a Omni::UI window, it can be upcasted.\n" #define OMNIUI_PYBIND_DOC_Workspace_getWindow "Find Window by name.\n" #define OMNIUI_PYBIND_DOC_Workspace_getWindowFromCallback "Find Window by window callback.\n" #define OMNIUI_PYBIND_DOC_Workspace_getDockedNeighbours "Get all the windows that docked with the given widow.\n" #define OMNIUI_PYBIND_DOC_Workspace_getSelectedWindowIndex \ "Get currently selected window inedx from the given dock id.\n" #define OMNIUI_PYBIND_DOC_Workspace_clear "Undock all.\n" #define OMNIUI_PYBIND_DOC_Workspace_getMainWindowWidth "Get the width in points of the current main window.\n" #define OMNIUI_PYBIND_DOC_Workspace_getMainWindowHeight "Get the height in points of the current main window.\n" #define OMNIUI_PYBIND_DOC_Workspace_getDockedWindows "Get all the windows of the given dock ID.\n" #define OMNIUI_PYBIND_DOC_Workspace_getParentDockId \ "Return the parent Dock Node ID.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `dockId :`\n" \ " the child Dock Node ID to get parent\n" #define OMNIUI_PYBIND_DOC_Workspace_getDockNodeChildrenId \ "Get two dock children of the given dock ID.\n" \ "true if the given dock ID has children\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `dockId :`\n" \ " the given dock ID\n" \ "\n" \ " `first :`\n" \ " output. the first child dock ID\n" \ "\n" \ " `second :`\n" \ " output. the second child dock ID\n" #define OMNIUI_PYBIND_DOC_Workspace_getDockPosition \ "Returns the position of the given dock ID. Left/Right/Top/Bottom.\n" #define OMNIUI_PYBIND_DOC_Workspace_getDockIdWidth \ "Returns the width of the docking node.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `dockId :`\n" \ " the given dock ID\n" #define OMNIUI_PYBIND_DOC_Workspace_getDockIdHeight \ "Returns the height of the docking node.\n" \ "It's different from the window height because it considers dock tab bar.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `dockId :`\n" \ " the given dock ID\n" #define OMNIUI_PYBIND_DOC_Workspace_setDockIdWidth \ "Set the width of the dock node.\n" \ "It also sets the width of parent nodes if necessary and modifies the width of siblings.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `dockId :`\n" \ " the given dock ID\n" \ "\n" \ " `width :`\n" \ " the given width\n" #define OMNIUI_PYBIND_DOC_Workspace_setDockIdHeight \ "Set the height of the dock node.\n" \ "It also sets the height of parent nodes if necessary and modifies the height of siblings.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `dockId :`\n" \ " the given dock ID\n" \ "\n" \ " `height :`\n" \ " the given height\n" #define OMNIUI_PYBIND_DOC_Workspace_showWindow \ "Makes the window visible or create the window with the callback provided with set_show_window_fn.\n" \ "true if the window is already created, otherwise it's necessary to wait one frame\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `title :`\n" \ " the given window title\n" \ "\n" \ " `show :`\n" \ " true to show, false to hide\n" #define OMNIUI_PYBIND_DOC_Workspace_setWindowCreatedCallback \ "Addd the callback that is triggered when a new window is created.\n" #define OMNIUI_PYBIND_DOC_Workspace_setWindowVisibilityChangedCallback \ "Add the callback that is triggered when window's visibility changed.\n" #define OMNIUI_PYBIND_DOC_Workspace_removeWindowVisibilityChangedCallback \ "Remove the callback that is triggered when window's visibility changed.\n" #define OMNIUI_PYBIND_DOC_Workspace_setShowWindowFn \ "Add the callback to create a window with the given title. When the callback's argument is true, it's necessary to create the window. Otherwise remove.\n" #define OMNIUI_PYBIND_DOC_Workspace_RegisterWindow \ "Register Window, so it's possible to return it in getWindows. It's called by Window creator.\n" #define OMNIUI_PYBIND_DOC_Workspace_OmitWindow "Deregister window. It's called by Window destructor.\n"
11,851
C
73.54088
158
0.28428
omniverse-code/kit/include/omni/ui/bind/BindMainWindow.h
// Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindUtils.h" #include "DocMainWindow.h" #include <omni/ui/bind/Pybind.h> // clang-format off #define OMNIUI_PYBIND_INIT_MainWindow #define OMNIUI_PYBIND_KWARGS_DOC_MainWindow // clang-format on
659
C
31.999998
77
0.786039
omniverse-code/kit/include/omni/ui/bind/DocContainerScope301Void014.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_ContainerScope \ < void > \ "Specialization. It takes existing container and puts it to the top of the stack.\n" \ "\n"
691
C
45.13333
120
0.674385
omniverse-code/kit/include/omni/ui/bind/BindUtils.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include <carb/logging/Log.h> #include <omni/ui/Api.h> #include <omni/ui/bind/BindStyleContainer.h> #include <omni/ui/bind/Pybind.h> #include <functional> #define OMNIUI_BIND(x) \ void wrap##x(pybind11::module& m); \ wrap##x(m) // Set of macros for python constructors. We need to provide a way to initialize all the properties in the Python // constructor. And to do it we need to list all the properties from all the derived classes. To do it shortly, we use // the following pattern in the Python init lambda: // // OMNIUI_PYBIND_INIT(className) // // It expands to the Python constructor. Here are the implementations of the macros to do it. // Expands to the code that constructs the C++ object and its properties from pybind11 init. // // Omni::UI provides a property system. And this macro OMNIUI_PYBIND_INIT is the part of the property system. It's // possible to set any property in the constructor of the Python object. It gives the ability to have declarative-like // Python code. And we believe it allows the Python users creating complex widgets with straightforward code. The // simplest example looks like this: // // ui.Image( // image_source, // height=160, // alignment=ui.Alignment.CENTER, // style={"border_radius": 8, "margin": 20}, // ) // // We need to make sure that it's possible to initialize the properties of base class in the python constructor. It // seems pybind11 doesn't have a way to call the python constructor of the base object. It means that the Python // constructor of child class needs to have the code that initializes properties of the base class. To avoid duplicating // of actual code, we put the initialization of properties to macros. And it looks like this (it's simplified): // // #define OMNIUI_PYBIND_INIT_Widget // OMNIUI_PYBIND_INIT_CALL(width, setWidth, toLength) // OMNIUI_PYBIND_INIT_CALL(height, setHeight, toLength) // OMNIUI_PYBIND_INIT_CAST(name, setName, std::string) // // The initialization of child object looks like this (also simplified): // // #define OMNIUI_PYBIND_INIT_Button // OMNIUI_PYBIND_INIT_Widget // OMNIUI_PYBIND_INIT_CAST(text, setText, std::string) // // And to construct the python object, we can use the macro like this (also simplified): // // #define OMNIUI_PYBIND_INIT(className, ...) // auto result = className::create(__VA_ARGS__); // OMNIUI_PYBIND_INIT_##className // // We use className to create the object and to call the correct macro. Thus, the pybind11 constructor looks like this // for all the widgets: // // .def(init([](std::string title, kwargs kwargs) { OMNIUI_PYBIND_INIT(Button, title) })) // #define OMNIUI_PYBIND_INIT(className, ...) \ auto result = className::create(__VA_ARGS__); \ OMNIUI_PYBIND_INIT_BEGIN \ OMNIUI_PYBIND_INIT_##className OMNIUI_PYBIND_INIT_END return result; #define OMNIUI_PYBIND_INIT_WITH_DESTRUCTOR(className, destructor, ...) \ auto result = className::createWithDestructor((destructor), ##__VA_ARGS__); \ OMNIUI_PYBIND_INIT_BEGIN \ OMNIUI_PYBIND_INIT_##className OMNIUI_PYBIND_INIT_END return result; // The header of the code that constructs the C++ object and its properties from pybind11 init. It should only be used // by OMNIUI_PYBIND_INIT #define OMNIUI_PYBIND_INIT_BEGIN \ for (auto item : kwargs) \ { \ auto name = item.first.cast<std::string>(); \ const auto& value = item.second; \ \ if (0) \ { \ } // The footer of the code that constructs the C++ object and its properties from pybind11 init. It should only be used // by OMNIUI_PYBIND_INIT #define OMNIUI_PYBIND_INIT_END } // Initialize the property using the pybind11 cast to convert pybind11 handle to the type we need. #define OMNIUI_PYBIND_INIT_CAST(NAME, METHOD, CASTTO) \ else if (name == #NAME) \ { \ result->METHOD(value.cast<CASTTO>()); \ } // Initialize the property using the additional function to convert pybind11 handle to the type we need. #define OMNIUI_PYBIND_INIT_CALL(NAME, METHOD, CALL) \ else if (name == #NAME) \ { \ result->METHOD(CALL(value)); \ } // Initialize the property with the function that is not a method. #define OMNIUI_PYBIND_INIT_EXT_CALL(NAME, FUNCTION) \ else if (name == #NAME) \ { \ FUNCTION(result, value); \ } // Initialize the property of the function type. #define OMNIUI_PYBIND_INIT_CALLBACK(NAME, METHOD, CASTTO) \ else if (name == #NAME) \ { \ result->METHOD(wrapPythonCallback(value.cast<std::function<CASTTO>>())); \ } // Initialize widget style from Python dictionary. #define OMNIUI_PYBIND_INIT_STYLES \ else if (name == "style") \ { \ setWidgetStyle(*result.get(), value); \ } // Extended version of the init macros. // clang-format off #define OMNIUI_PYBIND_INIT_EX(className, ...) \ OMNIUI_PYBIND_INIT_EX_BEFORE_##className(__VA_ARGS__) \ OMNIUI_PYBIND_INIT_EX_CREATE_##className(__VA_ARGS__) \ OMNIUI_PYBIND_INIT_EX_AFTER_##className(__VA_ARGS__) \ OMNIUI_PYBIND_INIT_EX_BEGIN_KWARGS_##className(__VA_ARGS__) \ OMNIUI_PYBIND_INIT_EX_KWARGS_##className(__VA_ARGS__) \ OMNIUI_PYBIND_INIT_EX_END_KWARGS_##className(__VA_ARGS__) \ OMNIUI_PYBIND_INIT_EX_FINAL_##className(__VA_ARGS__) \ return result; // clang-format on // Expands to the body of the method that is abstract in the base class. This method redirects the call to python // bindings. #define OMNIUI_PYBIND_ABSTRACT_METHOD(TYPE, PARENT, PYNAME) \ try \ { \ PYBIND11_OVERLOAD_PURE_NAME(TYPE, PARENT, #PYNAME, 0); \ } \ catch (const pybind11::error_already_set& e) \ { \ CARB_LOG_ERROR("%s", e.what()); \ } \ catch (const std::runtime_error& e) \ { \ CARB_LOG_ERROR("%s", e.what()); \ } #define OMNIUI_PYBIND_ABSTRACT_METHOD_VA(TYPE, PARENT, PYNAME, ...) \ try \ { \ PYBIND11_OVERLOAD_PURE_NAME(TYPE, PARENT, #PYNAME, 0, __VA_ARGS__); \ } \ catch (const pybind11::error_already_set& e) \ { \ CARB_LOG_ERROR("%s", e.what()); \ } \ catch (const std::runtime_error& e) \ { \ CARB_LOG_ERROR("%s", e.what()); \ } #define OMNIUI_PYBIND_OVERLOAD(TYPE, PARENT, CNAME, PYNAME) \ try \ { \ PYBIND11_OVERLOAD_NAME(TYPE, PARENT, #PYNAME, CNAME); \ } \ catch (const pybind11::error_already_set& e) \ { \ CARB_LOG_ERROR("%s", e.what()); \ } \ catch (const std::runtime_error& e) \ { \ CARB_LOG_ERROR("%s", e.what()); \ } #define OMNIUI_PYBIND_OVERLOAD_VA(TYPE, PARENT, CNAME, PYNAME, ...) \ try \ { \ PYBIND11_OVERLOAD_INT(PYBIND11_TYPE(TYPE), PYBIND11_TYPE(PARENT), #PYNAME, __VA_ARGS__); \ } \ catch (const pybind11::error_already_set& e) \ { \ CARB_LOG_ERROR("%s", e.what()); \ } \ catch (const std::runtime_error& e) \ { \ CARB_LOG_ERROR("%s", e.what()); \ } \ return CNAME(__VA_ARGS__); #define OMNIUI_PYBIND_CLASS_DOC(className) OMNIUI_PYBIND_DOC_##className #define OMNIUI_PYBIND_CONSTRUCTOR_DOC(className, constructor) \ BOOST_PP_CAT(OMNIUI_PYBIND_DOC_, BOOST_PP_CAT(className, BOOST_PP_CAT(_, constructor))) \ "\n `kwargs : dict`\n See below\n\n### Keyword Arguments:\n" OMNIUI_PYBIND_KWARGS_DOC_##className #define OMNIUI_PYBIND_DEF_CALLBACK(python_name, cpp_class, cpp_name) \ def("set_" #python_name "_fn", wrapCallbackSetter(&cpp_class::set##cpp_name##Fn), arg("fn"), \ OMNIUI_PYBIND_DOC_##cpp_class##_##cpp_name) \ .def("has_" #python_name "_fn", &cpp_class::has##cpp_name##Fn, OMNIUI_PYBIND_DOC_##cpp_class##_##cpp_name) \ .def("call_" #python_name "_fn", &cpp_class::call##cpp_name##Fn, OMNIUI_PYBIND_DOC_##cpp_class##_##cpp_name) OMNIUI_NAMESPACE_OPEN_SCOPE /** * Assuming std::function will call into python code this function makes it safe. * It wraps it into try/catch, acquires GIL lock and log errors. */ template <typename ReturnT, typename... ArgsT> ReturnT callPythonCodeSafe(const std::function<ReturnT(ArgsT...)>& fn, ArgsT... args) { using namespace pybind11; try { if (fn) { gil_scoped_acquire gilLock; return fn(args...); } } catch (const error_already_set& e) { CARB_LOG_ERROR("%s", e.what()); } catch (const std::runtime_error& e) { CARB_LOG_ERROR("%s", e.what()); } return ReturnT(); } // This is deprecated function, use the one below instead. template <typename ReturnT, typename... Args> auto wrapPythonCallback(const std::function<ReturnT(Args...)>& c) -> std::function<ReturnT(Args...)> { return [=](Args... args) -> ReturnT { return callPythonCodeSafe<ReturnT, Args...>(c, args...); }; } template <typename ReturnT, typename... Args> std::function<ReturnT(Args...)> wrapPythonCallback(std::function<ReturnT(Args...)>&& c) { return [c{ std::forward<std::function<ReturnT(Args...)>>(c) }](Args... args) -> ReturnT { return callPythonCodeSafe<ReturnT, Args...>(c, args...); }; } /** * @brief Should be used when binding the callback setter, and it will lock GIL when calling the python callback. */ template <typename ClassT, typename R, typename... Args> auto wrapCallbackSetter(void (ClassT::*MethodT)(std::function<R(Args...)>)) { return [MethodT](ClassT& self, std::function<R(Args...)> fn) { (self.*MethodT)(wrapPythonCallback(std::move(fn))); }; } /** * @brief Convert pybind11::args to vector */ template <typename T, typename U = T> std::vector<T> argsToVector(pybind11::args args) { std::vector<T> result; // TODO: reserve for (const auto& it : args) { if (pybind11::isinstance<U>(it)) { result.push_back(it.cast<T>()); } else { CARB_LOG_WARN("Omni::UI Args: argument has wrong type"); } } return result; } #define OMNIUI_PROTECT_PYBIND11_OBJECT(className, pythonClassName) \ /* Storing shared_ptrs to Python-derived instances for later execution causes virtual functions to fail if the */ \ /* Python instance has subsequently been destroyed. This is the workaround described in */ \ /* https://github.com/pybind/pybind11/issues/1546 */ \ namespace pybind11 \ { \ namespace detail \ { \ \ template <> \ class type_caster<std::shared_ptr<className>> \ { \ PYBIND11_TYPE_CASTER(std::shared_ptr<className>, _(#pythonClassName)); \ \ using BaseCaster = copyable_holder_caster<className, std::shared_ptr<className>>; \ \ bool load(pybind11::handle src, bool b) \ { \ BaseCaster bc; \ bool success = bc.load(src, b); \ if (!success) \ { \ return false; \ } \ \ auto py_obj = pybind11::reinterpret_borrow<pybind11::object>(src); \ auto base_ptr = static_cast<std::shared_ptr<className>>(bc); \ \ /* Construct a shared_ptr to the py::object */ \ auto py_obj_ptr = std::shared_ptr<object>{ new object{ py_obj }, [](object* py_object_ptr) \ { \ /* It's possible that when the shared_ptr dies we won't */ \ /* have the gil (if the last holder is in a non-Python */ \ /* thread, so we make sure to acquire it in the deleter. */ \ gil_scoped_acquire gil; \ delete py_object_ptr; \ } }; \ \ value = std::shared_ptr<className>(py_obj_ptr, base_ptr.get()); \ return true; \ } \ \ static handle cast(std::shared_ptr<className> base, return_value_policy rvp, handle h) \ { \ return BaseCaster::cast(base, rvp, h); \ } \ }; \ \ template <> \ struct is_holder_type<className, std::shared_ptr<className>> : std::true_type \ { \ }; \ } \ } OMNIUI_NAMESPACE_CLOSE_SCOPE
25,117
C
70.561253
121
0.315006
omniverse-code/kit/include/omni/ui/bind/DocButton.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Button \ "The Button widget provides a command button.\n" \ "The command button, is perhaps the most commonly used widget in any graphical user interface. Click a button to execute a command. It is rectangular and typically displays a text label describing its action.\n" #define OMNIUI_PYBIND_DOC_Button_setComputedContentWidth \ "Reimplemented the method to indicate the width hint that represents the preferred size of the widget. Currently this widget can't be smaller than the size of the text.\n" #define OMNIUI_PYBIND_DOC_Button_setComputedContentHeight \ "Reimplemented the method to indicate the height hint that represents the preferred size of the widget. Currently this widget can't be smaller than the size of the text.\n" #define OMNIUI_PYBIND_DOC_Button_onStyleUpdated \ "Reimplemented. Something happened with the style or with the parent style. We need to gerenerate the cache.\n" #define OMNIUI_PYBIND_DOC_Button_cascadeStyle \ "Reimplemented. It's called when the style is changed. It should be propagated to children to make the style cached and available to children.\n" #define OMNIUI_PYBIND_DOC_Button_text "This property holds the button's text.\n" #define OMNIUI_PYBIND_DOC_Button_imageUrl "This property holds the button's optional image URL.\n" #define OMNIUI_PYBIND_DOC_Button_imageWidth \ "This property holds the width of the image widget. Do not use this function to find the width of the image.\n" #define OMNIUI_PYBIND_DOC_Button_imageHeight \ "This property holds the height of the image widget. Do not use this function to find the height of the image.\n" #define OMNIUI_PYBIND_DOC_Button_spacing "Sets a non-stretchable space in points between image and text.\n" #define OMNIUI_PYBIND_DOC_Button_Button \ "Construct a button with a text on it.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `text :`\n" \ " The text for the button to use.\n"
3,695
C
63.842104
215
0.498512
omniverse-code/kit/include/omni/ui/bind/DocLabel.h
// Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Label \ "The Label widget provides a text to display.\n" \ "Label is used for displaying text. No additional to Widget user interaction functionality is provided.\n" #define OMNIUI_PYBIND_DOC_Label_setComputedContentWidth \ "Reimplemented the method to indicate the width hint that represents the preferred size of the widget. Currently this widget can't be smaller than the size of the text.\n" #define OMNIUI_PYBIND_DOC_Label_setComputedContentHeight \ "Reimplemented the method to indicate the height hint that represents the preferred size of the widget. Currently this widget can't be smaller than the size of the text.\n" #define OMNIUI_PYBIND_DOC_Label_onStyleUpdated \ "Reimplemented. Something happened with the style or with the parent style. We need to update the saved font.\n" #define OMNIUI_PYBIND_DOC_Label_exactContentWidth \ "Return the exact width of the content of this label. Computed content width is a size hint and may be bigger than the text in the label.\n" #define OMNIUI_PYBIND_DOC_Label_exactContentHeight \ "Return the exact height of the content of this label. Computed content height is a size hint and may be bigger than the text in the label.\n" #define OMNIUI_PYBIND_DOC_Label_text "This property holds the label's text.\n" #define OMNIUI_PYBIND_DOC_Label_wordWrap \ "This property holds the label's word-wrapping policy If this property is true then label text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. By default, word wrap is disabled.\n" #define OMNIUI_PYBIND_DOC_Label_elidedText \ "When the text of a big length has to be displayed in a small area, it can be useful to give the user a visual hint that not all text is visible. Label can elide text that doesn't fit in the area. When this property is true, Label elides the middle of the last visible line and replaces it with \"...\".\n" #define OMNIUI_PYBIND_DOC_Label_elidedTextStr \ "Customized elidedText string when elidedText is True, default is ...." \ #define OMNIUI_PYBIND_DOC_Label_hideTextAfterHash \ "Hide anything after a '##' string or not" \ #define OMNIUI_PYBIND_DOC_Label_alignment \ "This property holds the alignment of the label's contents. By default, the contents of the label are left-aligned and vertically-centered.\n" #define OMNIUI_PYBIND_DOC_Label_Label \ "Create a label with the given text.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `text :`\n" \ " The text for the label.\n"
4,682
C
72.171874
310
0.48334
omniverse-code/kit/include/omni/ui/bind/DocImage.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Image \ "The Image widget displays an image.\n" \ "The source of the image is specified as a URL using the source property. By default, specifying the width and height of the item causes the image to be scaled to that size. This behavior can be changed by setting the fill_mode property, allowing the image to be stretched or scaled instead. The property alignment controls where to align the scaled image.\n" #define OMNIUI_PYBIND_DOC_Image_onStyleUpdated "Reimplemented. Called when the style or the parent style is changed.\n" #define OMNIUI_PYBIND_DOC_Image_hasSourceUrl \ "Returns true if the image has non empty sourceUrl obtained through the property or the style.\n" #define OMNIUI_PYBIND_DOC_Image_sourceUrl \ "This property holds the image URL. It can be an\n" \ "omni:\n" \ "file:\n" #define OMNIUI_PYBIND_DOC_Image_alignment \ "This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the image is centered.\n" #define OMNIUI_PYBIND_DOC_Image_fillPolicy \ "Define what happens when the source image has a different size than the item.\n" #define OMNIUI_PYBIND_DOC_Image_pixelAligned \ "Prevents image blurring when it's placed to fractional position (like x=0.5, y=0.5)\n" #define OMNIUI_PYBIND_DOC_Image_progress "The progress of the image loading.\n" #define OMNIUI_PYBIND_DOC_Image_Image \ "Construct image with given url. If the url is empty, it gets the image URL from styling.\n"
2,793
C
59.739129
363
0.546724
omniverse-code/kit/include/omni/ui/bind/DocPixel.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Pixel \ "Pixel length is exact length in pixels.\n" \ "\n" #define OMNIUI_PYBIND_DOC_Pixel_Pixel "Construct Pixel.\n" #define OMNIUI_PYBIND_DOC_Pixel_resolve \ "Resolves the length value to a absolute value\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `absoluteFactor :`\n" \ " the unit multiplier\n" \ "the computed absolute value\n"
1,773
C
62.357141
120
0.343486
omniverse-code/kit/include/omni/ui/bind/BindIntDrag.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindIntSlider.h" #include "BindUtils.h" #include "DocIntDrag.h" #include "DocUIntDrag.h" // clang-format off #define OMNIUI_PYBIND_INIT_IntDrag \ OMNIUI_PYBIND_INIT_IntSlider \ OMNIUI_PYBIND_INIT_CAST(step, setStep, float) #define OMNIUI_PYBIND_INIT_UIntDrag \ OMNIUI_PYBIND_INIT_UIntSlider \ OMNIUI_PYBIND_INIT_CAST(step, setStep, float) #define OMNIUI_PYBIND_KWARGS_DOC_IntDrag \ "\n `step : `\n " \ OMNIUI_PYBIND_DOC_IntDrag_step \ OMNIUI_PYBIND_KWARGS_DOC_IntSlider #define OMNIUI_PYBIND_KWARGS_DOC_UIntDrag \ "\n `step : `\n " \ OMNIUI_PYBIND_DOC_UIntDrag_step \ OMNIUI_PYBIND_KWARGS_DOC_UIntSlider // clang-format on
1,992
C
55.942856
120
0.421185
omniverse-code/kit/include/omni/ui/bind/DocSimpleListModel.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_SimpleListModel \ "A very simple model that holds the the root model and the flat list of models.\n" \ "\n" #define OMNIUI_PYBIND_DOC_SimpleListModel_getItemChildren \ "Reimplemented. Returns the vector of items that are nested to the given parent item.\n" #define OMNIUI_PYBIND_DOC_SimpleListModel_appendChildItem \ "Reimplemented. Creates a new item from the value model and appends it to the list of the children of the given item.\n" #define OMNIUI_PYBIND_DOC_SimpleListModel_removeItem "Reimplemented. Removes the item from the model.\n" #define OMNIUI_PYBIND_DOC_SimpleListModel_getItemValueModel \ "Reimplemented. Get the value model associated with this item.\n" #define OMNIUI_PYBIND_DOC_SimpleListModel_SimpleListModel \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `rootModel :`\n" \ " The model that will be returned when querying the root item.\n" \ "\n" \ " `models :`\n" \ " The list of all the value submodels of this model.\n"
2,628
C
63.12195
124
0.414764
omniverse-code/kit/include/omni/ui/bind/DocIntField.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_IntField \ "The IntField widget is a one-line text editor with a string model.\n" \ "\n" #define OMNIUI_PYBIND_DOC_IntField_IntField "Construct IntField.\n"
776
C
44.70588
120
0.643041
omniverse-code/kit/include/omni/ui/bind/Pybind.h
// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #ifdef _MSC_VER // WAR Pybind11 issue with VS2019+: https://github.com/pybind/pybind11/issues/3459 // Also: https://github.com/microsoft/onnxruntime/issues/9735 #include <corecrt.h> #endif #include <pybind11/functional.h> #include <pybind11/pybind11.h>
702
C
35.999998
82
0.782051
omniverse-code/kit/include/omni/ui/bind/BindOffsetLine.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindFreeShape.h" #include "BindUtils.h" #include "DocOffsetLine.h" // clang-format off #define OMNIUI_PYBIND_INIT_OffsetLine \ OMNIUI_PYBIND_INIT_FreeLine \ OMNIUI_PYBIND_INIT_CAST(offset, setOffset, float) \ OMNIUI_PYBIND_INIT_CAST(bound_offset, setBoundOffset, float) #define OMNIUI_PYBIND_KWARGS_DOC_OffsetLine \ "\n `offset : `\n " \ OMNIUI_PYBIND_DOC_OffsetLine_offset \ "\n `bound_offset : `\n " \ OMNIUI_PYBIND_DOC_OffsetLine_boundOffset \ OMNIUI_PYBIND_KWARGS_DOC_FreeLine // clang-format on
1,638
C
59.703701
120
0.455433
omniverse-code/kit/include/omni/ui/bind/BindIntSlider.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindAbstractSlider.h" #include "BindUtils.h" #include "DocCommonIntSlider.h" #include "DocIntSlider.h" #include "DocUIntSlider.h" // clang-format off #define OMNIUI_PYBIND_INIT_IntSlider \ OMNIUI_PYBIND_INIT_AbstractSlider \ OMNIUI_PYBIND_INIT_CAST(min, setMin, int64_t) \ OMNIUI_PYBIND_INIT_CAST(max, setMax, int64_t) #define OMNIUI_PYBIND_INIT_UIntSlider \ OMNIUI_PYBIND_INIT_AbstractSlider \ OMNIUI_PYBIND_INIT_CAST(min, setMin, uint64_t) \ OMNIUI_PYBIND_INIT_CAST(max, setMax, uint64_t) #define OMNIUI_PYBIND_KWARGS_DOC_IntSlider \ "\n `min : `\n " \ OMNIUI_PYBIND_DOC_CommonIntSlider_min \ "\n `max : `\n " \ OMNIUI_PYBIND_DOC_CommonIntSlider_max \ OMNIUI_PYBIND_KWARGS_DOC_Widget #define OMNIUI_PYBIND_KWARGS_DOC_UIntSlider \ OMNIUI_PYBIND_KWARGS_DOC_IntSlider // clang-format on
2,264
C
58.605262
120
0.427562
omniverse-code/kit/include/omni/ui/bind/DocContainer.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Container \ "The container is an abstract widget that can hold one or several child widgets.\n" \ "The user is allowed to add or replace child widgets. If the widget has multiple children internally (like Button) and the user doesn't have access to them, it's not necessary to use this class.\n" #define OMNIUI_PYBIND_DOC_Container_addChild \ "Adds widget to this container in a manner specific to the container. If it's allowed to have one sub-widget only, it will be overwriten.\n" #define OMNIUI_PYBIND_DOC_Container_clear "Removes the container items from the container.\n"
1,263
C
59.190473
201
0.659541
omniverse-code/kit/include/omni/ui/bind/BindWindowHandle.h
// Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "DocWindowHandle.h" #define OMNIUI_PYBIND_KWARGS_DOC_WindowHandle
529
C
36.85714
77
0.797732
omniverse-code/kit/include/omni/ui/bind/DocContainerScopeBase.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_ContainerScopeBase \ "Puts the given container to the top of the stack when this object is constructed. And removes this container when it's destructed.\n" \ "\n" #define OMNIUI_PYBIND_DOC_ContainerScopeBase_get "Returns the container it was created with.\n" #define OMNIUI_PYBIND_DOC_ContainerScopeBase_isValid \ "Checks if this object is valid. It's always valid untill it's invalidated. Once it's invalidated, there is no way to make it valid again.\n" #define OMNIUI_PYBIND_DOC_ContainerScopeBase_invalidate "Makes this object invalid.\n"
1,202
C
49.124998
145
0.674709
omniverse-code/kit/include/omni/ui/bind/BindMenuItem.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindMenuHelper.h" #include "BindUtils.h" #include "BindWidget.h" #include "DocMenuItem.h" // clang-format off #define OMNIUI_PYBIND_INIT_MenuItem \ OMNIUI_PYBIND_INIT_MenuHelper \ OMNIUI_PYBIND_INIT_Widget #define OMNIUI_PYBIND_KWARGS_DOC_MenuItem \ OMNIUI_PYBIND_KWARGS_DOC_MenuHelper \ OMNIUI_PYBIND_KWARGS_DOC_Widget // clang-format on
1,144
C
44.799998
120
0.554196
omniverse-code/kit/include/omni/ui/bind/BindEllipse.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindShape.h" #include "BindUtils.h" #include "DocEllipse.h" // clang-format off #define OMNIUI_PYBIND_INIT_Ellipse \ OMNIUI_PYBIND_INIT_Shape #define OMNIUI_PYBIND_KWARGS_DOC_Ellipse \ OMNIUI_PYBIND_KWARGS_DOC_Shape // clang-format on
872
C
38.681816
121
0.629587
omniverse-code/kit/include/omni/ui/bind/BindAbstractSlider.h
// Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindAbstractField.h" #include "BindUtils.h" #include "DocAbstractSlider.h" // clang-format off #define OMNIUI_PYBIND_INIT_AbstractSlider \ OMNIUI_PYBIND_INIT_AbstractField #define OMNIUI_PYBIND_KWARGS_DOC_AbstractSlider \ OMNIUI_PYBIND_KWARGS_DOC_AbstractField // clang-format on
900
C
41.90476
120
0.66
omniverse-code/kit/include/omni/ui/bind/DocSimpleIntModel.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_SimpleIntModel \ "A very simple Int model.\n" \ "\n"
706
C
49.499996
120
0.589235
omniverse-code/kit/include/omni/ui/bind/DocPercent.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Percent \ "Percent is the length in percents from the parent widget.\n" \ "\n" #define OMNIUI_PYBIND_DOC_Percent_Percent "Construct Percent.\n"
773
C
44.529409
120
0.6326
omniverse-code/kit/include/omni/ui/bind/DocRadioButton.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_RadioButton \ "RadioButton is the widget that allows the user to choose only one of a predefined set of mutually exclusive options.\n" \ "RadioButtons are arranged in collections of two or more with the class RadioCollection, which is the central component of the system and controls the behavior of all the RadioButtons in the collection.\n" #define OMNIUI_PYBIND_DOC_RadioButton_radioCollection "This property holds the button's text.\n" #define OMNIUI_PYBIND_DOC_RadioButton_RadioButton "Constructs RadioButton.\n"
1,098
C
53.949997
209
0.730419
omniverse-code/kit/include/omni/ui/bind/BindMenu.h
// Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindMenuHelper.h" #include "BindStack.h" #include "BindUtils.h" #include "DocMenu.h" // clang-format off #define OMNIUI_PYBIND_INIT_Menu \ OMNIUI_PYBIND_INIT_CALLBACK(shown_changed_fn, setShownChangedFn, void(const bool&)) \ OMNIUI_PYBIND_INIT_CAST(tearable, setTearable, bool) \ OMNIUI_PYBIND_INIT_CALLBACK(teared_changed_fn, setTearedChangedFn, void(const bool&)) \ OMNIUI_PYBIND_INIT_CALLBACK(on_build_fn, setOnBuildFn, void()) \ OMNIUI_PYBIND_INIT_MenuHelper \ OMNIUI_PYBIND_INIT_Stack #define OMNIUI_PYBIND_KWARGS_DOC_Menu \ "\n `tearable : bool`\n " \ OMNIUI_PYBIND_DOC_Menu_tearable \ "\n `shown_changed_fn : `\n " \ OMNIUI_PYBIND_DOC_Menu_shown \ "\n `teared_changed_fn : `\n " \ OMNIUI_PYBIND_DOC_Menu_teared \ "\n `on_build_fn : `\n " \ OMNIUI_PYBIND_DOC_Menu_OnBuild \ OMNIUI_PYBIND_KWARGS_DOC_MenuHelper \ OMNIUI_PYBIND_KWARGS_DOC_Stack // clang-format off
2,592
C
65.487178
120
0.38966
omniverse-code/kit/include/omni/ui/bind/DocColorWidget.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_ColorWidget \ "The ColorWidget widget is a button that displays the color from the item model and can open a picker window to change the color.\n" \ "\n" #define OMNIUI_PYBIND_DOC_ColorWidget_setComputedContentWidth \ "Reimplemented the method to indicate the width hint that represents the preferred size of the widget. Currently this widget can't be smaller than the size of the ColorWidget square.\n" #define OMNIUI_PYBIND_DOC_ColorWidget_setComputedContentHeight \ "Reimplemented the method to indicate the height hint that represents the preferred size of the widget. Currently this widget can't be smaller than the size of the ColorWidget square.\n" #define OMNIUI_PYBIND_DOC_ColorWidget_onModelUpdated \ "Reimplemented the method from ItemModelHelper that is called when the model is changed.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `item :`\n" \ " The item in the model that is changed. If it's NULL, the root is chaged.\n" #define OMNIUI_PYBIND_DOC_ColorWidget_ColorWidget "Construct ColorWidget.\n"
2,386
C
67.199998
190
0.49036
omniverse-code/kit/include/omni/ui/bind/BindFrame.h
// Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindContainer.h" #include "BindUtils.h" #include "DocFrame.h" #include "DocRasterHelper.h" // clang-format off #define OMNIUI_PYBIND_INIT_Frame \ OMNIUI_PYBIND_INIT_Container \ OMNIUI_PYBIND_INIT_CAST(horizontal_clipping, setHorizontalClipping, bool) \ OMNIUI_PYBIND_INIT_CAST(vertical_clipping, setVerticalClipping, bool) \ OMNIUI_PYBIND_INIT_CAST(separate_window, setSeparateWindow, bool) \ OMNIUI_PYBIND_INIT_CAST(raster_policy, setRasterPolicy, RasterPolicy) \ OMNIUI_PYBIND_INIT_CALLBACK(build_fn, setBuildFn, void()) #define OMNIUI_PYBIND_KWARGS_DOC_Frame \ "\n `horizontal_clipping : `\n " \ OMNIUI_PYBIND_DOC_Frame_horizontalClipping \ "\n `vertical_clipping : `\n " \ OMNIUI_PYBIND_DOC_Frame_verticalClipping \ "\n `separate_window : `\n " \ OMNIUI_PYBIND_DOC_Frame_separateWindow \ "\n `raster_policy : `\n " \ OMNIUI_PYBIND_DOC_RasterHelper_rasterPolicy \ "\n `build_fn : `\n " \ OMNIUI_PYBIND_DOC_Frame_Build \ OMNIUI_PYBIND_KWARGS_DOC_Container // clang-format on
2,753
C
71.473682
120
0.40247
omniverse-code/kit/include/omni/ui/bind/BindHGrid.h
// Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindGrid.h" #include "BindUtils.h" #include "DocHGrid.h" #define OMNIUI_PYBIND_INIT_HGrid OMNIUI_PYBIND_INIT_Grid #define OMNIUI_PYBIND_KWARGS_DOC_HGrid OMNIUI_PYBIND_KWARGS_DOC_Grid
647
C
37.117645
77
0.79289
omniverse-code/kit/include/omni/ui/bind/DocSeparator.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Separator \ "The Separator class provides blank space.\n" \ "Normally, it's used to create separator line in the UI elements\n" #define OMNIUI_PYBIND_DOC_Separator_cascadeStyle \ "It's called when the style is changed. It should be propagated to children to make the style cached and available to children.\n" #define OMNIUI_PYBIND_DOC_Separator_Separator "Construct Separator.\n"
1,100
C
51.428569
134
0.619091
omniverse-code/kit/include/omni/ui/bind/BindComboBox.h
// Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindUtils.h" #include "BindWidget.h" #include "DocComboBox.h" // clang-format off #define OMNIUI_PYBIND_INIT_ComboBox \ OMNIUI_PYBIND_INIT_Widget \ OMNIUI_PYBIND_INIT_CAST(arrow_only, setArrowOnly, bool) #define OMNIUI_PYBIND_KWARGS_DOC_ComboBox \ "\n `arrow_only : bool`\n " \ OMNIUI_PYBIND_DOC_ComboBox_arrowOnly \ OMNIUI_PYBIND_KWARGS_DOC_Widget // clang-format on
1,266
C
51.791665
120
0.511058
omniverse-code/kit/include/omni/ui/bind/BindArrowHelper.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindShape.h" #include "BindUtils.h" #include "DocArrowHelper.h" // clang-format off #define OMNIUI_PYBIND_INIT_ArrowHelper \ OMNIUI_PYBIND_INIT_CAST(begin_arrow_width, setBeginArrowWidth, float) \ OMNIUI_PYBIND_INIT_CAST(begin_arrow_height, setBeginArrowHeight, float) \ OMNIUI_PYBIND_INIT_CAST(begin_arrow_type, setBeginArrowType, ArrowHelper::ArrowType) \ OMNIUI_PYBIND_INIT_CAST(end_arrow_width, setEndArrowWidth, float) \ OMNIUI_PYBIND_INIT_CAST(end_arrow_height, setEndArrowHeight, float) \ OMNIUI_PYBIND_INIT_CAST(end_arrow_type, setEndArrowType, ArrowHelper::ArrowType) #define OMNIUI_PYBIND_KWARGS_DOC_ArrowHelper \ "\n `arrow : `\n " \ OMNIUI_PYBIND_DOC_ArrowHelper_beginArrowWidth \ OMNIUI_PYBIND_DOC_ArrowHelper_beginArrowHeight \ OMNIUI_PYBIND_DOC_ArrowHelper_beginArrowType \ OMNIUI_PYBIND_DOC_ArrowHelper_endArrowWidth \ OMNIUI_PYBIND_DOC_ArrowHelper_endArrowHeight \ OMNIUI_PYBIND_DOC_ArrowHelper_endArrowType // clang-format on
2,361
C
70.575755
127
0.47734
omniverse-code/kit/include/omni/ui/bind/DocIntSlider.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_IntSlider \ "The slider is the classic widget for controlling a bounded value. It lets the user move a slider handle along a horizontal groove and translates the handle's position into an integer value within the legal range.\n" \ "\n" #define OMNIUI_PYBIND_DOC_IntSlider_IntSlider \ "Constructs IntSlider.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `model :`\n" \ " The widget's model. If the model is not assigned, the default model is created.\n"
1,855
C
76.33333
222
0.381132
omniverse-code/kit/include/omni/ui/bind/DocSimpleBoolModel.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_SimpleBoolModel \ "A very simple bool model.\n" \ "\n"
706
C
49.499996
120
0.592068
omniverse-code/kit/include/omni/ui/bind/BindInvisibleButton.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindWidget.h" #include "DocInvisibleButton.h" #define OMNIUI_PYBIND_INIT_InvisibleButton \ OMNIUI_PYBIND_INIT_Widget OMNIUI_PYBIND_INIT_CALLBACK(clicked_fn, setClickedFn, void()) // clang-format off #define OMNIUI_PYBIND_KWARGS_DOC_InvisibleButton \ "\n `clicked_fn : Callable[[], None]`\n " \ OMNIUI_PYBIND_DOC_InvisibleButton_Clicked \ OMNIUI_PYBIND_KWARGS_DOC_Widget // clang-format on
1,161
C
51.818179
120
0.575366
omniverse-code/kit/include/omni/ui/bind/DocPlot.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Plot \ "The Plot widget provides a line/histogram to display.\n" \ "\n" #define OMNIUI_PYBIND_DOC_Plot_Type "This type is used to determine the type of the image.\n" #define OMNIUI_PYBIND_DOC_Plot_setComputedContentHeight \ "Reimplemented the method to indicate the height hint that represents the preferred size of the widget. Currently this widget can't be smaller than 1 pixel.\n" #define OMNIUI_PYBIND_DOC_Plot_setDataProviderFn "Sets the function that will be called when when data required.\n" #define OMNIUI_PYBIND_DOC_Plot_setData "Sets the image data value.\n" #define OMNIUI_PYBIND_DOC_Plot_type \ "This property holds the type of the image, can only be line or histogram. By default, the type is line.\n" #define OMNIUI_PYBIND_DOC_Plot_scaleMin "This property holds the min scale values. By default, the value is FLT_MAX.\n" #define OMNIUI_PYBIND_DOC_Plot_scaleMax "This property holds the max scale values. By default, the value is FLT_MAX.\n" #define OMNIUI_PYBIND_DOC_Plot_valueOffset "This property holds the value offset. By default, the value is 0.\n" #define OMNIUI_PYBIND_DOC_Plot_valueStride \ "This property holds the stride to get value list. By default, the value is 1.\n" #define OMNIUI_PYBIND_DOC_Plot_title "This property holds the title of the image.\n" #define OMNIUI_PYBIND_DOC_Plot_Plot \ "Construct Plot.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `type :`\n" \ " The type of the image, can be line or histogram.\n" \ "\n" \ " `scaleMin :`\n" \ " The minimal scale value.\n" \ "\n" \ " `scaleMax :`\n" \ " The maximum scale value.\n" \ "\n" \ " `valueList :`\n" \ " The list of values to draw the image.\n"
4,161
C
62.060605
163
0.379236
omniverse-code/kit/include/omni/ui/bind/DocItemModelHelper.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_ItemModelHelper \ "The ItemModelHelper class provides the basic functionality for item widget classes.\n" #define OMNIUI_PYBIND_DOC_ItemModelHelper_onModelUpdated \ "Called by the model when the model value is changed. The class should react to the changes.\n" \ "\n" \ "\n" \ "### Arguments:\n" \ "\n" \ " `item :`\n" \ " The item in the model that is changed. If it's NULL, the root is chaged.\n" #define OMNIUI_PYBIND_DOC_ItemModelHelper_setModel "Set the current model.\n" #define OMNIUI_PYBIND_DOC_ItemModelHelper_getModel "Returns the current model.\n"
1,770
C
60.068963
120
0.449718
omniverse-code/kit/include/omni/ui/bind/BindLength.h
// Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindUtils.h" #include "DocFraction.h" #include "DocLength.h" #include "DocPercent.h" #include "DocPixel.h" #define OMNIUI_PYBIND_INIT_Length #define OMNIUI_PYBIND_KWARGS_DOC_Length #define OMNIUI_PYBIND_INIT_Percent OMNIUI_PYBIND_INIT_Length #define OMNIUI_PYBIND_KWARGS_DOC_Percent OMNIUI_PYBIND_KWARGS_DOC_Length #define OMNIUI_PYBIND_INIT_Pixel OMNIUI_PYBIND_INIT_Length #define OMNIUI_PYBIND_KWARGS_DOC_Pixel OMNIUI_PYBIND_KWARGS_DOC_Length #define OMNIUI_PYBIND_INIT_Fraction OMNIUI_PYBIND_INIT_Length #define OMNIUI_PYBIND_KWARGS_DOC_Fraction OMNIUI_PYBIND_KWARGS_DOC_Length
1,048
C
36.464284
77
0.803435
omniverse-code/kit/include/omni/ui/bind/DocStyleStore.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_StyleStore \ "A common template for indexing the style properties of the specific types.\n" \ "\n" #define OMNIUI_PYBIND_DOC_StyleStore_store "Save the color by name.\n" #define OMNIUI_PYBIND_DOC_StyleStore_get "Return the color by index.\n" #define OMNIUI_PYBIND_DOC_StyleStore_find "Return the index of the color with specific name.\n"
951
C
40.391303
120
0.675079
omniverse-code/kit/include/omni/ui/bind/DocRasterPolicy.h
// Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_RasterPolicy \ "Used to set the rasterization behaviour.\n" #define OMNIUI_PYBIND_DOC_RasterPolicy_eNever \ "Do not rasterize the widget at any time.\n" #define OMNIUI_PYBIND_DOC_RasterPolicy_eOnDemand \ "Rasterize the widget as soon as possible and always use the rasterized version. This means that the widget will only be updated when the user called invalidateRaster.\n" #define OMNIUI_PYBIND_DOC_RasterPolicy_eAuto \ "Automatically determine whether to rasterize the widget based on performance considerations. If necessary, the widget will be rasterized and updated when its content changes.\n"
1,399
C
54.999998
182
0.620443
omniverse-code/kit/include/omni/ui/bind/DocCircle.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Circle \ "The Circle widget provides a colored circle to display.\n" \ "\n" #define OMNIUI_PYBIND_DOC_Circle_setComputedContentWidth \ "Reimplemented the method to indicate the width hint that represents the preferred size of the widget. when the circle is in fixed mode it can't be smaller than the radius.\n" #define OMNIUI_PYBIND_DOC_Circle_setComputedContentHeight \ "Reimplemented the method to indicate the height hint that represents the preferred size of the widget. when the circle is in fixed mode it can't be smaller than the radius.\n" #define OMNIUI_PYBIND_DOC_Circle_radius \ "This property holds the radius of the circle when the fill policy is eFixed or eFixedCrop. By default, the circle radius is 0.\n" #define OMNIUI_PYBIND_DOC_Circle_alignment \ "This property holds the alignment of the circle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the circle is centered.\n" #define OMNIUI_PYBIND_DOC_Circle_arc \ "This property is the way to draw a half or a quarter of the circle. When it's eLeft, only left side of the circle is rendered. When it's eLeftTop, only left top quarter is rendered.\n" #define OMNIUI_PYBIND_DOC_Circle_sizePolicy \ "Define what happens when the source image has a different size than the item.\n" #define OMNIUI_PYBIND_DOC_Circle_Circle "Constructs Circle.\n"
2,437
C
58.463413
189
0.589659
omniverse-code/kit/include/omni/ui/bind/DocFrame.h
// Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Frame \ "The Frame is a widget that can hold one child widget.\n" \ "Frame is used to crop the contents of a child widget or to draw small widget in a big view. The child widget must be specified with addChild().\n" #define OMNIUI_PYBIND_DOC_Frame_addChild \ "Reimplemented adding a widget to this Frame. The Frame class can not contain multiple widgets. The widget overrides.\n" #define OMNIUI_PYBIND_DOC_Frame_clear "Reimplemented removing all the child widgets from this Stack.\n" #define OMNIUI_PYBIND_DOC_Frame_setComputedContentWidth \ "Reimplemented the method to indicate the width hint that represents the preferred size of the widget. Currently this widget can't be smaller than the minimal size of the child widgets.\n" #define OMNIUI_PYBIND_DOC_Frame_setComputedContentHeight \ "Reimplemented the method to indicate the height hint that represents the preferred size of the widget. Currently this widget can't be smaller than the minimal size of the child widgets.\n" #define OMNIUI_PYBIND_DOC_Frame_cascadeStyle \ "It's called when the style is changed. It should be propagated to children to make the style cached and available to children.\n" #define OMNIUI_PYBIND_DOC_Frame_forceRasterDirty "Next frame the content will be forced to re-bake.\n" #define OMNIUI_PYBIND_DOC_Frame_Build \ "Set the callback that will be called once the frame is visible and the content of the callback will override the frame child. It's useful for lazy load.\n" #define OMNIUI_PYBIND_DOC_Frame_rebuild \ "After this method is called, the next drawing cycle build_fn will be called again to rebuild everything.\n" #define OMNIUI_PYBIND_DOC_Frame_setVisiblePreviousFrame "Change dirty bits when the visibility is changed.\n" #define OMNIUI_PYBIND_DOC_Frame_horizontalClipping \ "When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for horizontal direction.\n" #define OMNIUI_PYBIND_DOC_Frame_verticalClipping \ "When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for vertial direction.\n" #define OMNIUI_PYBIND_DOC_Frame_separateWindow \ "A special mode where the child is placed to the transparent borderless window. We need it to be able to place the UI to the exact stacking order between other windows.\n" #define OMNIUI_PYBIND_DOC_Frame_Frame "Constructs Frame.\n"
3,749
C
59.48387
193
0.612963
omniverse-code/kit/include/omni/ui/bind/DocCallback.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Callback \ "Callback containers that is used with OMNIUI_CALLBACK macro. It keeps only one function, but it's possible to set up another function called when the main one is replaced.\n" \ "\n"
828
C
58.214282
181
0.640097
omniverse-code/kit/include/omni/ui/bind/DocMenuDelegate.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_MenuDelegate \ "MenuDelegate is used to generate widgets that represent the menu item.\n" \ "\n" #define OMNIUI_PYBIND_DOC_MenuDelegate_MenuDelegate "Constructor.\n" #define OMNIUI_PYBIND_DOC_MenuDelegate_buildItem "This method must be reimplemented to generate custom item.\n" #define OMNIUI_PYBIND_DOC_MenuDelegate_buildTitle "This method must be reimplemented to generate custom title.\n" #define OMNIUI_PYBIND_DOC_MenuDelegate_buildStatus \ "This method must be reimplemented to generate custom widgets on the bottom of the window.\n" #define OMNIUI_PYBIND_DOC_MenuDelegate_OnBuildItem "Called to create a new item.\n" #define OMNIUI_PYBIND_DOC_MenuDelegate_OnBuildTitle "Called to create a new title.\n" #define OMNIUI_PYBIND_DOC_MenuDelegate_OnBuildStatus "Called to create a new widget on the bottom of the window.\n" #define OMNIUI_PYBIND_DOC_MenuDelegate_propagate \ "Determine if Menu children should use this delegate when they don't have the own one.\n" #define OMNIUI_PYBIND_DOC_MenuDelegate_getDefaultDelegate \ "Get the default delegate that is used when the menu doesn't have anything.\n" #define OMNIUI_PYBIND_DOC_MenuDelegate_setDefaultDelegate \ "Set the default delegate to use it when the item doesn't have a delegate.\n" #define OMNIUI_PYBIND_DOC_MenuDelegate__siblingsHaveHotkeyText \ "Return true if at least one of the siblings have the hotkey text.\n" #define OMNIUI_PYBIND_DOC_MenuDelegate__siblingsHaveCheckable \ "Return true if at least one of the siblings is checkable.\n"
2,534
C
44.267856
120
0.626677
omniverse-code/kit/include/omni/ui/bind/DocTriangle.h
// Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #define OMNIUI_PYBIND_DOC_Triangle \ "The Triangle widget provides a colored triangle to display.\n" \ "\n" #define OMNIUI_PYBIND_DOC_Triangle_alignment \ "This property holds the alignment of the triangle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop.\ By default, the triangle is centered.\n" #define OMNIUI_PYBIND_DOC_Triangle_Triangle "Constructs Triangle.\n"
1,068
C
47.590907
122
0.623596
omniverse-code/kit/include/omni/ui/bind/BindWindow.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindUtils.h" #include "DocWindow.h" #include <omni/ui/bind/Pybind.h> #define OMNIUI_PYBIND_INIT_Window \ OMNIUI_PYBIND_INIT_CAST(flags, setFlags, Window::Flags) \ OMNIUI_PYBIND_INIT_CAST(visible, setVisible, bool) \ OMNIUI_PYBIND_INIT_CAST(title, setTitle, std::string) \ OMNIUI_PYBIND_INIT_CAST(padding_x, setPaddingX, float) \ OMNIUI_PYBIND_INIT_CAST(padding_y, setPaddingY, float) \ OMNIUI_PYBIND_INIT_CAST(width, setWidth, float) \ OMNIUI_PYBIND_INIT_CAST(height, setHeight, float) \ OMNIUI_PYBIND_INIT_CAST(position_x, setPositionX, float) \ OMNIUI_PYBIND_INIT_CAST(position_y, setPositionY, float) \ OMNIUI_PYBIND_INIT_CAST(auto_resize, setAutoResize, bool) \ OMNIUI_PYBIND_INIT_CAST(noTabBar, setNoTabBar, bool) \ OMNIUI_PYBIND_INIT_CAST(exclusive_keyboard, setExclusiveKeyboard, bool) \ OMNIUI_PYBIND_INIT_CAST(detachable, setDetachable, bool) \ OMNIUI_PYBIND_INIT_CAST(raster_policy, setRasterPolicy, RasterPolicy) \ OMNIUI_PYBIND_INIT_CALLBACK(width_changed_fn, setWidthChangedFn, void(const float&)) \ OMNIUI_PYBIND_INIT_CALLBACK(height_changed_fn, setHeightChangedFn, void(const float&)) \ OMNIUI_PYBIND_INIT_CALLBACK(visibility_changed_fn, setVisibilityChangedFn, void(bool)) // clang-format off #define OMNIUI_PYBIND_KWARGS_DOC_Window \ "\n `flags : `\n " \ OMNIUI_PYBIND_DOC_Window_flags \ "\n `visible : `\n " \ OMNIUI_PYBIND_DOC_Window_visible \ "\n `title : `\n " \ OMNIUI_PYBIND_DOC_Window_title \ "\n `padding_x : `\n " \ OMNIUI_PYBIND_DOC_Window_paddingX \ "\n `padding_y : `\n " \ OMNIUI_PYBIND_DOC_Window_paddingY \ "\n `width : `\n " \ OMNIUI_PYBIND_DOC_Window_width \ "\n `height : `\n " \ OMNIUI_PYBIND_DOC_Window_heigh \ "\n `position_x : `\n " \ OMNIUI_PYBIND_DOC_Window_positionX \ "\n `position_y : `\n " \ OMNIUI_PYBIND_DOC_Window_positionY \ "\n `auto_resize : `\n " \ OMNIUI_PYBIND_DOC_Window_autoResize \ "\n `noTabBar : `\n " \ OMNIUI_PYBIND_DOC_Window_noTabBar \ "\n `raster_policy : `\n " \ OMNIUI_PYBIND_DOC_Window_getRasterPolicy \ "\n `width_changed_fn : `\n " \ OMNIUI_PYBIND_DOC_Window_width \ "\n `height_changed_fn : `\n " \ OMNIUI_PYBIND_DOC_Window_heigh \ "\n `visibility_changed_fn : `\n " \ OMNIUI_PYBIND_DOC_Window_visible // clang-format on
6,389
C
92.970587
120
0.306308
omniverse-code/kit/include/omni/ui/bind/BindCanvasFrame.h
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // NVIDIA CORPORATION and its licensors retain all intellectual property // and proprietary rights in and to this software, related documentation // and any modifications thereto. Any use, reproduction, disclosure or // distribution of this software and related documentation without an express // license agreement from NVIDIA CORPORATION is strictly prohibited. // #pragma once #include "BindFrame.h" #include "BindUtils.h" #include "DocCanvasFrame.h" // clang-format off #define OMNIUI_PYBIND_INIT_CanvasFrame \ OMNIUI_PYBIND_INIT_Frame \ OMNIUI_PYBIND_INIT_CAST(pan_x, setPanX, float) \ OMNIUI_PYBIND_INIT_CAST(pan_y, setPanY, float) \ OMNIUI_PYBIND_INIT_CAST(zoom, setZoom, float) \ OMNIUI_PYBIND_INIT_CAST(zoom_min, setZoomMin, float) \ OMNIUI_PYBIND_INIT_CAST(zoom_max, setZoomMax, float) \ OMNIUI_PYBIND_INIT_CAST(compatibility, setCompatibility, bool) \ OMNIUI_PYBIND_INIT_CALLBACK(pan_x_changed_fn, setPanXChangedFn, void(float)) \ OMNIUI_PYBIND_INIT_CALLBACK(pan_y_changed_fn, setPanYChangedFn, void(float)) \ OMNIUI_PYBIND_INIT_CALLBACK(zoom_changed_fn, setZoomChangedFn, void(float)) \ OMNIUI_PYBIND_INIT_CAST(smooth_zoom, setSmoothZoom, bool) \ OMNIUI_PYBIND_INIT_CAST(draggable, setDraggable, bool) #define OMNIUI_PYBIND_KWARGS_DOC_CanvasFrame \ "\n `pan_x : `\n " \ OMNIUI_PYBIND_DOC_CanvasFrame_panX \ "\n `pan_y : `\n " \ OMNIUI_PYBIND_DOC_CanvasFrame_panY \ "\n `zoom : `\n " \ OMNIUI_PYBIND_DOC_CanvasFrame_zoomMin \ "\n `zoom_min : `\n " \ OMNIUI_PYBIND_DOC_CanvasFrame_zoomMax \ "\n `zoom_max : `\n " \ OMNIUI_PYBIND_DOC_CanvasFrame_zoom \ "\n `compatibility : `\n " \ OMNIUI_PYBIND_DOC_CanvasFrame_compatibility \ "\n `pan_x_changed_fn : `\n " \ OMNIUI_PYBIND_DOC_CanvasFrame_panX \ "\n `pan_y_changed_fn : `\n " \ OMNIUI_PYBIND_DOC_CanvasFrame_panY \ "\n `zoom_changed_fn : `\n " \ OMNIUI_PYBIND_DOC_CanvasFrame_zoom \ "\n `draggable : `\n " \ OMNIUI_PYBIND_DOC_CanvasFrame_draggable \ OMNIUI_PYBIND_KWARGS_DOC_Frame // clang-format on
4,655
C
86.849055
120
0.324597