This commit is contained in:
Alexander Bock
2017-12-12 00:30:38 -05:00
parent c321d76b3e
commit 0f0fb78a63
8 changed files with 66 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ return {
TextColor = { 0.3, 0.3, 0.8, 1.0 },
TextSize = 14.8,
TextMinSize = 10.0,
TextMaxSize = 200.0,
Unit = "pc"
},
GuiPath = "/Milky Way/Exoplanets"

View File

@@ -13,6 +13,7 @@ return {
DrawLabels = true,
TextSize = 14.7,
TextMinSize = 6.0,
TextMaxSize = 50.0,
Unit = "pc"
},
GuiPath = "/Milky Way/Stars"

View File

@@ -128,6 +128,13 @@ namespace {
"objects being rendered."
};
static const openspace::properties::Property::PropertyInfo LabelMaxSizeInfo = {
"TextMaxSize",
"Text Max Size",
"The maximum size (in pixels) of the text for the labels for the astronomical "
"objects being rendered."
};
static const openspace::properties::Property::PropertyInfo DrawElementsInfo = {
"DrawElements",
"Draw Elements",
@@ -247,6 +254,12 @@ documentation::Documentation RenderableBillboardsCloud::Documentation() {
Optional::Yes,
LabelMinSizeInfo.description
},
{
LabelMaxSizeInfo.identifier,
new DoubleVerifier,
Optional::Yes,
LabelMaxSizeInfo.description
},
{
ColorOptionInfo.identifier,
new StringListVerifier,
@@ -289,6 +302,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
)
, _textSize(TextSizeInfo, 8.0, 0.5, 24.0)
, _textMinSize(LabelMinSizeInfo, 8.0, 0.5, 24.0)
, _textMaxSize(LabelMaxSizeInfo, 500.0, 0.0, 1000.0)
, _drawElements(DrawElementsInfo, true)
, _drawLabels(DrawLabelInfo, false)
, _colorOption(ColorOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
@@ -467,6 +481,11 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
_textMinSize = static_cast<int>(dictionary.value<float>(LabelMinSizeInfo.identifier));
}
addProperty(_textMinSize);
if (dictionary.hasKey(LabelMaxSizeInfo.identifier)) {
_textMaxSize = static_cast<int>(dictionary.value<float>(LabelMaxSizeInfo.identifier));
}
addProperty(_textMaxSize);
}
}
@@ -504,7 +523,7 @@ void RenderableBillboardsCloud::initializeGL() {
_fontRenderer = std::unique_ptr<ghoul::fontrendering::FontRenderer>(
ghoul::fontrendering::FontRenderer::createProjectionSubjectText());
if (_font == nullptr) {
size_t _fontSize = 30;
size_t _fontSize = 50;
_font = OsEng.fontManager().font("Mono", static_cast<float>(_fontSize),
ghoul::fontrendering::FontManager::Outline::Yes, ghoul::fontrendering::FontManager::LoadGlyphs::No);
}
@@ -667,6 +686,7 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, const glm::
_textColor,
pow(10.0, _textSize.value()),
_textMinSize,
_textMaxSize,
modelViewProjectionMatrix,
orthoRight,
orthoUp,

View File

@@ -122,6 +122,7 @@ private:
properties::Vec4Property _textColor;
properties::FloatProperty _textSize;
properties::FloatProperty _textMinSize;
properties::FloatProperty _textMaxSize;
properties::BoolProperty _drawElements;
properties::BoolProperty _drawLabels;
properties::OptionProperty _colorOption;

View File

@@ -108,6 +108,13 @@ namespace {
"objects being rendered."
};
static const openspace::properties::Property::PropertyInfo LabelMaxSizeInfo = {
"TextMaxSize",
"Text Max Size",
"The maximum size (in pixels) of the text for the labels for the astronomical "
"objects being rendered."
};
static const openspace::properties::Property::PropertyInfo DrawElementsInfo = {
"DrawElements",
"Draw Elements",
@@ -207,6 +214,12 @@ documentation::Documentation RenderableDUMeshes::Documentation() {
Optional::Yes,
LabelMinSizeInfo.description
},
{
LabelMaxSizeInfo.identifier,
new IntVerifier,
Optional::Yes,
LabelMaxSizeInfo.description
},
{
TransformationMatrixInfo.identifier,
new Matrix4x4Verifier<double>,
@@ -232,6 +245,7 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
, _hasLabel(false)
, _labelDataIsDirty(true)
, _textMinSize(0)
, _textMaxSize(200)
, _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f)
, _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 64.f)
//, _pointColor(ColorInfo, glm::vec3(1.f, 0.4f, 0.2f), glm::vec3(0.f, 0.f, 0.f), glm::vec3(1.0f, 1.0f, 1.0f))
@@ -349,6 +363,10 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
if (dictionary.hasKey(LabelMinSizeInfo.identifier)) {
_textMinSize = static_cast<int>(dictionary.value<float>(LabelMinSizeInfo.identifier));
}
if (dictionary.hasKey(LabelMaxSizeInfo.identifier)) {
_textMaxSize = static_cast<int>(dictionary.value<float>(LabelMaxSizeInfo.identifier));
}
}
if (dictionary.hasKey(TransformationMatrixInfo.identifier)) {
@@ -523,6 +541,7 @@ void RenderableDUMeshes::renderLabels(const RenderData& data, const glm::dmat4&
_textColor,
pow(10.0, _textSize.value()),
_textMinSize,
_textMaxSize,
modelViewProjectionMatrix,
orthoRight,
orthoUp,

View File

@@ -124,6 +124,7 @@ private:
bool _labelDataIsDirty;
int _textMinSize;
int _textMaxSize;
properties::FloatProperty _alphaValue;
properties::FloatProperty _scaleFactor;

View File

@@ -108,6 +108,13 @@ namespace {
"objects being rendered."
};
static const openspace::properties::Property::PropertyInfo LabelMaxSizeInfo = {
"TextMaxSize",
"Text Max Size",
"The maximum size (in pixels) of the text for the labels for the astronomical "
"objects being rendered."
};
static const openspace::properties::Property::PropertyInfo DrawElementsInfo = {
"DrawElements",
"Draw Elements",
@@ -208,7 +215,13 @@ documentation::Documentation RenderablePlanesCloud::Documentation() {
new IntVerifier,
Optional::Yes,
LabelMinSizeInfo.description
},
},
{
LabelMaxSizeInfo.identifier,
new IntVerifier,
Optional::Yes,
LabelMaxSizeInfo.description
},
{
TransformationMatrixInfo.identifier,
new Matrix4x4Verifier<double>,
@@ -252,6 +265,7 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
, _hasLabel(false)
, _labelDataIsDirty(true)
, _textMinSize(0)
, _textMaxSize(200)
, _planeStartingIndexPos(0)
, _textureVariableIndex(0)
, _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f)
@@ -370,7 +384,11 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
if (dictionary.hasKey(LabelMinSizeInfo.identifier)) {
_textMinSize = static_cast<int>(dictionary.value<float>(LabelMinSizeInfo.identifier));
}
}
if (dictionary.hasKey(LabelMaxSizeInfo.identifier)) {
_textMaxSize = static_cast<int>(dictionary.value<float>(LabelMaxSizeInfo.identifier));
}
}
if (dictionary.hasKey(TransformationMatrixInfo.identifier)) {
@@ -591,6 +609,7 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data, const glm::dmat
_textColor,
pow(10.0, _textSize.value()),
_textMinSize,
_textMaxSize,
modelViewProjectionMatrix,
orthoRight,
orthoUp,

View File

@@ -111,6 +111,7 @@ namespace openspace {
bool _labelDataIsDirty;
int _textMinSize;
int _textMaxSize;
int _planeStartingIndexPos;
int _textureVariableIndex;