Merge branch 'develop' into feature/globebrowsing

Conflicts:
	modules/base/scale/staticscale.cpp
	modules/base/scale/staticscale.h
	modules/globebrowsing/meshes/trianglesoup.h
	modules/globebrowsing/tile/tiledataset.cpp
	modules/newhorizons/shaders/renderableModelProjection_fs.glsl
	src/interaction/interactionhandler.cpp
	src/rendering/renderengine.cpp
	src/scene/scenegraphnode.cpp
This commit is contained in:
Alexander Bock
2016-09-20 15:52:01 +02:00
142 changed files with 8052 additions and 1702 deletions
+73 -141
View File
@@ -1,21 +1,21 @@
bin/
build/
cache/
tmp/
ext/SGCT
.DS_Store
*.swp
.vscode
# Windows system files:
Thumbs.db
# Emacs backup files:
*~
*.swp
.DS_Store
.vscode
/bin/
/build/
/cache/
Thumbs.db
tmp/
/documentation
/doc
/ext/SGCT
# generated glsl files
*.gglsl
*.GhoulGenerated.glsl
*.OpenSpaceGenerated.glsl
shaders/generated/*
# CMake stuff
@@ -29,135 +29,67 @@ install_manifest.txt
.cproject
.project
# Doxygen stuff
html/
latex/
shaders/ABuffer/constants.hglsl
*.OpenSpaceGenerated.glsl
LuaScripting.txt
Properties.txt
log.html
gui/externaltimecontrol/CMakeLists.txt
gui/externaltimecontrol/main.cpp
gui/externaltimecontrol/mainwindow.cpp
gui/externaltimecontrol/mainwindow.h
data/scene/rosetta/67P/obj/67P_rotated_5_130.obj
data/spice/NewHorizonsKernels/
data/spice/RosettaKernels/
data/scene/newhorizons/pluto/pluto/textures/
data/scene/newhorizons/pluto/pluto/utcEvents.txt
data/scene/rosetta/rosetta/obj/mainbodyros.obj
data/scene/rosetta/rosetta/obj/solarpanelleft.obj
data/scene/rosetta/rosetta/obj/solarpanelright.obj
data/scene/rosetta/rosetta/textures/defaultProj.png
data/scene/rosetta/rosetta/textures/glare_blue.png
data/scene/rosetta/rosetta/textures/gray.png
data/scene/rosetta/rosetta/textures/squarefov.png
data/scene/saturn/textures/saturn.jpg
data/scene/stars/colorbv.cmap
data/scene/stars/speck/stars.speck
data/scene/stars/textures/glare.png
data/scene/stars/textures/halo.png
data/scene/sun/textures/marker.png
data/scene/sun/textures/sun-glare.png
data/scene/sun/textures/sun.jpg
data/scene/uranus/textures/uranus.jpg
data/scene/venus/textures/venus.jpg
data/scene/dawn/vestaprojection/VestaComet/VestaComet_5000.obj
data/spice/DawnKernels/
data/scene/newhorizons/jupiter/jupiter/ProjectionsOfInterest/
data/scene/rosetta/67P/textures/black.jpg
data/scene/rosetta/67P/textures/defaultProj.png
data/scene/rosetta/67P/textures/gray.jpg
data/scene/rosetta/67P/textures/gray.png
data/scene/rosetta/67P/textures/texmapflipped.jpg
data/scene/rosetta/67P/textures/white.jpg
data/scene/rosetta/67P/textures/white.png
data/scene/newhorizons/jupiter/callisto/textures/callisto.jpg
data/scene/dawn/ceres/textures/gray.png
data/scene/newhorizons/pluto/charon/textures/Charon-Text.png
data/scene/newhorizons/pluto/charon/textures/charon_highres.jpg
data/scene/newhorizons/pluto/charon/textures/charon_highres_annotated.jpg
data/scene/newhorizons/pluto/charon/textures/defaultProj.png
data/scene/dawn/dawn/obj/mainbodydawn.obj
data/scene/dawn/dawn/obj/solarpanelleft.obj
data/scene/dawn/dawn/obj/solarpanelright.obj
data/scene/dawn/dawn/textures/glare_blue.png
data/scene/dawn/dawn/textures/gray.png
data/scene/earth/textures/ToastMapOfEarth.jpg
data/scene/earth/textures/earth_bluemarble.jpg
data/scene/earth/textures/earth_bluemarble_height.jpg
data/scene/earth/textures/earth_night.jpg
data/scene/earth/textures/marker.png
data/scene/earth/textures/earth_clouds.jpg
data/scene/earth/textures/earth_reflectance.png
data/scene/moon/textures/Moon16k.dds
data/scene/newhorizons/jupiter/europa/textures/europa.jpg
data/scene/newhorizons/jupiter/ganymede/textures/ganymede.jpg
data/scene/newhorizons/jupiter/io/textures/io.jpg
data/scene/jupiter/jupiter/textures/jupiter.jpg
data/scene/mars/textures/mars.jpg
data/scene/mercury/textures/mercury.jpg
data/scene/milkyway/textures/DarkUniverse_mellinger_8k.jpg
data/scene/neptune/textures/neptune.jpg
data/scene/newhorizons/newhorizons/models/Labels.obj
data/scene/newhorizons/newhorizons/models/NewHorizonsCleanModel.obj
data/scene/newhorizons/newhorizons/textures/NHTexture.jpg
data/scene/newhorizons/newhorizons/textures/goldfoilbump.tif
data/scene/newhorizons/newhorizons/textures/labels.png
data/scene/pluto/textures/
data/scene/pluto/textures/Shenk_180.jpg
data/scene/pluto/textures/pluto_highres_180.jpg
data/scene/newhorizons/pluto/pluto/assets/core_v9h_obs_getmets_v8_time_fix_nofrcd_mld.txt
data/scene/newhorizons/pluto/pluto/textures/3.jpg
data/scene/newhorizons/pluto/pluto/textures/Pluto-Text.png
data/scene/dawn/vestaprojection/VestaComet/VestaComet.mtl
data/scene/dawn/vestaprojection/textures/defaultProj_backup.png
data/scene/dawn/vestaprojection/textures/dummy.jpg
data/scene/dawn/vestaprojection/textures/glare.png
data/scene/dawn/vestaprojection/textures/projectMe.png
data/spice/MAR063.BSP
data/spice/de430_1850-2150.bsp
data/spice/jup260.bsp
data/BATSRUS.cdf
data/ENLIL.cdf
data/scene/newhorizons/pluto/pluto/images
data/spice/nh_kernels/
data/scene/jupiter/jupiter/textures/Jupiter-text.png
data/scene/jupiter/callisto/textures/callisto.jpg
data/scene/jupiter/europa/textures/europa.jpg
data/scene/jupiter/ganymede/textures/ganymede.jpg
data/scene/jupiter/io/textures/io.jpg
data/scene/milkyway-eso/textures/eso0932a_blend.png
data/scene/stars-denver/denver_colorbv.cmap
data/scene/stars-denver/speck/stars.speck
data/scene/stars-denver/textures/halo.png
data/scene/newhorizons/pluto/pluto/full_images/
data/scene/rosetta/67P/rosettaimages/
data/spice/RosettaKernels_New/
data/scene/newhorizons/pluto/charon/utcEvents.txt
data/scene/rosetta/67P/obj/67P_HD_2015-05-09.obj
data/scene/rosetta/67P/obj/may9_map.jpg
data/scene/rosetta/67P/textures/may9_map.jpg
data/scene/newhorizons/pluto/charon/textures/cpdem-Mcolor2-MLorriCA-lr-5_ZMfs-cyl.jpg
data/scene/newhorizons/pluto/charon/textures/cpmap_cyl_HR_0e.jpg
data/scene/volumetricmilkyway/milkyway/
ScriptLog.txt
data/scene/atmosphereearth/textures/ToastMapOfEarth.jpg
data/scene/atmosphereearth/textures/earth_bluemarble.jpg
data/scene/atmosphereearth/textures/earth_bluemarble_height.jpg
data/scene/atmosphereearth/textures/earth_clouds.jpg
data/scene/atmosphereearth/textures/earth_night.jpg
data/scene/atmosphereearth/textures/earth_reflectance.png
data/scene/atmosphereearth/textures/marker.png
data/scene/juno/juno/textures
data/scene/juno/juno/spice
data/scene/atmosphereearth/textures
data/scene/dawn/ceres/textures
data/scene/dawn/dawn/obj
data/scene/dawn/dawn/textures
data/scene/dawn/vestaprojection/textures
data/scene/dawn/vestaprojection/VestaComet
data/scene/debugglobe/textures
data/scene/earth/textures
data/scene/juno/juno/Juno.mtl
data/scene/juno/juno/Juno.obj
KeyboardMapping.txt
saturn_rings.png
data/scene/debugglobe/textures/earth_clouds.jpg
data/scene/debugglobe/textures/earth_reflectance.png
data/scene/rosetta/rosetta/obj/Rosetta.obj
data/scene/rosetta/rosetta/rosetta/
data/scene/rosetta/rosetta/textures/
data/scene/juno/juno/spice
data/scene/juno/juno/textures
data/scene/jupiter/callisto/textures
data/scene/jupiter/europa/textures
data/scene/jupiter/ganymede/textures
data/scene/jupiter/io/textures
data/scene/jupiter/jupiter/textures
data/scene/mars/textures
data/scene/mercury/textures
data/scene/milkyway/textures
data/scene/milkyway-eso/textures
data/scene/moon/textures
data/scene/neptune/textures
data/scene/newhorizons/jupiter/callisto/textures
data/scene/newhorizons/jupiter/europa/textures
data/scene/newhorizons/jupiter/ganymede/textures
data/scene/newhorizons/jupiter/io/textures
data/scene/newhorizons/jupiter/jupiter/ProjectionsOfInterest
data/scene/newhorizons/newhorizons/models
data/scene/newhorizons/newhorizons/textures
data/scene/newhorizons/pluto/charon/textures
data/scene/newhorizons/pluto/pluto/assets
data/scene/newhorizons/pluto/pluto/full_images
data/scene/newhorizons/pluto/pluto/images
data/scene/newhorizons/pluto/pluto/textures
data/scene/pluto/textures
data/scene/saturn/textures
data/scene/rosetta/67P/obj
data/scene/rosetta/67P/rosettaimages
data/scene/rosetta/67P/textures
data/scene/rosetta/rosetta/rosetta
data/scene/rosetta/rosetta/textures
data/scene/stars/colorbv.cmap
data/scene/stars/speck
data/scene/stars/textures
data/scene/stars-denver/denver_colorbv.cmap
data/scene/stars-denver/speck
data/scene/stars-denver/textures
data/scene/sun/textures
data/scene/uranus/textures
data/scene/venus/textures
data/scene/volumetricmilkyway/milkyway
data/spice/DawnKernels
data/spice/jup260.bsp
data/spice/de430_1850-2150.bsp
data/spice/MAR063.BSP
data/spice/NewHorizonsKernels
data/spice/nh_kernels
data/spice/Rosetta
+19 -367
View File
@@ -1,45 +1,19 @@
# Doxyfile 1.7.6.1
# Doxyfile 1.8.8
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = OpenSpace
PROJECT_NUMBER =
PROJECT_LOGO =
OUTPUT_DIRECTORY = doc/
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = YES
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = YES
# This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value".
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
# put the command \sideeffect (or @sideeffect) in the documentation, which
# will result in a user-defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
ALIASES =
BUILTIN_STL_SUPPORT = NO
SUBGROUPING = YES
# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
# unions are shown inside the group in which they are included (e.g. using
# @ingroup) instead of on a separate page (for HTML and Man pages) or
# section (for LaTeX and RTF).
INLINE_GROUPED_CLASSES = NO
INLINE_SIMPLE_STRUCTS = YES
TYPEDEF_HIDES_STRUCT = NO
LOOKUP_CACHE_SIZE = 1
LOOKUP_CACHE_SIZE = 9
#---------------------------------------------------------------------------
# Build related configuration options
@@ -48,405 +22,83 @@ LOOKUP_CACHE_SIZE = 1
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = NO
HIDE_SCOPE_NAMES = YES
SHOW_INCLUDE_FILES = YES
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = NO
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = YES
SORT_MEMBERS_CTORS_1ST = YES
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
STRICT_PROTO_MATCHING = NO
GENERATE_TODOLIST = YES
GENERATE_TODOLIST = NO
GENERATE_TESTLIST = NO
GENERATE_BUGLIST = YES
GENERATE_BUGLIST = NO
GENERATE_DEPRECATEDLIST= YES
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = NO
SHOW_FILES = NO
SHOW_NAMESPACES = YES
SHOW_FILES = YES
LAYOUT_FILE =
EXTENSION_MAPPING = inl=C++
BUILTIN_STL_SUPPORT = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = YES
WARN_FORMAT = "$file:$line: $text"
#---------------------------------------------------------------------------
# configuration options related to the input files
# Configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = src \
include
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c \
*.cpp \
FILE_PATTERNS = *.cpp \
*.h \
*.inl
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = /ext/* bin/* build/* config/* gui/* kernels/* openspace-data/* scripts/* shaders/*
EXCLUDE_SYMBOLS =
EXCLUDE_PATTERNS = ext/* bin/* build/* config/* gui/* kernels/* data/* scripts/* shaders/*
USE_MDFILE_AS_MAINPAGE = README.md
#---------------------------------------------------------------------------
# configuration options related to source browsing
# Configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = YES
VERBATIM_HEADERS = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 4
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER = support/doxygen/header.html
HTML_FOOTER = support/doxygen/footer.html
HTML_STYLESHEET = support/doxygen/stylesheet.css
#HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 200
HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = NO
HTML_DYNAMIC_SECTIONS = NO
# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
GENERATE_DOCSET = NO
DOCSET_FEEDNAME =
DOCSET_BUNDLE_ID =
DOCSET_PUBLISHER_ID =
DOCSET_PUBLISHER_NAME =
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = YES
HTML_COLORSTYLE_HUE = 225
HTML_COLORSTYLE_SAT = 18
HTML_COLORSTYLE_GAMMA = 100
GENERATE_TREEVIEW = YES
ENUM_VALUES_PER_LINE = 6
TREEVIEW_WIDTH = 300
EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
MATHJAX_EXTENSIONS =
SEARCHENGINE = YES
SERVER_BASED_SEARCH = NO
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
# Other output configuration options
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
LATEX_FOOTER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED = YES
SKIP_FUNCTION_MACROS = NO
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz, a graph visualization
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = NO
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
# allowed to run in parallel. When set to 0 (the default) doxygen will
# base this on the number of processors available in the system. You can set it
# explicitly to a value larger than 0 to get control over the balance
# between CPU load and processing speed.
DOT_NUM_THREADS = 0
# By default doxygen will use the Helvetica font for all dot files that
# doxygen generates. When you want a differently looking font you can specify
# the font name using DOT_FONTNAME. You need to make sure dot is able to find
# the font, which can be done by putting it in a standard location or by setting
# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
# directory containing the font.
DOT_FONTNAME = Helvetica
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the Helvetica font.
# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
# set the path where dot can find it.
DOT_FONTPATH =
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
# CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect implementation dependencies (inheritance, containment, and
# class references variables) of the class with other documented classes.
COLLABORATION_GRAPH = YES
# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for groups, showing the direct groups dependencies
GROUP_GRAPHS = YES
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
UML_LOOK = NO
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
TEMPLATE_RELATIONS = NO
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
# tags are set to YES then doxygen will generate a graph for each documented
# file showing the direct and indirect include dependencies of the file with
# other documented files.
INCLUDE_GRAPH = YES
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
# documented header file showing the documented files that directly or
# indirectly include this file.
INCLUDED_BY_GRAPH = YES
# If the CALL_GRAPH and HAVE_DOT options are set to YES then
# doxygen will generate a call dependency graph for every global function
# or class method. Note that enabling this option will significantly increase
# the time of a run. So in most cases it will be better to enable call graphs
# for selected functions only using the \callgraph command.
CALL_GRAPH = NO
# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
# doxygen will generate a caller dependency graph for every global function
# or class method. Note that enabling this option will significantly increase
# the time of a run. So in most cases it will be better to enable caller
# graphs for selected functions only using the \callergraph command.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will generate a graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
# then doxygen will show the dependencies a directory has on other directories
# in a graphical way. The dependency relations are determined by the #include
# relations between the files in the directories.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. Possible values are svg, png, jpg, or gif.
# If left blank png will be used. If you choose svg you need to set
# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
# visible in IE 9+ (other browsers do not have this requirement).
DOT_IMAGE_FORMAT = png
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
# Note that this requires a modern browser other than Internet Explorer.
# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
# visible. Older versions of IE do not have SVG support.
INTERACTIVE_SVG = NO
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the
# \dotfile command).
DOTFILE_DIRS =
# The MSCFILE_DIRS tag can be used to specify one or more directories that
# contain msc files that are included in the documentation (see the
# \mscfile command).
MSCFILE_DIRS =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
# nodes that will be shown in the graph. If the number of nodes in a graph
# becomes larger than this value, doxygen will truncate the graph, which is
# visualized by representing a node as a red box. Note that doxygen if the
# number of direct children of the root node in a graph is already larger than
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
DOT_GRAPH_MAX_NODES = 50
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
# from the root by following a path via at most 3 edges will be shown. Nodes
# that lay further from the root node will be omitted. Note that setting this
# option to 1 or 2 may greatly reduce the computation time needed for large
# code bases. Also note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not
# seem to support this out of the box. Warning: Depending on the platform used,
# enabling this option may lead to badly anti-aliased labels on the edges of
# a graph (i.e. they become hard to read).
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10)
# support this, this feature is disabled by default.
DOT_MULTI_TARGETS = NO
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
# generate a legend page explaining the meaning of the various boxes and
# arrows in the dot generated graphs.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
# remove the intermediate dot files that are used to generate
# the various graphs.
DOT_CLEANUP = YES
+79 -79
View File
@@ -1,82 +1,82 @@
<?xml version="1.0" ?>
<Cluster masterAddress="127.0.0.1" externalControlPort="20500">
<Node address="127.0.0.1" port="20400">
<Window fullScreen="false">
<Stereo type="none" />
<Pos x="0" y="100" />
<Size x="910" y="263" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-3.34533" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="-3.34533" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="3.34533" y="0.965" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<Node address="127.0.0.2" port="20401">
<Window fullScreen="false">
<Stereo type="none" />
<Size x="400" y="300" />
<Pos x="0" y="400" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-3.34533" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="-3.34533" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="-0.772" y="0.965" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<Node address="127.0.0.3" port="20402">
<Window fullScreen="false">
<Stereo type="none" />
<Size x="400" y="300" />
<Pos x="400" y="400" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-1.286667" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="-1.286667" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="1.286667" y="0.965" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<Node address="127.0.0.4" port="20403">
<Window fullScreen="false">
<Stereo type="none" />
<Size x="400" y="300" />
<Pos x="800" y="400" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="0.772" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="0.772" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="3.34533" y="0.965" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="-0.065" z="4.0" />
</User>
<Node address="127.0.0.1" port="20400">
<Window fullScreen="false">
<Stereo type="none" />
<Pos x="0" y="100" />
<Size x="910" y="263" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-3.34533" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="-3.34533" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="3.34533" y="0.965" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<Node address="127.0.0.2" port="20401">
<Window fullScreen="false">
<Stereo type="none" />
<Size x="400" y="300" />
<Pos x="0" y="400" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-3.34533" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="-3.34533" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="-0.772" y="0.965" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<Node address="127.0.0.3" port="20402">
<Window fullScreen="false">
<Stereo type="none" />
<Size x="400" y="300" />
<Pos x="400" y="400" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-1.286667" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="-1.286667" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="1.286667" y="0.965" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<Node address="127.0.0.4" port="20403">
<Window fullScreen="false">
<Stereo type="none" />
<Size x="400" y="300" />
<Pos x="800" y="400" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="0.772" y="-0.965" z="0.0" />
<!-- Upper left -->
<Pos x="0.772" y="0.965" z="0.0" />
<!-- Upper right -->
<Pos x="3.34533" y="0.965" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="-0.065" z="4.0" />
</User>
</Cluster>
+16 -16
View File
@@ -1,24 +1,24 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost" externalControlPort="20500">
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="false" fxaa="false" numberOfSamples="8" name="OpenSpace">
<Stereo type="none" />
<Size x="1280" y="720" />
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="false" fxaa="false" numberOfSamples="8" name="OpenSpace">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="16.875" left="30.0" right="30.0" up="16.875" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost" externalControlPort="20500">
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="false" fxaa="false" numberOfSamples="8" name="OpenSpace">
<Stereo type="none" />
<Size x="1280" y="720" />
<Res x="3840" y="2160" />
<Pos x="50" y="50" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="16.875" left="30.0" right="30.0" up="16.875" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+34 -34
View File
@@ -1,37 +1,37 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<!-- <Scene>
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
<Offset x="0.0" y="0.0" z="0.0" />
<Scale value="1.0" />
</Scene> -->
<Node address="localhost" port="20401">
<Window fullScreen="false" numberOfSamples="8" name="OpenSpace">
<Stereo type="none" />
<!-- 16:9 aspect ratio -->
<Size x="1024" y="1024" />
<!-- Frame buffer resolution
<Res x="4096" y="4096" /> -->
<!--
quality options (cubemap size):
- low (256)
- medium (512)
- high/1k (1024)
- 2k (2048)
- 4k (4096)
- 8k (8192)
tilt specifies the dome tilt angle in degrees from the horizontal
-->
<Viewport name="fisheye">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<FisheyeProjection fov="180" quality="1k" tilt="27.0">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</FisheyeProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
<!-- <Scene>
<Orientation yaw="0.0" pitch="-27.0" roll="0.0" />
<Offset x="0.0" y="0.0" z="0.0" />
<Scale value="1.0" />
</Scene> -->
<Node address="localhost" port="20401">
<Window fullScreen="false" numberOfSamples="8" name="OpenSpace">
<Stereo type="none" />
<!-- 16:9 aspect ratio -->
<Size x="1024" y="1024" />
<!-- Frame buffer resolution
<Res x="4096" y="4096" /> -->
<!--
quality options (cubemap size):
- low (256)
- medium (512)
- high/1k (1024)
- 2k (2048)
- 4k (4096)
- 8k (8192)
tilt specifies the dome tilt angle in degrees from the horizontal
-->
<Viewport name="fisheye">
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<FisheyeProjection fov="180" quality="1k" tilt="27.0">
<Background r="0.1" g="0.1" b="0.1" a="1.0" />
</FisheyeProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.06">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+24 -24
View File
@@ -1,37 +1,37 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost" externalControlPort="20500">
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="false" fxaa="false" numberOfSamples="8" name="OpenSpace">
<Stereo type="none" />
<Size x="1280" y="720" />
<Settings>
<Display swapInterval="0" />
</Settings>
<Node address="localhost" port="20401">
<Window fullScreen="false" fxaa="false" numberOfSamples="8" name="OpenSpace">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="16.875" left="30.0" right="30.0" up="16.875" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
<Window fullScreen="false" fxaa="false" numberOfSamples="8" name="GUI">
<Stereo type="none" />
<Size x="1280" y="720" />
</Viewport>
</Window>
<Window fullScreen="false" fxaa="false" numberOfSamples="8" name="GUI">
<Stereo type="none" />
<Size x="1280" y="720" />
<Pos x="50" y="50" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="16.875" left="30.0" right="30.0" up="16.875" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="0.0" />
</User>
</Cluster>
+14 -14
View File
@@ -1,21 +1,21 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<Node address="localhost" port="20401">
<Window fullScreen="false" numberOfSamples="8" name="OpenSpace">
<Stereo type="side_by_side" />
<!-- 16:9 aspect ratio -->
<Size x="3840" y="1080" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Node address="localhost" port="20401">
<Window fullScreen="false" numberOfSamples="8" name="OpenSpace">
<Stereo type="side_by_side" />
<!-- 16:9 aspect ratio -->
<Size x="3840" y="1080" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<PlanarProjection>
<FOV down="16.875" left="30.0" right="30.0" up="16.875" />
<Orientation heading="0.0" pitch="0.0" roll="0.0" />
</PlanarProjection>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
</Cluster>
+22 -22
View File
@@ -1,25 +1,25 @@
<?xml version="1.0" ?>
<Cluster masterAddress="localhost">
<Node address="localhost" port="20401">
<Window fullScreen="false" numberOfSamples="8" name="OpenSpace">
<Stereo type="test" />
<!-- 16:9 aspect ratio -->
<Size x="640" y="360" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-1.778" y="-1.0" z="0.0" />
<!-- Upper left -->
<Pos x="-1.778" y="1.0" z="0.0" />
<!-- Upper right -->
<Pos x="1.778" y="1.0" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
<Node address="localhost" port="20401">
<Window fullScreen="false" numberOfSamples="8" name="OpenSpace">
<Stereo type="test" />
<!-- 16:9 aspect ratio -->
<Size x="640" y="360" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-1.778" y="-1.0" z="0.0" />
<!-- Upper left -->
<Pos x="-1.778" y="1.0" z="0.0" />
<!-- Upper right -->
<Pos x="1.778" y="1.0" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
</Cluster>
+37 -37
View File
@@ -1,40 +1,40 @@
<?xml version="1.0" ?>
<Cluster masterAddress="127.0.0.1">
<Node address="127.0.0.1" port="20401">
<Window fullScreen="false" numberOfSamples="8" border="true">
<Pos x="10" y="100" />
<Size x="320" y="480" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-1.778" y="-1.0" z="0.0" />
<!-- Upper left -->
<Pos x="-1.778" y="1.0" z="0.0" />
<!-- Upper right -->
<Pos x="0.0" y="1.0" z="0.0" />
</Viewplane>
</Viewport>
</Window>
<Window fullScreen="false" numberOfSamples="8" border="false">
<Pos x="340" y="100" />
<Size x="320" y="480" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="0.0" y="-1.0" z="0.0" />
<!-- Upper left -->
<Pos x="0.0" y="1.0" z="0.0" />
<!-- Upper right -->
<Pos x="1.778" y="1.0" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
<Node address="127.0.0.1" port="20401">
<Window fullScreen="false" numberOfSamples="8" border="true">
<Pos x="10" y="100" />
<Size x="320" y="480" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-1.778" y="-1.0" z="0.0" />
<!-- Upper left -->
<Pos x="-1.778" y="1.0" z="0.0" />
<!-- Upper right -->
<Pos x="0.0" y="1.0" z="0.0" />
</Viewplane>
</Viewport>
</Window>
<Window fullScreen="false" numberOfSamples="8" border="false">
<Pos x="340" y="100" />
<Size x="320" y="480" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="0.0" y="-1.0" z="0.0" />
<!-- Upper left -->
<Pos x="0.0" y="1.0" z="0.0" />
<!-- Upper right -->
<Pos x="1.778" y="1.0" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
</Cluster>
+41 -41
View File
@@ -1,44 +1,44 @@
<?xml version="1.0" ?>
<Cluster masterAddress="127.0.0.1">
<Node address="127.0.0.1" port="20401">
<Window fullScreen="false">
<Pos x="0" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="640" y="360" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-1.778" y="-1.0" z="0.0" />
<!-- Upper left -->
<Pos x="-1.778" y="1.0" z="0.0" />
<!-- Upper right -->
<Pos x="1.778" y="1.0" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<Node address="127.0.0.2" port="20402">
<Window fullScreen="false">
<Pos x="640" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="640" y="360" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-1.778" y="-1.0" z="0.0" />
<!-- Upper left -->
<Pos x="-1.778" y="1.0" z="0.0" />
<!-- Upper right -->
<Pos x="1.778" y="1.0" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
<Node address="127.0.0.1" port="20401">
<Window fullScreen="false">
<Pos x="0" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="640" y="360" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-1.778" y="-1.0" z="0.0" />
<!-- Upper left -->
<Pos x="-1.778" y="1.0" z="0.0" />
<!-- Upper right -->
<Pos x="1.778" y="1.0" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<Node address="127.0.0.2" port="20402">
<Window fullScreen="false">
<Pos x="640" y="300" />
<!-- 16:9 aspect ratio -->
<Size x="640" y="360" />
<Viewport>
<Pos x="0.0" y="0.0" />
<Size x="1.0" y="1.0" />
<Viewplane>
<!-- Lower left -->
<Pos x="-1.778" y="-1.0" z="0.0" />
<!-- Upper left -->
<Pos x="-1.778" y="1.0" z="0.0" />
<!-- Upper right -->
<Pos x="1.778" y="1.0" z="0.0" />
</Viewplane>
</Viewport>
</Window>
</Node>
<User eyeSeparation="0.065">
<Pos x="0.0" y="0.0" z="4.0" />
</User>
</Cluster>
@@ -129,7 +129,8 @@ return {
Size = {3.0, 11.0},
Origin = "Center",
Billboard = true,
Texture = "textures/marker.png"
Texture = "textures/marker.png",
BlendMode = "Additive"
},
Ephemeris = {
Type = "Static",
+6 -1
View File
@@ -76,7 +76,12 @@ return {
Size = {3.0, 11.0},
Origin = "Center",
Billboard = true,
Texture = "textures/marker.png"
Texture = "textures/marker.png",
BlendMode = "Additive"
},
Ephemeris = {
Type = "Static",
Position = {0, 0, 0, 5}
}
}
]]
@@ -22,6 +22,7 @@ return {
Observer = "NEW HORIZONS",
Target = "CALLISTO",
Aberration = "NONE",
AspectRatio = 2
},
Instrument = {
Name = "NH_LORRI",
@@ -78,7 +79,8 @@ return {
Size = {1.0, 7.4},
Origin = "Center",
Billboard = true,
Texture = "textures/Callisto-Text.png"
Texture = "textures/Callisto-Text.png",
BlendMode = "Additive"
},
--[[
Ephemeris = {
@@ -22,6 +22,7 @@ return {
Observer = "NEW HORIZONS",
Target = "EUROPA",
Aberration = "NONE",
AspectRatio = 2
},
Instrument = {
Name = "NH_LORRI",
@@ -78,7 +79,8 @@ return {
Size = {1.0, 7.4},
Origin = "Center",
Billboard = true,
Texture = "textures/Europa-Text.png"
Texture = "textures/Europa-Text.png",
BlendMode = "Additive"
},
--[[
Ephemeris = {
@@ -22,6 +22,7 @@ return {
Observer = "NEW HORIZONS",
Target = "GANYMEDE",
Aberration = "NONE",
AspectRatio = 2
},
Instrument = {
Name = "NH_LORRI",
@@ -78,7 +79,8 @@ return {
Size = {1.0, 7.4},
Origin = "Center",
Billboard = true,
Texture = "textures/Ganymede-Text.png"
Texture = "textures/Ganymede-Text.png",
BlendMode = "Additive"
},
Transform = {
Translation = {
+3 -1
View File
@@ -22,6 +22,7 @@ return {
Observer = "NEW HORIZONS",
Target = "IO",
Aberration = "NONE",
AspectRatio = 2
},
Instrument = {
Name = "NH_LORRI",
@@ -78,7 +79,8 @@ return {
Size = {1.0, 7.4},
Origin = "Center",
Billboard = true,
Texture = "textures/Io-Text.png"
Texture = "textures/Io-Text.png",
BlendMode = "Additive"
},
Transform = {
Translation = {
@@ -41,6 +41,7 @@ return {
Observer = "NEW HORIZONS",
Target = "JUPITER",
Aberration = "NONE",
AspectRatio = 2
},
DataInputTranslation = {
Instrument = {
@@ -106,7 +107,8 @@ return {
Size = {1.0, 7.5},
Origin = "Center",
Billboard = true,
Texture = "textures/Jupiter-text.png"
Texture = "textures/Jupiter-text.png",
BlendMode = "Additive"
},
Transform = {
Translation = {
@@ -40,6 +40,7 @@ return {
Observer = "NEW HORIZONS",
Target = "CHARON",
Aberration = "NONE",
AspectRatio = 2
},
Instrument = {
Name = "NH_LORRI",
@@ -93,7 +94,8 @@ return {
Size = {1.0, 6.3},
Origin = "Center",
Billboard = true,
Texture = "textures/Charon-Text.png"
Texture = "textures/Charon-Text.png",
BlendMode = "Additive"
},
Transform = {
Translation = {
+3 -1
View File
@@ -67,6 +67,7 @@ return {
Observer = "NEW HORIZONS",
Target = "PLUTO",
Aberration = "NONE",
AspectRatio = 2
},
DataInputTranslation = {
Instrument = {
@@ -223,7 +224,8 @@ return {
Size = {1.0, 6.3},
Origin = "Center",
Billboard = true,
Texture = "textures/Pluto-Text.png"
Texture = "textures/Pluto-Text.png",
BlendMode = "Additive"
},
Transform = {
Translation = {
+2 -1
View File
@@ -66,7 +66,8 @@ return {
Size = {1.0, 6.3},
Origin = "Center",
Billboard = true,
Texture = "textures/Styx-Text.png"
Texture = "textures/Styx-Text.png",
BlendMode = "Additive"
},
Transform = {
Translation = {
+1
View File
@@ -51,6 +51,7 @@ return {
Observer = "OSIRIS-REX",
Target = BENNU_BODY,
Aberration = "NONE",
AspectRatio = 2
},
DataInputTranslation = {
Instruments = {
+11 -3
View File
@@ -9,8 +9,16 @@ function preInitialization()
openspace.spice.loadKernel("${SPICE}/naif0011.tls")
openspace.spice.loadKernel("${SPICE}/pck00010.tpc")
openspace.time.setTime("2014-08-15T03:05:18.101")
-- openspace.time.setTime("2014-11-17T03:05:18.101")
-- Usual start
openspace.time.setTime("2014-08-01T03:05:18.101")
-- Philae release
-- openspace.time.setTime("2014-11-12T08:00:00.000")
-- Shadow flyby
-- openspace.time.setTime("2015-02-14T12:00:00.000")
-- openspace.time.setTime("2015-07-29T06:02:10.000")
-- openspace.time.setTime("2014 AUG 21 18:00:00")
-- openspace.time.setTime("2015 SEP 10 19:39:00")
@@ -50,7 +58,7 @@ return {
"venus",
"earth",
"mars",
"jupiter",
"jupiter/jupiter",
"saturn",
"uranus",
"neptune",
-1
View File
@@ -5,6 +5,5 @@ return {
},
TorrentFiles = {
{ File = "67P_rotated_5_130.obj.torrent", Destination = "obj" },
{ File = "RosettaKernels.torrent", Destination = "${SPICE}" }
}
}
+5 -26
View File
@@ -9,28 +9,6 @@ return {
Body = "CHURYUMOV-GERASIMENKO",
Reference = "GALACTIC",
Observer = "SUN",
Kernels = {
--needed
"${OPENSPACE_DATA}/spice/de430_1850-2150.bsp",
-- SPK
--long term orbits loaded first
'${OPENSPACE_DATA}/spice/RosettaKernels_New/SPK/LORL_DL_009_02____P__00268.BSP',
'${OPENSPACE_DATA}/spice/RosettaKernels_New/SPK/RORL_DL_009_02____P__00268.BSP',
'${OPENSPACE_DATA}/spice/RosettaKernels_New/SPK/CORL_DL_009_02____P__00268.BSP',
'${OPENSPACE_DATA}/spice/RosettaKernels/SPK/LORL_DL_006_01____H__00156.BSP',
'${OPENSPACE_DATA}/spice/RosettaKernels/SPK/RORL_DL_006_01____H__00156.BSP',
'${OPENSPACE_DATA}/spice/RosettaKernels/SPK/CORL_DL_006_01____H__00156.BSP',
--Jan 2014 - May 2015 (version match with 00162 ck files)
"${OPENSPACE_DATA}/spice/RosettaKernels/SPK/CORB_DV_097_01_______00162.BSP",
"${OPENSPACE_DATA}/spice/RosettaKernels/SPK/RORB_DV_097_01_______00162.BSP",
"${OPENSPACE_DATA}/spice/RosettaKernels/SPK/LORB_DV_097_01_______00162.BSP",
"${OPENSPACE_DATA}/spice/RosettaKernels_New/SPK/CORB_DV_211_01_______00288.BSP",
"${OPENSPACE_DATA}/spice/RosettaKernels_New/SPK/RORB_DV_211_01_______00288.BSP",
"${OPENSPACE_DATA}/spice/RosettaKernels_New/SPK/LORB_DV_211_01_______00288.BSP",
}
},
},
GuiName = "/Solar/67PBarycenter",
@@ -50,6 +28,7 @@ return {
Textures = {
Type = "simple",
Color = "textures/gray.jpg",
-- Color = "textures/may9_map.jpg",
Project = "textures/defaultProj.png",
Default = "textures/defaultProj.png"
},
@@ -63,7 +42,8 @@ return {
Observer = "ROSETTA",
Target = "CHURYUMOV-GERASIMENKO",
Aberration = "NONE",
TextureMap = true
TextureMap = true,
ShadowMap = true
},
DataInputTranslation = {
Instrument = {
@@ -98,10 +78,9 @@ return {
Method = "ELLIPSOID",
Aberration = "NONE",
Fovy = 5.00,
Aspect = 1,
Near = 0.01,
Far = 1000000,
Aspect = 1
},
BoundingSphereRadius = 5000.0
},
Transform = {
Rotation = {
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -2
View File
@@ -4,7 +4,6 @@ return {
{ Identifier = "rosetta_textures", Destination = "textures", Version = 2 }
},
TorrentFiles = {
{ File = "RosettaKernels.torrent", Destination = "${SPICE}" },
{ File = "RosettaKernels_New.torrent", Destination = "${SPICE}" }
{ File = "Rosetta.torrent", Destination = "${SPICE}" },
}
}
+176 -123
View File
@@ -1,58 +1,61 @@
RosettaKernels = {
--needed
"${OPENSPACE_DATA}/spice/de430_1850-2150.bsp",
-- SPK
--long term orbits loaded first
-- '${OPENSPACE_DATA}/spice/RosettaKernels/SPK/LORL_DL_006_01____H__00156.BSP',
-- '${OPENSPACE_DATA}/spice/RosettaKernels/SPK/RORL_DL_006_01____H__00156.BSP',
-- '${OPENSPACE_DATA}/spice/RosettaKernels/SPK/CORL_DL_006_01____H__00156.BSP',
"${OPENSPACE_DATA}/spice/Rosetta/SCLK/ROS_160718_STEP.TSC",
"${OPENSPACE_DATA}/spice/Rosetta/SCLK/ros_triv.tsc",
--Jan 2014 - May 2015 (version match with 00162 ck files)
-- "${OPENSPACE_DATA}/spice/RosettaKernels/SPK/CORB_DV_097_01_______00162.BSP",
-- "${OPENSPACE_DATA}/spice/RosettaKernels/SPK/RORB_DV_097_01_______00162.BSP",
-- "${OPENSPACE_DATA}/spice/RosettaKernels/SPK/LORB_DV_097_01_______00162.BSP",
"${OPENSPACE_DATA}/spice/Rosetta/SPK/CORB_DV_243_01___T19_00325.BSP",
"${OPENSPACE_DATA}/spice/Rosetta/SPK/CORB_DV_223_01___T19_00302.BSP",
"${OPENSPACE_DATA}/spice/Rosetta/SPK/CORB_DV_145_01___T19_00216.BSP",
--IK
"${OPENSPACE_DATA}/spice/RosettaKernels_New/IK/ROS_NAVCAM_V01.TI",
"${OPENSPACE_DATA}/spice/RosettaKernels/IK/ROS_NAVCAM_V00-20130102.TI",
"${OPENSPACE_DATA}/spice/Rosetta/SPK/LORB_DV_236_01___T19_00318.BSP",
"${OPENSPACE_DATA}/spice/Rosetta/SPK/LORB_DV_223_01___T19_00302.BSP",
"${OPENSPACE_DATA}/spice/Rosetta/SPK/LORB_DV_145_01___T19_00216.BSP",
"${OPENSPACE_DATA}/spice/Rosetta/SPK/RORB_DV_243_01___T19_00325.BSP",
"${OPENSPACE_DATA}/spice/Rosetta/SPK/RORB_DV_223_01___T19_00302.BSP",
"${OPENSPACE_DATA}/spice/Rosetta/SPK/RORB_DV_145_01___T19_00216.BSP",
--SCLK
-- "${OPENSPACE_DATA}/spice/RosettaKernels/SCLK/ROS_150227_STEP.TSC",
"${OPENSPACE_DATA}/spice/Rosetta/CK/ATNR_P040302093352_00127.BC",
-- FK
-- "${OPENSPACE_DATA}/spice/RosettaKernels/FK/ROS_CHURYUMOV_V01.TF",
-- "${OPENSPACE_DATA}/spice/RosettaKernels/FK/ROS_V24.TF",
"${OPENSPACE_DATA}/spice/Rosetta/SPK/ROS_STRUCT_V5.BSP",
"${OPENSPACE_DATA}/spice/Rosetta/IK/ROS_NAVCAM_V01.TI",
"${OPENSPACE_DATA}/spice/Rosetta/FK/ROS_CHURYUMOV_V01.TF",
"${OPENSPACE_DATA}/spice/Rosetta/FK/ROS_V26.TF",
-- CK
-- '${OPENSPACE_DATA}/spice/RosettaKernels/CK/RATT_DV_097_01_01____00162.BC',
-- "${OPENSPACE_DATA}/spice/RosettaKernels/CK/CATT_DV_097_01_______00162.BC",
-- Rosetta attitude
"${OPENSPACE_DATA}/spice/Rosetta/CK/RATT_DV_243_01_01____00325.BC",
"${OPENSPACE_DATA}/spice/Rosetta/CK/RATT_DV_223_01_01____00302.BC",
"${OPENSPACE_DATA}/spice/Rosetta/CK/RATT_DV_145_01_01____00216.BC",
--SCLK
-- "${OPENSPACE_DATA}/spice/RosettaKernels/SCLK/ROS_150227_STEP.TSC",
"${OPENSPACE_DATA}/spice/RosettaKernels_New/SCLK/ROS_160425_STEP.TSC",
-- Comet attitude
"${OPENSPACE_DATA}/spice/Rosetta/CK/CATT_DV_243_01_______00325.BC",
"${OPENSPACE_DATA}/spice/Rosetta/CK/CATT_DV_223_01_______00302.BC",
"${OPENSPACE_DATA}/spice/Rosetta/CK/CATT_DV_145_01_______00216.BC",
-- FK
-- High gain antenna
"${OPENSPACE_DATA}/spice/Rosetta/CK/ROS_HGA_2016_V0035.BC",
"${OPENSPACE_DATA}/spice/Rosetta/CK/ROS_HGA_2015_V0053.BC",
"${OPENSPACE_DATA}/spice/Rosetta/CK/ROS_HGA_2014_V0044.BC",
"${OPENSPACE_DATA}/spice/RosettaKernels_New/FK/ROS_CHURYUMOV_V01.TF",
"${OPENSPACE_DATA}/spice/RosettaKernels_New/FK/ROS_V26.TF",
-- "${OPENSPACE_DATA}/spice/RosettaKernels/FK/ROS_V24.TF",
-- CK
"${OPENSPACE_DATA}/spice/RosettaKernels_New/CK/RATT_DV_211_01_01____00288.BC",
"${OPENSPACE_DATA}/spice/RosettaKernels_New/CK/CATT_DV_211_01_______00288.BC",
'${OPENSPACE_DATA}/spice/RosettaKernels/CK/RATT_DV_097_01_01____00162.BC',
"${OPENSPACE_DATA}/spice/RosettaKernels/CK/CATT_DV_097_01_______00162.BC",
-- PCK
"${OPENSPACE_DATA}/spice/RosettaKernels_New/PCK/ROS_CGS_RSOC_V03.TPC",
-- "${OPENSPACE_DATA}/spice/RosettaKernels/PCK/ROS_CGS_RSOC_V03.TPC",
-- Solar arrays
"${OPENSPACE_DATA}/spice/Rosetta/CK/ROS_SA_2016_V0034.BC",
"${OPENSPACE_DATA}/spice/Rosetta/CK/ROS_SA_2015_V0042.BC",
"${OPENSPACE_DATA}/spice/Rosetta/CK/ROS_SA_2014_V0047.BC",
"${OPENSPACE_DATA}/spice/RosettaKernels_New/CK/ROS_SA_2014_V0047.BC",
"${OPENSPACE_DATA}/spice/RosettaKernels_New/CK/ROS_SA_2015_V0042.BC",
"${OPENSPACE_DATA}/spice/RosettaKernels_New/CK/ROS_SA_2016_V0019.BC",
"${OPENSPACE_DATA}/spice/Rosetta/PCK/ROS_CGS_RSOC_V03.TPC",
}
RotationMatrix = {
0, 1, 0,
0, 0, 1,
1, 0, 0
}
return {
{
Name = "Rosetta",
@@ -64,7 +67,7 @@ return {
Reference = "GALACTIC",
Observer = "SUN",
Kernels = RosettaKernels
},
},
Rotation = {
Type = "SpiceRotation",
SourceFrame = "ROS_SPACECRAFT",
@@ -73,8 +76,19 @@ return {
}
},
{
Name = "Rosetta_black_foil",
Name = "RosettaModel",
Parent = "Rosetta",
Transform = {
Scale = {
Type = "StaticScale",
-- The scale of the model is in cm; OpenSpace is in m
Scale = 0.01
}
}
},
{
Name = "Rosetta_black_foil",
Parent = "RosettaModel",
Renderable = {
Type = "RenderableModel",
Body = "ROSETTA",
@@ -85,12 +99,13 @@ return {
Textures = {
Type = "simple",
Color = "textures/foil_silver_ramp.png"
}
},
Rotation = { ModelTransform = RotationMatrix }
}
},
{
Name = "Rosetta_black_parts",
Parent = "Rosetta",
Parent = "RosettaModel",
Renderable = {
Type = "RenderableModel",
Body = "ROSETTA",
@@ -101,12 +116,13 @@ return {
Textures = {
Type = "simple",
Color = "textures/foil_silver_ramp.png"
}
},
Rotation = { ModelTransform = RotationMatrix }
}
},
{
Name = "Rosetta_dish",
Parent = "Rosetta",
Parent = "RosettaModel",
Renderable = {
Type = "RenderableModel",
Body = "ROSETTA",
@@ -117,12 +133,21 @@ return {
Textures = {
Type = "simple",
Color = "textures/dish_AO.png"
}
}
},
Rotation = { ModelTransform = RotationMatrix }
},
-- Transform = {
-- Rotation = {
-- Type = "SpiceRotation",
-- SourceFrame = "-226071", -- ROS_HGA
-- DestinationFrame = "ROS_SPACECRAFT",
-- }
-- }
},
{
Name = "Rosetta_parts",
Parent = "Rosetta",
Parent = "RosettaModel",
Renderable = {
Type = "RenderableModel",
Body = "ROSETTA",
@@ -133,12 +158,14 @@ return {
Textures = {
Type = "simple",
Color = "textures/parts2_AO.png"
}
},
Rotation = { ModelTransform = RotationMatrix }
}
},
{
Name = "Rosetta_silver_foil",
Parent = "Rosetta",
Parent = "RosettaModel",
Renderable = {
Type = "RenderableModel",
Body = "ROSETTA",
@@ -149,12 +176,14 @@ return {
Textures = {
Type = "simple",
Color = "textures/foil_silver_ramp.png"
}
},
Rotation = { ModelTransform = RotationMatrix }
}
},
{
Name = "Rosetta_vents",
Parent = "Rosetta",
Parent = "RosettaModel",
Renderable = {
Type = "RenderableModel",
Body = "ROSETTA",
@@ -165,12 +194,14 @@ return {
Textures = {
Type = "simple",
Color = "textures/tex_01.png"
}
},
Rotation = { ModelTransform = RotationMatrix }
}
},
{
Name = "Rosetta_wing_a",
Parent = "Rosetta",
Parent = "RosettaModel",
Renderable = {
Type = "RenderableModel",
Body = "ROSETTA",
@@ -181,12 +212,21 @@ return {
Textures = {
Type = "simple",
Color = "textures/tex_01.png"
}
}
},
Rotation = { ModelTransform = RotationMatrix }
},
-- Transform = {
-- Rotation = {
-- Type = "SpiceRotation",
-- SourceFrame = "-226015", -- ROS_SA
-- DestinationFrame = "ROS_SPACECRAFT",
-- }
-- }
},
{
Name = "Rosetta_wing_b",
Parent = "Rosetta",
Parent = "RosettaModel",
Renderable = {
Type = "RenderableModel",
Body = "ROSETTA",
@@ -197,12 +237,21 @@ return {
Textures = {
Type = "simple",
Color = "textures/tex_01.png"
}
}
},
Rotation = { ModelTransform = RotationMatrix }
},
-- Transform = {
-- Rotation = {
-- Type = "SpiceRotation",
-- SourceFrame = "-226025", -- ROS_SA
-- DestinationFrame = "ROS_SPACECRAFT",
-- }
-- }
},
{
Name = "Rosetta_yellow_foil",
Parent = "Rosetta",
Parent = "RosettaModel",
Renderable = {
Type = "RenderableModel",
Body = "ROSETTA",
@@ -213,14 +262,35 @@ return {
Textures = {
Type = "simple",
Color = "textures/foil_gold_ramp.png"
}
},
Rotation = { ModelTransform = RotationMatrix }
}
},
{
Name = "Philae",
Parent = "Rosetta"
Parent = "67PBarycenter",
-- This should need a transform, but currently the model is intrinsically
-- translated
Transform = {
Translation = {
Type = "SpiceEphemeris",
Body = "PHILAE",
Reference = "GALACTIC",
Observer = "CHURYUMOV-GERASIMENKO",
Kernels = RosettaKernels
},
Rotation = {
Type = "SpiceRotation",
SourceFrame = "ROS_SPACECRAFT",
DestinationFrame = "GALACTIC",
},
Scale = {
Type = "StaticScale",
-- The scale of the model is in cm; OpenSpace is in m
Scale = 0.01
}
}
},
{
Name = "Philae_foil",
@@ -235,7 +305,9 @@ return {
Textures = {
Type = "simple",
Color = "textures/foil_silver_ramp.png"
}
},
Rotation = { ModelTransform = RotationMatrix }
}
},
{
@@ -251,7 +323,9 @@ return {
Textures = {
Type = "simple",
Color = "textures/parts2_AO.png"
}
},
Rotation = { ModelTransform = RotationMatrix }
}
},
{
@@ -267,7 +341,9 @@ return {
Textures = {
Type = "simple",
Color = "textures/foil_silver_ramp.png"
}
},
Rotation = { ModelTransform = RotationMatrix }
}
},
{
@@ -283,55 +359,12 @@ return {
Textures = {
Type = "simple",
Color = "textures/tex_01.png"
}
},
Rotation = { ModelTransform = RotationMatrix }
}
},
--[[ -- Rosetta Trail Module
{
Name = "RosettaTrail",
Parent = "67P",
Renderable = {
Type = "RenderableTrail",
Body = "ROSETTA",
Frame = "GALACTIC",
Observer = "SUN",
-- 3 Dummy values for compilation:
TropicalOrbitPeriod = 10000.0,
EarthOrbitRatio = 2,
DayLength = 50,
-- End of Dummy values
RGB = { 0.7, 0.7, 0.4 },
Textures = {
Type = "simple",
Color = "textures/glare.png"
},
},
GuiName = "RosettaTrail"
}, --]]
-- Comet Dance trail
--[[{
Name = "RosettaCometTrail",
Parent = "67P",
Renderable = {
Type = "RenderableTrail",
Body = "ROSETTA",
Frame = "GALACTIC",
Observer = "CHURYUMOV-GERASIMENKO",
TropicalOrbitPeriod = 20000.0,
EarthOrbitRatio = 2,
DayLength = 25,
RGB = { 0.9, 0.2, 0.9 },
Textures = {
Type = "simple",
Color = "textures/glare.png"
},
StartTime = "2014 AUG 01 12:00:00",
EndTime = "2016 MAY 26 12:00:00"
},
GuiName = "RosettaCometTrail"
},
]]
{
{
Name = "RosettaCometTrail",
Parent = "67PBarycenter",
Renderable = {
@@ -341,7 +374,7 @@ return {
Frame = "GALACTIC",
Observer = "CHURYUMOV-GERASIMENKO",
-- Optional rendering properties
LineColor = { 0.9, 0.2, 0.9 },
LineColor = { 0.288, 0.375, 0.934 },
PointColor = { 0.9, 0.2, 0.9 },
LineFade = 0.0, -- [0,1]
RenderPart = 0.5, -- [0,1]
@@ -351,23 +384,43 @@ return {
-- Time interval
TimeRange = {
Start = "2014 AUG 01 12:00:00",
End = "2016 MAY 26 12:00:00"
End = "2016 SEP 30 12:00:00"
},
SampleDeltaTime = 3600, -- Seconds between each point
SubSamples = 3,
},
GuiName = "/Solar/RosettaCometTrail"
},
{
Name = "PhilaeTrail",
Parent = "67PBarycenter",
Renderable = {
Type = "RenderableTrailNew",
-- Spice
Body = "PHILAE",
Frame = "GALACTIC",
Observer = "CHURYUMOV-GERASIMENKO",
-- Optional rendering properties
LineColor = { 1.0, 1.0, 1.0 },
PointColor = { 0.9, 0.2, 0.9 },
LineFade = 0.0, -- [0,1]
RenderPart = 0.5, -- [0,1]
LineWidth = 2,
ShowTimeStamps = false,
RenderFullTrail = false,
-- Time interval
TimeRange = {
Start = "2014 NOV 12 08:35:00",
End = "2014 NOV 12 17:00:00"
},
SampleDeltaTime = 2, -- Seconds between each point
SubSamples = 0,
},
GuiName = "/Solar/RosettaCometTrail"
},
{
Name = "NAVCAM",
Parent = "Rosetta",
-- Transform = {
-- Rotation = {
-- Type = "SpiceRotation",
-- SourceFrame = "NAVCAM",
-- DestinationFrame = "ROS_SPACECRAFT",
-- },
-- },
GuiName = "/Solar/Rosetta_navcam"
},
{
+4 -2
View File
@@ -50,7 +50,8 @@ return {
Size = {1.3, 10.5},
Origin = "Center",
Billboard = true,
Texture = "textures/sun-glare.png"
Texture = "textures/sun-glare.png",
BlendMode = "Additive"
},
Ephemeris = {
Type = "Spice",
@@ -70,7 +71,8 @@ return {
Size = {3.0, 11.0},
Origin = "Center",
Billboard = true,
Texture = "textures/marker.png"
Texture = "textures/marker.png",
BlendMode = "Additive"
},
Ephemeris = {
Type = "Static",
@@ -0,0 +1,38 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* *
* 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 __CORE_REGISTRATION_H__
#define __CORE_REGISTRATION_H__
namespace openspace {
namespace documentation {
class DocumentationEngine;
void registerCoreClasses(documentation::DocumentationEngine& engine);
} // namespace documentation
} // namespace openspace
#endif // __CORE_REGISTRATION_H__
@@ -0,0 +1,288 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* *
* 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 __DOCUMENTATION_H__
#define __DOCUMENTATION_H__
#include <ghoul/misc/boolean.h>
#include <ghoul/misc/dictionary.h>
#include <ghoul/misc/exception.h>
#include <memory>
#include <string>
#include <vector>
namespace openspace {
namespace documentation {
using Optional = ghoul::Boolean;
using Exhaustive = ghoul::Boolean;
/**
* The TestResult structure returns the information from the #testSpecification method. It
* contains the information whether test specification test was successful
* (TestResult::success) and a list of TestResult::Offense%s (TestResult::offenses). If
* TestResult::success is true, TestResult::offenses is guaranteed to be empty.
*/
struct TestResult {
/**
* An Offense is a violation against a specific verifier. The Offense::offender is the
* key that caused the offense (in the case of nested tables, it will be fully
* qualified identifier) and the Offense::Reason is the reason that caused the
* offense.
*/
struct Offense {
/**
* The Reason for the offense
*/
enum class Reason {
MissingKey, ///< The offending key that was requested was not found
ExtraKey, ///< The exhaustive documentation contained an extra key
WrongType, ///< The key's value was not of the expected type
Verification, ///< The value did not pass a necessary non-type verifier
UnknownIdentifier ///< If the identifier for a ReferencingVerifier did not exist
};
/// The offending key that caused the Offense. In the case of a nested table,
/// this value will be the fully qualified name of the key
std::string offender;
/// The Reason that caused this offense
Reason reason;
};
/// Is \c true if the TestResult is positive, \c false otherwise
bool success;
/// Contains a list of offenses that were found in the test. Is empty if
/// TestResult::Success is \c true
std::vector<Offense> offenses;
};
/**
* This exception is thrown by the #testSpecificationAndThrow method if the test detected
* a specification violation. This class contains the TestResult that would have otherwise
* be returned in a call to #testSpecification.
*/
struct SpecificationError : public ghoul::RuntimeError {
/**
* Creates the SpecificationError exception instance.
* \param result The offending TestResult that is passed on
* \param component The component that initiated the specification test
* \pre \p result%'s TestResult::success must be \c false
*/
SpecificationError(TestResult result, std::string component);
/// The TestResult that caused the SpecificationError to be thrown
TestResult result;
};
struct Verifier;
/**
* A DocumentationEntry provides the specification for a single key, which is tested using
* the provided Verifier. Each DocumentationEntry can contain a textual documentation that
* describes the entry and is printed when the documentation for a Documentation is
* requested. Lastly, each DocumentationEntry can be Optional. If the provided key is the
* DocumentationEntry::Wildcard, any key in the containing Documentation will be tested
* against the provided verifier. The most convenient way of creating DocumentationEntry%s
* is by using an inline initializer list such as:
*\verbatim
DocumentationEntry e = { "key", new IntVerifier, "Documentation text", Optional::Yes };
\endverbatim
* Furthermore, these initializer lists can be crated all at once for a Documentation.
* Even if the Verifier%s are specified using the \c new operators, they will not leak
* memory as the DocumentationEntry takes ownership of them in the constructor.
*/
struct DocumentationEntry {
/// The wildcard character that will match against every key in a Documentation
static const std::string Wildcard;
/**
* The constructor for a DocumentationEntry describing a \p key in a Documentation.
* The value for the key (or each value in the case of the
* DocumentationEntry::Wildcard) is tested using the \p verifier, that specifies the
* conditions that the \p key%'s value has to fulfill. The textual documentation
* \p doc shall describe the usage of the key-value pair and will be printed for human
* consumption for example in the DocumentationEngine. Each DocumentationEntry can
* further be \p optional.
* \param key The key for which this DocumentationEntry is valid. If this valid is
* equal to DocumentationEntry::Wildcard, each entry in the Documentation that
* contains this DocumentationEntry will be matched
* \param verifier The Verifier that is used to test the \p key%'s value to determine
* if it is a valid value
* \param doc The textual documentation that describes the DocumentationEntry in a
* human readable format
* \param optional Determines whether the Documentation containing this
* DocumentationEntry must have a key \p key, or whether it is optional
* \pre \p key must not be empty
* \pre \p verifier must not be nullptr
*/
DocumentationEntry(std::string key, std::shared_ptr<Verifier> verifier,
std::string doc = "", Optional optional = Optional::No);
/**
* The constructor for a DocumentationEntry describing a \p key in a Documentation.
* The value for the key (or each value in the case of the
* DocumentationEntry::Wildcard) is tested using the \p verifier, that specifies the
* conditions that the \p key%'s value has to fulfill. The textual documentation
* \p doc shall describe the usage of the key-value pair and will be printed for human
* consumption for example in the DocumentationEngine. Each DocumentationEntry can
* further be \p optional.
* \param key The key for which this DocumentationEntry is valid. If this valid is
* equal to DocumentationEntry::Wildcard, each entry in the Documentation that
* contains this DocumentationEntry will be matched
* \param verifier The Verifier that is used to test the \p key%'s value to determine
* if it is a valid value. The DocumentationEntry will take ownership of the passed
* object
* \param doc The textual documentation that describes the DocumentationEntry in a
* human readable format
* \param optional Determines whether the Documentation containing this
* DocumentationEntry must have a key \p key, or whether it is optional
* \pre \p key must not be empty
* \pre \p verifier must not be nullptr
*/
DocumentationEntry(std::string key, Verifier* verifier, std::string doc = "",
Optional optional = Optional::No);
/// The key that is described by this DocumentationEntry
std::string key;
/// The Verifier that is used to test the key's value
std::shared_ptr<Verifier> verifier;
/// Determines whether the described DocumentationEntry is optional or not
Optional optional;
/// The textual description of this DocumentationEntry
std::string documentation;
};
/**
* This struct contains the documentation and specification for a ghoul::Dictionary. It is
* used to impose restrictions on keys and values and determine whether a given
* ghoul::Dictionary adheres to these specifications (see #testSpecification and
* #testSpecificationAndThrow methods). Each Documentation consists of a human-readable
* \c name, a list of DocumentationEntry%s that each describe a single key value, and a
* flag whether these entries are Exhaustive or not. If a Documentation is Exhaustive, a
* ghoul::Dictionary that contains additional keys will fail the specification, whereas a
* non-exhaustive Documentation allow for other (potentially non used) keys. The most
* convenient way of creating a Documentation is by using nested initializer lists:
*\verbatim
Documentation doc = {
"Documentation for an arbitrary dictionary",
{ // A list of DocumentationEntry%s; also specified using initializer lists
{ "key1", new IntVerifier, "Documentation key1", Optional::Yes },
{ "key2", new FloatVerifier, "Documentation key2" },
{ "key3", new StringVerifier }
},
Exhaustive::Yes
+;
\endverbatim
*
* If multiple DocumentationEntries cover the same key, they are all evaluated for that
* specific key. The same holds true if there is a DocumentationEntry with a
* DocumentationEntry::Wildcard and a more specialized DocumentationEntry. In this case,
* both the wildcard and the specialized entry will be evaluated.
*/
struct Documentation {
using DocumentationEntries = std::vector<documentation::DocumentationEntry>;
/**
* Creates a Documentation with a human-readable \p name and a list of \p entries.
* \param name The human-readable name of this Documentation
* \param id A unique identifier which can be used by applications (or other
* Documentation%s to reference this entry
* \param entries A list of DocumentationEntry%s that describe the individual keys for
* this entrie Documentation
* \param exhaustive Determines whether the \p entries are an exhaustive specification
* of the object or whether additional, potentially unused, keys are allowed
*/
Documentation(std::string name, std::string id, DocumentationEntries entries = {},
Exhaustive exhaustive = Exhaustive::No);
/**
* Creates a Documentation with a human-readable \p name.
* \param name The human-readable name of this Documentation
* \param entries A list of DocumentationEntry%s that describe the individual keys for
* this entrie Documentation
* \param exhaustive Determines whether the \p entries are an exhaustive specification
* of the object or whether additional, potentially unused, keys are allowed
*/
Documentation(std::string name, DocumentationEntries entries = {},
Exhaustive exhaustive = Exhaustive::No);
/**
* Creates a Documentation.
* \param entries A list of DocumentationEntry%s that describe the individual keys for
* this entrie Documentation
* \param exhaustive Determines whether the \p entries are an exhaustive specification
* of the object or whether additional, potentially unused, keys are allowed
*/
Documentation(DocumentationEntries entries = {}, Exhaustive exhaustive = Exhaustive::No);
/// The human-readable name of the Documentation
std::string name;
/// A unique identifier which can be used to reference this Documentation
std::string id;
/// A list of specifications that are describing this Documentation
DocumentationEntries entries;
/// A flag to say wheter the DocumentationEntries are an exhaustive description
Exhaustive exhaustive;
};
/**
* This method tests whether a provided ghoul::Dictionary \p dictionary adheres to the
* specification \p documentation and returns its result as a TestResult. The TestResult
* will contain whether the \p dictionary adheres to the \p documentation and, in
* addition, the list of all offending keys together with the reason why they are
* offending.
* \param documentation The Documentation that the \p dictionary is tested against
* \param dictionary The ghoul::Dictionary that is to be tested against the
* \p documentation
* \return A TestResult that contains the results of the specification testing
*/
TestResult testSpecification(const Documentation& documentation,
const ghoul::Dictionary& dictionary);
/**
* This method tests whether a provided ghoul::Dictionary \p dictionary adheres to the
* specification \p documentation. If the \p dictionary does not adhere to the
* specification a SpecificationError is thrown, and the exception contains the TestResult
* that contains more information about the offending keys. If the \p dictionary adheres to
* the \p documentation, the method returns normally.
* \param documentation The Documentation that the \p dictionary is tested against
* \param dictionary The ghoul::Dictionary that is to be tested against the
* \p documentation
* \param component The component that is using this method; this argument is passed to the
* SpecificationError that is thrown in case of not adhering to the \p documentation
* \throw SpecificationError If the \p dictionary does not adhere to the \p documentation
*/
void testSpecificationAndThrow(const Documentation& documentation,
const ghoul::Dictionary& dictionary, std::string component);
} // namespace documentation
// We want to make it easier for people to use it, so we pull the Documentation class into
// the openspace namespace
using documentation::Documentation;
} // namespace openspace
#endif // __DOCUMENTATION_H__
@@ -0,0 +1,102 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* *
* 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 __DOCUMENTATIONENGINE_H__
#define __DOCUMENTATIONENGINE_H__
#include <openspace/documentation/documentation.h>
#include <ghoul/designpattern/singleton.h>
#include <ghoul/misc/exception.h>
namespace openspace {
namespace documentation {
/**
* The DocumentationEngine has the ability to collect all Documentation%s that are
* produced in the application an write them out as a documentation file for human
* consumption.
*/
class DocumentationEngine : public ghoul::Singleton<DocumentationEngine> {
public:
/**
* This exception is thrown by the addDocumentation method if a provided Documentation
* has an identifier, but the identifier was registered previously.
*/
struct DuplicateDocumentationException : public ghoul::RuntimeError {
/**
* Constructor of a DuplicateDocumentationException storing the offending
* Documentation for later use.
* \param documentation The Documentation whose identifier was previously
* registered
*/
DuplicateDocumentationException(Documentation documentation);
/// The offending Documentation whose identifier was previously registered
Documentation documentation;
};
/**
* Write the collected Documentation%s to disk at the \p filename in the specified
* \p type. A new file is created and silently overwritten in the location that
* \p filename is pointed to.
* \param filename The file that is to be created containing all the Documentation
* information.
* \param type The type of documentation that is written. Currently allowed values are
* \c text and \c html
*/
void writeDocumentation(const std::string& filename, const std::string& type);
/**
* Adds the \p documentation to the list of Documentation%s that are written to a
* documentation file with the writeDocumentation method.
* \param documentation The Documentation object that is to be stored for later use
* \throws DuplicateDocumentationException If the \p documentation has a non-empty
* identifier and it was not unique
*/
void addDocumentation(Documentation documentation);
/**
* Returns a list of all registered Documentation%s
* \return A list of all registered Documentation%s
*/
std::vector<Documentation> documentations() const;
/**
* Returns a static reference to the main singleton DocumentationEngine
* \return A static reference to the main singleton DocumentationEngine
*/
static DocumentationEngine& ref();
private:
/// The list of all Documentation%s that are stored by the DocumentationEngine
std::vector<Documentation> _documentations;
};
} // namespace documentation
} // namespace openspace
#define DocEng (openspace::documentation::DocumentationEngine::ref())
#endif // __DOCUMENTATIONENGINE_H__
+858
View File
@@ -0,0 +1,858 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* *
* 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 __VERIFIER_H__
#define __VERIFIER_H__
#include <openspace/documentation/documentation.h>
#include <functional>
namespace openspace {
namespace documentation {
/**
* The base class of all Verifier%s. Each object must have an Verifier::operator()
* overload, that performs the actual testing of the key inside the passed
* ghoul::Dictionary and return a TestResult. The Verifier::type method returns a
* human-readable representation of the type that is expected by the concret subclass of
* Verifier. Furthermore, the Verifier::documentation method returns a human-readable
* description of the Verifier subclass and what it tests for.
*/
struct Verifier {
/**
* This method tests whether the \p key contained in the \p dictionary adheres to
* whatever the concrete Verifer needs to test. The actual testing depends on the
* concrete subclass and can range from type testing (for example IntVerifier or
* StringVerifier) to more complex testing (for example DoubleInRangeVerifier or
* TableVerifier).
* \param dictionary The dictionary that contains the \p key which is to be tested by
* this Verifier
* \param key The key inside the \p dictionary that is to be tested
* \return A TestResult struct that contains information about whether the key adheres
* to the demands of the specific Verifier. If it does not, TestResult::offenders will
* either contain \p key or, in the case of a TableVerifier, a list of all offending
* subkeys as fully qualified names.
* \post If the return values' TestResult::success is \c true, its
* TestResult::offenders is empty
*/
virtual TestResult operator()(const ghoul::Dictionary& dictionary,
const std::string& key) const = 0;
/**
* This method returns a human-readable string describing the type of object that is
* handled by the Verifier subclass. This is only used for generating a human-readable
* documentation and description of a Documenation object.
* \return A human-readable string describing the type of object for the Verifier
* \post The return value is not empty
*/
virtual std::string type() const = 0;
/**
* This method returns a human-readable string describing the tests that the concrete
* Verifier subclass implements. This is only used for generating a human-readable
* documentation and description of a Documentation object.
* \return A human-readable string describing the tests that are performed by the
* Verifier
* \post The return value is not empty
*/
virtual std::string documentation() const = 0;
};
//----------------------------------------------------------------------------------------
// General verifiers
//----------------------------------------------------------------------------------------
/**
* The base class Verifier for all Verifier%s that have to test against a specific value
* type. This Verifier tests whether a given key exists and whether it has the same type
* as the template parameter \c T.
* \tparam T The type against which the key's value is tested
*/
template <typename T>
struct TemplateVerifier : public Verifier {
using Type = T;
/**
* Tests whether the \p key contained in the ghoul::Dictionary \p dictionary exists
* and has the same type as \c T.
* \param dictionary The ghoul::Dictionary that contains the \p key to be tested
* \param key The key inside the \p dictinoary that is to be tested
* \return A TestResult that contains the information whether the \p key exists in the
* \p dictionary and whether the key's value's type agrees with \c T.
* \post The return values' TestResult::success is either \c true and
* TestResult::offenders is empty, or it is \c false and TestResult::offenders
* contains \p key
*/
TestResult operator()(const ghoul::Dictionary& dictionary,
const std::string& key) const override;
std::string documentation() const override;
};
/**
* A Verifier that checks whether a given key inside a ghoul::Dictionary is of type
* \c bool. No implicit conversion is considered in this testing.
*/
struct BoolVerifier : public TemplateVerifier<bool> {
std::string type() const override;
};
/**
* A Verifier that checks whether a given key inside a ghoul::Dictionary is of type
* \c double. No implicit conversion is considered in this testing.
*/
struct DoubleVerifier : public TemplateVerifier<double> {
std::string type() const override;
};
/**
* A Verifier that checks whether a given key inside a ghoul::Dictionary is of type
* \c int. It will also return \c true if the key's value is of type \c double, but is a
* integer value (for example, <code>0.0</code>, <code>12.0</code>, but not
* <code>0.5</code>).
*/
struct IntVerifier : public TemplateVerifier<int> {
TestResult operator()(const ghoul::Dictionary& dict,
const std::string& key) const override;
std::string type() const override;
};
/**
* A Verifier that checks whether a given key inside a ghoul::Dictionary is of type
* <code>std::string</code>. No implicit conversion is considered in this testing.
*/
struct StringVerifier : public TemplateVerifier<std::string> {
std::string type() const override;
};
/**
* A Verifier that checks whether a given key inside a ghoul::Dictionary is another
* ghoul::Dictionary. The constructor takes a list of DocumentationEntry%s, which are used
* recursively to check the contained table. If this list is empty, a simple type testing
* is performed instead. If the testing finds any offending keys, it will return those keys
* with fully qualified names, that is, the name of the table will be prepended to the
* offending keys. Example: If the key \c Table is tested and a passed DocumentationEntry
* checks for a nested key \c a and this does not comply, this Verifier will return
* <code>Table.a</code> as an offender.
*/
struct TableVerifier : public TemplateVerifier<ghoul::Dictionary> {
/**
* This constructor takes a list of DocumentationEntry%s that are used recursively to
* check the table (= ghoul::Dictionary) contained in the key's value. Similar to the
* Documentation, these DocumentationEntry%s can be Exhaustive or not.
* \param documentationEntries The DocumentationEntry%s that are used to recursively
* test the ghoul::Dictionary that is contained inside. If this list is empty, only a
* type check is performed
* \param exhaustive Whether the DocumentationEntry%s contained in
* \p documentationEntries completely describe the contained table or whether
* additional keys are allowed
*/
TableVerifier(std::vector<DocumentationEntry> documentationEntries = {},
Exhaustive exhaustive = Exhaustive::No);
/**
* Checks whether the \p key%'s value is a table (= ghoul::Dictionary) and (if
* provided) recursively checks whether the table adheres to the DocumentationEntry%s
* provided in the constructor. If the testing finds any offending keys, it will
* return those keys with fully qualified names, that is, the name of the table will
* be prepended to the offending keys.
* \param dictionary The ghoul::Dictionary that is to be tested for the \p key
* \param key The key for which the \p dictionary is tested
* \return A TestResult containing the results of the testing. If DocumentationEntry%s
* were specified in the constructor and one of those values find an offending key
* inside the table, it's name will be returned with a fully qualified name by
* prepending the name (= \key) of the table.
*/
TestResult operator()(const ghoul::Dictionary& dictionary,
const std::string& key) const override;
std::string type() const override;
/// The documentations passed in the constructor
std::vector<DocumentationEntry> documentations;
/// Flag that specifies whether the TableVerifier::documentation exhaustively
/// describes the table or whether additional keys are allowed
Exhaustive exhaustive;
};
//----------------------------------------------------------------------------------------
// Vector verifiers
//----------------------------------------------------------------------------------------
/**
* This struct is the base class for all Verifier%s that check for \c glm vector types.
* The template parameter for the subclasses is the containing type, not the full vector
* type. For example to check for <code>glm::dvec3</code>, one would create a
* <code>Vector3Verifier<double></code>.
*/
struct VectorVerifier {};
/**
* This Verifier checks whether the value is of type <code>glm::tvec2<T></code>
*/
template <typename T>
struct Vector2Verifier : public TemplateVerifier<glm::tvec2<T>>, public VectorVerifier {
std::string type() const override;
};
/**
* This Verifier checks whether the value is of type <code>glm::tvec3<T></code>
*/
template <typename T>
struct Vector3Verifier : public TemplateVerifier<glm::tvec3<T>>, public VectorVerifier {
std::string type() const override;
};
/**
* This Verifier checks whether the value is of type <code>glm::tvec4<T></code>
*/
template <typename T>
struct Vector4Verifier : public TemplateVerifier<glm::tvec4<T>>, public VectorVerifier {
std::string type() const override;
};
//----------------------------------------------------------------------------------------
// Operator verifiers
//----------------------------------------------------------------------------------------
/**
* This is the abstract base class of all binary operator-based verifiers. This class
* takes two template parameters. The first is the Verifier that one would use to only
* check for the type of the object, for example IntVerifier. The second argument is a
* function object that has its <code>operator()</code> function overloaded and returns a
* boolean value. In these cases, the \c std function objects <code>std::less</code>,
* <code>std::equal_to</code>, etc are used.
*
* This verifier will apply the \c Operator to the stored value and the incoming value
* (after type checking) and will check if the \c Operator returns \c true or \c false.
* The incoming value is used as the first argument and the stored value as the second
* argument to the \c Operator. If the type checking fails, the offense reason
* TestResult::Offense::Reason::WrongType is returned. If the \c Operator fails, the
* reason TestResult::Offense::Verification is returned instead.
*/
template <typename T, typename Operator>
struct OperatorVerifier : public T {
/**
* Constructor for an OperatorVerifier. As all operators need to compare the incoming
* value to a stored value, we require the comparison \p value to be passed in here.
* \param value The value against which the tested value is compared using the
* \c Operator
*/
OperatorVerifier(typename T::Type value);
/**
* First checks whether the \p dictionary contains the passed \p key and whether the
* \p key%'s value is correct using the template paramater \c T as a verifier. Then,
* the \p key%'s value is checked against the stored OperatorVerifier::value using the
* \c Operator.
* \param dictionary The ghoul::Dictionary that contains the \p key to be tested
* \param key The key inside the \p dictinoary that is to be tested
* \return A TestResult containing the results of the specification testing. If the
* \p key%'s value has the wrong type, it will be added to the TestResult's offense
* list with the reason TestResult::Offense::Reason::WrongType; if the \c Operator
* returns false, it will be added with the reason TestResult::Offense::Verification
* instead.
*/
TestResult operator()(const ghoul::Dictionary& dictionary,
const std::string& key) const override;
/// The stored value which is passed to the \c Operator as a second argument
typename T::Type value;
};
/**
* This Verifier checks whether the incoming value is strictly smaller than the stored
* value. Due to the operator type restrictions, \c T cannot be a subclass of (or the same
* as) BoolVerifier, StringVerifier, TableVerifier, or VectorVerifier.
*/
template <typename T>
struct LessVerifier : public OperatorVerifier<T, std::less<typename T::Type>> {
static_assert(!std::is_base_of_v<BoolVerifier, T>, "T cannot be BoolVerifier");
static_assert(!std::is_base_of_v<StringVerifier, T>, "T cannot be StringVerifier");
static_assert(!std::is_base_of_v<TableVerifier, T>, "T cannot be TableVerifier");
static_assert(!std::is_base_of_v<VectorVerifier, T>, "T cannot be VectorVerifier");
using OperatorVerifier::OperatorVerifier;
std::string documentation() const;
};
/**
* This Verifier checks whether the incoming value is smaller than or equal to the stored
* value. Due to the operator type restrictions, \c T cannot be a subclass of (or the same
* as) BoolVerifier, StringVerifier, TableVerifier, or VectorVerifier.
*/
template <typename T>
struct LessEqualVerifier : public OperatorVerifier<T, std::less_equal<typename T::Type>> {
static_assert(!std::is_base_of_v<BoolVerifier, T>, "T cannot be BoolVerifier");
static_assert(!std::is_base_of_v<StringVerifier, T>, "T cannot be StringVerifier");
static_assert(!std::is_base_of_v<TableVerifier, T>, "T cannot be TableVerifier");
static_assert(!std::is_base_of_v<VectorVerifier, T>, "T cannot be VectorVerifier");
using OperatorVerifier::OperatorVerifier;
std::string documentation() const override;
};
/**
* This Verifier checks whether the incoming value is strictly greater than the stored
* value. Due to the operator type restrictions, \c T cannot be a subclass of (or the same
* as) BoolVerifier, StringVerifier, TableVerifier, or VectorVerifier.
*/
template <typename T>
struct GreaterVerifier : public OperatorVerifier<T, std::greater<typename T::Type>> {
static_assert(!std::is_base_of_v<BoolVerifier, T>, "T cannot be BoolVerifier");
static_assert(!std::is_base_of_v<StringVerifier, T>, "T cannot be StringVerifier");
static_assert(!std::is_base_of_v<TableVerifier, T>, "T cannot be TableVerifier");
static_assert(!std::is_base_of_v<VectorVerifier, T>, "T cannot be VectorVerifier");
using OperatorVerifier::OperatorVerifier;
std::string documentation() const override;
};
/**
* This Verifier checks whether the incoming value is greater than or equal to the stored
* value. Due to the operator type restrictions, \c T cannot be a subclass of (or the same
* as) BoolVerifier, StringVerifier, TableVerifier, or VectorVerifier.
*/
template <typename T>
struct GreaterEqualVerifier : public OperatorVerifier<T, std::greater_equal<typename T::Type>> {
static_assert(!std::is_base_of_v<BoolVerifier, T>, "T cannot be BoolVerifier");
static_assert(!std::is_base_of_v<StringVerifier, T>, "T cannot be StringVerifier");
static_assert(!std::is_base_of_v<TableVerifier, T>, "T cannot be TableVerifier");
static_assert(!std::is_base_of_v<VectorVerifier, T>, "T cannot be VectorVerifier");
using OperatorVerifier::OperatorVerifier;
std::string documentation() const override;
};
/**
* This Verifier checks whether the incoming value is equal to the stored value. Due to the
* operator type restrictions, \c T cannot be a subclass of (or the same as) TableVerifier.
*/
template <typename T>
struct EqualVerifier : public OperatorVerifier<T, std::equal_to<typename T::Type>> {
static_assert(!std::is_base_of_v<TableVerifier, T>, "T cannot be TableVerifier");
using OperatorVerifier::OperatorVerifier;
std::string documentation() const override;
};
/**
* This Verifier checks whether the incoming value is unequal to the store value. Due to
* the operator type restrictions, \c T cannot be a subclass of (or the same as)
* TableVerifier.
*/
template <typename T>
struct UnequalVerifier : public OperatorVerifier<T, std::not_equal_to<typename T::Type>> {
static_assert(!std::is_base_of_v<TableVerifier, T>, "T cannot be TableVerifier");
using OperatorVerifier::OperatorVerifier;
std::string documentation() const override;
};
//----------------------------------------------------------------------------------------
// List verifiers
//----------------------------------------------------------------------------------------
/**
* This Verifier checks whether the incoming value is of the correct type, using the
* Verifier passed as a template parameter \c T and then checks whether it is part of a
* list that is passed to the constructor. To the missing equality operator, \c T cannot
* be a subclass of (or the same as) TableVerifier.
*/
template <typename T>
struct InListVerifier : public T {
static_assert(!std::is_base_of_v<TableVerifier, T>, "T cannot be TableVerifier");
/**
* Constructs an InListVerifier that checks whether the incoming value is of the
* correct type and whether the value is part of the list passed as \p values.
* \param values The list of values against which the incoming value is tested
*/
InListVerifier(std::vector<typename T::Type> values);
/**
* Tests whether the \p key exists in the \p dictionary, whether it has the correct
* type by invoking the template parameter \c T, and then tests if the \p key's value
* is part of the list passed to the constructor.
* \param dictionary The ghoul::Dictionary that contains the \p key
* \param key The key that is contained in the \p dictionary and whose value is tested
* \return A TestResult containing the results of the specification testing. If the
* \p key%'s value has the wrong type, it will be added to the TestResult's offense
* list with the reason TestResult::Offense::Reason::WrongType; if the value is not
* in the list, it will be added with the reason TestResult::Offense::Verification
* instead.
*/
TestResult operator()(const ghoul::Dictionary& dictionary,
const std::string& key) const override;
std::string documentation() const override;
/// The list of values against which the incoming value is tested
std::vector<typename T::Type> values;
};
/**
* This Verifier checks whether the incoming value is of the correct type, using the
* Verifier passed as a template parameter \c T and then checks whether it is not part of a
* list that is passed to the constructor. To the missing equality operator, \c T cannot
* be a subclass of (or the same as) TableVerifier.
*/
template <typename T>
struct NotInListVerifier : public T {
static_assert(!std::is_base_of_v<TableVerifier, T>, "T cannot be TableVerifier");
/**
* Constructs a NotInListVerifier that checks whether the incoming value is of the
* correct type and whether the value is not part of the list passed as \p values.
* \param values The list of values against which the incoming value is tested
*/
NotInListVerifier(std::vector<typename T::Type> values);
/**
* Tests whether the \p key exists in the \p dictionary, whether it has the correct
* type by invoking the template parameter \c T, and then tests if the \p key's value
* is not part of the list passed to the constructor.
* \param dictionary The ghoul::Dictionary that contains the \p key
* \param key The key that is contained in the \p dictionary and whose value is tested
* \return A TestResult containing the results of the specification testing. If the
* \p key%'s value has the wrong type, it will be added to the TestResult's offense
* list with the reason TestResult::Offense::Reason::WrongType; if the value is in the
* list, it will be added with the reason TestResult::Offense::Verification instead.
*/
TestResult operator()(const ghoul::Dictionary& dictionary,
const std::string& key) const override;
std::string documentation() const override;
std::vector<typename T::Type> values;
};
//----------------------------------------------------------------------------------------
// Range verifiers
//----------------------------------------------------------------------------------------
/**
* This Verifier checks whether the incoming value is of the correct type, using the
* Verifier passed as a template parameter \c T and then checks whether it is greater or
* equal to a lower limit and less or equal to a higher limit. To the missing comparison
* operators, \c T cannot be a subclass of (or the same as) BoolVerifier, StringVerifier,
* TableVerifier, or VectorVerifier. Both the lower and the higher limit are inclusive).
*/
template <typename T>
struct InRangeVerifier : public T {
static_assert(!std::is_base_of_v<BoolVerifier, T>, "T cannot be BoolVerifier");
static_assert(!std::is_base_of_v<StringVerifier, T>, "T cannot be StringVerifier");
static_assert(!std::is_base_of_v<TableVerifier, T>, "T cannot be TableVerifier");
static_assert(!std::is_base_of_v<VectorVerifier, T>, "T cannot be VectorVerifier");
/**
* Constructs a InRangeVerifier that checks whether the incoming value is of the
* correct type and whether the value is greater or equal to \p lower and less or equal
* to \upper.
* \param lower The (inclusive) lower limit of the range
* \param upper The (inclusive) upper limit of the range
* \pre \p lower must be smaller or equal to \p upper
*/
InRangeVerifier(typename T::Type lower, typename T::Type upper);
/**
* Tests whether the \p key exists in the \p dictionary, whether it has the correct
* type by invoking the template parameter \c T, and then tests if the \p key's value
* is between the lower and upper limits (both inclusive) that were passed to the
* constructor.
* \param dictionary The ghoul::Dictionary that contains the \p key
* \param key The key that is contained in the \p dictionary and whose value is tested
* \return A TestResult containing the results of the specification testing. If the
* \p key%'s value has the wrong type, it will be added to the TestResult's offense
* list with the reason TestResult::Offense::Reason::WrongType; if the value is outside
* the range defined by the lower and upper limits passed to the constructor, it will
* be added with the reason TestResult::Offense::Verification instead.
*/
TestResult operator()(const ghoul::Dictionary& dictionary,
const std::string& key) const override;
std::string documentation() const override;
typename T::Type lower;
typename T::Type upper;
};
/**
* This Verifier checks whether the incoming value is of the correct type, using the
* Verifier passed as a template parameter \c T and then checks whether it is outside the
* (exclusive) range defined by a lower and upper limit. To the missing comparison
* operators, \c T cannot be a subclass of (or the same as) BoolVerifier, StringVerifier,
* TableVerifier, or VectorVerifier. Both the lower and the higher limit are exclusive).
*/
template <typename T>
struct NotInRangeVerifier : public T {
static_assert(!std::is_base_of_v<BoolVerifier, T>, "T cannot be BoolVerifier");
static_assert(!std::is_base_of_v<StringVerifier, T>, "T cannot be StringVerifier");
static_assert(!std::is_base_of_v<TableVerifier, T>, "T cannot be TableVerifier");
static_assert(!std::is_base_of_v<VectorVerifier, T>, "T cannot be VectorVerifier");
/**
* Constructs a InRangeVerifier that checks whether the incoming value is of the
* correct type and whether the value is less then \p lower and greater than \upper.
* \param lower The (exclusive) lower limit of the range
* \param upper The (exclusive) upper limit of the range
* \pre \p lower must be smaller or equal to \p upper
*/
NotInRangeVerifier(typename T::Type lower, typename T::Type upper);
/**
* Tests whether the \p key exists in the \p dictionary, whether it has the correct
* type by invoking the template parameter \c T, and then tests if the \p key's value
* is outside the lower and upper limits (both exclusive) that were passed to the
* constructor.
* \param dictionary The ghoul::Dictionary that contains the \p key
* \param key The key that is contained in the \p dictionary and whose value is tested
* \return A TestResult containing the results of the specification testing. If the
* \p key%'s value has the wrong type, it will be added to the TestResult's offense
* list with the reason TestResult::Offense::Reason::WrongType; if the value is greater
* or equal to the lower limit and less or equal to the upper limit, it will be added
* with the reason TestResult::Offense::Verification instead.
*/
TestResult operator()(const ghoul::Dictionary& dictionary,
const std::string& key) const override;
std::string documentation() const override;
typename T::Type lower;
typename T::Type upper;
};
//----------------------------------------------------------------------------------------
// Misc verifiers
//----------------------------------------------------------------------------------------
/**
* This Verifier only checks for the correct type of the incoming value. If the
* documentation is requested, it will return an additional string that is the annotation.
* This can be used to specify further conditions that are hard (or impossible) to codify,
* but the user should be notified about. This, for example, can be that used to notify
* the user that the parameter should be a file of a specific type.
*/
template <typename T>
struct AnnotationVerifier : public T {
/**
* Constructs an AnnotationVerifier that contains the passed \p annotation which is
* passed to the user when a documentation is requested.
* \param annotation The annotation that is stored and returned to the user when it
* is requested.
* \pre annotation must not be empty
*/
AnnotationVerifier(std::string annotation);
std::string documentation() const override;
/// The annotation that is returned to the user in the documentation
std::string annotation;
};
/**
* This Verifier can reference and apply other Documentation%s that have been registered
* with a DocumentationEngine. The dependency is only resolved when the operator() is
* called, at which the referencing Documentation must have been registered, or the
* TestResult will contain an offense of TestResult::Offense::Reason::UnknownIdentifier.
* If the referenced Documentation exists, the stored Table will be checked against that
* Documentation.
*/
struct ReferencingVerifier : public TableVerifier {
/**
* Creates a ReferencingVerifier that references a documentation with the provided
* \p identifier. The ReferencingVerifier will use the static DocumentationEngine to
* retrieve Documentation%s and find the \p identifier among them.
* \param identifier The identifier of the Documentation that this Verifier references
*/
ReferencingVerifier(std::string identifier);
/**
* Checks whether the \p key in the \p dictionary exists and is of type Table (similar
* to the TableVerifier). If it exists and is a Table, the Documentation referenced by
* the identifier provided in the constructor is used to validate the Table. If the
* identifier does not name a registered Documentation, the TestResult::offenses
* will contain the \p key and TestResult::Offense::Reason::UnknownIdentifier will be
* signaled. If the identifier exists and the \p key%'s value does not comply with the
* Documentation, the offending keys will be returned in the TestResult with their
* fully qualified names.
* \param dictionary The ghoul::Dictionary whose \p key should be tested
* \param key The key contained in the \p dictionary that should be tested
* \return A TestResult struct that contains the results of the testing
*/
TestResult operator()(const ghoul::Dictionary& dictionary,
const std::string& key) const override;
std::string documentation() const override;
/// The identifier that references another Documentation registered with the
/// DocumentationEngine
std::string identifier;
};
//----------------------------------------------------------------------------------------
// Misc verifiers
//----------------------------------------------------------------------------------------
/**
* This Verifier takes two Verifiers and performs a boolean \c and operation on their
* results. In essence, a value only passes this Verifier if it passes both Verifier%s
* that are passed in the constructor. Opposed to the <code>C++</code> <code>&&</code>
* operator, the AndVerifier does not perform any short-circut evaluation.
*/
struct AndVerifier : public Verifier {
/**
* Constructs an AndVerifier with two Verifiers which must be cleared by incoming
* values in order to pass this Verifier.
* \param lhs The first Verifier that is to be tested
* \param rhs The second Verifier that is to be tested
* \pre lhs must not be nullptr
* \pre rhs must not be nullptr
*/
AndVerifier(Verifier* lhs, Verifier* rhs);
/**
* Checks whether the \p dictionary contains the \p key and whether this key passes
* both Verifier%'s that were passed in the constructor. If the value fails either
* of the two Verifiers, it is only added once to the TestResult::offenses list with
* a reason of TestResult::Offense::Reason::Verification.
* \param dictionary The ghoul::Dictionary that is to be tested
* \param key The key contained in \p dictionary that is to be tested
* \return A TestResult object that contains the test results. If the value fails
* either of the two Verifiers, TestResult::success is \c false and the
* TestResult::offenses list contains \p with a reason of
* TestResult::Offense::Reason::Verification. If \p key%'s value passes both
* Verifier%s, the result's TestResult::success is \c true and the
* TestResult::offenses is empty.
*/
TestResult operator()(const ghoul::Dictionary& dictionary,
const std::string& key) const override;
std::string type() const override;
std::string documentation() const override;
/// The first Verifier that incoming values are tested against
std::shared_ptr<Verifier> lhs;
/// The second Verifier that incoming values are tested against
std::shared_ptr<Verifier> rhs;
};
/**
* This Verifier takes two Verifiers and performs a boolean \c or operation on their
* results. In essence, a value only passes this Verifier if it passes either of the two
* Verifier%s that are passed in the constructor. Opposed to the <code>C++</code>
* <code>||</code> operator, the OrVerifier does not perform any short-circut evaluation.
*/
struct OrVerifier : public Verifier {
/**
* Constructs an OrVerifier with two Verifiers, either of which must be cleared by
* incoming values in order to pass this Verifier.
* \param lhs The first Verifier that is to be tested
* \param rhs The second Verifier that is to be tested
* \pre lhs must not be nullptr
* \pre rhs must not be nullptr
*/
OrVerifier(Verifier* lhs, Verifier* rhs);
/**
* Checks whether the \p dictionary contains the \p key and whether this key passes
* either of the two Verifier%'s that were passed in the constructor. If the value
* fails both Verifiers, it is added to the TestResult::offenses list with a reason of
* TestResult::Offense::Reason::Verification.
* \param dictionary The ghoul::Dictionary that is to be tested
* \param key The key contained in \p dictionary that is to be tested
* \return A TestResult object that contains the test results. If the value fails
* both Verifiers, TestResult::success is \c false and the TestResult::offenses list
* contains \p with a reason of TestResult::Offense::Reason::Verification. If \p key%'s
* value passes either of the two Verifier%s, the result's TestResult::success is
* \c true and the TestResult::offenses is empty.
*/
TestResult operator()(const ghoul::Dictionary& dict,
const std::string& key) const override;
std::string type() const override;
std::string documentation() const override;
/// The first Verifier that incoming values are tested against
std::shared_ptr<Verifier> lhs;
/// The second Verifier that incoming values are tested against
std::shared_ptr<Verifier> rhs;
};
/// A short-hand definition for a Verifier checking for <code>glm::bvec2</code>
using BoolVector2Verifier = Vector2Verifier<bool>;
/// A short-hand definition for a Verifier checking for <code>glm::ivec2</code>
using IntVector2Verifier = Vector2Verifier<int>;
/// A short-hand definition for a Verifier checking for <code>glm::dvec2</code>
using DoubleVector2Verifier = Vector2Verifier<double>;
/// A short-hand definition for a Verifier checking for <code>glm::bvec3</code>
using BoolVector3Verifier = Vector3Verifier<bool>;
/// A short-hand definition for a Verifier checking for <code>glm::ivec3</code>
using IntVector3Verifier = Vector3Verifier<int>;
/// A short-hand definition for a Verifier checking for <code>glm::dvec3</code>
using DoubleVector3Verifier = Vector3Verifier<double>;
/// A short-hand definition for a Verifier checking for <code>glm::bvec4</code>
using BoolVector4Verifier = Vector4Verifier<bool>;
/// A short-hand definition for a Verifier checking for <code>glm::ivec4</code>
using IntVector4Verifier = Vector4Verifier<int>;
/// A short-hand definition for a Verifier checking for <code>glm::dvec4</code>
using DoubleVector4Verifier = Vector4Verifier<double>;
/// A short-hand definition for a LessVerifier with a type check for \c int
using IntLessVerifier = LessVerifier<IntVerifier>;
/// A short-hand definition for a LessVerifier with a type check for \c double
using DoubleLessVerifier = LessVerifier<DoubleVerifier>;
/// A short-hand definition for a LessEqualVerifier with a type check for \c int
using IntLessEqualVerifier = LessEqualVerifier<IntVerifier>;
/// A short-hand definition for a LessEqualVerifier with a type check for \c double
using DoubleLessEqualVerifier = LessEqualVerifier<DoubleVerifier>;
/// A short-hand definition for a GreaterVerifier with a type check for \c int
using IntGreaterVerifier = GreaterVerifier<IntVerifier>;
/// A short-hand definition for a GreaterVerifier with a type check for \c double
using DoubleGreaterVerifier = GreaterVerifier<DoubleVerifier>;
/// A short-hand definition for a GreaterEqualVerifier with a type check for \c int
using IntGreaterEqualVerifier = GreaterEqualVerifier<IntVerifier>;
/// A short-hand definition for a GreaterEqualVerifier with a type check for \c double
using DoubleGreaterEqualVerifier = GreaterEqualVerifier<DoubleVerifier>;
/// A short-hand definition for a EqualVerifier with a type check for \c bool
using BoolEqualVerifier = EqualVerifier<BoolVerifier>;
/// A short-hand definition for a EqualVerifier with a type check for \c int
using IntEqualVerifier = EqualVerifier<IntVerifier>;
/// A short-hand definition for a EqualVerifier with a type check for \c double
using DoubleEqualVerifier = EqualVerifier<DoubleVerifier>;
/// A short-hand definition for a EqualVerifier with a type check for \c string
using StringEqualVerifier = EqualVerifier<StringVerifier>;
/// A short-hand definition for a UnequalVerifier with a type check for \c bool
using BoolUnequalVerifier = UnequalVerifier<BoolVerifier>;
/// A short-hand definition for a UnequalVerifier with a type check for \c int
using IntUnequalVerifier = UnequalVerifier<IntVerifier>;
/// A short-hand definition for a UnequalVerifier with a type check for \c double
using DoubleUnequalVerifier = UnequalVerifier<DoubleVerifier>;
/// A short-hand definition for a UnequalVerifier with a type check for \c string
using StringUnequalVerifier = UnequalVerifier<StringVerifier>;
/// A short-hand definition for a InListVerifier with a type check for \c bool
using BoolInListVerifier = InListVerifier<BoolVerifier>;
/// A short-hand definition for a InListVerifier with a type check for \c int
using IntInListVerifier = InListVerifier<IntVerifier>;
/// A short-hand definition for a InListVerifier with a type check for \c double
using DoubleInListVerifier = InListVerifier<DoubleVerifier>;
/// A short-hand definition for a InListVerifier with a type check for \c string
using StringInListVerifier = InListVerifier<StringVerifier>;
/// A short-hand definition for a NotInListVerifier with a type check for \c bool
using BoolNotInListVerifier = NotInListVerifier<BoolVerifier>;
/// A short-hand definition for a NotInListVerifier with a type check for \c int
using IntNotInListVerifier = NotInListVerifier<IntVerifier>;
/// A short-hand definition for a NotInListVerifier with a type check for \c double
using DoubleNotInListVerifier = NotInListVerifier<DoubleVerifier>;
/// A short-hand definition for a NotInListVerifier with a type check for \c string
using StringNotInListVerifier = NotInListVerifier<StringVerifier>;
/// A short-hand definition for a InRangeVerifier with a type check for \c int
using IntInRangeVerifier = InRangeVerifier<IntVerifier>;
/// A short-hand definition for a InRangeVerifier with a type check for \c double
using DoubleInRangeVerifier = InRangeVerifier<DoubleVerifier>;
/// A short-hand definition for a NotInRangeVerifier with a type check for \c int
using IntNotInRangeVerifier = NotInRangeVerifier<IntVerifier>;
/// A short-hand definition for a NotInRangeVerifier with a type check for \c double
using DoubleNotInRangeVerifier = NotInRangeVerifier<DoubleVerifier>;
/// A short-hand definition for a AnnotationVerifier with a type check for \c bool
using BoolAnnotationVerifier = AnnotationVerifier<BoolVerifier>;
/// A short-hand definition for a AnnotationVerifier with a type check for \c int
using IntAnnotationVerifier = AnnotationVerifier<IntVerifier>;
/// A short-hand definition for a AnnotationVerifier with a type check for \c double
using DoubleAnnotationVerifier = AnnotationVerifier<DoubleVerifier>;
/// A short-hand definition for a AnnotationVerifier with a type check for \c string
using StringAnnotationVerifier = AnnotationVerifier<StringVerifier>;
/// A short-hand definition for a AnnotationVerifier with a type check for
/// <code>ghoul::Dictionary</code>
using TableAnnotationVerifier = AnnotationVerifier<TableVerifier>;
// Definitions of external templates that are instantiated in the cpp file
// This cuts down the compilation times as almost all of the possible template types do
// not need to be instantiated multiple times
extern template struct Vector2Verifier<bool>;
extern template struct Vector2Verifier<int>;
extern template struct Vector2Verifier<double>;
extern template struct Vector3Verifier<bool>;
extern template struct Vector3Verifier<int>;
extern template struct Vector3Verifier<double>;
extern template struct Vector4Verifier<bool>;
extern template struct Vector4Verifier<int>;
extern template struct Vector4Verifier<double>;
extern template struct LessVerifier<IntVerifier>;
extern template struct LessVerifier<DoubleVerifier>;
extern template struct LessEqualVerifier<IntVerifier>;
extern template struct LessEqualVerifier<DoubleVerifier>;
extern template struct GreaterVerifier<IntVerifier>;
extern template struct GreaterVerifier<DoubleVerifier>;
extern template struct GreaterEqualVerifier<IntVerifier>;
extern template struct GreaterEqualVerifier<DoubleVerifier>;
extern template struct EqualVerifier<BoolVerifier>;
extern template struct EqualVerifier<IntVerifier>;
extern template struct EqualVerifier<DoubleVerifier>;
extern template struct EqualVerifier<StringVerifier>;
extern template struct UnequalVerifier<BoolVerifier>;
extern template struct UnequalVerifier<IntVerifier>;
extern template struct UnequalVerifier<DoubleVerifier>;
extern template struct UnequalVerifier<StringVerifier>;
extern template struct InListVerifier<BoolVerifier>;
extern template struct InListVerifier<IntVerifier>;
extern template struct InListVerifier<DoubleVerifier>;
extern template struct InListVerifier<StringVerifier>;
extern template struct NotInListVerifier<BoolVerifier>;
extern template struct NotInListVerifier<IntVerifier>;
extern template struct NotInListVerifier<DoubleVerifier>;
extern template struct NotInListVerifier<StringVerifier>;
extern template struct InRangeVerifier<IntVerifier>;
extern template struct InRangeVerifier<DoubleVerifier>;
extern template struct NotInRangeVerifier<IntVerifier>;
extern template struct NotInRangeVerifier<DoubleVerifier>;
extern template struct AnnotationVerifier<BoolVerifier>;
extern template struct AnnotationVerifier<IntVerifier>;
extern template struct AnnotationVerifier<DoubleVerifier>;
extern template struct AnnotationVerifier<StringVerifier>;
extern template struct AnnotationVerifier<TableVerifier>;
} // namespace documentation
} // namespace openspace
#include "verifier.inl"
#endif // __VERIFIER_H__
@@ -0,0 +1,303 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* *
* 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. *
****************************************************************************************/
#include <iterator>
namespace std {
std::string to_string(std::string value);
}
namespace openspace {
namespace documentation {
template <typename T>
TestResult TemplateVerifier<T>::operator()(const ghoul::Dictionary& dict,
const std::string& key) const
{
if (dict.hasKeyAndValue<Type>(key)) {
return { true, {} };
}
else {
if (dict.hasKey(key)) {
return { false, { { key, TestResult::Offense::Reason::WrongType } } };
}
else {
return { false, { { key, TestResult::Offense::Reason::MissingKey } } };
}
}
}
template <typename T>
std::string TemplateVerifier<T>::documentation() const {
return "Type testing of '" + type() + "'";
}
template <typename T>
std::string Vector2Verifier<T>::type() const {
using namespace std::string_literals;
return "Vector2<"s + typeid(T).name() + ">";
}
template <typename T>
std::string Vector3Verifier<T>::type() const {
using namespace std::string_literals;
return "Vector3<"s + typeid(T).name() + ">";
}
template <typename T>
std::string Vector4Verifier<T>::type() const {
using namespace std::string_literals;
return "Vector4<"s + typeid(T).name() + ">";
}
template <typename T, typename Operator>
OperatorVerifier<T, Operator>::OperatorVerifier(typename T::Type value)
: value(std::move(value))
{}
template <typename T, typename Operator>
TestResult OperatorVerifier<T, Operator>::operator()(const ghoul::Dictionary& dict,
const std::string& key) const
{
TestResult res = T::operator()(dict, key);
if (res.success) {
if (Operator()(dict.value<Type>(key), value)) {
return { true, {} };
}
else {
return { false, { { key, TestResult::Offense::Reason::Verification }}};
}
}
else {
return res;
}
}
template <typename T>
std::string LessVerifier<T>::documentation() const {
return "Less than: " + std::to_string(value);
}
template <typename T>
std::string LessEqualVerifier<T>::documentation() const {
return "Less or equal to: " + std::to_string(value);
}
template <typename T>
std::string GreaterVerifier<T>::documentation() const {
return "Greater than: " + std::to_string(value);
}
template <typename T>
std::string GreaterEqualVerifier<T>::documentation() const {
return "Greater or equal to: " + std::to_string(value);
}
template <typename T>
std::string EqualVerifier<T>::documentation() const {
return "Equal to: " + std::to_string(value);
}
template <typename T>
std::string UnequalVerifier<T>::documentation() const {
return "Unequal to: " + std::to_string(value);
}
template <typename T>
InListVerifier<T>::InListVerifier(std::vector<typename T::Type> values)
: values(std::move(values))
{}
template <typename T>
TestResult InListVerifier<T>::operator()(const ghoul::Dictionary& dict,
const std::string& key) const
{
TestResult res = T::operator()(dict, key);
if (res.success) {
typename T::Type value = dict.value<typename T::Type>(key);
auto it = std::find(values.begin(), values.end(), value);
if (it != values.end()) {
return { true, {} };
}
else {
return { false, { { key, TestResult::Offense::Reason::Verification } } };
}
}
else {
return res;
}
}
template <typename T>
std::string InListVerifier<T>::documentation() const {
std::string result = "In list { ";
std::stringstream s;
std::copy(
values.begin(),
values.end(),
std::ostream_iterator<typename T::Type>(s, ",")
);
std::string joined = s.str();
// We need to remove a trailing ',' at the end of the string
result += joined.substr(0, joined.size() - 1);
result += " }";
return result;
}
template <typename T>
NotInListVerifier<T>::NotInListVerifier(std::vector<typename T::Type> values)
: values(std::move(values))
{}
template <typename T>
TestResult NotInListVerifier<T>::operator()(const ghoul::Dictionary& dict,
const std::string& key) const
{
TestResult res = T::operator()(dict, key);
if (res.success) {
typename T::Type value = dict.value<typename T::Type>(key);
auto it = std::find(values.begin(), values.end(), value);
if (it == values.end()) {
return { true, {} };
}
else {
return { false, { { key, TestResult::Offense::Reason::Verification } } };
}
}
else {
return res;
}
}
template <typename T>
std::string NotInListVerifier<T>::documentation() const {
std::string result = "Not in list { ";
std::stringstream s;
std::copy(
values.begin(),
values.end(),
std::ostream_iterator<typename T::Type>(s, ",")
);
std::string joined = s.str();
// We need to remove a trailing ',' at the end of the string
result += joined.substr(0, joined.size() - 1);
result += " }";
return result;
}
template <typename T>
InRangeVerifier<T>::InRangeVerifier(typename T::Type lower, typename T::Type upper)
: lower(std::move(lower))
, upper(std::move(upper))
{
ghoul_assert(lower <= upper, "lower must be smaller or equal to upper");
}
template <typename T>
TestResult InRangeVerifier<T>::operator()(const ghoul::Dictionary& dict,
const std::string& key) const
{
TestResult res = T::operator()(dict, key);
if (res.success) {
typename T::Type val = dict.value<typename T::Type>(key);
if (val >= lower && val <= upper) {
return { true, {} };
}
else {
return { false, { { key, TestResult::Offense::Reason::Verification } } };
}
}
else {
return res;
}
}
template <typename T>
std::string InRangeVerifier<T>::documentation() const {
return "In range: ( " + std::to_string(lower) + "," +
std::to_string(upper) + " )";
}
template <typename T>
NotInRangeVerifier<T>::NotInRangeVerifier(typename T::Type lower, typename T::Type upper)
: lower(std::move(lower))
, upper(std::move(upper))
{
ghoul_assert(lower <= upper, "lower must be smaller or equal to upper");
}
template <typename T>
TestResult NotInRangeVerifier<T>::operator()(const ghoul::Dictionary& dict,
const std::string& key) const {
TestResult res = T::operator()(dict, key);
if (res.success) {
typename T::Type val = dict.value<typename T::Type>(key);
if (val >= lower && val <= upper) {
return { false, { { key, TestResult::Offense::Reason::Verification } } };
}
else {
return { true, {} };
}
}
else {
return res;
}
}
template <typename T>
std::string NotInRangeVerifier<T>::documentation() const {
return "Not in range: ( " + std::to_string(lower) + "," +
std::to_string(upper) + " )";
}
template <typename T>
AnnotationVerifier<T>::AnnotationVerifier(std::string annotation)
: annotation(std::move(annotation))
{
ghoul_assert(!this->annotation.empty(), "Annotation must not be empty");
}
template <typename T>
std::string AnnotationVerifier<T>::documentation() const {
return annotation;
}
} // namespace documentation
} // namespace openspace
+32 -19
View File
@@ -25,6 +25,8 @@
#ifndef __CONFIGURATIONMANAGER_H__
#define __CONFIGURATIONMANAGER_H__
#include <openspace/documentation/documentation.h>
#include <ghoul/misc/dictionary.h>
namespace openspace {
@@ -49,22 +51,22 @@ public:
/// The key that stores the location of the SGCT configuration file that is used on
/// application launch
static const std::string KeyConfigSgct;
/// The key that stores the type of Lua documentation that should be stored
static const std::string KeyLuaDocumentationType;
/// The key that stores the save location of the Lua documentation
static const std::string KeyLuaDocumentationFile;
/// The key that stores the type of scripting log that should be stored
static const std::string KeyScriptLogType;
/// The key that stores the save location of the scripting log
static const std::string KeyScriptLogFile;
/// The key that stores the type of Property documentation that should be stored
static const std::string KeyPropertyDocumentationType;
/// The key that stores the save location of the Property documentation
static const std::string KeyPropertyDocumentationFile;
/// The key that stores the type of keyboard bindings that should be stored
static const std::string KeyKeyboardShortcutsType;
/// The key that stores the save location of the keyboard bindings file
static const std::string KeyKeyboardShortcutsFile;
/// The part of the key that defines the type
static const std::string PartType;
/// The part of the key that defines the file
static const std::string PartFile;
/// The key that stores the Lua documentation
static const std::string KeyLuaDocumentation;
/// The key that stores the scripting log
static const std::string KeyScriptLog;
/// The key that stores the Property documentation
static const std::string KeyPropertyDocumentation;
/// The key that stores the keyboard bindings that should be stored
static const std::string KeyKeyboardShortcuts;
/// The key that stores the main documentation
static const std::string KeyDocumentation;
/// The key that stores the factory documentation values
static const std::string KeyFactoryDocumentation;
/// The key that stores the location of the scene file that is initially loaded
static const std::string KeyConfigScene;
/// The key that stores the subdirectory containing a list of all startup scripts to
@@ -73,18 +75,24 @@ public:
/// The key that stores the subdirectory containing a list of all settings scripts to
/// be executed on application start and after the scene file is loaded
static const std::string KeySettingsScript;
/// The key that stores the settings for determining log-related settings
static const std::string KeyLogging;
/// The key that stores the desired LogLevel for the whole application
/// \sa ghoul::logging::LogManager
static const std::string KeyLogLevel;
static const std::string PartLogLevel;
/// The key that stores whether the log should be immediately flushed after a n
/// \sa ghoul::logging::LogManager
static const std::string KeyLogImmediateFlush;
static const std::string PartImmediateFlush;
/// The key that stores a subdirectory with a description for additional
/// ghoul::logging::Log%s to be created
/// \sa LogFactory
static const std::string KeyLogs;
static const std::string PartLogs;
/// The key that stores whether a log should be appended to or should be overwritten
static const std::string PartAppend;
/// The key that stores the verbosity (None, Minimal, Default, Full) of the system
/// capabilities components
static const std::string PartCapabilitiesVerbosity;
/// The full key that stores the verbosity of the system capabilities component
static const std::string KeyCapabilitiesVerbosity;
/// The key that stores the time (in seconds) that the application will wait before
/// shutting down after the shutdown call is made
@@ -95,6 +103,9 @@ public:
/// The key that sets the request URL that is used to request additional data to be
/// downloaded
static const std::string KeyDownloadRequestURL;
/// The key that stores the switch for enabling/disabling the rendering on a master
/// computer
static const std::string KeyRenderingMethod;
/**
* Iteratively walks the directory structure starting with \p filename to find the
@@ -123,6 +134,8 @@ public:
*/
void loadFromFile(const std::string& filename);
static Documentation Documentation();
private:
/**
* Checks whether the loaded configuration file is complete, that is specifying the
@@ -179,9 +179,9 @@ public:
class MouseStates
{
public:
/*!
/**
\param sensitivity
\param velocityScalefactor can be set to 60 to remove the inertia of the
\param velocityScaleFactor can be set to 60 to remove the inertia of the
interaction. Lower value will make it harder to move the camera.
*/
MouseStates(double sensitivity, double velocityScaleFactor);
@@ -48,7 +48,10 @@ public:
bool setStringValue(std::string value) override;
T minValue() const;
void setMinValue(T value);
T maxValue() const;
void setMaxValue(T value);
virtual std::string className() const override;
@@ -329,11 +329,21 @@ T NumericalProperty<T>::minValue() const {
return _minimumValue;
}
template <typename T>
void NumericalProperty<T>::setMinValue(T value) {
_minimumValue = std::move(value);
}
template <typename T>
T NumericalProperty<T>::maxValue() const {
return _maximumValue;
}
template <typename T>
void NumericalProperty<T>::setMaxValue(T value) {
_maximumValue = std::move(value);
}
template <typename T>
std::string NumericalProperty<T>::generateAdditionalDescription() const {
std::string result;
@@ -60,9 +60,16 @@ public:
* to its super class.
* \param identifier A unique identifier for this property
* \param guiName The GUI name that should be used to represent this property
* \param displayType Optional DisplayType for GUI (default RADIO)
*/
OptionProperty(std::string identifier, std::string guiName);
/**
* The constructor delegating the <code>identifier</code> and the <code>guiName</code>
* to its super class.
* \param identifier A unique identifier for this property
* \param guiName The GUI name that should be used to represent this property
* \param displayType Optional DisplayType for GUI (default RADIO)
*/
OptionProperty(std::string identifier, std::string guiName, DisplayType displayType);
/**
+2
View File
@@ -71,6 +71,8 @@ public:
* \param identifier A unique identifier for this property. It has to be unique to the
* PropertyOwner and cannot contain any <code>.</code>s
* \param guiName The human-readable GUI name for this Property
* \pre \p identifier must not be empty
* \pre \p guiName must not be empty
*/
Property(std::string identifier, std::string guiName);
@@ -25,6 +25,77 @@
#ifndef __SCALARPROPERTY_H__
#define __SCALARPROPERTY_H__
/**
* \file scalarproperty.h
*
* \addtogroup openspace
* @{
* \addtogroup properties
* @{
* \class BoolProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>bool</code>.
* \class CharProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>char</code>.
* \class SignedCharProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>signed char</code>.
* \class UCharProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>unsigned char</code>.
* \class ShortProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>short</code>.
* \class UShortProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>unsigned short</code>.
* \class IntProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>int</code>.
* \class UIntProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>unsigned int</code>.
* \class LongProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>long</code>.
* \class ULongProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>unsigned long</code>.
* \class LongLongProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>long long</code>.
* \class ULongLongProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>unsigned long long</code>.
* \class FloatProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>float</code>.
* \class DoubleProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>double</code>.
* \class LongDoubleProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>long double</code>.
* @} @}
*/
#include "openspace/properties/numericalproperty.h"
namespace openspace {
@@ -38,7 +38,7 @@ namespace properties {
// C++ class name for which a typedef will be created
// TYPE = The template parameter T for which the TemplateProperty is specialized
#define REGISTER_TEMPLATEPROPERTY_HEADER(CLASS_NAME, TYPE) \
typedef TemplateProperty<TYPE> CLASS_NAME; \
using CLASS_NAME = TemplateProperty<TYPE>; \
\
template <> \
std::string PropertyDelegate<TemplateProperty<TYPE>>::className(); \
@@ -105,7 +105,7 @@ private:
/**
* When a volume is attached or detached from the scene graph,
* the resolve program needs to be recompiled.
* The #_volumes map keeps track of which volumes that can
* The _volumes map keeps track of which volumes that can
* be rendered using the current resolve program, along with their raycast data
* (id, namespace, etc)
*/
+18 -3
View File
@@ -1,4 +1,3 @@
/*****************************************************************************************
* *
* OpenSpace *
@@ -33,6 +32,8 @@
#include <ghoul/opengl/programobject.h>
#include <openspace/documentation/documentation.h>
// Forward declare to minimize dependencies
namespace ghoul {
@@ -51,6 +52,13 @@ class PowerScaledCoordinate;
class Renderable : public properties::PropertyOwner {
public:
enum class RenderBin : int {
Background = 1,
Opaque = 2,
Transparent = 4,
Overlay = 8
};
static Renderable* createFromDictionary(const ghoul::Dictionary& dictionary);
// constructors & destructor
@@ -64,14 +72,18 @@ public:
virtual bool isReady() const = 0;
bool isEnabled() const;
void setBoundingSphere(const PowerScaledScalar& boundingSphere);
const PowerScaledScalar& getBoundingSphere();
void setBoundingSphere(PowerScaledScalar boundingSphere);
PowerScaledScalar getBoundingSphere();
virtual void render(const RenderData& data);
virtual void render(const RenderData& data, RendererTasks& rendererTask);
virtual void postRender(const RenderData& data);
virtual void update(const UpdateData& data);
RenderBin renderBin() const;
void setRenderBin(RenderBin bin);
bool matchesRenderBinMask(int binMask);
bool isVisible() const;
bool hasTimeInterval();
@@ -81,10 +93,13 @@ public:
static void setPscUniforms(ghoul::opengl::ProgramObject& program, const Camera& camera, const PowerScaledCoordinate& position);
static Documentation Documentation();
protected:
properties::BoolProperty _enabled;
private:
RenderBin _renderBin;
PowerScaledScalar boundingSphere_;
std::string _startTime;
std::string _endTime;
@@ -35,6 +35,8 @@
#include <ghoul/opengl/texture.h>
#include <ghoul/opengl/textureunit.h>
#include <openspace/documentation/documentation.h>
namespace openspace {
/**
@@ -63,6 +65,8 @@ public:
glm::vec3 sphericalPosition() const;
float depth() const;
static openspace::Documentation Documentation();
protected:
void createPlane();
void useEuclideanCoordinates(bool b);
+4
View File
@@ -29,6 +29,8 @@
#include <ghoul/misc/dictionary.h>
#include <openspace/util/updatestructures.h>
#include <openspace/documentation/documentation.h>
namespace openspace {
class Ephemeris {
@@ -41,6 +43,8 @@ public:
virtual const glm::dvec3& position() const = 0;
virtual void update(const UpdateData& data);
static openspace::Documentation Documentation();
protected:
Ephemeris();
};
+4
View File
@@ -28,6 +28,8 @@
#include <ghoul/misc/dictionary.h>
#include <openspace/util/updatestructures.h>
#include <openspace/documentation/documentation.h>
namespace openspace {
class Rotation {
@@ -40,6 +42,8 @@ public:
virtual const glm::dmat3& matrix() const = 0;
virtual void update(const UpdateData& data);
static openspace::Documentation Documentation();
protected:
Rotation();
};
+4
View File
@@ -29,6 +29,8 @@
#include <openspace/util/updatestructures.h>
#include <openspace/properties/propertyowner.h>
#include <openspace/documentation/documentation.h>
namespace openspace {
class Scale : public properties::PropertyOwner {
@@ -41,6 +43,8 @@ public:
virtual double scaleValue() const = 0;
virtual void update(const UpdateData& data);
static openspace::Documentation Documentation();
protected:
Scale();
};
+4
View File
@@ -31,6 +31,8 @@
#include <set>
#include <mutex>
#include <openspace/documentation/documentation.h>
#include <openspace/util/camera.h>
#include <openspace/util/updatestructures.h>
#include <openspace/scripting/scriptengine.h>
@@ -117,6 +119,8 @@ public:
*/
static scripting::LuaLibrary luaLibrary();
static documentation::Documentation Documentation();
private:
bool loadSceneInternal(const std::string& sceneDescriptionFilePath);
+4
View File
@@ -26,6 +26,8 @@
#define __SCENEGRAPHNODE_H__
// open space includes
#include <openspace/documentation/documentation.h>
#include <openspace/rendering/renderable.h>
#include <openspace/scene/ephemeris.h>
#include <openspace/scene/rotation.h>
@@ -106,6 +108,8 @@ public:
_ephemeris = eph;
}
static documentation::Documentation Documentation();
private:
bool sphereInsideFrustum(const psc& s_pos, const PowerScaledScalar& s_rad, const Camera* camera);
+1 -1
View File
@@ -70,7 +70,7 @@ public:
bool runScript(const std::string& script);
bool runScriptFile(const std::string& filename);
bool writeDocumentation(const std::string& filename, const std::string& type) const;
void writeDocumentation(const std::string& filename, const std::string& type) const;
bool writeLog(const std::string& script);
+18 -2
View File
@@ -86,9 +86,11 @@ public:
/**
* Adds the passed \p factory to the FactoryManager. Factories may only be added once.
* \param factory The ghoul::TemplateFactory to add to this FactoryManager
* \param name A user-readable name for the registered factory.
* \pre \p factory must not be nullptr
*/
void addFactory(std::unique_ptr<ghoul::TemplateFactoryBase> factory);
void addFactory(std::unique_ptr<ghoul::TemplateFactoryBase> factory,
std::string name = "");
/**
* This method provides access to all registered ghoul::TemplateFactory%s through
@@ -102,11 +104,25 @@ public:
template <class T>
ghoul::TemplateFactory<T>* factory() const;
/**
* Writes a documentation for the FactoryMananger that contains all of the registered
* factories and for each factory all registered class names.
* \param file The file to which the documentation will be written
* \param type The type of documentation that will be written
* \pre \p file must not be empty
* \pre \p type must not be empty
*/
void writeDocumentation(const std::string& file, const std::string& type);
private:
/// Singleton member for the Factory Manager
static FactoryManager* _manager;
std::vector<std::unique_ptr<ghoul::TemplateFactoryBase>> _factories;
struct FactoryInfo {
std::unique_ptr<ghoul::TemplateFactoryBase> factory;
std::string name;
};
std::vector<FactoryInfo> _factories;
};
} // namespace openspace
+2 -2
View File
@@ -27,8 +27,8 @@ namespace openspace {
template <class T>
ghoul::TemplateFactory<T>* FactoryManager::factory() const {
for (auto& factory : _factories) {
if (factory->baseClassType() == typeid(T))
return dynamic_cast<ghoul::TemplateFactory<T>*>(factory.get());
if (factory.factory->baseClassType() == typeid(T))
return dynamic_cast<ghoul::TemplateFactory<T>*>(factory.factory.get());
}
throw FactoryNotFoundError(typeid(T).name());
+4
View File
@@ -27,6 +27,8 @@
#include <openspace/properties/propertyowner.h>
#include <openspace/documentation/documentation.h>
#include <string>
#include <vector>
@@ -64,6 +66,8 @@ public:
*/
void deinitialize();
virtual std::vector<Documentation> documentations() const;
protected:
/**
* Customization point for each derived class. The internalInitialize method is called
@@ -50,12 +50,14 @@ struct UpdateData {
bool doPerformanceMeasurement;
};
struct RenderData {
const Camera& camera;
// psc position to be removed in favor of the double precision position defined in
// the translation in transform.
psc position;
bool doPerformanceMeasurement;
int renderBinMask;
TransformData modelTransform;
};
+26 -5
View File
@@ -65,12 +65,27 @@ BaseModule::BaseModule()
{}
void BaseModule::internalInitialize() {
FactoryManager::ref().addFactory(std::make_unique<ghoul::TemplateFactory<planetgeometry::PlanetGeometry>>());
FactoryManager::ref().addFactory(std::make_unique<ghoul::TemplateFactory<modelgeometry::ModelGeometry>>());
FactoryManager::ref().addFactory(std::make_unique<ghoul::TemplateFactory<ScreenSpaceRenderable>>());
FactoryManager::ref().addFactory(
std::make_unique<ghoul::TemplateFactory<planetgeometry::PlanetGeometry>>(),
"PlanetGeometry"
);
FactoryManager::ref().addFactory(
std::make_unique<ghoul::TemplateFactory<modelgeometry::ModelGeometry>>(),
"ModelGeometry"
);
FactoryManager::ref().addFactory(
std::make_unique<ghoul::TemplateFactory<ScreenSpaceRenderable>>(),
"ScreenSpaceRenderable"
);
FactoryManager::ref().addFactory(std::make_unique<ghoul::TemplateFactory<Rotation>>());
FactoryManager::ref().addFactory(std::make_unique<ghoul::TemplateFactory<Scale>>());
FactoryManager::ref().addFactory(
std::make_unique<ghoul::TemplateFactory<Rotation>>(),
"Rotation"
);
FactoryManager::ref().addFactory(
std::make_unique<ghoul::TemplateFactory<Scale>>(),
"Scale"
);
auto fScreenSpaceRenderable = FactoryManager::ref().factory<ScreenSpaceRenderable>();
ghoul_assert(fScreenSpaceRenderable, "ScreenSpaceRenderable factory was not created");
@@ -119,4 +134,10 @@ void BaseModule::internalInitialize() {
fModelGeometry->registerClass<modelgeometry::MultiModelGeometry>("MultiModelGeometry");
}
std::vector<Documentation> BaseModule::documentations() const {
return {
StaticScale::Documentation()
};
}
} // namespace openspace
+2
View File
@@ -33,6 +33,8 @@ class BaseModule : public OpenSpaceModule {
public:
BaseModule();
std::vector<Documentation> documentations() const override;
protected:
void internalInitialize() override;
};
+10 -1
View File
@@ -27,6 +27,8 @@
#include <openspace/util/spicemanager.h>
#include <openspace/util/time.h>
#include <ghoul/filesystem/filesystem.h>
namespace {
const std::string _loggerCat = "SpiceEphemeris";
//const std::string keyGhosting = "EphmerisGhosting";
@@ -59,8 +61,15 @@ SpiceEphemeris::SpiceEphemeris(const ghoul::Dictionary& dictionary)
for (size_t i = 1; i <= kernels.size(); ++i) {
std::string kernel;
bool success = kernels.getValue(std::to_string(i), kernel);
if (!success)
if (!success) {
LERROR("'" << KeyKernels << "' has to be an array-style table");
break;
}
if (!FileSys.fileExists(kernel)) {
LERROR("Kernel '" << kernel << "' does not exist");
continue;
}
try {
SpiceManager::ref().loadKernel(kernel);
+3 -3
View File
@@ -125,9 +125,9 @@ bool ModelGeometry::initialize(Renderable* parent) {
for (auto v: _vertices)
{
maximumDistanceSquared = glm::max(
glm::pow(v.location[0], 2) +
glm::pow(v.location[1], 2) +
glm::pow(v.location[2], 2), maximumDistanceSquared);
glm::pow(v.location[0], 2.f) +
glm::pow(v.location[1], 2.f) +
glm::pow(v.location[2], 2.f), maximumDistanceSquared);
}
_parent->setBoundingSphere(PowerScaledScalar(glm::sqrt(maximumDistanceSquared), 0.0));
+1 -1
View File
@@ -211,7 +211,7 @@ void RenderableModel::render(const RenderData& data) {
glm::dmat4 modelTransform =
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation
glm::dmat4(data.modelTransform.rotation) * // Spice rotation
glm::dmat4(glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)));
glm::dmat4(glm::scale(glm::dmat4(_modelTransform), glm::dvec3(data.modelTransform.scale)));
debugModelRotation; // debug model rotation controlled from GUI
glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform;
+30 -1
View File
@@ -60,6 +60,7 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
, _shader(nullptr)
, _textureIsDirty(false)
, _texture(nullptr)
, _blendMode(BlendMode::Normal)
, _quad(0)
, _vertexPositionBuffer(0)
{
@@ -67,7 +68,7 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
dictionary.getValue("Size", size);
_size = size;
if (dictionary.hasKey("Name")){
if (dictionary.hasKey("Name")) {
dictionary.getValue("Name", _nodeName);
}
@@ -102,6 +103,13 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
}
}
std::string blendMode;
if (dictionary.getValue("BlendMode", blendMode)) {
if (blendMode == "Additive") {
_blendMode = BlendMode::Additive;
setRenderBin(Renderable::RenderBin::Transparent);
}
}
std::string texturePath = "";
bool success = dictionary.getValue("Texture", texturePath);
@@ -228,9 +236,30 @@ void RenderablePlane::render(const RenderData& data) {
_texture->bind();
_shader->setUniform("texture1", unit);
bool usingFramebufferRenderer =
OsEng.renderEngine().rendererImplementation() == RenderEngine::RendererImplementation::Framebuffer;
bool usingABufferRenderer =
OsEng.renderEngine().rendererImplementation() == RenderEngine::RendererImplementation::ABuffer;
if (usingABufferRenderer) {
_shader->setUniform("additiveBlending", _blendMode == BlendMode::Additive);
}
bool additiveBlending = _blendMode == BlendMode::Additive && usingFramebufferRenderer;
if (additiveBlending) {
glDepthMask(false);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
}
glBindVertexArray(_quad);
glDrawArrays(GL_TRIANGLES, 0, 6);
if (additiveBlending) {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask(true);
}
_shader->deactivate();
}
+6
View File
@@ -51,6 +51,11 @@ class RenderablePlane : public Renderable {
};
public:
enum class BlendMode : int {
Normal = 0,
Additive
};
RenderablePlane(const ghoul::Dictionary& dictionary);
~RenderablePlane();
@@ -79,6 +84,7 @@ private:
std::unique_ptr<ghoul::opengl::ProgramObject> _shader;
bool _textureIsDirty;
std::unique_ptr<ghoul::opengl::Texture> _texture;
BlendMode _blendMode;
ghoul::filesystem::File* _textureFile;
GLuint _quad;
GLuint _vertexPositionBuffer;
@@ -124,6 +124,7 @@ bool RenderableTrail::initialize() {
"${MODULE_BASE}/shaders/ephemeris_vs.glsl",
"${MODULE_BASE}/shaders/ephemeris_fs.glsl");
setRenderBin(Renderable::RenderBin::Overlay);
if (!_programObject)
return false;
@@ -192,6 +193,14 @@ void RenderableTrail::render(const RenderData& data) {
// _programObject->setUniform("forceFade", _distanceFade);
//}
bool usingFramebufferRenderer =
OsEng.renderEngine().rendererImplementation() == RenderEngine::RendererImplementation::Framebuffer;
if (usingFramebufferRenderer) {
glDepthMask(false);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
}
glLineWidth(_lineWidth);
glBindVertexArray(_vaoID);
@@ -207,6 +216,12 @@ void RenderableTrail::render(const RenderData& data) {
glBindVertexArray(0);
}
if (usingFramebufferRenderer) {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask(true);
}
_programObject->deactivate();
}
+26 -13
View File
@@ -24,6 +24,8 @@
#include <modules/base/scale/staticscale.h>
#include <openspace/documentation/verifier.h>
namespace {
const std::string _loggerCat = "StaticScale";
const std::string KeyValue = "Scale";
@@ -31,24 +33,35 @@ namespace {
namespace openspace {
StaticScale::StaticScale(const ghoul::Dictionary& dictionary)
Documentation StaticScale::Documentation() {
using namespace openspace::documentation;
return {
"Static Scaling",
{{
KeyValue,
new DoubleVerifier,
"The scaling factor by which the scenegraph node is scaled."
}}
};
}
StaticScale::StaticScale()
: _scaleValue("scale", "Scale", 1.0, 1.0, 1000.0)
{
const bool hasValue = dictionary.hasKeyAndValue<glm::vec3>(KeyValue);
if (hasValue) {
float value;
dictionary.getValue(KeyValue, value);
_scaleValue.setValue(value);
}
Scale::addProperty(_scaleValue);
addProperty(_scaleValue);
}
StaticScale::~StaticScale() {}
StaticScale::StaticScale(const ghoul::Dictionary& dictionary)
: StaticScale()
{
documentation::testSpecificationAndThrow(Documentation(), dictionary, "StaticScale");
_scaleValue = dictionary.value<double>(KeyValue);
}
double StaticScale::scaleValue() const {
return _scaleValue.value();
return _scaleValue;
}
void StaticScale::update(const UpdateData&) {}
} // namespace openspace
} // namespace openspace
+9 -6
View File
@@ -27,17 +27,20 @@
#include <openspace/scene/scale.h>
#include <openspace/documentation/documentation.h>
namespace openspace {
class StaticScale: public Scale {
class StaticScale : public Scale {
public:
StaticScale(const ghoul::Dictionary& dictionary = ghoul::Dictionary());
virtual ~StaticScale();
virtual double scaleValue() const;
virtual void update(const UpdateData& data) override;
StaticScale();
StaticScale(const ghoul::Dictionary& dictionary);
double scaleValue() const;
static openspace::Documentation Documentation();
private:
properties::FloatProperty _scaleValue;
//double _scaleValue;
};
} // namespace openspace
+4 -3
View File
@@ -32,10 +32,11 @@ in float fade;
#include "fragment.glsl"
Fragment getFragment() {
vec4 c = vec4(color, fade*forceFade);
vec4 c = vec4(color * fade * forceFade, 1.0);
Fragment frag;
frag.color = c;
frag.depth = vs_positionScreenSpace.w;
frag.blend = BLEND_MODE_ADDITIVE;
return frag;
}
}
+5
View File
@@ -24,6 +24,7 @@
uniform float time;
uniform sampler2D texture1;
uniform bool additiveBlending;
in vec2 vs_st;
in vec4 vs_positionScreenSpace;
@@ -50,6 +51,10 @@ Fragment getFragment() {
Fragment frag;
frag.color = diffuse;
frag.depth = vs_positionScreenSpace.w;
if (additiveBlending) {
frag.blend = BLEND_MODE_ADDITIVE;
}
return frag;
}
@@ -26,8 +26,6 @@
#include <modules/debugging/rendering/renderabledebugplane.h>
#include <openspace/engine/configurationmanager.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/util/powerscaledcoordinate.h>
@@ -214,7 +214,7 @@ namespace openspace {
const vec4& clippingSpaceCorner = mvp * modelSpaceCorners[i];
clippingSpaceCorners[i] = clippingSpaceCorner;
vec3 screenSpaceCorner = (1.0f / clippingSpaceCorner.w) * clippingSpaceCorner.xyz();
vec3 screenSpaceCorner = (1.0f / clippingSpaceCorner.w) * clippingSpaceCorner;
screenSpaceBounds.expand(screenSpaceCorner);
}
@@ -372,7 +372,7 @@ namespace openspace {
glm::vec3 directionToSunWorldSpace =
glm::normalize(-data.modelTransform.translation);
glm::vec3 directionToSunCameraSpace =
(viewTransform * glm::dvec4(directionToSunWorldSpace, 0)).xyz();
(viewTransform * glm::dvec4(directionToSunWorldSpace, 0));
data.modelTransform.translation;
programObject->setUniform("modelViewTransform", modelViewTransform);
programObject->setUniform("lightDirectionCameraSpace", -directionToSunCameraSpace);
@@ -451,7 +451,7 @@ namespace openspace {
glm::vec3 directionToSunWorldSpace =
glm::normalize(-data.modelTransform.translation);
glm::vec3 directionToSunCameraSpace =
(viewTransform * glm::dvec4(directionToSunWorldSpace, 0)).xyz();
(viewTransform * glm::dvec4(directionToSunWorldSpace, 0));
data.modelTransform.translation;
programObject->setUniform("lightDirectionCameraSpace", -directionToSunCameraSpace);
}
+1 -1
View File
@@ -72,7 +72,7 @@ namespace openspace {
dvec4 cornerClippingSpace = modelViewProjectionTransform * corners[i];
clippingSpaceCorners[i] = cornerClippingSpace;
dvec3 cornerScreenSpace = (1.0f / glm::abs(cornerClippingSpace.w)) * cornerClippingSpace.xyz();
dvec3 cornerScreenSpace = (1.0f / glm::abs(cornerClippingSpace.w)) * cornerClippingSpace;
bounds.expand(cornerScreenSpace);
}
+1 -1
View File
@@ -145,7 +145,7 @@ namespace openspace {
}
Scalar Ellipsoid::longitudalDistance(Scalar lat, Scalar lon1, Scalar lon2) const {
Vec2 ellipseRadii = glm::cos(lat) * _radii.xy();
Vec2 ellipseRadii = glm::cos(lat) * Vec2(_radii);
// Approximating with the ellipse mean radius
Scalar meanRadius = 0.5 * (ellipseRadii.x + ellipseRadii.y);
return meanRadius * std::abs(lon2 - lon1);
@@ -239,14 +239,14 @@ namespace openspace {
// Sample and do linear interpolation (could possibly be moved as a function in ghoul texture)
glm::uvec3 dimensions = tile.texture->dimensions();
glm::vec2 samplePos = transformedUv * glm::vec2(dimensions.xy());
glm::vec2 samplePos = transformedUv * glm::vec2(dimensions);
glm::uvec2 samplePos00 = samplePos;
samplePos00 = glm::clamp(samplePos00, glm::uvec2(0, 0), dimensions.xy() - glm::uvec2(1));
samplePos00 = glm::clamp(samplePos00, glm::uvec2(0, 0), glm::uvec2(dimensions) - glm::uvec2(1));
glm::vec2 samplePosFract = samplePos - glm::vec2(samplePos00);
glm::uvec2 samplePos10 = glm::min(samplePos00 + glm::uvec2(1, 0), dimensions.xy() - glm::uvec2(1));
glm::uvec2 samplePos01 = glm::min(samplePos00 + glm::uvec2(0, 1), dimensions.xy() - glm::uvec2(1));
glm::uvec2 samplePos11 = glm::min(samplePos00 + glm::uvec2(1, 1), dimensions.xy() - glm::uvec2(1));
glm::uvec2 samplePos10 = glm::min(samplePos00 + glm::uvec2(1, 0), glm::uvec2(dimensions) - glm::uvec2(1));
glm::uvec2 samplePos01 = glm::min(samplePos00 + glm::uvec2(0, 1), glm::uvec2(dimensions) - glm::uvec2(1));
glm::uvec2 samplePos11 = glm::min(samplePos00 + glm::uvec2(1, 1), glm::uvec2(dimensions) - glm::uvec2(1));
float sample00 = tile.texture->texelAsFloat(samplePos00).x;
float sample10 = tile.texture->texelAsFloat(samplePos10).x;
@@ -36,9 +36,9 @@ TriangleSoup::TriangleSoup(std::vector<unsigned int> elements,
: _vaoID(0)
,_vertexBufferID(0)
,_elementBufferID(0)
,_useVertexPositions(usePositions == Positions::Yes)
,_useTextureCoordinates(useTextures == TextureCoordinates::Yes)
,_useVertexNormals(useNormals == Normals::Yes)
,_useVertexPositions(usePositions)
,_useTextureCoordinates(useTextures)
,_useVertexNormals(useNormals)
{
setElements(elements);
}
+4 -3
View File
@@ -25,6 +25,7 @@
#ifndef __TRIANGLESOUP_H__
#define __TRIANGLESOUP_H__
#include <ghoul/misc/boolean.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/logging/logmanager.h>
@@ -46,9 +47,9 @@ namespace openspace {
class TriangleSoup
{
public:
enum class Positions { Yes, No };
enum class TextureCoordinates { Yes, No };
enum class Normals { Yes, No };
using Positions = ghoul::Boolean;
using TextureCoordinates = ghoul::Boolean;
using Normals = ghoul::Boolean;
TriangleSoup(
std::vector<unsigned int> elements, // At least elements are required
+3 -2
View File
@@ -24,6 +24,7 @@
#ifndef __STATS_TRACKER_H__
#define __STATS_TRACKER_H__
#include <ghoul/misc/boolean.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/filesystem/filesystem>
@@ -143,13 +144,13 @@ namespace openspace {
StatsCollector() = delete;
enum class Enabled { Yes, No };
using Enabled = ghoul::Boolean;
StatsCollector(const std::string& filename, int dumpEveryXRecord, Enabled enabled = Enabled::Yes, const std::string& delimiter = ",")
: _filename(filename)
, _dumpEveryXRecord(dumpEveryXRecord)
, _recordsSinceLastDump(0)
, _enabled(enabled == Enabled::Yes)
, _enabled(enabled)
, _delimiter(delimiter)
, _hasWrittenHeader(false)
, i(TemplatedStatsCollector<long long>(_enabled, delimiter))
+3 -3
View File
@@ -473,7 +473,7 @@ namespace openspace {
io.write.region.roundDownToQuadratic();
io.write.region.roundUpNumPixelToNearestMultipleOf(2);
if (preRound != io.write.region.numPixels) {
//LDEBUG(chunkIndex << " | " << preRound.x << ", " << preRound.y << " --> " << io.write.region.numPixels.x << ", " << io.write.region.numPixels.y);
LDEBUG(chunkIndex << " | " << preRound.x << ", " << preRound.y << " --> " << io.write.region.numPixels.x << ", " << io.write.region.numPixels.y);
}
@@ -611,10 +611,10 @@ namespace openspace {
}
}
if (depth == 0) {
//if (depth == 0) {
//LDEBUG(indentation << "main rasterIO read: " << io.read.region);
//LDEBUG(indentation << "main rasterIO write: " << io.write.region);
}
//}
else if (worstError > CPLErr::CE_None) {
LDEBUG(indentation << "Error reading padding: " << worstError);
+4 -1
View File
@@ -51,7 +51,10 @@ NewHorizonsModule::NewHorizonsModule()
void NewHorizonsModule::internalInitialize() {
ImageSequencer::initialize();
FactoryManager::ref().addFactory(std::make_unique<ghoul::TemplateFactory<Decoder>>());
FactoryManager::ref().addFactory(
std::make_unique<ghoul::TemplateFactory<Decoder>>(),
"Decoder"
);
auto fRenderable = FactoryManager::ref().factory<Renderable>();
ghoul_assert(fRenderable, "No renderable factory existed");
@@ -24,12 +24,10 @@
#include <modules/newhorizons/rendering/renderablecrawlingline.h>
#include <openspace/engine/configurationmanager.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/util/spicemanager.h>
#include <modules/newhorizons/util/imagesequencer.h>
//#include <imgui.h>
namespace {
const std::string _loggerCat = "RenderableCrawlingLine";
@@ -528,7 +528,7 @@ void RenderableFov::computeIntercepts(const RenderData& data) {
_interceptTag[_bounds.size()] = _interceptTag[0];
fovSurfaceIntercept(_interceptTag, _bounds);
glm::vec3 aim = (_spacecraftRotation * glm::vec4(_boresight, 1)).xyz();
glm::vec3 aim = (_spacecraftRotation * glm::vec4(_boresight, 1));
double lt;
glm::dvec3 position =
SpiceManager::ref().targetPosition(
@@ -40,6 +40,7 @@ namespace {
const std::string keyDestination = "Rotation.Destination";
const std::string keyBody = "Body";
const std::string keyGeometry = "Geometry";
const std::string keyBoundingSphereRadius = "BoundingSphereRadius";
const std::string keyTextureColor = "Textures.Color";
const std::string keyTextureProject = "Textures.Project";
@@ -96,10 +97,10 @@ RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& di
completeSuccess &= _projectionComponent.initializeProjectionSettings(dictionary);
openspace::SpiceManager::ref().addFrame(_target, _source);
double boundingRadius = _geometry->boundingRadius();
setBoundingSphere(PowerScaledScalar::CreatePSS(boundingRadius));
float boundingSphereRadius = 1.0e9;
dictionary.getValue(keyBoundingSphereRadius, boundingSphereRadius);
setBoundingSphere(PowerScaledScalar::CreatePSS(boundingSphereRadius));
Renderable::addProperty(_performShading);
Renderable::addProperty(_rotation);
@@ -132,9 +133,18 @@ bool RenderableModelProjection::initialize() {
ghoul::opengl::ProgramObject::IgnoreError::Yes
);
_depthFboProgramObject = ghoul::opengl::ProgramObject::Build("DepthPass",
"${MODULE_NEWHORIZONS}/shaders/renderableModelDepth_vs.glsl",
"${MODULE_NEWHORIZONS}/shaders/renderableModelDepth_fs.glsl");
completeSuccess &= loadTextures();
completeSuccess &= _projectionComponent.initialize();
auto bs = getBoundingSphere();
completeSuccess &= _geometry->initialize(this);
setBoundingSphere(bs); // ignore bounding sphere set by geometry.
completeSuccess &= !_source.empty();
completeSuccess &= !_destination.empty();
@@ -164,7 +174,6 @@ void RenderableModelProjection::render(const RenderData& data) {
if (_projectionComponent.needsClearProjection())
_projectionComponent.clearAllProjections();
_camScaling = data.camera.scaling();
_up = data.camera.lookUpVectorCameraSpace();
if (_capture && _projectionComponent.doesPerformProjection())
@@ -221,6 +230,9 @@ void RenderableModelProjection::update(const UpdateData& data) {
_projectionComponent.update();
if (_depthFboProgramObject->isDirty())
_depthFboProgramObject->rebuildFromFile();
_time = data.time;
if (openspace::ImageSequencer::ref().isReady()) {
@@ -252,8 +264,20 @@ void RenderableModelProjection::update(const UpdateData& data) {
void RenderableModelProjection::imageProjectGPU(
std::shared_ptr<ghoul::opengl::Texture> projectionTexture)
{
_projectionComponent.imageProjectBegin();
if (_projectionComponent.needsShadowMap()) {
_projectionComponent.depthMapRenderBegin();
_depthFboProgramObject->activate();
_depthFboProgramObject->setUniform("ProjectorMatrix", _projectorMatrix);
_depthFboProgramObject->setUniform("ModelTransform", _transform);
_geometry->setUniforms(*_fboProgramObject);
_geometry->render();
_depthFboProgramObject->deactivate();
_projectionComponent.depthMapRenderEnd();
}
_projectionComponent.imageProjectBegin();
_fboProgramObject->activate();
ghoul::opengl::TextureUnit unitFbo;
@@ -261,9 +285,17 @@ void RenderableModelProjection::imageProjectGPU(
projectionTexture->bind();
_fboProgramObject->setUniform("projectionTexture", unitFbo);
_fboProgramObject->setUniform("needShadowMap", _projectionComponent.needsShadowMap());
ghoul::opengl::TextureUnit unitDepthFbo;
if (_projectionComponent.needsShadowMap()) {
unitDepthFbo.activate();
_projectionComponent.depthTexture().bind();
_fboProgramObject->setUniform("depthTexture", unitDepthFbo);
}
_fboProgramObject->setUniform("ProjectorMatrix", _projectorMatrix);
_fboProgramObject->setUniform("ModelTransform", _transform);
_fboProgramObject->setUniform("_scaling", _camScaling);
_fboProgramObject->setUniform("boresight", _boresight);
_geometry->setUniforms(*_fboProgramObject);
@@ -325,19 +357,24 @@ void RenderableModelProjection::attitudeParameters(double time) {
time, lightTime);
psc position = PowerScaledCoordinate::CreatePowerScaledCoordinate(p.x, p.y, p.z);
position[3] += (3 + _camScaling[1]) + 1;
position[3] += 4;
glm::vec3 cpos = position.vec3();
float distance = glm::length(cpos);
float radius = getBoundingSphere().lengthf();
_projectorMatrix = _projectionComponent.computeProjectorMatrix(
cpos, boresight, _up, _instrumentMatrix,
_projectionComponent.fieldOfViewY(),
_projectionComponent.aspectRatio(),
_projectionComponent.nearPlane(),
_projectionComponent.farPlane(),
distance - radius,
distance + radius,
_boresight
);
}
void RenderableModelProjection::project() {
for (auto img : _imageTimes) {
attitudeParameters(img.timeRange.start);
@@ -74,6 +74,7 @@ private:
std::unique_ptr<ghoul::opengl::ProgramObject> _programObject;
std::unique_ptr<ghoul::opengl::ProgramObject> _fboProgramObject;
std::unique_ptr<ghoul::opengl::ProgramObject> _depthFboProgramObject;
std::unique_ptr<ghoul::opengl::Texture> _baseTexture;
@@ -100,7 +101,6 @@ private:
bool _capture;
psc _sunPosition;
properties::BoolProperty _performShading;
};
@@ -47,6 +47,7 @@ namespace {
const std::string keyFrame = "Frame";
const std::string keyGeometry = "Geometry";
const std::string keyRadius = "Geometry.Radius";
const std::string keyShading = "PerformShading";
const std::string keyBody = "Body";
const std::string _mainFrame = "GALACTIC";
@@ -101,6 +102,10 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary&
if (success)
_heightMapTexturePath = absPath(heightMapPath);
glm::vec2 radius = glm::vec2(1.0, 9.0);
dictionary.getValue(keyRadius, radius);
setBoundingSphere(pss(radius));
addPropertySubOwner(_geometry.get());
addPropertySubOwner(_projectionComponent);
@@ -134,7 +139,6 @@ bool RenderablePlanetProjection::initialize() {
completeSuccess &= loadTextures();
completeSuccess &= _projectionComponent.initialize();
completeSuccess &= _geometry->initialize(this);
if (completeSuccess) {
@@ -285,6 +289,9 @@ void RenderablePlanetProjection::attitudeParameters(double time) {
//position[3] += 3;
glm::vec3 cpos = position.vec3();
float distance = glm::length(cpos);
float radius = getBoundingSphere().lengthf();
_projectorMatrix = _projectionComponent.computeProjectorMatrix(
cpos,
bs,
@@ -292,8 +299,8 @@ void RenderablePlanetProjection::attitudeParameters(double time) {
_instrumentMatrix,
_projectionComponent.fieldOfViewY(),
_projectionComponent.aspectRatio(),
_projectionComponent.nearPlane(),
_projectionComponent.farPlane(),
distance - radius,
distance + radius,
_boresight
);
}
@@ -0,0 +1,30 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* *
* 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. *
****************************************************************************************/
#version __CONTEXT__
void main() {
gl_FragColor = vec4(1.0);
//gl_FragDepth = gl_FragCoord.z;
}
@@ -0,0 +1,36 @@
/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014-2016 *
* *
* 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. *
****************************************************************************************/
#version __CONTEXT__
#include "PowerScaling/powerScaling_vs.hglsl"
layout(location = 0) in vec4 in_position;
uniform mat4 ProjectorMatrix;
uniform mat4 ModelTransform;
void main() {
gl_Position = ProjectorMatrix * ModelTransform * psc_to_meter(in_position, vec2(1.0, 0.0));
}
@@ -25,9 +25,8 @@
#version __CONTEXT__
in vec4 vs_position;
in vec4 vs_ndc;
in vec4 vs_normal;
in vec2 vs_uv;
in vec4 ProjTexCoord;
layout (location = 0) out vec4 color;
// Even though the stencel texture is only a single channel, we still need to
@@ -35,34 +34,53 @@ layout (location = 0) out vec4 color;
layout (location = 1) out vec4 stencil;
uniform sampler2D projectionTexture;
uniform sampler2D depthTexture;
uniform bool needShadowMap;
uniform mat4 ModelTransform;
uniform vec2 _scaling;
uniform vec3 boresight;
uniform vec4 debugColor;
bool inRange(float x, float a, float b) {
return (x >= a && x <= b);
}
void main() {
vec2 uv = vec2(0.5,0.5)*vs_uv+vec2(0.5,0.5);
vec3 n = normalize(vs_normal.xyz);
vec4 projected = ProjTexCoord;
vec4 projected = vs_ndc;
vec2 uv = vec2(0.5) * projected.xy + vec2(0.5);
// normalize
projected.x /= projected.w;
projected.y /= projected.w;
// invert gl coordinates
projected.x = 1 - projected.x;
if (needShadowMap) {
float thisDepth = projected.z * 0.5 + 0.5;
float closestDepth = texture(depthTexture, uv).r;
float epsilon = 0.001;
if ((inRange(projected.x, 0, 1) && inRange(projected.y, 0, 1)) && (dot(n, boresight) < 0)) {
color = texture(projectionTexture, projected.xy);
//color.a = 1.0;
stencil = vec4(1.0);
if (inRange(uv.x, 0.0, 1.0) && inRange(uv.y, 0.0, 1.0) &&
dot(n, boresight) < 0 && thisDepth <= closestDepth + epsilon)
{
// color = texture(projectionTexture, projected.xy);
color = texture(projectionTexture, vec2(1.0) - uv);
color.a = 1.0;
stencil = vec4(1.0);
}
else {
color = vec4(vec3(0.0), 0.0);
stencil = vec4(0.0);
}
}
else {
color = vec4(0.0);//vec4(vec3(0.0), 1.0);
stencil = vec4(0.0);
if (inRange(uv.x, 0.0, 1.0) && inRange(uv.y, 0.0, 1.0) &&
dot(n, boresight) < 0)
{
// color = texture(projectionTexture, projected.xy);
color = texture(projectionTexture, vec2(1.0) - uv);
color.a = 1.0;
stencil = vec4(1.0);
}
else {
color = vec4(vec3(0.0), 0.0);
stencil = vec4(0.0);
}
}
}
@@ -33,26 +33,20 @@ layout(location = 2) in vec3 in_normal;
out vec4 vs_position;
out vec4 vs_normal;
out vec2 vs_uv;
out vec4 ProjTexCoord;
out vec4 vs_ndc;
uniform mat4 ProjectorMatrix;
uniform mat4 ModelTransform;
uniform vec2 _scaling;
uniform vec3 boresight;
void main() {
vs_position = in_position;
vec4 tmp = in_position;
vec4 position = pscTransform(tmp, ModelTransform);
vs_position = position;
vec4 raw_pos = psc_to_meter(in_position, _scaling);
ProjTexCoord = ProjectorMatrix * ModelTransform * raw_pos;
vec4 raw_pos = psc_to_meter(in_position, vec2(1.0, 0.0));
vs_position = ProjectorMatrix * ModelTransform * raw_pos;
vs_normal = normalize(ModelTransform * vec4(in_normal,0));
vs_ndc = vs_position / vs_position.w;
//match clipping plane
vec2 texco = (in_st * 2) - 1;
vs_uv = texco;
@@ -84,12 +84,12 @@ Fragment getFragment() {
color = diffuseAlbedo;
}
float transparency = 1.0;
float alpha = _projectionFading * transparency;
// float transparency = 1.0;
// float alpha = _projectionFading * transparency;
Fragment frag;
frag.color = vec4(color, alpha);
frag.color = vec4(color, 1.0);
frag.depth = vs_positionScreenSpace.w;
return frag;
}
@@ -73,6 +73,8 @@ void main() {
projected.x /= projected.w;
projected.y /= projected.w;
projected = projected * 0.5 + vec4(0.5);
vec3 normal = normalize((ModelTransform*vec4(vertex.xyz,0)).xyz);
vec3 v_b = normalize(boresight);
@@ -83,7 +85,7 @@ void main() {
{
// The 1-x is in this texture call because of flipped textures
// to be fixed soon ---abock
color = texture(projectionTexture, vec2(projected.x, 1-projected.y));
color = texture(projectionTexture, vec2(projected.x, projected.y));
stencil = vec4(1.0);
}
else {
+11 -15
View File
@@ -23,8 +23,11 @@
****************************************************************************************/
#include <modules/newhorizons/util/decoder.h>
#include <openspace/util/factorymanager.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/exception.h>
namespace {
const std::string _loggerCat = "Decoder";
@@ -32,29 +35,22 @@ const std::string _loggerCat = "Decoder";
namespace openspace {
Decoder* Decoder::createFromDictionary(const ghoul::Dictionary& dictionary, const std::string& type)
std::unique_ptr<Decoder> Decoder::createFromDictionary(
const ghoul::Dictionary& dictionary, const std::string& type)
{
ghoul::TemplateFactory<Decoder>* factory
= FactoryManager::ref().factory<Decoder>();
Decoder* result = factory->create(type, dictionary);
if (result == nullptr) {
LERROR("Failed creating Payload object of type '" << type << "'");
return nullptr;
throw ghoul::RuntimeError(
"Failed creating payload object of type '" + type + '"',
"Decoder"
);
}
return result;
return std::unique_ptr<Decoder>(result);
}
Decoder::Decoder()
{
}
Decoder::Decoder(const ghoul::Dictionary& dictionary)
{
}
Decoder::~Decoder()
{
}
Decoder::~Decoder() {}
} // namespace openspace
+7 -4
View File
@@ -26,20 +26,23 @@
#define __DECODER_H__
#include <ghoul/misc/dictionary.h>
#include <openspace/util/updatestructures.h>
#include <memory>
namespace openspace {
class Decoder {
public:
static Decoder* createFromDictionary(const ghoul::Dictionary& dictionary, const std::string& type);
static std::unique_ptr<Decoder> createFromDictionary(
const ghoul::Dictionary& dictionary, const std::string& type);
Decoder(const ghoul::Dictionary& dictionary);
virtual ~Decoder();
virtual std::string getDecoderType() = 0;
virtual std::vector<std::string> getTranslation() = 0;
protected:
Decoder();
Decoder() = default;
};
} // namespace openspace
+3 -3
View File
@@ -75,10 +75,10 @@ HongKangParser::HongKangParser(std::string name, std::string fileName,
ghoul::Dictionary decoderDictionary;
translationDictionary.getValue(currentKey, decoderDictionary);
Decoder* decoder = Decoder::createFromDictionary(decoderDictionary, decoders[i]);
auto decoder = Decoder::createFromDictionary(decoderDictionary, decoders[i]);
//insert decoder to map - this will be used in the parser to determine
//behavioral characteristics of each instrument
_fileTranslation[keys[j]] = decoder;
_fileTranslation[keys[j]] = std::move(decoder);
}
}
//Hong's playbook needs _only_ instrument translation though.
@@ -201,7 +201,7 @@ bool HongKangParser::create() {
if (it->second->getDecoderType() == "SCANNER"){ // SCANNER START
scan_start = time;
InstrumentDecoder* scanner = static_cast<InstrumentDecoder*>(it->second);
InstrumentDecoder* scanner = static_cast<InstrumentDecoder*>(it->second.get());
std::string endNominal = scanner->getStopCommand();
// store current position in file
+1 -2
View File
@@ -46,7 +46,6 @@ public:
bool create() override;
void findPlaybookSpecifiedTarget(std::string line, std::string& target);
virtual std::map<std::string, Decoder*> getTranslation(){ return _fileTranslation; };
private:
double getMetFromET(double et);
@@ -70,7 +69,7 @@ private:
std::string _name;
std::string _fileName;
std::string _spacecraft;
std::map<std::string, Decoder*> _fileTranslation;
std::map<std::string, std::unique_ptr<Decoder>> _fileTranslation;
std::vector<std::string> _potentialTargets;
};
+9 -6
View File
@@ -338,9 +338,9 @@ void ImageSequencer::runSequenceParser(SequenceParser* parser){
bool parserComplete = parser->create();
if (parserComplete){
// get new data
std::map<std::string, Decoder*> translations = parser->getTranslation(); // in1
std::map<std::string, std::unique_ptr<Decoder>>& translations = parser->getTranslation(); // in1
std::map<std::string, ImageSubset> imageData = parser->getSubsetMap(); // in2
std::vector<std::pair<std::string, TimeRange>> instrumentTimes = parser->getIstrumentTimes(); //in3
std::vector<std::pair<std::string, TimeRange>> instrumentTimes = parser->getInstrumentTimes(); //in3
std::vector<std::pair<double, std::string>> targetTimes = parser->getTargetTimes(); //in4
std::vector<double> captureProgression = parser->getCaptureProgression(); //in5
@@ -349,11 +349,14 @@ void ImageSequencer::runSequenceParser(SequenceParser* parser){
LERROR("Missing sequence data");
return;
}
// append data
_fileTranslation.insert(translations.begin(), translations.end());
for (auto it : imageData){
for (auto& it : translations) {
_fileTranslation[it.first] = std::move(it.second);
}
for (auto& it : imageData){
if (_subsetMap.find(it.first) == _subsetMap.end()) {
// if key not exist yet - add sequence data for key (target)
_subsetMap.insert(it);
@@ -404,7 +407,7 @@ void ImageSequencer::runSequenceParser(SequenceParser* parser){
sortData();
// extract payload from _fileTranslation
for (auto t : _fileTranslation){
for (auto& t : _fileTranslation){
if (t.second->getDecoderType() == "CAMERA" ||
t.second->getDecoderType() == "SCANNER"){
std::vector<std::string> spiceIDs = t.second->getTranslation();
+1 -1
View File
@@ -152,7 +152,7 @@ private:
* \see Decoder
* \see (projection mod files)
*/
std::map<std::string, Decoder*> _fileTranslation;
std::map<std::string, std::unique_ptr<Decoder>> _fileTranslation;
/*
* This is the main container of image data. The key is the target name,

Some files were not shown because too many files have changed in this diff Show More