mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-18 09:51:18 -06:00
* Update add add documentation for `RenderableDistanceLabel` * Move distancelabel to `base` module and remove now empty `vislab` module * Add examples for `RenderableNodeLine` and `RenderableDistanceLabel` * Fix faultily formatted documentation ID for `RenderableNodeLine` * Make `RenderableDistanceLabel` unit use units from distanceconversion file And simplify how the different names for a unit are specified * Use new distanceUnitList() function for other classes that uses the units * Change default unit to correct option according to documentation * Make the text property readonly for `RenderableDistanceLabel` * Add property to specify the precision of the number distance label precision to docs * Add examples with different units and descriptors * Add docs description to `RenderableNodeLine` * Update name in one of the examples * Remove redundant switch cases * Apply suggestions from code review Co-authored-by: Ylva Selling <ylva.selling@gmail.com> --------- Co-authored-by: Ylva Selling <ylva.selling@gmail.com>
56 lines
3.0 KiB
C++
56 lines
3.0 KiB
C++
/*****************************************************************************************
|
|
* *
|
|
* OpenSpace *
|
|
* *
|
|
* Copyright (c) 2014-2025 *
|
|
* *
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
|
* software and associated documentation files (the "Software"), to deal in the Software *
|
|
* without restriction, including without limitation the rights to use, copy, modify, *
|
|
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
|
* permit persons to whom the Software is furnished to do so, subject to the following *
|
|
* conditions: *
|
|
* *
|
|
* The above copyright notice and this permission notice shall be included in all copies *
|
|
* or substantial portions of the Software. *
|
|
* *
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
|
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
|
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
|
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
|
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
|
****************************************************************************************/
|
|
|
|
#ifndef __OPENSPACE_MODULE_BASE___RENDERABLEDISTANCELABEL___H__
|
|
#define __OPENSPACE_MODULE_BASE___RENDERABLEDISTANCELABEL___H__
|
|
|
|
#include <modules/base/rendering/renderablelabel.h>
|
|
|
|
#include <openspace/properties/optionproperty.h>
|
|
#include <openspace/properties/scalar/intproperty.h>
|
|
#include <openspace/properties/stringproperty.h>
|
|
|
|
namespace openspace {
|
|
|
|
namespace documentation { struct Documentation; }
|
|
|
|
class RenderableDistanceLabel : public RenderableLabel {
|
|
public:
|
|
RenderableDistanceLabel(const ghoul::Dictionary& dictionary);
|
|
|
|
void update(const UpdateData& data) override;
|
|
static documentation::Documentation Documentation();
|
|
|
|
private:
|
|
properties::StringProperty _nodelineId;
|
|
properties::OptionProperty _distanceUnit;
|
|
properties::StringProperty _customUnitDescriptor;
|
|
properties::IntProperty _precision;
|
|
bool _errorThrown = false;
|
|
};
|
|
|
|
} // namespace openspace
|
|
|
|
#endif // __OPENSPACE_MODULE_BASE___RENDERABLEDISTANCELABEL___H__
|