Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::util Namespace Reference

Classes

struct  alwaysTrue
 
class  BrickIterator
 An iterator providing access to a subregion, or brick, within linearized 3D data. More...
 
struct  BufferDispatcher
 
struct  BuildInfo
 Provides information on build time and date as well as git hashes. More...
 
class  cloneable_ptr
 
class  Combinations
 
struct  DefaultColorRepresentation
 
struct  DefaultColorRepresentation< ivec3 >
 
struct  DefaultColorRepresentation< ivec4 >
 
struct  DefaultTraversalFilter
 
struct  extent
 
struct  extent< const T, N >
 
struct  extent< glm::mat< C, R, T, Q >, 0 >
 
struct  extent< glm::mat< C, R, T, Q >, 1 >
 
struct  extent< glm::tquat< T, Q >, 0 >
 
struct  extent< glm::vec< L, T, Q >, 0 >
 
struct  flat_extent
 
struct  for_each_type
 
struct  for_each_type< std::tuple< T > >
 
struct  for_each_type< std::tuple< T, Types... > >
 
struct  for_each_type_pair
 
struct  for_each_type_pair< std::tuple< ATypes... >, std::tuple< BTypes... > >
 
struct  glmtype
 
struct  glmtype< T, 1, 1, P >
 
struct  glmtype< T, L, 1, P >
 
struct  Grid3DPointGeneration
 
struct  GridPos
 
struct  identifier
 
struct  identity
 
struct  IndexMapper
 
struct  IndexMapper< 2, IndexType >
 
struct  IndexMapper< 3, IndexType >
 
class  IndexProduct
 
struct  IndirectIterator
 
struct  is_constructible
 
class  is_container
 
struct  is_dereferenceable
 
struct  is_dereferenceable< T, std::void_t< decltype(*std::declval< T >())> >
 
struct  is_floating_point
 
class  is_stream_insertable
 
struct  is_string
 
struct  iter_range
 
struct  IterRangeGenerator
 
class  KeepTrueWhileInScope
 sets the given bool variable to true and restores its state when leaving the scope More...
 
class  MemoryFileHandle
 RAII class for providing a FILE stream handle to a buffer in memory. This class will open a file handle to /dev/null and use a dedicated buffer for buffering. As long as less bytes than getBufferSize() bytes are written/read, its status is well defined. However, after writing more than buffer size bytes, the buffer contents will be flushed, i.e. are no longer accessible. More...
 
class  MetaDataToProperty
 
struct  nonesuch
 
class  NotificationBlocker
 
class  OnScopeExit
 calls the given function when leaving the current scope More...
 
class  ostream_joiner
 
struct  overloaded
 
class  Permutations
 
struct  PropertyDistanceSorter
 
struct  RandomCubicalPointGeneration
 
struct  RandomSphericalPointGeneration
 
struct  rank
 
struct  rank< const T >
 
struct  rank< glm::mat< C, R, T, Q > >
 
struct  rank< glm::tquat< T, Q > >
 
struct  rank< glm::vec< L, T, Q > >
 
struct  same_extent
 
struct  same_extent< glm::mat< C, R, T, Q >, U >
 
struct  same_extent< glm::tquat< T, Q >, U >
 
struct  same_extent< glm::vec< L, T, Q >, U >
 
struct  sequence
 
class  TempFileHandle
 RAII interface for providing a file handle and file name to a temporary file. More...
 
class  TextureAtlas
 Texture atlas for a number of strings rendered with the TextRenderer. More...
 
struct  TransformIterator
 
struct  value_type
 
struct  value_type< glm::mat< C, R, T, Q > >
 
struct  value_type< glm::tquat< T, Q > >
 
struct  value_type< glm::vec< L, T, Q > >
 

Typedefs

using OffsetCallback = std::function<ivec2(std::vector<Processor*>)>
 
template<template< class... > class Op, class... Args>
using is_detected = typename detail::detector<nonesuch, void, Op, Args...>::value_t
 
template<template< class... > class Op, class... Args>
using detected_t = typename detail::detector<nonesuch, void, Op, Args...>::type
 
template<class Default , template< class... > class Op, class... Args>
using detected_or = detail::detector<Default, void, Op, Args...>
 
template<class Default , template< class... > class Op, class... Args>
using detected_or_t = typename detected_or<Default, Op, Args...>::type
 
template<class Expected , template< class... > class Op, class... Args>
using is_detected_exact = std::is_same<Expected, detected_t<Op, Args...>>
 
template<class To , template< class... > class Op, class... Args>
using is_detected_convertible = std::is_convertible<detected_t<Op, Args...>, To>
 
template<typename T >
using PrecisionType = typename std::remove_pointer<typename std::remove_const<T>::type>::type
 
template<typename T >
using PrecisionValueType = typename PrecisionType<T>::type
 
template<template< typename > typename Wrapper, typename List >
using wrap = typename detail::wrap<Wrapper, List>::type
 
template<typename T >
using value_type_t = typename value_type<T>::type
 
template<typename T , typename U >
using same_extent_t = typename same_extent<T, U>::type
 
template<typename T = double, glm::length_t C = 1, glm::length_t R = 1, glm::qualifier Q = glm::defaultp>
using glmtype_t = typename glmtype<T, C, R, Q>::type
 
using IndexMapper2D = IndexMapper<2, size_t>
 
using IndexMapper3D = IndexMapper<3, size_t>
 

Enumerations

enum class  UseUnitPrefixes { Yes , No }
 
enum class  TraversalDirection { Up , Down }
 
enum class  VisitPattern { Pre , Post }
 
enum class  DryRun { Yes , No }
 
enum class  OverwriteState { Yes , No }
 
enum class  VolumeLaplacianPostProcessing { None , Normalized , SignNormalized , Scaled }
 
enum class  DownsamplingMode { Strided , Averaged }
 

Functions

IVW_CORE_API std::string base64_encode (std::span< char > s, bool url=false)
 
IVW_CORE_API std::string base64_encode_pem (std::span< char > s)
 
IVW_CORE_API std::string base64_encode_mime (std::span< char > s)
 
IVW_CORE_API std::string base64_decode (std::string_view s, bool remove_linebreaks=false)
 
IVW_CORE_API std::optional< mat4 > boundingBoxUnion (const std::optional< mat4 > &a, const std::optional< mat4 > &b)
 
IVW_CORE_API mat4 boundingBox (const Layer &layer)
 
IVW_CORE_API mat4 boundingBox (const std::vector< std::shared_ptr< Layer > > &layers)
 
IVW_CORE_API mat4 boundingBox (const Mesh &mesh)
 
IVW_CORE_API mat4 boundingBox (const std::vector< std::shared_ptr< const Mesh > > &meshes)
 
IVW_CORE_API mat4 boundingBox (const Volume &volume)
 
IVW_CORE_API mat4 boundingBox (const std::vector< std::shared_ptr< Volume > > &volumes)
 
IVW_CORE_API void cubePlaneIntersectionAppend (const Plane &plane, std::vector< vec3 > &pos, std::vector< std::uint32_t > &inds)
 
auto cubePlaneInstersection (const Plane &plane)
 
IVW_CORE_API std::vector< double > calculatePercentiles (const std::vector< size_t > &hist, dvec2 range, size_t sum)
 
IVW_CORE_API Statistics calculateHistogramStats (const std::vector< size_t > &hist)
 
template<typename T >
std::vector< Histogram1DcalculateHistograms (std::span< const T > data, const DataMapper &dataMap, size_t bins)
 
template<typename T >
constexpr T linearMap (T val, glm::vec< 2, T > from, glm::vec< 2, T > to) noexcept
 
template<glm::length_t L, typename T >
constexpr glm::vec< L, T > linearMap (glm::vec< L, T > val, glm::vec< 2, T > from, glm::vec< 2, T > to) noexcept
 
template<glm::length_t C, glm::length_t R, typename T >
constexpr glm::mat< C, R, T > linearMap (glm::mat< C, R, T > val, glm::vec< 2, T > from, glm::vec< 2, T > to) noexcept
 
template<typename T >
constexpr T linearMapToNormalized (T val, glm::vec< 2, T > from) noexcept
 
template<glm::length_t L, typename T >
constexpr glm::vec< L, T > linearMapToNormalized (glm::vec< L, T > val, glm::vec< 2, T > from) noexcept
 
template<glm::length_t C, glm::length_t R, typename T >
constexpr glm::mat< C, R, T > linearMapToNormalized (glm::mat< C, R, T > val, glm::vec< 2, T > from) noexcept
 
template<typename T >
constexpr T linearMapFromNormalized (T val, glm::vec< 2, T > to) noexcept
 
template<glm::length_t L, typename T >
constexpr glm::vec< L, T > linearMapFromNormalized (glm::vec< L, T > val, glm::vec< 2, T > to) noexcept
 
template<glm::length_t C, glm::length_t R, typename T >
constexpr glm::mat< C, R, T > linearMapFromNormalized (glm::mat< C, R, T > val, glm::vec< 2, T > to) noexcept
 
IVW_CORE_API Document md2doc (std::string_view markdown)
 
IVW_CORE_API Document unindentMd2doc (std::string_view markdown)
 
template<typename T >
std::vector< T > makeVectorRange (ptrdiff_t start, ptrdiff_t end, ptrdiff_t step=1)
 
template<typename T , size_t N>
 Permutations (std::span< T, N >, size_t) -> Permutations< T >
 
template<typename T , size_t N>
 Combinations (std::span< T, N >, size_t) -> Combinations< T >
 
template<typename T , size_t N>
 IndexProduct (std::span< T, N >) -> IndexProduct< T >
 
IVW_CORE_API InviwoApplicationgetInviwoApplication (ProcessorNetwork *)
 
IVW_CORE_API InviwoApplicationgetInviwoApplication (Processor *)
 
IVW_CORE_API InviwoApplicationgetInviwoApplication (PropertyOwner *)
 
IVW_CORE_API InviwoApplicationgetInviwoApplication (Property *)
 
IVW_CORE_API InviwoApplicationgetInviwoApplication ()
 
IVW_CORE_API bool isInviwoApplicationInitialized ()
 
std::shared_ptr< IndexBuffermakeIndexBuffer (std::vector< std::uint32_t > &&data)
 
template<typename T = vec3, BufferUsage U = BufferUsage::Static, BufferTarget Target = BufferTarget::Data>
std::shared_ptr< Buffer< T, Target > > makeBuffer (std::vector< T > &&data)
 
IVW_CORE_API FloatRefPropertygetCameraFovProperty (CameraProperty &cameraProperty)
 Find the vertical fov property in the cameraProperty.
 
IVW_CORE_API std::unique_ptr< FloatRefPropertycreateCameraFovProperty (std::function< float()> get, std::function< void(const float &)> set)
 Create a vertical fov property for use in a camera property.
 
IVW_CORE_API FloatRefPropertyupdateOrCreateCameraFovProperty (CameraProperty &cameraProperty, std::function< float()> get, std::function< void(const float &)> set)
 Either return an existing vertical fov property updated with the provided get and set functions or create a new one. The new one will automatically be added to the camera property.
 
IVW_CORE_API FloatRefPropertygetCameraWidthProperty (CameraProperty &cameraProperty)
 Find the width property in the cameraProperty.
 
IVW_CORE_API std::unique_ptr< FloatRefPropertycreateCameraWidthProperty (std::function< float()> get, std::function< void(const float &)> set)
 Create a width property for use in a CameraProperty.
 
IVW_CORE_API FloatRefPropertyupdateOrCreateCameraWidthProperty (CameraProperty &cameraProperty, std::function< float()> get, std::function< void(const float &)> set)
 Either return an existing width property updated with the provided get and set functions or create a new one. The new one will automatically be added to the camera property.
 
IVW_CORE_API FloatVec2RefPropertygetCameraEyeOffsetProperty (CameraProperty &cameraProperty)
 Find the eye offset property in the cameraProperty.
 
IVW_CORE_API std::unique_ptr< FloatVec2RefPropertycreateCameraEyeOffsetProperty (std::function< vec2()> get, std::function< void(const vec2 &)> set)
 Create an eye offset property for use in a camera property.
 
IVW_CORE_API FloatVec2RefPropertyupdateOrCreateCameraEyeOffsetProperty (CameraProperty &cameraProperty, std::function< vec2()> get, std::function< void(const vec2 &)> set)
 Either return an existing eye offset property updated with the provided get and set functions or create a new one. The new one will automatically be added to the camera property.
 
IVW_CORE_API float fovyToWidth (float fovy, float distance, float aspect)
 
IVW_CORE_API float widthToFovy (float width, float distance, float aspect)
 
IVW_CORE_API float widthToViewDist (float width, float fov, float aspect)
 
template<typename CamType >
vec3 perspectiveZoom (CamType &cam, float factor, std::optional< mat4 >)
 
template<size_t N>
constexpr auto generateTransforms (std::array< CoordinateSpace, N > spaces)
 
constexpr uvec3 getDataFormatColor (NumericType t, size_t comp, size_t size)
 
IVW_CORE_API std::string appendIfNotEmpty (std::string_view a, std::string_view b)
 
IVW_CORE_API size_t numberOfPrimitives (DrawType dt, ConnectivityType ct, size_t indices)
 
IVW_CORE_API size_t numberOfVerticesForPrimitive (DrawType dt)
 
template<typename T >
glm::vec< 4, T > applySwizzleMask (const glm::vec< 4, T > &value, const SwizzleMask &swizzlemask)
 
IVW_CORE_API void registerCoreRepresentations (InviwoModule &obj)
 
IVW_CORE_API void registerCoreRepresentations (RepresentationFactoryManager &obj)
 
IVW_CORE_API void distributeAlphaEvenly (std::vector< TFPrimitive * > selection)
 
IVW_CORE_API void distributePositionEvenly (std::vector< TFPrimitive * > selection)
 
IVW_CORE_API void alignAlphaToMean (const std::vector< TFPrimitive * > &selection)
 
IVW_CORE_API void alignAlphaToTop (const std::vector< TFPrimitive * > &selection)
 
IVW_CORE_API void alignAlphaToBottom (const std::vector< TFPrimitive * > &selection)
 
IVW_CORE_API void alignPositionToMean (std::vector< TFPrimitive * > selection)
 
IVW_CORE_API void alignPositionToLeft (std::vector< TFPrimitive * > selection)
 
IVW_CORE_API void alignPositionToRight (std::vector< TFPrimitive * > selection)
 
IVW_CORE_API void interpolateAlpha (const std::vector< TFPrimitive * > &selection)
 
IVW_CORE_API void flipPositions (const std::vector< TFPrimitive * > &selection)
 
template<size_t N>
std::array< Axis, N > defaultAxes ()
 
IVW_CORE_API unitgroups::EnabledGroups getSystemUnitGroups ()
 
IVW_CORE_API std::unordered_map< units::detail::unit_data, std::vector< UnitDesc > > getUnitGroupsFor (Unit unit, const unitgroups::EnabledGroups &enabledGroups)
 
IVW_CORE_API std::pair< double, std::vector< std::tuple< std::string_view, std::string_view, int > > > findBestSetOfNamedUnits (Unit unit, const unitgroups::EnabledGroups &enabledGroups, UseUnitPrefixes usesPrefixes)
 
IVW_CORE_API std::back_insert_iterator< fmt::memory_buffer > formatUnitTo (std::back_insert_iterator< fmt::memory_buffer > it, Unit unit, const unitgroups::EnabledGroups &enabledGroups, UseUnitPrefixes usesPrefixes)
 
template<typename... Args>
void printEvent (std::ostream &os, const std::string &event, Args... args)
 
void IVW_CORE_API readBytesIntoBuffer (const std::filesystem::path &file, size_t offset, size_t bytes, bool littleEndian, size_t elementSize, void *dest)
 
template<typename T >
void saveData (const T &data, const std::filesystem::path &filePath, const FileExtension &extension, Overwrite overwrite)
 
template<typename T >
std::optional< std::filesystem::path > saveData (const T &data, const std::filesystem::path &path, std::string_view name, const std::vector< FileExtension > &extensions, Overwrite overwrite)
 
IVW_CORE_API void saveLayer (const Layer &layer, const std::filesystem::path &path, const FileExtension &extension=FileExtension())
 
IVW_CORE_API void saveLayer (const Layer &layer)
 
IVW_CORE_API void renamePort (Deserializer &d, std::vector< std::pair< const Port *, std::string > > rules)
 
IVW_CORE_API void renameProperty (Deserializer &d, std::vector< std::pair< const Property *, std::string > > rules, std::string path="Properties")
 
IVW_CORE_API void changePropertyType (Deserializer &d, std::vector< std::pair< const Property *, std::string > > rules)
 
IVW_CORE_API std::unordered_set< Processor * > getDirectPredecessors (Processor *processor)
 
IVW_CORE_API std::unordered_set< Processor * > getDirectSuccessors (Processor *processor)
 
IVW_CORE_API std::unordered_set< Processor * > getPredecessors (Processor *processor)
 
IVW_CORE_API std::unordered_set< Processor * > getSuccessors (Processor *processor)
 
template<TraversalDirection D, VisitPattern V, typename Func , typename Filter = DefaultTraversalFilter>
void traverseNetwork (std::unordered_set< Processor * > &state, Processor *processor, Func f, Filter connectionFilter=DefaultTraversalFilter{})
 
IVW_CORE_API std::vector< Processor * > topologicalSortFiltered (ProcessorNetwork *network)
 
IVW_CORE_API std::vector< Processor * > topologicalSort (ProcessorNetwork *network)
 
IVW_CORE_API std::vector< ivec2 > getPositions (const std::vector< Processor * > &processors)
 
IVW_CORE_API std::vector< ivec2 > getPositions (ProcessorNetwork *network)
 
IVW_CORE_API ivec2 getCenterPosition (const std::vector< Processor * > &processors)
 
IVW_CORE_API ivec2 getCenterPosition (ProcessorNetwork *network)
 
IVW_CORE_API std::pair< ivec2, ivec2 > getBoundingBox (const std::vector< Processor * > &processors)
 
IVW_CORE_API std::pair< ivec2, ivec2 > getBoundingBox (ProcessorNetwork *network)
 
IVW_CORE_API void offsetPosition (const std::vector< Processor * > &processors, ivec2 offset)
 
IVW_CORE_API void setSelected (const std::vector< Processor * > &processors, bool selected)
 
IVW_CORE_API void serializeSelected (ProcessorNetwork *network, std::ostream &os, const std::filesystem::path &refPath)
 
IVW_CORE_API std::vector< Processor * > appendPartialProcessorNetwork (ProcessorNetwork *network, std::istream &is, const std::filesystem::path &refPath, InviwoApplication *app, OffsetCallback offsetCallback=nullptr)
 
IVW_CORE_API std::vector< Processor * > appendProcessorNetwork (ProcessorNetwork *destinationNetwork, const std::filesystem::path &workspaceFile, InviwoApplication *app)
 
IVW_CORE_API bool addProcessorOnConnection (ProcessorNetwork &network, Processor &processor, PortConnection connection)
 
IVW_CORE_API bool addProcessorOnConnection (ProcessorNetwork *network, std::shared_ptr< Processor > processor, PortConnection connection)
 
IVW_CORE_API std::shared_ptr< ProcessorreplaceProcessor (ProcessorNetwork *network, Processor &newProcessor, Processor *oldProcessor)
 
IVW_CORE_API std::shared_ptr< ProcessorreplaceProcessor (ProcessorNetwork *network, std::shared_ptr< Processor > newProcessor, Processor *oldProcessor)
 
IVW_CORE_API bool canSplitConnection (Processor &p, const PortConnection &connection)
 
IVW_CORE_API void forEachWorkspaceInDirRecursive (const std::filesystem::path &path, std::function< void(const std::filesystem::path &)> callback)
 
IVW_CORE_API size_t updateWorkspaces (InviwoApplication *app, const std::filesystem::path &path, DryRun dryRun, std::function< void()> updateGui=[]() {}, size_t current=0, size_t total=0)
 
IVW_CORE_API void updateExampleWorkspaces (InviwoApplication *app, DryRun dryRun, std::function< void()> updateGui=[]() {})
 
IVW_CORE_API void updateRegressionWorkspaces (InviwoApplication *app, DryRun dryRun, std::function< void()> updateGui=[]() {})
 
IVW_CORE_API void replaceSelectionWithCompositeProcessor (ProcessorNetwork &network)
 
IVW_CORE_API void expandCompositeProcessorIntoNetwork (CompositeProcessor &composite)
 
IVW_CORE_API std::vector< std::filesystem::path > exportAllFiles (ProcessorNetwork &network, const std::filesystem::path &dir, std::string_view nameTemplate, const std::vector< FileExtension > &candidateExtensions, Overwrite overwrite)
 
Tags IVW_CORE_API getPlatformTags (const Tags &t)
 
IVW_CORE_API const ProcessorMetaDatagetMetaData (const Processor *processor)
 
IVW_CORE_API ProcessorMetaDatagetMetaData (Processor *processor)
 
IVW_CORE_API ivec2 getPosition (const Processor *processor)
 
IVW_CORE_API void setPosition (Processor *processor, ivec2 pos)
 
IVW_CORE_API bool isSelected (const Processor *processor)
 
IVW_CORE_API void setSelected (Processor *processor, bool selected)
 
template<typename T , typename... Args>
std::unique_ptr< T > makeProcessor (ivec2 pos, Args &&... args)
 
IVW_CORE_API InviwoModulegetProcessorModule (const Processor *processor, InviwoApplication &app)
 Find which module that registered a processor.
 
IVW_CORE_API InviwoModulegetProcessorModule (std::string_view classIdentifier, InviwoApplication &app)
 Find which module that registered a processor.
 
template<typename T , typename V >
T & trySetProperty (Processor *proc, std::string_view identifier, V &&val, bool recursive=false)
 Tries to set a processor's property to a given value.
 
IVW_CORE_API std::optional< std::string > getProcessorModuleIdentifier (std::string_view classIdentifier, InviwoApplication &app)
 Find the module identifier of a registered processor.
 
IVW_CORE_API std::vector< OptionPropertyIntOptionenumeratedOptions (std::string_view name, size_t count, int start=0, int step=1)
 
IVW_CORE_API OrdinalPropertyState< vec4 > ordinalColor (float r, float g, float b, float a=1.0f, InvalidationLevel invalidationLevel=InvalidationLevel::InvalidOutput)
 
IVW_CORE_API OrdinalPropertyState< vec4 > ordinalColor (const vec4 &value, InvalidationLevel invalidationLevel=InvalidationLevel::InvalidOutput)
 
IVW_CORE_API OrdinalPropertyState< vec3 > ordinalColor (const vec3 &value, InvalidationLevel invalidationLevel=InvalidationLevel::InvalidOutput)
 
IVW_CORE_API OrdinalPropertyState< vec3 > ordinalLight (const vec3 &pos, float min=-100.0, float max=100.0, InvalidationLevel invalidationLevel=InvalidationLevel::InvalidOutput)
 
template<typename T = double, typename U = T>
OrdinalPropertyState< T > ordinalSymmetricVector (const T &value={0}, const U &minMax=U{100})
 
template<typename T = size_t, typename U = T>
OrdinalPropertyState< T > ordinalCount (const T &value=T{0}, const U &max=U{100})
 
template<typename T = double, typename U = T>
OrdinalPropertyState< T > ordinalLength (const T &value=T{0}, const U &max=U{100})
 
template<typename T = double, typename U = T>
OrdinalPropertyState< T > ordinalScale (const T &value=T{0}, const U &max=U{100})
 
IVW_CORE_API OrdinalRefPropertyState< vec4 > ordinalRefColor (InvalidationLevel invalidationLevel=InvalidationLevel::InvalidOutput)
 
template<typename T = double, typename U = T>
OrdinalRefPropertyState< T > ordinalRefSymmetricVector (const U &minMax=U{100})
 
template<typename T , typename U >
void updateDefaultState (T &property, const U &state, OverwriteState overwrite)
 
template<size_t N>
std::span< const std::string_view, N > defaultValues ()
 
IVW_CORE_API void debugBreak ()
 
IVW_CORE_API void reverse (BufferBase &b)
 
std::optional< BuildInfo > IVW_CORE_API getBuildInfo ()
 Accesses build information via an INI file or compile-time definitions.
 
IVW_CORE_API std::string msToString (double ms, bool includeZeros=true, bool spacing=false)
 convert the given duration from milliseconds to a string. The returned string will have the format "%dd %dh %dmin %dsec %.3fms", where days, hours, minutes, seconds, ... are suppressed up to the first non-zero unit if not needed. Milliseconds and seconds are combined if larger than 1 second.
 
template<class Rep , class Period = std::ratio<1>>
std::string durationToString (std::chrono::duration< Rep, Period > duration, bool includeZeros=true, bool spacing=false)
 convenience function for converting a std::chrono::duration to a string calling msToString(double).
 
constexpr std::uint64_t constexpr_hash (std::string_view str) noexcept
 
template<size_t len>
constexpr std::uint64_t constexpr_hash (const char(&str)[len]) noexcept
 
IVW_CORE_API std::string demangle (const char *name)
 
IVW_CORE_API std::string parseTypeIdName (const char *name)
 
template<typename T >
constexpr bool alwaysFalse ()
 
template<typename T >
constexpr std::string_view enumName ()
 
template<typename Iterable , typename Callback >
void forEach (const Iterable &iterable, Callback &&callback)
 
template<typename Iterable , typename Callback , typename OnDoneCallback >
std::vector< std::future< void > > forEachParallelAsync (const Iterable &iterable, Callback &&callback, size_t jobs, OnDoneCallback &&onTaskDone)
 
template<typename Iterable , typename Callback >
std::vector< std::future< void > > forEachParallelAsync (const Iterable &iterable, Callback &&callback, size_t jobs=0)
 
template<typename Iterable , typename Callback >
void forEachParallel (const Iterable &iterable, Callback &&callback, size_t jobs=0)
 
template<class F , class... Args>
auto for_each_argument (F &&f, Args &&... args)
 
template<typename F , typename TupleType >
void for_each_in_tuple (F &&f, TupleType &&t)
 
template<typename F , typename TupleType1 , typename TupleType2 >
void for_each_in_tuple (F &&f, TupleType1 &&t1, TupleType2 &&t2)
 
IVW_CORE_API size_t bytes_to_kilobytes (size_t bytes)
 
IVW_CORE_API size_t bytes_to_megabytes (size_t bytes)
 
IVW_CORE_API size_t kilobytes_to_bytes (size_t bytes)
 
IVW_CORE_API size_t megabytes_to_bytes (size_t bytes)
 
IVW_CORE_API std::string formatBytesToString (size_t bytes)
 
template<typename T >
constexpr NumericType getNumericType ()
 
IVW_CORE_API NumericType commonNumericType (std::span< const DataFormatBase * > formats)
 
IVW_CORE_API size_t commonFormatPrecision (std::span< const DataFormatBase * > formats)
 
template<typename T >
bool isfinite (const T &v)
 
template<glm::length_t L, typename T , glm::qualifier Q>
glm::vec< L, bool, Q > isfinite (const glm::vec< L, T, Q > &x)
 
template<typename T >
bool isnan (const T &v)
 
template<glm::length_t L, typename T , glm::qualifier Q>
glm::vec< L, bool, Q > isnan (const glm::vec< L, T, Q > &x)
 
template<class U , class T , class BinaryOperation >
accumulate (T x, U init, BinaryOperation op)
 
template<glm::length_t L, class U , glm::qualifier Q, template< glm::length_t, typename, glm::qualifier > class vecType, class BinaryOperation >
std::enable_if_t< util::rank< vecType< L, U, Q > >::value==1, U > accumulate (const vecType< L, U, Q > &x, U init, BinaryOperation op)
 
template<glm::length_t C, glm::length_t R, class U , glm::qualifier Q, template< glm::length_t, glm::length_t, typename, glm::qualifier > class vecType, class BinaryOperation >
std::enable_if_t< util::rank< vecType< C, R, U, Q > >::value==2, U > accumulate (const vecType< C, R, U, Q > &x, U init, BinaryOperation op)
 
template<typename Type1 , typename Type2 >
Type1 invertY (Type1 vec, Type2 dim)
 
template<typename T >
bool all (const T &t)
 
template<>
bool all (const bool &t)
 
template<typename T >
bool any (const T &t)
 
template<>
bool any (const bool &t)
 
template<typename M , typename T = typename M::value_type>
filled (T v)
 
template<typename T >
epsilon ()
 
template<typename T >
bool almostEqual (const T &x, const T &y, int ulp=2)
 
template<typename T >
glm::vec< 3, T > transformPos (const glm::mat< 4, 4, T > &m, const glm::vec< 3, T > &pos)
 
template<typename T >
glm::vec< 3, T > transformNormal (const glm::mat< 4, 4, T > &modelViewMatrix, const glm::vec< 3, T > &normal)
 
template<typename T , typename std::enable_if< util::rank< T >::value==0, int >::type = 0>
constexpr auto glmcomp (T &elem, size_t) -> T &
 
template<typename T , typename std::enable_if< util::rank< T >::value==2, int >::type = 0>
constexpr auto glmcomp (const T &elem, size_t i) -> const typename T::value_type &
 
template<typename T , typename std::enable_if< util::rank< T >::value==0, int >::type = 0>
constexpr auto glmcomp (T &elem, size_t, size_t) -> T &
 
template<typename T , typename std::enable_if< util::rank< T >::value==2, int >::type = 0>
constexpr auto glmcomp (const T &elem, size_t i, size_t j) -> const typename T::value_type &
 
template<typename To = double, typename From >
constexpr To glm_convert (From x)
 
template<typename To = double, typename From >
constexpr To glm_convert_normalized (From x)
 
template<class T >
constexpr void hash_combine (std::size_t &seed, const T &v) noexcept
 
template<typename C >
void forEachPixel (const size2_t dims, C callback)
 
template<typename C >
void forEachPixel (const LayerRAM &layer, C callback)
 
template<typename C >
void forEachPixelParallel (const size2_t dims, C callback, size_t jobs=0)
 
template<typename C >
void forEachPixelParallel (const LayerRAM &layer, C callback, size_t jobs=0)
 
IVW_CORE_API void flipLayerVertical (Layer &layer)
 
IVW_CORE_API void flipLayerHorizontal (Layer &layer)
 
IVW_CORE_API void flipImageVertical (Image &img)
 
IVW_CORE_API void flipImageHorizontal (Image &img)
 
IVW_CORE_API std::shared_ptr< ImagereadImageFromDisk (std::string filename)
 
template<size_t N, typename IndexType = size_t>
auto makeIndexMapper (const Vector< N, IndexType > &dim)
 
template<bool PropagateConst = true, typename Iter >
IndirectIterator< Iter, PropagateConst > makeIndirectIterator (Iter iter) noexcept(std::is_nothrow_move_constructible_v< Iter >)
 
template<typename T >
constexpr std::string_view classIdentifier ()
 
template<typename T >
constexpr std::string_view dataName ()
 
template<typename T >
constexpr uvec3 colorCode ()
 
template<typename T >
Document info (const T &data)
 
template<class Iter >
iter_range< Iter > as_range (Iter begin, Iter end)
 
template<class Iter >
iter_range< Iter > as_range (std::pair< Iter, Iter > const &x)
 
template<class Container >
iter_range< typename Container::iterator > as_range (Container &c)
 
template<class Container >
iter_range< typename Container::const_iterator > as_range (const Container &c)
 
void IVW_CORE_API configureCodePage ()
 
IVW_CORE_API void log (ExceptionContext context, std::string_view message, LogLevel level=LogLevel::Info, LogAudience audience=LogAudience::Developer)
 
IVW_CORE_API void log (Logger *logger, ExceptionContext context, std::string_view message, LogLevel level=LogLevel::Info, LogAudience audience=LogAudience::Developer)
 
template<typename... Args>
void log (SourceContext context, LogLevel level, LogAudience audience, fmt::format_string< Args... > format, Args &&... args)
 
template<typename... Args>
void logInfo (SourceContext context, fmt::format_string< Args... > format, Args &&... args)
 
template<typename... Args>
void logWarn (SourceContext context, fmt::format_string< Args... > format, Args &&... args)
 
template<typename... Args>
void logError (SourceContext context, fmt::format_string< Args... > format, Args &&... args)
 
IVW_CORE_API ModuleManagergetModuleManager ()
 
IVW_CORE_API ModuleManagergetModuleManager (InviwoApplication *app)
 
IVW_CORE_API InviwoModulegetModuleByIdentifier (std::string_view identifier)
 
IVW_CORE_API InviwoModulegetModuleByIdentifier (InviwoApplication *app, std::string_view identifier)
 
IVW_CORE_API size_t getNumberOfModules ()
 
IVW_CORE_API size_t getNumberOfModules (InviwoApplication *app)
 
IVW_CORE_API InviwoModulegetModuleByIndex (size_t index)
 
IVW_CORE_API InviwoModulegetModuleByIndex (InviwoApplication *app, size_t index)
 
IVW_CORE_API std::filesystem::path getModulePath (InviwoModule *module)
 
IVW_CORE_API std::filesystem::path getModulePath (InviwoModule *module, ModulePath pathType)
 
IVW_CORE_API std::filesystem::path getModulePath (std::string_view identifier, ModulePath pathType)
 return the path for a specific type located within the requested module
 
IVW_CORE_API std::filesystem::path getModulePath (InviwoApplication *app, std::string_view identifier, ModulePath pathType)
 
IVW_CORE_API std::filesystem::path getModulePath (std::string_view identifier)
 
IVW_CORE_API std::filesystem::path getModulePath (InviwoApplication *app, std::string_view identifier)
 
template<class T >
T * getModuleByType (InviwoApplication *app)
 
template<class T >
T * getModuleByType ()
 
template<typename T >
std::filesystem::path getModulePath (ModulePath pathType)
 return the path for a specific type located within the requested module of type T
 
template<typename T >
std::filesystem::path getModulePath (InviwoApplication *app, ModulePath pathType)
 
template<class charT , class traits , class DelimT >
ostream_joiner< std::decay_t< DelimT >, charT, traits > make_ostream_joiner (std::basic_ostream< charT, traits > &os, DelimT &&delimiter)
 
template<typename T >
void SetValue (T &t, T value)
 
template<typename T >
OnScopeExit::ExitAction RevertValue (T &t)
 
IVW_CORE_API std::vector< std::filesystem::path > getLibrarySearchPaths ()
 Returns paths to search for module libraries. All platforms: executable directory and application modules directory (AppData/Inviwo/modules on windows). Platform dependent search directories: OSX: DYLD_LIBRARY_PATH UNIX: LD_LIBRARY_PATH/LD_RUN_PATH, RPATH and "executable directory /../../lib".
 
template<typename Derived , typename Base , typename Del >
std::unique_ptr< Derived, Del > static_unique_ptr_cast (std::unique_ptr< Base, Del > &&p)
 
template<typename Derived , typename Base , typename Del >
std::unique_ptr< Derived, Del > dynamic_unique_ptr_cast (std::unique_ptr< Base, Del > &&p)
 
template<typename Derived , typename Base >
std::unique_ptr< Derived > dynamic_unique_ptr_cast (std::unique_ptr< Base, std::default_delete< Base > > &&p)
 
template<std::size_t N, typename Index = size_t, typename Functor >
constexpr auto make_array (Functor &&func) noexcept -> std::array< decltype(func(std::declval< Index >())), N >
 
template<typename Common , typename... Ts>
auto ref (Ts &... args)
 
template<class... Ts>
 overloaded (Ts...) -> overloaded< Ts... >
 
template<typename T , typename V >
auto erase_remove (T &cont, const V &elem) -> decltype(std::distance(std::declval< T >().begin(), std::declval< T >().end()))
 
template<typename T , typename Pred >
auto erase_remove_if (T &cont, Pred pred) -> decltype(std::distance(std::declval< T >().begin(), std::declval< T >().end()))
 
template<typename T >
void reverse_erase (T &cont)
 
template<typename T , typename Pred >
void reverse_erase_if (T &cont, Pred pred)
 
template<typename T , typename Pred >
size_t map_erase_remove_if (T &cont, Pred pred)
 
template<typename T >
bool push_back_unique (T &cont, typename T::value_type elem)
 
template<typename Dst , typename... Srcs>
Dst & append (Dst &dest, Srcs &&... sources)
 
template<typename T , typename V >
auto find (T &cont, const V &elem)
 
template<typename T , typename Pred >
auto find_if (T &cont, Pred pred) -> typename T::iterator
 
template<typename T , typename Pred >
auto find_if (const T &cont, Pred pred) -> typename T::const_iterator
 
template<typename T , typename V >
bool contains (T &cont, const V &elem)
 
template<typename T , typename Pred >
bool contains_if (T &cont, Pred pred)
 
template<typename T , typename V >
bool contains (const T &cont, const V &elem)
 
template<typename T , typename Pred >
bool contains_if (const T &cont, Pred pred)
 
template<typename T , typename P >
auto find_if_or_null (T &cont, P pred) -> typename T::value_type
 
template<typename T , typename V >
auto find_or_null (T &cont, const V &elem) -> typename T::value_type
 
template<typename T , typename V , typename Callable >
auto find_or_null (T &cont, const V &elem, Callable f) -> typename T::value_type
 
template<typename T >
bool has_key (T &map, const typename T::key_type &key)
 
template<typename T >
bool insert_unique (T &map, const typename T::key_type &key, typename T::mapped_type &value)
 
template<typename T , typename V >
auto map_find_or_null (T &cont, const V &elem) -> typename T::mapped_type
 
template<typename T , typename V , typename Callable >
auto map_find_or_null (T &cont, const V &elem, Callable f) -> typename std::invoke_result_t< Callable, typename T::mapped_type >
 
template<typename InputIter , typename UnaryPredicate >
constexpr bool all_of (InputIter begin, InputIter end, UnaryPredicate pred)
 
template<typename T , typename UnaryPredicate >
constexpr bool all_of (const T &cont, UnaryPredicate pred)
 
template<typename InputIter , typename UnaryPredicate >
constexpr bool any_of (InputIter begin, InputIter end, UnaryPredicate pred)
 
template<typename T , typename UnaryPredicate >
constexpr bool any_of (const T &cont, UnaryPredicate pred)
 
template<typename InputIter , typename UnaryPredicate >
constexpr bool none_of (InputIter begin, InputIter end, UnaryPredicate pred)
 
template<typename T , typename UnaryPredicate >
constexpr bool none_of (const T &cont, UnaryPredicate pred)
 
template<typename Iter , typename Proj = identity>
Iter find_not_equal (Iter begin, Iter end, Proj proj={})
 
template<typename T , typename OutIt , typename P >
OutIt copy_if (const T &cont, OutIt out, P pred)
 
template<typename T , typename P >
auto copy_if (const T &cont, P pred) -> std::vector< typename T::value_type >
 
template<typename T , typename UnaryOperation >
auto transform (const T &cont, UnaryOperation op) -> std::vector< std::invoke_result_t< UnaryOperation, const typename T::value_type > >
 
template<typename T , typename Pred >
auto ordering (T &cont, Pred pred) -> std::vector< size_t >
 
template<typename T >
auto ordering (T &cont) -> std::vector< size_t >
 
template<typename Generator >
auto table (Generator gen, int start, int end, int step=1) -> std::vector< decltype(gen(std::declval< int >()))>
 
template<class T , typename Tuple , size_t count = 0>
constexpr size_t index_of ()
 
template<class T , typename Tuple , size_t count = 0>
constexpr size_t index_of_derived ()
 
template<typename T >
bool is_future_ready (const std::future< T > &future)
 
IVW_CORE_API std::wstring toWstring (std::string_view str)
 convert the given std::string to std::wstring. On Windows, MultiByteToWideChar is used for this conversion assuming utf8 encoding. Otherwise, std::mbsrtowcs is used.
 
IVW_CORE_API std::string fromWstring (std::wstring_view str)
 convert the given std::wstring to std::string. On Windows, WideCharToMultiByte is used for this conversion assuming utf8 encoding. Otherwise, std::wcsrtombs is used.
 
template<typename Func >
constexpr void forEachStringPart (std::string_view str, std::string_view sep, Func &&func)
 Call a functor on each part of the string after splitting by sep.
 
constexpr std::pair< std::string_view, std::string_view > splitByFirst (std::string_view str, char delimiter=' ')
 Divide a string into two parts by the first instance of a delimiter.
 
constexpr std::pair< std::string_view, std::string_view > splitByFirst (std::string_view str, std::string_view delimiter)
 Divide a string into two parts by the first instance of a delimiter.
 
constexpr std::pair< std::string_view, std::string_view > splitByLast (std::string_view str, char delimiter=' ')
 Divide a string into two parts by the last instance of a delimiter.
 
constexpr std::pair< std::string_view, std::string_view > splitByLast (std::string_view str, std::string_view delimiter)
 Divide a string into two parts by the last instance of a delimiter.
 
IVW_CORE_API std::vector< std::string > splitString (std::string_view str, char delimiter=' ')
 Split string into substrings based on separating delimiter character. Using delimiter ';' on string "aa;bb" will result in a vector contaning aa and bb.
 
IVW_CORE_API std::vector< std::string_view > splitStringView (std::string_view str, char delimiter=' ')
 Split string into substrings based on separating delimiter character. Using delimiter ';' on string "aa;bb" will result in a vector contaning aa and bb.
 
constexpr std::string_view trim (std::string_view str) noexcept
 trims str from beginning and end by removing white spaces
 
constexpr std::string_view ltrim (std::string_view str) noexcept
 trims str from beginning removing white spaces
 
constexpr std::string_view rtrim (std::string_view str) noexcept
 trims str from end by removing white spaces
 
IVW_CORE_API bool iCaseEndsWith (std::string_view str, std::string_view suffix)
 Checks if provided string ends with suffix using case insensitive equal comparison.
 
IVW_CORE_API std::string elideLines (std::string_view str, std::string_view abbrev="...", size_t maxLineLength=500)
 Elide parts of lines in str which are longer than maxLineLength and append abbrev instead.
 
IVW_CORE_API void urlEncodeTo (std::string_view text, StrBuffer &strBuffer)
 
IVW_CORE_API void htmlEncodeTo (std::string_view data, StrBuffer &strBuffer)
 
IVW_CORE_API std::string urlEncode (std::string_view text)
 
IVW_CORE_API std::string htmlEncode (std::string_view data)
 
IVW_CORE_API void setThreadDescription (const std::string &desc)
 
IVW_CORE_API int getPid ()
 
IVW_CORE_API ThreadPoolgetThreadPool ()
 
IVW_CORE_API ThreadPoolgetThreadPool (InviwoApplication *app)
 
IVW_CORE_API void waitForPool ()
 
IVW_CORE_API void waitForPool (InviwoApplication *app)
 
IVW_CORE_API size_t processFront ()
 
IVW_CORE_API size_t processFront (InviwoApplication *app)
 
IVW_CORE_API size_t getPoolSize ()
 
template<class F , class... Args>
auto dispatchPool (F &&f, Args &&... args) -> std::future< std::invoke_result_t< F, Args... > >
 
template<class F , class... Args>
auto dispatchPool (InviwoApplication *app, F &&f, Args &&... args) -> std::future< std::invoke_result_t< F, Args... > >
 
IVW_CORE_API void dispatchFrontAndForget (std::function< void()> fun)
 
IVW_CORE_API void dispatchFrontAndForget (InviwoApplication *app, std::function< void()> fun)
 
template<class F , class... Args>
auto dispatchFront (F &&f, Args &&... args) -> std::future< std::invoke_result_t< F, Args... > >
 
template<class F , class... Args>
auto dispatchFront (InviwoApplication *app, F &&f, Args &&... args) -> std::future< std::invoke_result_t< F, Args... > >
 
IVW_CORE_API TimerThreadgetDefaultTimerThread ()
 
template<typename Transform , typename Iter >
auto makeTransformIterator (Transform &&transform, Iter iter)
 
template<typename Range , typename Transform >
auto transformRange (Range &range, Transform &&transform)
 
template<typename... A, typename F >
constexpr bool is_callable_with (F &&)
 
IVW_CORE_API void saveNetwork (ProcessorNetwork *network, std::string_view filename)
 
IVW_CORE_API void saveAllCanvases (ProcessorNetwork *network, const std::filesystem::path &dir, std::string_view name="UPN", std::string_view ext=".png", bool onlyActiveCanvases=false)
 
IVW_CORE_API bool isValidIdentifierCharacter (char c, std::string_view extra="")
 
IVW_CORE_API void validateIdentifier (std::string_view identifier, std::string_view type, ExceptionContext context)
 
IVW_CORE_API std::string findUniqueIdentifier (std::string_view identifier, std::function< bool(std::string_view)> isUnique, std::string_view sep=" ")
 
IVW_CORE_API std::string cleanIdentifier (std::string_view identifier, std::string_view extra="")
 
IVW_CORE_API std::string stripModuleFileNameDecoration (const std::filesystem::path &filePath)
 Removes inviwo-module from module library file name. Turns "/path/to/inviwo-module-yourmodule.dll" into "yourmodule". Returns filename without extension if inviwo-module was not found.
 
IVW_CORE_API std::string stripIdentifier (std::string_view identifier)
 
template<typename... Args>
void show (Args &&... args)
 
template<typename... Args>
void hide (Args &&... args)
 
template<typename C >
void forEachVoxel (const size3_t dims, C callback)
 
template<typename C >
void forEachVoxel (const VolumeRAM &v, C callback)
 
template<typename C >
void forEachVoxelParallel (const size3_t dims, C callback, size_t jobs=0)
 
template<typename C >
void forEachVoxelParallel (const VolumeRAM &v, C callback, size_t jobs=0)
 
IVW_CORE_API bool hasTimestamps (const VolumeSequence &seq, bool checkfirstonly=true)
 
IVW_CORE_API std::pair< double, double > getTimestampRange (const VolumeSequence &seq, bool sorted=true)
 
IVW_CORE_API bool isSorted (const VolumeSequence &seq)
 
VolumeSequence IVW_CORE_API sortSequence (const VolumeSequence &seq)
 
IVW_CORE_API std::pair< std::shared_ptr< const Volume >, std::shared_ptr< const Volume > > getVolumesForTimestep (const VolumeSequence &seq, double t, bool sorted=true)
 
bool IVW_CORE_API hasTimestamp (const std::shared_ptr< const Volume > &vol)
 
double IVW_CORE_API getTimestamp (const std::shared_ptr< const Volume > &vol)
 
bool IVW_CORE_API hasMargins (const std::shared_ptr< const Volume > &volume)
 
bool IVW_CORE_API isBricked (const std::shared_ptr< const Volume > &volume)
 
size3_t IVW_CORE_API getBrickDimensions (const std::shared_ptr< const Volume > &volume)
 
std::pair< vec3, vec3 > IVW_CORE_API getVolumeMargins (const std::shared_ptr< const Volume > &volume)
 return the margins of a volume, in normalized texture coordinates [0,1]
 
size3_t IVW_CORE_API getVolumeDimensions (const std::shared_ptr< const Volume > &volume)
 returns the true volume dimensions considering volume margins and bricking
 
double IVW_CORE_API voxelVolume (const Volume &volume)
 calculates the volume of a single voxel, taking the basis and the dimensions into account The units of the result is in the unit as the basis vectors ^3
 
template<typename... T>
auto zip (T &&... args) -> detailzip::zipper< T... >
 
template<typename T >
auto make_sequence (const T &begin, const T &end, const T &inc=T{1}) -> sequence< T >
 
template<typename TIndex = size_t, typename T , typename... Ts>
auto enumerate (T &&cont, Ts &&... conts)
 
IVW_SYS_API std::vector< ModuleContainergetModuleContainersImpl (ModuleManager &moduleManager, std::span< const std::filesystem::path > searchPaths)
 
template<typename... Args>
std::vector< inviwo::ModuleContainergetModuleContainers (ModuleManager &moduleManager, Args &&... searchPaths)
 
template<typename Filter , typename... Args>
void registerModulesFiltered (ModuleManager &moduleManager, Filter &&filter, Args &&... searchPaths)
 
template<typename... Args>
void registerModules (ModuleManager &moduleManager, Args &&... searchPaths)
 
void IVW_QTEDITOR_API insertNetworkForData (const std::filesystem::path &dataFile, ProcessorNetwork *net, bool alwaysFirst=false, bool onlySource=false, QWidget *parent=nullptr)
 
template<typename T , typename TRAMrep >
requires requires(T data) { typename T::repr; std::is_base_of_v<typename T::repr, TRAMrep>; data.template getRepresentation<TRAMrep>(); }
std::shared_ptr< T > combineChannels (const std::array< DataInport< T >, 4 > &sources, const std::array< int, 4 > &selectedPortChannels)
 
template<class T , typename std::enable_if< util::rank< T >::value==1 &&util::extent< T >::value==2, int >::type = 0>
bool isConvex (const std::vector< T > &polygon)
 check whether the given polygon is convex
 
template<class T , typename std::enable_if< util::rank< T >::value==1 &&util::extent< T >::value==2, int >::type = 0>
bool isInside (const std::vector< T > &hull, const T &p)
 check whether a given point lies within the convex hull
 
template<class T , typename std::enable_if< util::rank< T >::value==1 &&util::extent< T >::value==2, int >::type = 0>
double getArea (const std::vector< T > &polygon)
 compute the area of a convex polygon
 
template<class T , typename std::enable_if< util::rank< T >::value==1 &&util::extent< T >::value==2, int >::type = 0>
std::vector< T > convexHull (const std::vector< T > &points)
 compute the complex hull from a given set of 2D points using the Monotone Chain algorithm, i.e. Andrew's convex hull algorithm
 
std::shared_ptr< Mesh > IVW_MODULE_BASE_API convertHullToMesh (const std::vector< vec2 > &hull, bool useIndices=false)
 
IVW_MODULE_BASE_API std::pair< dvec4, dvec4 > volumeMinMax (const VolumeRAM *volume, IgnoreSpecialValues ignore=IgnoreSpecialValues::No)
 
IVW_MODULE_BASE_API std::pair< dvec4, dvec4 > layerMinMax (const LayerRAM *layer, IgnoreSpecialValues ignore=IgnoreSpecialValues::No)
 
IVW_MODULE_BASE_API std::pair< dvec4, dvec4 > bufferMinMax (const BufferRAM *layer, IgnoreSpecialValues ignore=IgnoreSpecialValues::No)
 
IVW_MODULE_BASE_API std::pair< dvec4, dvec4 > volumeMinMax (const Volume *volume, IgnoreSpecialValues ignore=IgnoreSpecialValues::No)
 
IVW_MODULE_BASE_API std::pair< dvec4, dvec4 > layerMinMax (const Layer *layer, IgnoreSpecialValues ignore=IgnoreSpecialValues::No)
 
IVW_MODULE_BASE_API std::pair< dvec4, dvec4 > bufferMinMax (const BufferBase *buffer, IgnoreSpecialValues ignore=IgnoreSpecialValues::No)
 
template<typename ValueType >
std::pair< dvec4, dvec4 > dataMinMax (const ValueType *data, size_t size, IgnoreSpecialValues ignore=IgnoreSpecialValues::No)
 
template<typename T , typename U , typename Predicate , typename ValueTransform , typename ProgressCallback >
void layerRAMDistanceTransform (const LayerRAMPrecision< T > *inLayer, LayerRAMPrecision< U > *outDistanceField, const Matrix< 2, U > basis, const size2_t upsample, Predicate predicate, ValueTransform valueTransform, ProgressCallback callback)
 
template<typename T , typename U >
void layerRAMDistanceTransform (const LayerRAMPrecision< T > *inVolume, LayerRAMPrecision< U > *outDistanceField, const Matrix< 2, U > basis, const size2_t upsample)
 
template<typename U , typename Predicate , typename ValueTransform , typename ProgressCallback >
void layerDistanceTransform (const Layer *inLayer, LayerRAMPrecision< U > *outDistanceField, const size2_t upsample, Predicate predicate, ValueTransform valueTransform, ProgressCallback callback)
 
template<typename U , typename ProgressCallback >
void layerDistanceTransform (const Layer *inLayer, LayerRAMPrecision< U > *outDistanceField, const size2_t upsample, double threshold, bool normalize, bool flip, bool square, double scale, ProgressCallback callback)
 
template<typename U >
void layerDistanceTransform (const Layer *inLayer, LayerRAMPrecision< U > *outDistanceField, const size2_t upsample, double threshold, bool normalize, bool flip, bool square, double scale)
 
IVW_MODULE_BASE_API std::shared_ptr< LayerRAMlayerSubSet (const Layer *in, ivec2 offset, size2_t extent, bool clampBorderOutsideImage=false)
 extracts a subregion from a layer and returns it as a new layer
 
template<typename T >
std::shared_ptr< LayerRAMPrecision< T > > typedLayerSubSet (const Layer *in, ivec2 offset, size2_t extent, bool clampBorderOutsideImage=false)
 extracts a subregion from a layer and converts it into a new layer
 
template<typename T , typename OutIt >
void generatePoints (OutIt outIt, std::variant< Grid3DPointGeneration, RandomCubicalPointGeneration, RandomSphericalPointGeneration > opts)
 
template<typename T >
haltonSequence (size_t n, size_t base)
 
template<typename T >
std::shared_ptr< LayerhaltonSequence (size2_t dims, size_t numberOfPoints, size_t baseX=2, size_t baseY=3)
 
template<typename T >
std::shared_ptr< VolumehaltonSequence (size3_t dims, size_t numberOfPoints, size_t baseX=2, size_t baseY=3, size_t baseZ=5)
 
template<typename T , typename Rand = std::mt19937, typename Dist = typename std::conditional<std::is_integral<T>::value, std::uniform_int_distribution<T>, std::uniform_real_distribution<T>>::type>
void randomSequence (T *data, size_t numberOfElements, Rand &randomNumberGenerator=Rand(), Dist &distribution=Dist(0, 1))
 
template<typename T , typename Rand = std::mt19937, typename Dist = typename std::conditional<std::is_integral<T>::value, std::uniform_int_distribution<T>, std::uniform_real_distribution<T>>::type>
void randomSequence (std::span< T > data, Rand &randomNumberGenerator=Rand(), Dist &distribution=Dist(0, 1))
 
template<typename T , typename Rand = std::mt19937, typename Dist = typename std::conditional<std::is_integral<T>::value, std::uniform_int_distribution<T>, std::uniform_real_distribution<T>>::type>
std::shared_ptr< LayerRAMPrecision< T > > randomLayerRAM (size2_t dims, Rand &randomNumberGenerator=Rand(), Dist &distribution=Dist(0, 1))
 
template<typename T , typename Rand = std::mt19937, typename Dist = typename std::conditional<std::is_integral<T>::value, std::uniform_int_distribution<T>, std::uniform_real_distribution<T>>::type>
std::shared_ptr< LayerrandomLayer (size2_t dims, Rand &randomNumberGenerator=Rand(), Dist &distribution=Dist(0, 1))
 
template<typename T , typename Rand = std::mt19937, typename Dist = typename std::conditional<std::is_integral<T>::value, std::uniform_int_distribution<T>, std::uniform_real_distribution<T>>::type>
std::shared_ptr< VolumerandomVolume (size3_t dims, Rand &randomNumberGenerator=Rand(), Dist &distribution=Dist(0, 1))
 
template<typename Rand = std::mt19937>
std::shared_ptr< LayerperlinNoise (size2_t dims, float persistence, size_t startLevel, size_t endLevel, Rand &randomNumberGenerator=Rand())
 
template<typename Rand = std::mt19937>
std::shared_ptr< LayerpoissonDisk (size2_t dims, size_t poissonDotsAlongX, size_t maxPoints, Rand &randomNumberGenerator=Rand())
 
IVW_MODULE_BASE_API std::shared_ptr< Meshmarchingcubes (std::shared_ptr< const Volume > volume, double iso, const vec4 &color, bool invert, bool enclose, std::function< void(float)> progressCallback=std::function< void(float)>(), std::function< bool(const size3_t &)> maskingCallback=[](const size3_t &) { return true;})
 
IVW_MODULE_BASE_API std::shared_ptr< MeshmarchingCubesOpt (std::shared_ptr< const Volume > volume, double iso, const vec4 &color, bool invert, bool enclose, std::function< void(float)> progressCallback=nullptr, std::function< bool(const size3_t &)> maskingCallback=nullptr)
 
std::shared_ptr< Meshmarchingtetrahedron (std::shared_ptr< const Volume > volume, double iso, const vec4 &color=vec4(1.0f), bool invert=false, bool enclose=true, std::function< void(float)> progressCallback=std::function< void(float)>(), std::function< bool(const size3_t &)> maskingCallback=[](const size3_t &) { return true;})
 
IVW_MODULE_BASE_API std::unique_ptr< VolumecurlVolume (std::shared_ptr< const Volume > volume)
 
IVW_MODULE_BASE_API std::unique_ptr< VolumecurlVolume (const Volume &volume)
 
IVW_MODULE_BASE_API std::unique_ptr< VolumedivergenceVolume (const Volume &volume)
 
IVW_MODULE_BASE_API std::unique_ptr< VolumedivergenceVolume (std::shared_ptr< const Volume > volume)
 
template<typename Functor >
std::unique_ptr< VolumegenerateVolume (const size3_t &dimensions, const mat3 &basis, Functor &&function)
 
template<typename T = float>
std::unique_ptr< VolumemakeSingleVoxelVolume (const size3_t &size)
 
template<typename T = float>
std::unique_ptr< VolumemakeSphericalVolume (const size3_t &size)
 
template<typename T = float>
std::unique_ptr< VolumemakeRippleVolume (const size3_t &size)
 
template<typename T = float>
std::unique_ptr< VolumemakeMarchingCubeVolume (const size_t &index)
 
IVW_MODULE_BASE_API std::shared_ptr< VolumegradientVolume (std::shared_ptr< const Volume > volume, int channel)
 
IVW_MODULE_BASE_API std::shared_ptr< VolumevolumeLaplacian (std::shared_ptr< const Volume > volume, VolumeLaplacianPostProcessing postProcessing, double scale)
 
template<typename T , typename U , typename Predicate , typename ValueTransform , typename ProgressCallback >
void volumeRAMDistanceTransform (const VolumeRAMPrecision< T > *inVolume, VolumeRAMPrecision< U > *outDistanceField, const Matrix< 3, U > &basis, const size3_t &upsample, Predicate predicate, ValueTransform valueTransform, ProgressCallback progress)
 
template<typename T , typename U >
void volumeRAMDistanceTransform (const VolumeRAMPrecision< T > *inVolume, VolumeRAMPrecision< U > *outDistanceField, const Matrix< 3, U > &basis, const size3_t &upsample)
 
template<typename U , typename Predicate , typename ValueTransform , typename ProgressCallback >
void volumeDistanceTransform (const Volume *inVolume, VolumeRAMPrecision< U > *outDistanceField, const size3_t &upsample, Predicate predicate, ValueTransform valueTransform, ProgressCallback progress)
 
template<typename U , typename ProgressCallback >
void volumeDistanceTransform (const Volume *inVolume, VolumeRAMPrecision< U > *outDistanceField, const size3_t &upsample, double threshold, bool normalize, bool flip, bool square, double scale, ProgressCallback progress)
 
template<typename U >
void volumeDistanceTransform (const Volume *inVolume, VolumeRAMPrecision< U > *outDistanceField, const size3_t &upsample, double threshold, bool normalize, bool flip, bool square, double scale)
 
IVW_MODULE_BASE_API std::shared_ptr< VolumeRAMvolumeDownsample (const VolumeRAM *in, size3_t strides, DownsamplingMode mode)
 
IVW_MODULE_BASE_API std::shared_ptr< VolumeRAMvolumeStridedDownsample (const VolumeRAM *in, size3_t strides)
 
IVW_MODULE_BASE_API std::shared_ptr< VolumeRAMvolumeAveragedDownsample (const VolumeRAM *in, size3_t strides)
 
IVW_MODULE_BASE_API size_t volumeSignificantVoxels (const VolumeRAM *volume, IgnoreSpecialValues ignore=IgnoreSpecialValues::No)
 
IVW_MODULE_BASE_API std::shared_ptr< VolumevoronoiSegmentation (const size3_t volumeDimensions, const mat4 &indexToDataMatrix, const mat4 &dataToModelMatrix, const std::vector< std::pair< uint32_t, vec3 > > &seedPointsWithIndices, const Wrapping3D &wrapping, const std::optional< std::vector< float > > &weights)
 
IVW_MODULE_BASE_API void writeDatVolume (const Volume &data, const std::filesystem::path &filePath, Overwrite overwrite=Overwrite::No)
 
IVW_MODULE_BASE_API std::filesystem::path writeIvfVolumeSequence (const VolumeSequence &volumes, std::string_view name, const std::filesystem::path &path, std::string_view relativePathToElements="", Overwrite overwrite=Overwrite::Yes)
 Writes a volume sequence to disk.
 
IVW_MODULE_BASE_API void writeIvfVolume (const Volume &data, const std::filesystem::path &filePath, Overwrite overwrite=Overwrite::No)
 
void updateReaderFromFile (const FileProperty &filePath, OptionProperty< FileExtension > &extensions)
 
template<typename... Types>
void updateFilenameFilters (const DataReaderFactory &rf, FileProperty &filePath, OptionProperty< FileExtension > &optionProperty)
 
template<typename T , typename std::enable_if< util::rank< T >::value==1, int >::type = 0>
auto glm2eigen (const T &elem) -> Eigen::Matrix< typename T::value_type, util::extent< T, 0 >::value, 1 >
 
template<typename T , unsigned Rows, unsigned Cols, typename std::enable_if<(Rows >=2 &&Rows<=4 &&Cols >=2 &&Cols<=4), int >::type = 0>
auto eigen2glm (const Eigen::Matrix< T, Rows, Cols > &m)
 
template<typename T , unsigned Rows, unsigned Cols, typename std::enable_if<(Cols >=2 &&Cols<=4 &&Rows==1), int >::type = 0>
auto eigen2glm (const Eigen::Matrix< T, Cols, Cols > &m)
 
template<typename T >
std::shared_ptr< ImageeigenMatToImage (const T &m, bool flipY=false, std::string name="")
 
IVW_MODULE_FONTRENDERING_API TextTextureObject createTextTextureObject (TextRenderer &textRenderer, std::string text, vec4 fontColor, std::shared_ptr< Texture2D > tex=nullptr)
 Creates a texture with rendered text for a given string including its bounding box.
 
IVW_MODULE_FONTRENDERING_API std::shared_ptr< Texture2DcreateTextTexture (TextRenderer &textRenderer, std::string text, vec4 fontColor, std::shared_ptr< Texture2D > tex=nullptr)
 Creates a texture with rendered text for a given string.
 
IVW_MODULE_GLFW_API MouseButton mapGLFWMouseButton (int mouseButtonGLFW)
 
IVW_MODULE_GLFW_API MouseState mapGLFWMouseState (int mouseStateGLFW)
 
IVW_MODULE_GLFW_API KeyModifiers mapGLFWModifiers (int modifiersGLFW)
 
IVW_MODULE_GLFW_API KeyState mapGLFWMKeyState (int actionGLFW)
 
IVW_MODULE_GLFW_API IvwKey mapGLFWMKey (int keyGLFW)
 
IVW_MODULE_QTWIDGETS_API IvwKey mapKeyFromQt (const QKeyEvent *keyevent)
 
IVW_MODULE_QTWIDGETS_API ModifierAction getModifierAction (Qt::KeyboardModifiers modifiers)
 
IVW_MODULE_QTWIDGETS_API MouseCursor fromCursorShape (const Qt::CursorShape cursor)
 
IVW_MODULE_QTWIDGETS_API Qt::CursorShape toCursorShape (const MouseCursor cursor)
 
template<typename T >
spherical (T val)
 
template<typename T >
euclidean (T val)
 
template<class T , class... Args>
auto make_qptr (Args &&... args)
 
IVW_MODULE_QTWIDGETS_API std::shared_ptr< TransferFunctionimportTransferFunctionDialog (QWidget *parent=nullptr)
 Shows an InviwoFileDialog to import a TransferFunction from a file.
 
IVW_MODULE_QTWIDGETS_API void exportTransferFunctionDialog (const TransferFunction &tf, QWidget *parent=nullptr)
 Shows an InviwoFileDialog to export a TFPrimitiveSet to a file.
 
IVW_MODULE_QTWIDGETS_API std::shared_ptr< IsoValueCollectionimportIsoValueCollectionDialog (QWidget *parent=nullptr)
 Shows an InviwoFileDialog to import a IsoValueCollection from a file.
 
IVW_MODULE_QTWIDGETS_API void exportIsoValueCollectionDialog (const IsoValueCollection &iso, QWidget *parent=nullptr)
 Shows an InviwoFileDialog to export a TFPrimitiveSet to a file.
 
IVW_MODULE_QTWIDGETS_API QMenu * addTFPresetsMenu (QWidget *parent, QMenu *menu, TransferFunctionProperty *property)
 create a submenu containing entries for TF presets of all transfer functions found in the path PathType::TransferFunctions. Upon selecting a menu entry, the respective preset will be loaded by property. The submenu will be disabled if property is read-only.
 
IVW_MODULE_QTWIDGETS_API QMenu * addTFColorbrewerPresetsMenu (QWidget *parent, QMenu *menu, TransferFunctionProperty *property)
 
auto encode (const std::vector< SgctCommand > &commands) -> std::vector< std::byte >
 
void decode (const std::vector< std::byte > &bytes, std::vector< SgctCommand > &commands)
 
auto sgctToInviwo (sgct::Log::Level level) -> inviwo::LogLevel
 
IVW_MODULE_VECTORFIELDVISUALIZATION_API IntegralLine curvature (const IntegralLine &line, dmat4 toWorld)
 
IVW_MODULE_VECTORFIELDVISUALIZATION_API IntegralLineSet curvature (const IntegralLineSet &lines)
 
IVW_MODULE_VECTORFIELDVISUALIZATION_API void curvature (IntegralLine &line, dmat4 toWorld)
 
IVW_MODULE_VECTORFIELDVISUALIZATION_API void curvature (IntegralLineSet &lines)
 
IVW_MODULE_VECTORFIELDVISUALIZATION_API IntegralLine tortuosity (const IntegralLine &line, dmat4 toWorld)
 
IVW_MODULE_VECTORFIELDVISUALIZATION_API IntegralLineSet tortuosity (const IntegralLineSet &lines)
 
IVW_MODULE_VECTORFIELDVISUALIZATION_API void tortuosity (IntegralLine &line, dmat4 toWorld)
 
IVW_MODULE_VECTORFIELDVISUALIZATION_API void tortuosity (IntegralLineSet &lines)
 
void IVW_MODULE_VOLUME_API remap (Volume &volume, const std::vector< int > &src, const std::vector< int > &dst, int missingValue, bool useMissingValue)
 

Variables

constexpr std::array< std::string_view, 4 > defaultAxesNames = {"x", "y", "z", "t"}
 
constexpr std::array< Unit, 4 > defaultAxesUnits = {Unit{}, Unit{}, Unit{}, Unit{}}
 
template<template< class... > class Op, class... Args>
constexpr bool is_detected_v = is_detected<Op, Args...>::value
 
template<class Expected , template< class... > class Op, class... Args>
constexpr bool is_detected_exact_v = is_detected_exact<Expected, Op, Args...>::value
 
template<class To , template< class... > class Op, class... Args>
constexpr bool is_detected_convertible_v = is_detected_convertible<To, Op, Args...>::value
 
template<typename T >
constexpr bool is_floating_point_v = is_floating_point<T>::value
 
template<class T >
constexpr size_t rank_v = rank<T>::value
 
template<class T , unsigned N = 0>
constexpr size_t extent_v = extent<T, N>::value
 
template<class T >
constexpr size_t flat_extent_v = flat_extent<T>::value
 
constexpr auto fmtHelp
 
IVW_CORE_API std::function< std::optional< mat4 >()> boundingBox (const DataInport< Layer > &layer)
 
IVW_CORE_API std::function< std::optional< mat4 >()> boundingBox (const DataInport< Layer, 0 > &layers)
 
IVW_CORE_API std::function< std::optional< mat4 >()> boundingBox (const DataInport< Layer, 0, true > &layers)
 
IVW_CORE_API std::function< std::optional< mat4 >()> boundingBox (const DataOutport< Layer > &layer)
 
IVW_CORE_API std::function< std::optional< mat4 >()> boundingBox (const DataInport< Mesh > &mesh)
 
IVW_CORE_API std::function< std::optional< mat4 >()> boundingBox (const DataInport< Mesh, 0 > &meshes)
 
IVW_CORE_API std::function< std::optional< mat4 >()> boundingBox (const DataInport< Mesh, 0, true > &meshes)
 
IVW_CORE_API std::function< std::optional< mat4 >()> boundingBox (const DataOutport< Mesh > &mesh)
 
IVW_CORE_API std::function< std::optional< mat4 >()> boundingBox (const DataInport< Volume > &volume)
 
IVW_CORE_API std::function< std::optional< mat4 >()> boundingBox (const DataInport< std::vector< std::shared_ptr< Volume > > > &volumes)
 
IVW_CORE_API std::function< std::optional< mat4 >()> boundingBox (const DataOutport< Volume > &volume)
 
IVW_CORE_API std::function< std::optional< mat4 >()> boundingBox (const DataOutport< std::vector< std::shared_ptr< Volume > > > &volumes)
 
IVW_CORE_API CameraFactorygetCameraFactory ()
 
IVW_CORE_API CameraFactorygetCameraFactory (InviwoApplication *app)
 
IVW_CORE_API CameraFactorygetCameraFactory (Processor *processor)
 
IVW_CORE_API CameraFactorygetCameraFactory (Property *property)
 
IVW_CORE_API DataReaderFactorygetDataReaderFactory ()
 
IVW_CORE_API DataReaderFactorygetDataReaderFactory (InviwoApplication *app)
 
IVW_CORE_API DataReaderFactorygetDataReaderFactory (Processor *processor)
 
IVW_CORE_API DataReaderFactorygetDataReaderFactory (Property *property)
 
IVW_CORE_API DataWriterFactorygetDataWriterFactory ()
 
IVW_CORE_API DataWriterFactorygetDataWriterFactory (InviwoApplication *app)
 
IVW_CORE_API DataWriterFactorygetDataWriterFactory (Processor *processor)
 
IVW_CORE_API DataWriterFactorygetDataWriterFactory (Property *property)
 
IVW_CORE_API DialogFactorygetDialogFactory ()
 
IVW_CORE_API DialogFactorygetDialogFactory (InviwoApplication *app)
 
IVW_CORE_API DialogFactorygetDialogFactory (Processor *processor)
 
IVW_CORE_API DialogFactorygetDialogFactory (Property *property)
 
IVW_CORE_API MeshDrawerFactorygetMeshDrawerFactory ()
 
IVW_CORE_API MeshDrawerFactorygetMeshDrawerFactory (InviwoApplication *app)
 
IVW_CORE_API MeshDrawerFactorygetMeshDrawerFactory (Processor *processor)
 
IVW_CORE_API MeshDrawerFactorygetMeshDrawerFactory (Property *property)
 
IVW_CORE_API MetaDataFactorygetMetaDataFactory ()
 
IVW_CORE_API MetaDataFactorygetMetaDataFactory (InviwoApplication *app)
 
IVW_CORE_API MetaDataFactorygetMetaDataFactory (Processor *processor)
 
IVW_CORE_API MetaDataFactorygetMetaDataFactory (Property *property)
 
IVW_CORE_API InportFactorygetInportFactory ()
 
IVW_CORE_API InportFactorygetInportFactory (InviwoApplication *app)
 
IVW_CORE_API InportFactorygetInportFactory (Processor *processor)
 
IVW_CORE_API InportFactorygetInportFactory (Property *property)
 
IVW_CORE_API OutportFactorygetOutportFactory ()
 
IVW_CORE_API OutportFactorygetOutportFactory (InviwoApplication *app)
 
IVW_CORE_API OutportFactorygetOutportFactory (Processor *processor)
 
IVW_CORE_API OutportFactorygetOutportFactory (Property *property)
 
IVW_CORE_API PortInspectorFactorygetPortInspectorFactory ()
 
IVW_CORE_API PortInspectorFactorygetPortInspectorFactory (InviwoApplication *app)
 
IVW_CORE_API PortInspectorFactorygetPortInspectorFactory (Processor *processor)
 
IVW_CORE_API PortInspectorFactorygetPortInspectorFactory (Property *property)
 
IVW_CORE_API ProcessorFactorygetProcessorFactory ()
 
IVW_CORE_API ProcessorFactorygetProcessorFactory (InviwoApplication *app)
 
IVW_CORE_API ProcessorFactorygetProcessorFactory (Processor *processor)
 
IVW_CORE_API ProcessorFactorygetProcessorFactory (Property *property)
 
IVW_CORE_API ProcessorWidgetFactorygetProcessorWidgetFactory ()
 
IVW_CORE_API ProcessorWidgetFactorygetProcessorWidgetFactory (InviwoApplication *app)
 
IVW_CORE_API ProcessorWidgetFactorygetProcessorWidgetFactory (Processor *processor)
 
IVW_CORE_API ProcessorWidgetFactorygetProcessorWidgetFactory (Property *property)
 
IVW_CORE_API PropertyConverterManagergetPropertyConverterManager ()
 
IVW_CORE_API PropertyConverterManagergetPropertyConverterManager (InviwoApplication *app)
 
IVW_CORE_API PropertyConverterManagergetPropertyConverterManager (Processor *processor)
 
IVW_CORE_API PropertyConverterManagergetPropertyConverterManager (Property *property)
 
IVW_CORE_API PropertyFactorygetPropertyFactory ()
 
IVW_CORE_API PropertyFactorygetPropertyFactory (InviwoApplication *app)
 
IVW_CORE_API PropertyFactorygetPropertyFactory (Processor *processor)
 
IVW_CORE_API PropertyFactorygetPropertyFactory (Property *property)
 
IVW_CORE_API PropertyWidgetFactorygetPropertyWidgetFactory ()
 
IVW_CORE_API PropertyWidgetFactorygetPropertyWidgetFactory (InviwoApplication *app)
 
IVW_CORE_API PropertyWidgetFactorygetPropertyWidgetFactory (Processor *processor)
 
IVW_CORE_API PropertyWidgetFactorygetPropertyWidgetFactory (Property *property)
 
IVW_CORE_API RepresentationMetaFactorygetRepresentationMetaFactory ()
 
IVW_CORE_API RepresentationMetaFactorygetRepresentationMetaFactory (InviwoApplication *app)
 
IVW_CORE_API RepresentationMetaFactorygetRepresentationMetaFactory (Processor *processor)
 
IVW_CORE_API RepresentationMetaFactorygetRepresentationMetaFactory (Property *property)
 
IVW_CORE_API RepresentationConverterMetaFactorygetRepresentationConverterMetaFactory ()
 
IVW_CORE_API RepresentationConverterMetaFactorygetRepresentationConverterMetaFactory (InviwoApplication *app)
 
IVW_CORE_API RepresentationConverterMetaFactorygetRepresentationConverterMetaFactory (Processor *processor)
 
IVW_CORE_API RepresentationConverterMetaFactorygetRepresentationConverterMetaFactory (Property *property)
 
IVW_CORE_API ResourceManagergetResourceManager ()
 
IVW_CORE_API ResourceManagergetResourceManager (InviwoApplication *app)
 
IVW_CORE_API ResourceManagergetResourceManager (Processor *processor)
 
IVW_CORE_API ResourceManagergetResourceManager (Property *property)
 

Detailed Description

util

Typedef Documentation

◆ PrecisionType

template<typename T >
using inviwo::util::PrecisionType = typename std::remove_pointer<typename std::remove_const<T>::type>::type

Utility for retrieving the type of a (Buffer/Layer/Volume)RamPrecision pointer variable. Example usage:

VolumeRam* volumeram = ...; // of some glm vector type.
auto count = volumeram->dispatch<size_t, dispatching::filter::Vecs>([](auto vrprecision) {
using VolumeType = util::PrecisionType<decltype(vrprecision)>;
....
typename std::remove_pointer< typename std::remove_const< T >::type >::type PrecisionType
Definition formatdispatching.h:493
Definition formatdispatching.h:393

VolumeType will then be for example VolumeRamPrecision<vec3>

◆ PrecisionValueType

template<typename T >
using inviwo::util::PrecisionValueType = typename PrecisionType<T>::type

Utility for retrieving the type of a (Buffer/Layer/Volume)RamPrecision pointer variable. Example usage:

VolumeRam* volumeram = ...; // of some glm vector type.
auto count = volumeram->dispatch<size_t, dispatching::filter::Vecs>([](auto vrprecision) {
using ValueType = util::PrecisionValueType<decltype(vrprecision)>;
....
typename PrecisionType< T >::type PrecisionValueType
Definition formatdispatching.h:511

ValueType will then be for example vec3

Function Documentation

◆ addTFPresetsMenu()

IVW_MODULE_QTWIDGETS_API QMenu * inviwo::util::addTFPresetsMenu ( QWidget * parent,
QMenu * menu,
TransferFunctionProperty * property )

create a submenu containing entries for TF presets of all transfer functions found in the path PathType::TransferFunctions. Upon selecting a menu entry, the respective preset will be loaded by property. The submenu will be disabled if property is read-only.

Parameters
parentparent widget
menuparent menu to which the TF preset submenu should be added
propertythis property will load the TF presets once the menu entries are triggered
Returns
newly created submenu, which is owned by parent

◆ alignAlphaToBottom()

IVW_CORE_API void inviwo::util::alignAlphaToBottom ( const std::vector< TFPrimitive * > & selection)

Set the alphas value of selection to the min alpha value.

◆ alignAlphaToMean()

IVW_CORE_API void inviwo::util::alignAlphaToMean ( const std::vector< TFPrimitive * > & selection)

Set the alphas value of selection to the average alpha value.

◆ alignAlphaToTop()

IVW_CORE_API void inviwo::util::alignAlphaToTop ( const std::vector< TFPrimitive * > & selection)

Set the alphas value of selection to the max alpha value.

◆ alignPositionToLeft()

IVW_CORE_API void inviwo::util::alignPositionToLeft ( std::vector< TFPrimitive * > selection)

Set the position value of selection to the min position value.

◆ alignPositionToMean()

IVW_CORE_API void inviwo::util::alignPositionToMean ( std::vector< TFPrimitive * > selection)

Set the position value of selection to the average position value.

◆ alignPositionToRight()

IVW_CORE_API void inviwo::util::alignPositionToRight ( std::vector< TFPrimitive * > selection)

Set the position value of selection to the max position value.

◆ appendIfNotEmpty()

IVW_CORE_API std::string inviwo::util::appendIfNotEmpty ( std::string_view a,
std::string_view b )

Appends b to a if a is not empty and returns a. Useful if an empty a is considered an error and we want to propagate that error.

◆ appendPartialProcessorNetwork()

IVW_CORE_API std::vector< Processor * > inviwo::util::appendPartialProcessorNetwork ( ProcessorNetwork * network,
std::istream & is,
const std::filesystem::path & refPath,
InviwoApplication * app,
OffsetCallback offsetCallback = nullptr )

Append a PartialProcessorNetwork to the network

Parameters
networkthe network to append to the current one
isa stream of a serialized PartialProcessorNetwork
refPatha possible path to the original file of the PartialProcessorNetwork, for error reporting
appThe inviwo application
offsetCallbackcallback for determining an offset, which is applied to all added processors
Returns
the appended processors.

◆ boundingBox() [1/18]

IVW_CORE_API std::function< std::optional< mat4 >()> inviwo::util::boundingBox ( const DataInport< Layer > & layer)

Constructs a function that returns the bounding box of the data in the port. If the port is empty the function should return std::nullopt;

◆ boundingBox() [2/18]

IVW_CORE_API std::function< std::optional< mat4 >()> inviwo::util::boundingBox ( const DataInport< Layer, 0 > & layers)

Constructs a function that returns the bounding box of the data in the port. If the port is empty the function should return std::nullopt;

◆ boundingBox() [3/18]

IVW_CORE_API std::function< std::optional< mat4 >()> inviwo::util::boundingBox ( const DataInport< Layer, 0, true > & layers)

Constructs a function that returns the bounding box of the data in the port. If the port is empty the function should return std::nullopt;

◆ boundingBox() [4/18]

IVW_CORE_API std::function< std::optional< mat4 >()> inviwo::util::boundingBox ( const DataInport< Mesh > & mesh)

Constructs a function that returns the bounding box of the data in the port. If the port is empty the function should return std::nullopt;

◆ boundingBox() [5/18]

IVW_CORE_API std::function< std::optional< mat4 >()> inviwo::util::boundingBox ( const DataInport< Mesh, 0 > & meshes)

Constructs a function that returns the bounding box of the data in the port. If the port is empty the function should return std::nullopt;

◆ boundingBox() [6/18]

IVW_CORE_API std::function< std::optional< mat4 >()> inviwo::util::boundingBox ( const DataInport< Mesh, 0, true > & meshes)

Constructs a function that returns the bounding box of the data in the port. If the port is empty the function should return std::nullopt;

◆ boundingBox() [7/18]

IVW_CORE_API std::function< std::optional< mat4 >()> inviwo::util::boundingBox ( const DataInport< std::vector< std::shared_ptr< Volume > > > & volumes)

Constructs a function that returns the bounding box of the data in the port. If the port is empty the function should return std::nullopt;

◆ boundingBox() [8/18]

IVW_CORE_API std::function< std::optional< mat4 >()> inviwo::util::boundingBox ( const DataInport< Volume > & volume)

Constructs a function that returns the bounding box of the data in the port. If the port is empty the function should return std::nullopt;

◆ boundingBox() [9/18]

IVW_CORE_API std::function< std::optional< mat4 >()> inviwo::util::boundingBox ( const DataOutport< Layer > & layer)

Constructs a function that returns the bounding box of the data in the port. If the port is empty the function should return std::nullopt;

◆ boundingBox() [10/18]

IVW_CORE_API std::function< std::optional< mat4 >()> inviwo::util::boundingBox ( const DataOutport< Mesh > & mesh)

Constructs a function that returns the bounding box of the data in the port. If the port is empty the function should return std::nullopt;

◆ boundingBox() [11/18]

IVW_CORE_API std::function< std::optional< mat4 >()> inviwo::util::boundingBox ( const DataOutport< std::vector< std::shared_ptr< Volume > > > & volumes)

Constructs a function that returns the bounding box of the data in the port. If the port is empty the function should return std::nullopt;

◆ boundingBox() [12/18]

IVW_CORE_API std::function< std::optional< mat4 >()> inviwo::util::boundingBox ( const DataOutport< Volume > & volume)

Constructs a function that returns the bounding box of the data in the port. If the port is empty the function should return std::nullopt;

◆ boundingBox() [13/18]

IVW_CORE_API mat4 inviwo::util::boundingBox ( const Layer & layer)

Calculate a bounding box of the layers in world space. The bounding box is represented using a mat4, where all positions are between `bbox * (x,y,z,1) where x, y, and z are between 0 and 1. The bounding box will have zero depth in most cases since the layer basis is two-dimensional.

◆ boundingBox() [14/18]

IVW_CORE_API mat4 inviwo::util::boundingBox ( const Mesh & mesh)

Calculate a bounding box of the position buffer of the mesh in world space. The bounding box is represented using a mat4, where all positions are between `bbox * (x,y,z,1) where x, y, and z are between 0 and 1.

◆ boundingBox() [15/18]

IVW_CORE_API mat4 inviwo::util::boundingBox ( const std::vector< std::shared_ptr< const Mesh > > & meshes)

Calculate a bounding box of the position buffers of all the meshes in world space. The bounding box is represented using a mat4, where all positions are between `bbox * (x,y,z,1) where x, y, and z are between 0 and 1.

◆ boundingBox() [16/18]

IVW_CORE_API mat4 inviwo::util::boundingBox ( const std::vector< std::shared_ptr< Layer > > & layers)

Calculate a bounding box of all layers in world space. The bounding box is represented using a mat4, where all positions are between `bbox * (x,y,z,1) where x, y, and z are between 0 and 1.

◆ boundingBox() [17/18]

IVW_CORE_API mat4 inviwo::util::boundingBox ( const std::vector< std::shared_ptr< Volume > > & volumes)

Calculate a bounding box of all the volumes in world space. The bounding box is represented using a mat4, where all positions are between `bbox * (x,y,z,1) where x, y, and z are between 0 and 1.

◆ boundingBox() [18/18]

IVW_CORE_API mat4 inviwo::util::boundingBox ( const Volume & volume)

Calculate a bounding box of the volume in world space. The bounding box is represented using a mat4, where all positions are between `bbox * (x,y,z,1) where x, y, and z are between 0 and 1.

◆ calculateHistograms()

template<typename T >
std::vector< Histogram1D > inviwo::util::calculateHistograms ( std::span< const T > data,
const DataMapper & dataMap,
size_t bins )

Calculate histograms and statistics for a given span data of type T.

Template Parameters
Tunderlying data type, can be a scalar or glm vector type
Parameters
data
dataMapprovides the data range used for bin positions and size
binsupper limit of bins to use, actual number of bins might be lower based on data range and data type of T
Returns
vector of histograms, one per channel/component in data

◆ combineChannels()

template<typename T , typename TRAMrep >
requires requires(T data) { typename T::repr; std::is_base_of_v<typename T::repr, TRAMrep>; data.template getRepresentation<TRAMrep>(); }
std::shared_ptr< T > inviwo::util::combineChannels ( const std::array< DataInport< T >, 4 > & sources,
const std::array< int, 4 > & selectedPortChannels )

Combines up to four channels from four inports into a single object of type T.

Template Parameters
Tunderlying datatype
TRAMrepRAM representation for T
Parameters
sourcesarray of inports for type T
selectedPortChannelsselected channel for each inport
Returns
instance of T with the combined channels of sources

Usage: combineChannels<Layer, LayerRAM>(...)

See also
LayerCombiner, VolumeChannelCombiner

◆ commonFormatPrecision()

IVW_CORE_API size_t inviwo::util::commonFormatPrecision ( std::span< const DataFormatBase * > formats)

Determines the format precision of the given formats, that is the highest one.

Returns
maximum precision of all formats

◆ commonNumericType()

IVW_CORE_API NumericType inviwo::util::commonNumericType ( std::span< const DataFormatBase * > formats)

Determines the common numeric type of the given formats. Returns NumericType::Float if any of the formats is a floating point format. Otherwise, NumericType::SignedInteger is returned if at least one format is signed, and NumericType::UnsignedInteger if that is not the case.

Returns
NumericType based on formats. NumericType::NotSpecialized if the span is empty.

◆ convexHull()

template<class T , typename std::enable_if< util::rank< T >::value==1 &&util::extent< T >::value==2, int >::type = 0>
std::vector< T > inviwo::util::convexHull ( const std::vector< T > & points)

compute the complex hull from a given set of 2D points using the Monotone Chain algorithm, i.e. Andrew's convex hull algorithm

See also
https://en.wikipedia.org/wiki/Convex_hull_algorithms#Algorithms
Parameters
pointsset of 2D points
Returns
complex hull of input points

◆ createCameraEyeOffsetProperty()

IVW_CORE_API std::unique_ptr< FloatVec2RefProperty > inviwo::util::createCameraEyeOffsetProperty ( std::function< vec2()> get,
std::function< void(const vec2 &)> set )

Create an eye offset property for use in a camera property.

See also
SkewedPerspectiveCamera

◆ createCameraFovProperty()

IVW_CORE_API std::unique_ptr< FloatRefProperty > inviwo::util::createCameraFovProperty ( std::function< float()> get,
std::function< void(const float &)> set )

Create a vertical fov property for use in a camera property.

See also
PerspectiveCamera
SkewedPerspectiveCamera

◆ createCameraWidthProperty()

IVW_CORE_API std::unique_ptr< FloatRefProperty > inviwo::util::createCameraWidthProperty ( std::function< float()> get,
std::function< void(const float &)> set )

Create a width property for use in a CameraProperty.

See also
OrthographicCamera

◆ createTextTexture()

IVW_MODULE_FONTRENDERING_API std::shared_ptr< Texture2D > inviwo::util::createTextTexture ( TextRenderer & textRenderer,
std::string text,
vec4 fontColor,
std::shared_ptr< Texture2D > tex = nullptr )

Creates a texture with rendered text for a given string.

Creates a texture with a text string using the specified renderer and color. May take an additional variable tex of an existing texture that can be reused to reduce the number of times we need to allocating new textures.

The size of the texture will be the smallest possible for the given text and the pixels containing no text will have zero alpha.

For correct alignment of the baseline, the position of where this texture will be rendered must be adjusted by pos + computeBoundingBox(text).glyphsOrigin. See also TextOverlayGL::process() as an example.

Parameters
textRendererThe renderer that will be used to render the text
texttext to be rendered
fontColorthe final color of the text
texoptional cache texture which will be reused if possible
Returns
texture containing the text

◆ createTextTextureObject()

IVW_MODULE_FONTRENDERING_API TextTextureObject inviwo::util::createTextTextureObject ( TextRenderer & textRenderer,
std::string text,
vec4 fontColor,
std::shared_ptr< Texture2D > tex = nullptr )

Creates a texture with rendered text for a given string including its bounding box.

Creates a texture with rendered text for a string using the specified renderer and color. May take an additional variable tex of an existing texture that can be reused to reduce the number of times we need to allocating new textures. The resulting texture is returned along with the respective bounding box.

The size of the texture will be the smallest possible for the given text. All pixels containing no text will have zero alpha.

For correct alignment of the baseline, the position of where this texture will be rendered must be adjusted by pos + TextTextureObject.glyphsOrigin. See also TextOverlayGL::process() as an example.

Parameters
textRendererThe renderer that will be used to render the text
textstring to be rendered
fontColorthe final color of the text
texoptional cache texture which will be reused if possible (same texture will be returned)
Returns
text texture object referring to both texture and corresponding bounding box

◆ cubePlaneIntersectionAppend()

IVW_CORE_API void inviwo::util::cubePlaneIntersectionAppend ( const Plane & plane,
std::vector< vec3 > & pos,
std::vector< std::uint32_t > & inds )

Intersects a unit cube with the given plane. The intersection points and the midpoint will be added to 'pos' and a list of triangle indicies referring to the pos array will be appended to 'inds'

◆ dataMinMax()

template<typename ValueType >
std::pair< dvec4, dvec4 > inviwo::util::dataMinMax ( const ValueType * data,
size_t size,
IgnoreSpecialValues ignore = IgnoreSpecialValues::No )

Compute component-wise minimum and maximum values scalar and glm::vec types.

Parameters
datapointer to values
sizeof data
ignoreinfinite and NaN
Returns
minimum and maximum values of each component and zero for non-existing components

◆ demangle()

IVW_CORE_API std::string inviwo::util::demangle ( const char * name)

Demangle the type ID given in name

Parameters
namemangled type ID name
Returns
demangled type name without class and struct

◆ durationToString()

template<class Rep , class Period = std::ratio<1>>
std::string inviwo::util::durationToString ( std::chrono::duration< Rep, Period > duration,
bool includeZeros = true,
bool spacing = false )

convenience function for converting a std::chrono::duration to a string calling msToString(double).

Parameters
durationduration
includeZerosif true, time units for zero values are always shown, e.g. "2d 0h 0min 23s" vs. "2d 23s" and "2h 0min 0s" vs. "2h"
spacingif true, a space is inserted between digits and units
Returns
duration formatted as string

◆ elideLines()

IVW_CORE_API std::string inviwo::util::elideLines ( std::string_view str,
std::string_view abbrev = "...",
size_t maxLineLength = 500 )

Elide parts of lines in str which are longer than maxLineLength and append abbrev instead.

Parameters
strstring with lines to abbreviate
abbrevplaceholder that gets added at the end of abbreviated lines
maxLineLengthlines that are longer are abbreviated
Returns
input string where no line is longer than maxLineLength + abbrev.size()

◆ enumerate()

template<typename TIndex = size_t, typename T , typename... Ts>
auto inviwo::util::enumerate ( T && cont,
Ts &&... conts )

Enumerate element in a container. Example use case: std::vector<int> vec(10); for (auto&& item : util::enumerate(vec)) { auto&& ind = item.first(); auto&& elem = item.second(); // alternatively, get<0>(item) and get<1>(item) can be used }

with C++17 structured bindings for (auto&& [ind, elem] : util::enumerate(vec)) {

}

◆ enumeratedOptions()

IVW_CORE_API std::vector< OptionPropertyIntOption > inviwo::util::enumeratedOptions ( std::string_view name,
size_t count,
int start = 0,
int step = 1 )

A factory function for setting up a OptionPropertyInt with enumerated options. That is, "@p name 1", "@p name 2", etc. up to count.

◆ expandCompositeProcessorIntoNetwork()

IVW_CORE_API void inviwo::util::expandCompositeProcessorIntoNetwork ( CompositeProcessor & composite)

Expand a composite processors sub network into its network. Effectively reversing the actions of replaceSelectionWithCompositeProcessor. All processor except for composite sink and composite source processors are moved from the sub network into the network of the composite processor. Connections and links are the reestablished. Sources and sinks are discarded.

◆ exportAllFiles()

IVW_CORE_API std::vector< std::filesystem::path > inviwo::util::exportAllFiles ( ProcessorNetwork & network,
const std::filesystem::path & dir,
std::string_view nameTemplate,
const std::vector< FileExtension > & candidateExtensions,
Overwrite overwrite )

Exports the data from all export processors in network into the directory dir using a nameTemplate and candidate extensions.

Returns
names of exported files

◆ exportIsoValueCollectionDialog()

IVW_MODULE_QTWIDGETS_API void inviwo::util::exportIsoValueCollectionDialog ( const IsoValueCollection & iso,
QWidget * parent = nullptr )

Shows an InviwoFileDialog to export a TFPrimitiveSet to a file.

Parameters
isoIsoValueCollection set to be exported
parentparent widget of the file dialog

◆ exportTransferFunctionDialog()

IVW_MODULE_QTWIDGETS_API void inviwo::util::exportTransferFunctionDialog ( const TransferFunction & tf,
QWidget * parent = nullptr )

Shows an InviwoFileDialog to export a TFPrimitiveSet to a file.

Parameters
tfTransferFunction set to be exported
parentparent widget of the file dialog

◆ filled()

template<typename M , typename T = typename M::value_type>
M inviwo::util::filled ( T v)

Utility function to create a matrix filled with a constant. For example:

auto m = util::filled<mat3>(3.16);
// | 3.16 3.16 3.16 |
// | 3.16 3.16 3.16 |
// | 3.16 3.16 3.16 |
M filled(T v)
Definition glm.h:256

◆ findUniqueIdentifier()

IVW_CORE_API std::string inviwo::util::findUniqueIdentifier ( std::string_view identifier,
std::function< bool(std::string_view)> isUnique,
std::string_view sep = " " )

Utility to augment an identifier with a number to make it unique. Will add an increasing number to the end of the given identifier until the isUnique test returns true. Example for a processor identifier: auto uniqueIdentifier = util::findUniqueIdentifier( startIdentifier, [&](std::string_view id) { return processorNetwork->getProcessorByIdentifier(id) == nullptr; }, "" );

◆ flipPositions()

IVW_CORE_API void inviwo::util::flipPositions ( const std::vector< TFPrimitive * > & selection)

Flip the positions of the selection with respect to the respective range, i.e. p' = range.max - (p - range.min) with range.min/max corresponding to the lowest/highest position in selection.

Parameters
selectionlist of primitives to be flipped.

◆ forEach()

template<typename Iterable , typename Callback >
void inviwo::util::forEach ( const Iterable & iterable,
Callback && callback )

Utility function to iterate over all element in an iterable data structure (such as std::vector).

Parameters
iterablethe data structure to iterate over
callbackto call for each element, can be either [](auto &a){} or [](auto &a, size_t id){} where a is an data item from the iterable data structure and id is the index in the data structure

◆ forEachParallel()

template<typename Iterable , typename Callback >
void inviwo::util::forEachParallel ( const Iterable & iterable,
Callback && callback,
size_t jobs = 0 )

Use multiple threads to iterate over all elements in an iterable data structure (such as std::vector). If the Inviwo pool size is zero it will be executed directly in the same thread as the caller. The function will return once all jobs as has finished processing.

Parameters
iterablethe data structure to iterate over
callbackto call for each element, can be either [](auto &a){} or [](auto &a, size_t id){} where a is an data item from the iterable data structure and id is the index in the data structure
jobsoptional parameter specifying how many jobs to create, if jobs==0 (default) it will create pool size * 4 jobs

◆ forEachParallelAsync()

template<typename Iterable , typename Callback , typename OnDoneCallback >
std::vector< std::future< void > > inviwo::util::forEachParallelAsync ( const Iterable & iterable,
Callback && callback,
size_t jobs,
OnDoneCallback && onTaskDone )

Use multiple threads to iterate over all elements in an iterable data structure (such as std::vector). If the Inviwo pool size is zero it will be executed directly in the same thread as the caller. The function will return once all jobs as has been created and queued.

Parameters
iterablethe data structure to iterate over
callbackto call for each element, can be either [](auto &a){} or [](auto &a, size_t id){} where a is an data item from the iterable data structure and id is the index in the data structure
jobsoptional parameter specifying how many jobs to create, if jobs==0 (default) it will create pool size * 4 jobs
onTaskDonecallback that will be called when each job is done
Returns
a vector of futures, one for each job created.

◆ forEachStringPart()

template<typename Func >
void inviwo::util::forEachStringPart ( std::string_view str,
std::string_view sep,
Func && func )
constexpr

Call a functor on each part of the string after splitting by sep.

Parameters
strThe string to split
sepThe delimiter to split by
funcFunction callback, should take a std::string_view as argument

◆ fromWstring()

IVW_CORE_API std::string inviwo::util::fromWstring ( std::wstring_view str)

convert the given std::wstring to std::string. On Windows, WideCharToMultiByte is used for this conversion assuming utf8 encoding. Otherwise, std::wcsrtombs is used.

Parameters
strstd::wstring character string
Returns
input converted to multibyte std::string

◆ generateVolume()

template<typename Functor >
std::unique_ptr< Volume > inviwo::util::generateVolume ( const size3_t & dimensions,
const mat3 & basis,
Functor && function )

Convenience function for generating volumes

Parameters
dimensionsVolume grid dimensions
basisVolume basis, offset automatically set to center the volume around origo
functionFunctor called for each volume voxel. T(const size3_t& ind).

◆ getArea()

template<class T , typename std::enable_if< util::rank< T >::value==1 &&util::extent< T >::value==2, int >::type = 0>
double inviwo::util::getArea ( const std::vector< T > & polygon)

compute the area of a convex polygon

Parameters
polygonpoints ordered counter-clockwise
Returns
area of polygon

◆ getBoundingBox() [1/2]

IVW_CORE_API std::pair< ivec2, ivec2 > inviwo::util::getBoundingBox ( const std::vector< Processor * > & processors)

Retrieve bounding box of the processors in the list. The return value is pair of the min x,y and the max x,y

◆ getBoundingBox() [2/2]

IVW_CORE_API std::pair< ivec2, ivec2 > inviwo::util::getBoundingBox ( ProcessorNetwork * network)

Retrieve bounding box of the processors in the network. The return value is pair of the min x,y and the max x,y

◆ getBuildInfo()

std::optional< BuildInfo > IVW_CORE_API inviwo::util::getBuildInfo ( )

Accesses build information via an INI file or compile-time definitions.

Returns
build information

◆ getCameraEyeOffsetProperty()

IVW_CORE_API FloatVec2RefProperty * inviwo::util::getCameraEyeOffsetProperty ( CameraProperty & cameraProperty)

Find the eye offset property in the cameraProperty.

Parameters
cameraProperty
Returns
the eye offset property if found, nullptr otherwise
See also
SkewedPerspectiveCamera

◆ getCameraFactory() [1/4]

IVW_CORE_API CameraFactory * inviwo::util::getCameraFactory ( )

Camera factory

See also
Camera CameraFactory

◆ getCameraFactory() [2/4]

IVW_CORE_API CameraFactory * inviwo::util::getCameraFactory ( InviwoApplication * app)

Camera factory

See also
Camera CameraFactory

◆ getCameraFactory() [3/4]

IVW_CORE_API CameraFactory * inviwo::util::getCameraFactory ( Processor * processor)

Camera factory

See also
Camera CameraFactory

◆ getCameraFactory() [4/4]

IVW_CORE_API CameraFactory * inviwo::util::getCameraFactory ( Property * property)

Camera factory

See also
Camera CameraFactory

◆ getCameraFovProperty()

IVW_CORE_API FloatRefProperty * inviwo::util::getCameraFovProperty ( CameraProperty & cameraProperty)

Find the vertical fov property in the cameraProperty.

Parameters
cameraProperty
Returns
the fov property if found, nullptr otherwise
See also
PerspectiveCamera
SkewedPerspectiveCamera

◆ getCameraWidthProperty()

IVW_CORE_API FloatRefProperty * inviwo::util::getCameraWidthProperty ( CameraProperty & cameraProperty)

Find the width property in the cameraProperty.

Parameters
cameraProperty
Returns
the width property if found, nullptr otherwise
See also
OrthographicCamera

◆ getCenterPosition() [1/2]

IVW_CORE_API ivec2 inviwo::util::getCenterPosition ( const std::vector< Processor * > & processors)

Retrieve the mean position of the processors in the list.

◆ getCenterPosition() [2/2]

IVW_CORE_API ivec2 inviwo::util::getCenterPosition ( ProcessorNetwork * network)

Retrieve the mean position of the processors in the network.

◆ getDataReaderFactory() [1/4]

IVW_CORE_API DataReaderFactory * inviwo::util::getDataReaderFactory ( )

◆ getDataReaderFactory() [2/4]

IVW_CORE_API DataReaderFactory * inviwo::util::getDataReaderFactory ( InviwoApplication * app)

◆ getDataReaderFactory() [3/4]

IVW_CORE_API DataReaderFactory * inviwo::util::getDataReaderFactory ( Processor * processor)

◆ getDataReaderFactory() [4/4]

IVW_CORE_API DataReaderFactory * inviwo::util::getDataReaderFactory ( Property * property)

◆ getDataWriterFactory() [1/4]

IVW_CORE_API DataWriterFactory * inviwo::util::getDataWriterFactory ( )

◆ getDataWriterFactory() [2/4]

IVW_CORE_API DataWriterFactory * inviwo::util::getDataWriterFactory ( InviwoApplication * app)

◆ getDataWriterFactory() [3/4]

IVW_CORE_API DataWriterFactory * inviwo::util::getDataWriterFactory ( Processor * processor)

◆ getDataWriterFactory() [4/4]

IVW_CORE_API DataWriterFactory * inviwo::util::getDataWriterFactory ( Property * property)

◆ getDefaultTimerThread()

IVW_CORE_API TimerThread & inviwo::util::getDefaultTimerThread ( )

Utility function to get the default TimerThread from the app.

◆ getDialogFactory() [1/4]

IVW_CORE_API DialogFactory * inviwo::util::getDialogFactory ( )

Dialog factory

See also
Dialog DialogFactory

◆ getDialogFactory() [2/4]

IVW_CORE_API DialogFactory * inviwo::util::getDialogFactory ( InviwoApplication * app)

Dialog factory

See also
Dialog DialogFactory

◆ getDialogFactory() [3/4]

IVW_CORE_API DialogFactory * inviwo::util::getDialogFactory ( Processor * processor)

Dialog factory

See also
Dialog DialogFactory

◆ getDialogFactory() [4/4]

IVW_CORE_API DialogFactory * inviwo::util::getDialogFactory ( Property * property)

Dialog factory

See also
Dialog DialogFactory

◆ getInportFactory() [1/4]

IVW_CORE_API InportFactory * inviwo::util::getInportFactory ( )

Inport factory

See also
Inport InportFactory

◆ getInportFactory() [2/4]

IVW_CORE_API InportFactory * inviwo::util::getInportFactory ( InviwoApplication * app)

Inport factory

See also
Inport InportFactory

◆ getInportFactory() [3/4]

IVW_CORE_API InportFactory * inviwo::util::getInportFactory ( Processor * processor)

Inport factory

See also
Inport InportFactory

◆ getInportFactory() [4/4]

IVW_CORE_API InportFactory * inviwo::util::getInportFactory ( Property * property)

Inport factory

See also
Inport InportFactory

◆ getInviwoApplication() [1/5]

IVW_CORE_API InviwoApplication * inviwo::util::getInviwoApplication ( )

Utility function to get the InviwoApplication

◆ getInviwoApplication() [2/5]

IVW_CORE_API InviwoApplication * inviwo::util::getInviwoApplication ( Processor * )

Utility function to get the InviwoApplication from a Processor

◆ getInviwoApplication() [3/5]

IVW_CORE_API InviwoApplication * inviwo::util::getInviwoApplication ( ProcessorNetwork * )

Utility function to get the InviwoApplication from a ProcessorNetwork

◆ getInviwoApplication() [4/5]

IVW_CORE_API InviwoApplication * inviwo::util::getInviwoApplication ( Property * )

Utility function to get the InviwoApplication from a Property

◆ getInviwoApplication() [5/5]

IVW_CORE_API InviwoApplication * inviwo::util::getInviwoApplication ( PropertyOwner * )

Utility function to get the InviwoApplication from a PropertyOwner

◆ getLibrarySearchPaths()

IVW_CORE_API std::vector< std::filesystem::path > inviwo::util::getLibrarySearchPaths ( )

Returns paths to search for module libraries. All platforms: executable directory and application modules directory (AppData/Inviwo/modules on windows). Platform dependent search directories: OSX: DYLD_LIBRARY_PATH UNIX: LD_LIBRARY_PATH/LD_RUN_PATH, RPATH and "executable directory /../../lib".

Returns
List of paths to directories

◆ getMeshDrawerFactory() [1/4]

IVW_CORE_API MeshDrawerFactory * inviwo::util::getMeshDrawerFactory ( )

◆ getMeshDrawerFactory() [2/4]

IVW_CORE_API MeshDrawerFactory * inviwo::util::getMeshDrawerFactory ( InviwoApplication * app)

◆ getMeshDrawerFactory() [3/4]

IVW_CORE_API MeshDrawerFactory * inviwo::util::getMeshDrawerFactory ( Processor * processor)

◆ getMeshDrawerFactory() [4/4]

IVW_CORE_API MeshDrawerFactory * inviwo::util::getMeshDrawerFactory ( Property * property)

◆ getMetaData() [1/2]

IVW_CORE_API const ProcessorMetaData * inviwo::util::getMetaData ( const Processor * processor)

Retrieve the meta data of the processor.

◆ getMetaData() [2/2]

IVW_CORE_API ProcessorMetaData * inviwo::util::getMetaData ( Processor * processor)

Retrieve the meta data of the processor.

◆ getMetaDataFactory() [1/4]

IVW_CORE_API MetaDataFactory * inviwo::util::getMetaDataFactory ( )

◆ getMetaDataFactory() [2/4]

IVW_CORE_API MetaDataFactory * inviwo::util::getMetaDataFactory ( InviwoApplication * app)

◆ getMetaDataFactory() [3/4]

IVW_CORE_API MetaDataFactory * inviwo::util::getMetaDataFactory ( Processor * processor)

◆ getMetaDataFactory() [4/4]

IVW_CORE_API MetaDataFactory * inviwo::util::getMetaDataFactory ( Property * property)

◆ getModulePath() [1/2]

template<typename T >
std::filesystem::path inviwo::util::getModulePath ( ModulePath pathType)

return the path for a specific type located within the requested module of type T

Parameters
pathTypetype of the requested path
Returns
subdirectory of the module matching the type

◆ getModulePath() [2/2]

IVW_CORE_API std::filesystem::path inviwo::util::getModulePath ( std::string_view identifier,
ModulePath pathType )

return the path for a specific type located within the requested module

Parameters
identifiername of the module
pathTypetype of the requested path
Returns
subdirectory of the module matching the type

◆ getOutportFactory() [1/4]

IVW_CORE_API OutportFactory * inviwo::util::getOutportFactory ( )

Outport factory

See also
Outport OutportFactory

◆ getOutportFactory() [2/4]

IVW_CORE_API OutportFactory * inviwo::util::getOutportFactory ( InviwoApplication * app)

Outport factory

See also
Outport OutportFactory

◆ getOutportFactory() [3/4]

IVW_CORE_API OutportFactory * inviwo::util::getOutportFactory ( Processor * processor)

Outport factory

See also
Outport OutportFactory

◆ getOutportFactory() [4/4]

IVW_CORE_API OutportFactory * inviwo::util::getOutportFactory ( Property * property)

Outport factory

See also
Outport OutportFactory

◆ getPoolSize()

IVW_CORE_API size_t inviwo::util::getPoolSize ( )

Utility function to query the pool size of the InviwoApplication

Returns
pool size of the InviwoApplication, 0 if the application is not initialized
See also
InviwoApplication::getPoolSize(), InviwoApplication::isInitialized

◆ getPortInspectorFactory() [1/4]

IVW_CORE_API PortInspectorFactory * inviwo::util::getPortInspectorFactory ( )

◆ getPortInspectorFactory() [2/4]

IVW_CORE_API PortInspectorFactory * inviwo::util::getPortInspectorFactory ( InviwoApplication * app)

◆ getPortInspectorFactory() [3/4]

IVW_CORE_API PortInspectorFactory * inviwo::util::getPortInspectorFactory ( Processor * processor)

◆ getPortInspectorFactory() [4/4]

IVW_CORE_API PortInspectorFactory * inviwo::util::getPortInspectorFactory ( Property * property)

◆ getPosition()

IVW_CORE_API ivec2 inviwo::util::getPosition ( const Processor * processor)

Retrieve the position of the processor.

◆ getPositions() [1/2]

IVW_CORE_API std::vector< ivec2 > inviwo::util::getPositions ( const std::vector< Processor * > & processors)

Retrieve the positions of the processors in the list.

◆ getPositions() [2/2]

IVW_CORE_API std::vector< ivec2 > inviwo::util::getPositions ( ProcessorNetwork * network)

Retrieve the positions of the processors in the network.

◆ getProcessorFactory() [1/4]

IVW_CORE_API ProcessorFactory * inviwo::util::getProcessorFactory ( )

◆ getProcessorFactory() [2/4]

IVW_CORE_API ProcessorFactory * inviwo::util::getProcessorFactory ( InviwoApplication * app)

◆ getProcessorFactory() [3/4]

IVW_CORE_API ProcessorFactory * inviwo::util::getProcessorFactory ( Processor * processor)

◆ getProcessorFactory() [4/4]

IVW_CORE_API ProcessorFactory * inviwo::util::getProcessorFactory ( Property * property)

◆ getProcessorModule() [1/2]

IVW_CORE_API InviwoModule * inviwo::util::getProcessorModule ( const Processor * processor,
InviwoApplication & app )

Find which module that registered a processor.

Parameters
processorthe processor to look for
appthe InviwoApplication needed to get the modules
Returns
the InviwoModule that registered the processor or nullptr if not found

◆ getProcessorModule() [2/2]

IVW_CORE_API InviwoModule * inviwo::util::getProcessorModule ( std::string_view classIdentifier,
InviwoApplication & app )

Find which module that registered a processor.

Parameters
classIdentifierthe class identifier of the processor to look for
appthe InviwoApplication needed to get the modules
Returns
the InviwoModule that registered the processor or nullptr if not found

◆ getProcessorModuleIdentifier()

IVW_CORE_API std::optional< std::string > inviwo::util::getProcessorModuleIdentifier ( std::string_view classIdentifier,
InviwoApplication & app )

Find the module identifier of a registered processor.

Parameters
classIdentifierthe class identifier of the processor to look for
appthe InviwoApplication needed to get the modules
Returns
the identifer of the module that registered the processor or nullopt if not found

◆ getProcessorWidgetFactory() [1/4]

IVW_CORE_API ProcessorWidgetFactory * inviwo::util::getProcessorWidgetFactory ( )

◆ getProcessorWidgetFactory() [2/4]

IVW_CORE_API ProcessorWidgetFactory * inviwo::util::getProcessorWidgetFactory ( InviwoApplication * app)

◆ getProcessorWidgetFactory() [3/4]

IVW_CORE_API ProcessorWidgetFactory * inviwo::util::getProcessorWidgetFactory ( Processor * processor)

◆ getProcessorWidgetFactory() [4/4]

IVW_CORE_API ProcessorWidgetFactory * inviwo::util::getProcessorWidgetFactory ( Property * property)

◆ getPropertyConverterManager() [1/4]

IVW_CORE_API PropertyConverterManager * inviwo::util::getPropertyConverterManager ( )

◆ getPropertyConverterManager() [2/4]

IVW_CORE_API PropertyConverterManager * inviwo::util::getPropertyConverterManager ( InviwoApplication * app)

◆ getPropertyConverterManager() [3/4]

IVW_CORE_API PropertyConverterManager * inviwo::util::getPropertyConverterManager ( Processor * processor)

◆ getPropertyConverterManager() [4/4]

IVW_CORE_API PropertyConverterManager * inviwo::util::getPropertyConverterManager ( Property * property)

◆ getPropertyFactory() [1/4]

IVW_CORE_API PropertyFactory * inviwo::util::getPropertyFactory ( )

◆ getPropertyFactory() [2/4]

IVW_CORE_API PropertyFactory * inviwo::util::getPropertyFactory ( InviwoApplication * app)

◆ getPropertyFactory() [3/4]

IVW_CORE_API PropertyFactory * inviwo::util::getPropertyFactory ( Processor * processor)

◆ getPropertyFactory() [4/4]

IVW_CORE_API PropertyFactory * inviwo::util::getPropertyFactory ( Property * property)

◆ getPropertyWidgetFactory() [1/4]

IVW_CORE_API PropertyWidgetFactory * inviwo::util::getPropertyWidgetFactory ( )

◆ getPropertyWidgetFactory() [2/4]

IVW_CORE_API PropertyWidgetFactory * inviwo::util::getPropertyWidgetFactory ( InviwoApplication * app)

◆ getPropertyWidgetFactory() [3/4]

IVW_CORE_API PropertyWidgetFactory * inviwo::util::getPropertyWidgetFactory ( Processor * processor)

◆ getPropertyWidgetFactory() [4/4]

IVW_CORE_API PropertyWidgetFactory * inviwo::util::getPropertyWidgetFactory ( Property * property)

◆ getRepresentationConverterMetaFactory() [1/4]

IVW_CORE_API RepresentationConverterMetaFactory * inviwo::util::getRepresentationConverterMetaFactory ( )

The Representation Converter Meta Factory holds RepresentationConverterFactories for various kinds of representations (Volume Representation, Layer Representation, Buffer Representation, etc)

See also
Data DataRepresentation RepresentationConverter RepresentationConverterFactory RepresentationConverterMetaFactory

◆ getRepresentationConverterMetaFactory() [2/4]

IVW_CORE_API RepresentationConverterMetaFactory * inviwo::util::getRepresentationConverterMetaFactory ( InviwoApplication * app)

The Representation Converter Meta Factory holds RepresentationConverterFactories for various kinds of representations (Volume Representation, Layer Representation, Buffer Representation, etc)

See also
Data DataRepresentation RepresentationConverter RepresentationConverterFactory RepresentationConverterMetaFactory

◆ getRepresentationConverterMetaFactory() [3/4]

IVW_CORE_API RepresentationConverterMetaFactory * inviwo::util::getRepresentationConverterMetaFactory ( Processor * processor)

The Representation Converter Meta Factory holds RepresentationConverterFactories for various kinds of representations (Volume Representation, Layer Representation, Buffer Representation, etc)

See also
Data DataRepresentation RepresentationConverter RepresentationConverterFactory RepresentationConverterMetaFactory

◆ getRepresentationConverterMetaFactory() [4/4]

IVW_CORE_API RepresentationConverterMetaFactory * inviwo::util::getRepresentationConverterMetaFactory ( Property * property)

The Representation Converter Meta Factory holds RepresentationConverterFactories for various kinds of representations (Volume Representation, Layer Representation, Buffer Representation, etc)

See also
Data DataRepresentation RepresentationConverter RepresentationConverterFactory RepresentationConverterMetaFactory

◆ getRepresentationMetaFactory() [1/4]

IVW_CORE_API RepresentationMetaFactory * inviwo::util::getRepresentationMetaFactory ( )

The Representation Meta Factory holds RepresentationFactories for various kinds of representations (Volume Representation, Layer Representation, Buffer Representation, etc)

See also
Data DataRepresentation RepresentationFactory RepresentationMetaFactory

◆ getRepresentationMetaFactory() [2/4]

IVW_CORE_API RepresentationMetaFactory * inviwo::util::getRepresentationMetaFactory ( InviwoApplication * app)

The Representation Meta Factory holds RepresentationFactories for various kinds of representations (Volume Representation, Layer Representation, Buffer Representation, etc)

See also
Data DataRepresentation RepresentationFactory RepresentationMetaFactory

◆ getRepresentationMetaFactory() [3/4]

IVW_CORE_API RepresentationMetaFactory * inviwo::util::getRepresentationMetaFactory ( Processor * processor)

The Representation Meta Factory holds RepresentationFactories for various kinds of representations (Volume Representation, Layer Representation, Buffer Representation, etc)

See also
Data DataRepresentation RepresentationFactory RepresentationMetaFactory

◆ getRepresentationMetaFactory() [4/4]

IVW_CORE_API RepresentationMetaFactory * inviwo::util::getRepresentationMetaFactory ( Property * property)

The Representation Meta Factory holds RepresentationFactories for various kinds of representations (Volume Representation, Layer Representation, Buffer Representation, etc)

See also
Data DataRepresentation RepresentationFactory RepresentationMetaFactory

◆ getResourceManager() [1/4]

IVW_CORE_API ResourceManager * inviwo::util::getResourceManager ( )

Resource Manager

◆ getResourceManager() [2/4]

IVW_CORE_API ResourceManager * inviwo::util::getResourceManager ( InviwoApplication * app)

Resource Manager

◆ getResourceManager() [3/4]

IVW_CORE_API ResourceManager * inviwo::util::getResourceManager ( Processor * processor)

Resource Manager

◆ getResourceManager() [4/4]

IVW_CORE_API ResourceManager * inviwo::util::getResourceManager ( Property * property)

Resource Manager

◆ getVolumeDimensions()

size3_t IVW_CORE_API inviwo::util::getVolumeDimensions ( const std::shared_ptr< const Volume > & volume)

returns the true volume dimensions considering volume margins and bricking

Returns
true volume dimensions

◆ getVolumeMargins()

std::pair< vec3, vec3 > IVW_CORE_API inviwo::util::getVolumeMargins ( const std::shared_ptr< const Volume > & volume)

return the margins of a volume, in normalized texture coordinates [0,1]

Returns
pair of margins from the bottom left corner and the top right corner

◆ haltonSequence() [1/3]

template<typename T >
std::shared_ptr< Layer > inviwo::util::haltonSequence ( size2_t dims,
size_t numberOfPoints,
size_t baseX = 2,
size_t baseY = 3 )

Generate a Layer with sparse noise based on a pair of two Halton Sequences.

See also
haltonSequence(size_t base, size_t numberOfPoints)
https://en.wikipedia.org/wiki/Halton_sequence
Parameters
dimssize of the resulting layer.
numberOfPointsnumber of points to generate
baseXbase used for the fractions to generate the x-values
baseYbase used for the fractions to generate the y-values

◆ haltonSequence() [2/3]

template<typename T >
std::shared_ptr< Volume > inviwo::util::haltonSequence ( size3_t dims,
size_t numberOfPoints,
size_t baseX = 2,
size_t baseY = 3,
size_t baseZ = 5 )

Generate an Volume with sparse noise based on a three Halton Sequences.

See also
haltonSequence(size_t base, size_t numberOfPoints)
https://en.wikipedia.org/wiki/Halton_sequence
Parameters
dimssize of the resulting Volume.
numberOfPointsnumber of points to generate
baseXbase used for the fractions to generate the x-values
baseYbase used for the fractions to generate the y-values
baseZbase used for the fractions to generate the z-values

◆ haltonSequence() [3/3]

template<typename T >
T inviwo::util::haltonSequence ( size_t n,
size_t base )

Compute the n th point of the Halton sequence with base base on the open range (0 1).

See also
https://en.wikipedia.org/wiki/Halton_sequence
Parameters
basewhat base to use to generate fractions
nindex of the nth point of the Halton sequence
Returns
nth

◆ hash_combine()

template<class T >
void inviwo::util::hash_combine ( std::size_t & seed,
const T & v )
constexprnoexcept

◆ iCaseEndsWith()

IVW_CORE_API bool inviwo::util::iCaseEndsWith ( std::string_view str,
std::string_view suffix )

Checks if provided string ends with suffix using case insensitive equal comparison.

Parameters
strstring to check last part of. Allowed to be smaller than suffix.
suffixEnding to match.
Returns
True if last part of str is equal to suffix, false otherwise.

◆ importIsoValueCollectionDialog()

IVW_MODULE_QTWIDGETS_API std::shared_ptr< IsoValueCollection > inviwo::util::importIsoValueCollectionDialog ( QWidget * parent = nullptr)

Shows an InviwoFileDialog to import a IsoValueCollection from a file.

Parameters
parentparent widget of the file dialog

◆ importTransferFunctionDialog()

IVW_MODULE_QTWIDGETS_API std::shared_ptr< TransferFunction > inviwo::util::importTransferFunctionDialog ( QWidget * parent = nullptr)

Shows an InviwoFileDialog to import a TransferFunction from a file.

Parameters
parentparent widget of the file dialog

◆ index_of()

template<class T , typename Tuple , size_t count = 0>
size_t inviwo::util::index_of ( )
constexpr

Get the index of a type in a tuple, returns the index of the first matching type

◆ index_of_derived()

template<class T , typename Tuple , size_t count = 0>
size_t inviwo::util::index_of_derived ( )
constexpr

Get the index of the first type in the Tuple that is derived from T

◆ interpolateAlpha()

IVW_CORE_API void inviwo::util::interpolateAlpha ( const std::vector< TFPrimitive * > & selection)

Interpolate the alpha values of selected primitives in between the first and the last primitive based on their relative position.

◆ is_callable_with()

template<typename... A, typename F >
bool inviwo::util::is_callable_with ( F && )
constexpr

A type trait to determine if type "callback" can be called with certain arguments. Example: util::is_callable_with<float>(callback) where callback = [](float){} -> true callback = [](std::string){} -> false

◆ isConvex()

template<class T , typename std::enable_if< util::rank< T >::value==1 &&util::extent< T >::value==2, int >::type = 0>
bool inviwo::util::isConvex ( const std::vector< T > & polygon)

check whether the given polygon is convex

Parameters
polygonpolygon consisting of points
Returns
true if the polygon is convex, false otherwise

◆ isInside()

template<class T , typename std::enable_if< util::rank< T >::value==1 &&util::extent< T >::value==2, int >::type = 0>
bool inviwo::util::isInside ( const std::vector< T > & hull,
const T & p )

check whether a given point lies within the convex hull

Parameters
hullconvex hull
ppoint
Returns
true if the point lies inside the convex hull

◆ isInviwoApplicationInitialized()

IVW_CORE_API bool inviwo::util::isInviwoApplicationInitialized ( )

Utility function to return whether the InviwoApplication is initialized

See also
InviwoApplication::isInitialized

◆ isSelected()

IVW_CORE_API bool inviwo::util::isSelected ( const Processor * processor)

Retrieve the selection state of processor.

◆ layerRAMDistanceTransform()

template<typename T , typename U , typename Predicate , typename ValueTransform , typename ProgressCallback >
void inviwo::util::layerRAMDistanceTransform ( const LayerRAMPrecision< T > * inLayer,
LayerRAMPrecision< U > * outDistanceField,
const Matrix< 2, U > basis,
const size2_t upsample,
Predicate predicate,
ValueTransform valueTransform,
ProgressCallback callback )
Implementation of Euclidean Distance Transform according to Saito's algorithm:

T. Saito and J.I. Toriwaki. New algorithms for Euclidean distance transformations of an n-dimensional digitized picture with applications. Pattern Recognition, 27(11). pp. 1551-1565, 1994. http://www.cs.jhu.edu/~misha/ReadingSeminar/Papers/Saito94.pdf

Calculates the distance in base mat space

Template Parameters
Predicateis a function of type (const T &value) -> bool to decide if a value in the input is a "feature".
ValueTransformis a function of type (const U& squaredDist) -> U that is appiled to all squared distance values at the end of the calculation.
ProcessCallbackis a function of type (double progress) -> void that is called with a value from 0 to 1 to indicate the progress of the calculation.

◆ layerSubSet()

IVW_MODULE_BASE_API std::shared_ptr< LayerRAM > inviwo::util::layerSubSet ( const Layer * in,
ivec2 offset,
size2_t extent,
bool clampBorderOutsideImage = false )

extracts a subregion from a layer and returns it as a new layer

This function extracts a subregion given by offset and extent from the input layer. If border clamping is enabled, the output region will be clamped to lie completely within the source layer. Otherwise (default), the areas outside the source layer will be filled with zeros.

Parameters
ininput layer
offsetsubregion offset in input layer
extentextent (width and height) of subregion
clampBorderOutsideImageif true, the output region is clamped to the layer boundaries
Returns
std::shared_ptr<LayerRAM>

◆ ltrim()

std::string_view inviwo::util::ltrim ( std::string_view str)
constexprnoexcept

trims str from beginning removing white spaces

Parameters
strinput string
Returns
trimmed stringview without leading white space

◆ make_sequence()

template<typename T >
auto inviwo::util::make_sequence ( const T & begin,
const T & end,
const T & inc = T{1} ) -> sequence<T>

Convenvience function for creating a sequence. Use case example:

auto inc = 2; auto end = 3;
for (auto&& i : util::make_sequence(0, end, inc)) {
// Iterates over 0 and 2
}
auto make_sequence(const T &begin, const T &end, const T &inc=T{1}) -> sequence< T >
Definition zip.h:551

◆ makeIndirectIterator()

template<bool PropagateConst = true, typename Iter >
IndirectIterator< Iter, PropagateConst > inviwo::util::makeIndirectIterator ( Iter iter)
noexcept

◆ makeMarchingCubeVolume()

template<typename T = float>
std::unique_ptr< Volume > inviwo::util::makeMarchingCubeVolume ( const size_t & index)

A 2x2x2 volume corresponding to a marching cube case

◆ makeProcessor()

template<typename T , typename... Args>
std::unique_ptr< T > inviwo::util::makeProcessor ( ivec2 pos,
Args &&... args )

A utility function to create a processor and set identifier, display name, and position

Parameters
posSets the position meta data of the Processor
argsAny extra arguments to supply to the Processor constructor

◆ makeRippleVolume()

template<typename T = float>
std::unique_ptr< Volume > inviwo::util::makeRippleVolume ( const size3_t & size)

A quickly oscillating density between 0 and 1

◆ makeSingleVoxelVolume()

template<typename T = float>
std::unique_ptr< Volume > inviwo::util::makeSingleVoxelVolume ( const size3_t & size)

Center voxel equal to 1 all other 0

◆ makeSphericalVolume()

template<typename T = float>
std::unique_ptr< Volume > inviwo::util::makeSphericalVolume ( const size3_t & size)

Spherically symmetric density centered in the volume decaying radially with the distance from the center

◆ marchingcubes()

IVW_MODULE_BASE_API std::shared_ptr< Mesh > inviwo::util::marchingcubes ( std::shared_ptr< const Volume > volume,
double iso,
const vec4 & color,
bool invert,
bool enclose,
std::function< void(float)> progressCallback = std::function< void(float)>(),
std::function< bool(const size3_t &)> maskingCallback = [](const size3_t &) { return true;} )

Extracts an isosurface from a volume using the Marching Cubes algorithm

Note: Share interface with util::marchingtetrahedron

Parameters
volumethe scalar volume
isoiso-value for the extracted surface
colorthe color of the resulting surface
invertflips the normals of the surface normals (useful when values greater than the iso-value is 'outside' of the surface)
enclosewhether to create surface where the isosurface intersects the volume boundaries
progressCallbackif set, will be called will executing with the current progress in the interval [0,1], usefull for progressbars
maskingCallbackoptional callback to test whether current cell should be evaluated or not (return true to include current cell)

◆ marchingCubesOpt()

IVW_MODULE_BASE_API std::shared_ptr< Mesh > inviwo::util::marchingCubesOpt ( std::shared_ptr< const Volume > volume,
double iso,
const vec4 & color,
bool invert,
bool enclose,
std::function< void(float)> progressCallback = nullptr,
std::function< bool(const size3_t &)> maskingCallback = nullptr )

Extracts an iso surface from a volume using the Marching Cubes algorithm

Note: Shares interface with util::marchingcbes and util::marchingtetrahedron This is an optimized version of util::marchingcubes

Parameters
volumethe scalar volume
isoiso-value for the extracted surface
colorthe color of the resulting surface
invertflips the normals of the surface normals (useful when values greater than the iso-value is 'outside' of the surface)
enclosewhether to create surface where the iso surface intersects the volume boundaries
progressCallbackif set, will be called will executing with the current progress in the interval [0,1], useful for progress bars
maskingCallbackoptional callback to test whether current cell should be evaluated or not (return true to include current cell)

◆ marchingtetrahedron()

std::shared_ptr< Mesh > inviwo::util::marchingtetrahedron ( std::shared_ptr< const Volume > volume,
double iso,
const vec4 & color = vec4(1.0f),
bool invert = false,
bool enclose = true,
std::function< void(float)> progressCallback = std::function< void(float)>(),
std::function< bool(const size3_t &)> maskingCallback = [](const size3_t &) { return true;} )

Extracts an isosurface from a volume using the Marching Tetrahedron algorithm

Note: Share interface with util::marchingcubes

Parameters
volumethe scalar volume
isoiso-value for the extracted surface
colorthe color of the resulting surface
invertflips the normals of the surface normals (useful when values greater than the iso-value is 'outside' of the surface)
enclosewhether to create surface where the isosurface intersects the volume boundaries
progressCallbackif set, will be called will executing with the current progress in the interval [0,1], usefull for progressbars
maskingCallbackoptional callback to test whether current cell should be evaluated or not (return true to include current cell)

◆ md2doc()

IVW_CORE_API Document inviwo::util::md2doc ( std::string_view markdown)

Parse a markdown string and convert to an inviwo document.

See also
Document
Parameters
markdownA string that will be interpreted as markdown
Returns
an inviwo Document with an html representation of the parsed markdown

◆ msToString()

IVW_CORE_API std::string inviwo::util::msToString ( double ms,
bool includeZeros = true,
bool spacing = false )

convert the given duration from milliseconds to a string. The returned string will have the format "%dd %dh %dmin %dsec %.3fms", where days, hours, minutes, seconds, ... are suppressed up to the first non-zero unit if not needed. Milliseconds and seconds are combined if larger than 1 second.

Parameters
msin milliseconds
includeZerosif true, time units for zero values are always shown, e.g. "2d 0h 0min 23s" vs. "2d 23s" and "2h 0min 0s" vs. "2h"
spacingif true, a space is inserted between digits and units
Returns
duration formatted as string

◆ offsetPosition()

IVW_CORE_API void inviwo::util::offsetPosition ( const std::vector< Processor * > & processors,
ivec2 offset )

Offset all the positions of the processors in the list by offset

◆ ordinalColor()

IVW_CORE_API OrdinalPropertyState< vec4 > inviwo::util::ordinalColor ( float r,
float g,
float b,
float a = 1.0f,
InvalidationLevel invalidationLevel = InvalidationLevel::InvalidOutput )

A factory function for OrdinalProperties representing Colors When instantiating a Ordinal Property for a color value one would need to write something along there lines

color("cubeColor", "Cube Color", vec4(0.11f, 0.42f, 0.63f, 1.0f),
{vec4(1.0f), ConstraintBehavior::Immutable}, vec4(0.01f),
InvalidationLevel::InvalidOutput, PropertySemantics::Color)

by using the helper function most of the boilerplate can be removed:

color{"cubeColor", "Cube Color", util::ordinalColor(0.11f, 0.42f, 0.63f)}
IVW_CORE_API OrdinalPropertyState< vec4 > ordinalColor(float r, float g, float b, float a=1.0f, InvalidationLevel invalidationLevel=InvalidationLevel::InvalidOutput)

◆ ordinalCount()

template<typename T = size_t, typename U = T>
OrdinalPropertyState< T > inviwo::util::ordinalCount ( const T & value = T{0},
const U & max = U{100} )

A factory function for configuring a OrdinalProperty representing a count. It will have a Immutable min at zero and an upper Ignored max. The increment will be one. The invalidation level defaults to InvalidOutput, and the property semantics to SpinBox.

Parameters
valuethe default value for the property
maxused to construct the max value. The max constraint behavior will be Ignore.

◆ ordinalLength()

template<typename T = double, typename U = T>
OrdinalPropertyState< T > inviwo::util::ordinalLength ( const T & value = T{0},
const U & max = U{100} )

A factory function for configuring a OrdinalProperty representing a length. It will have a Immutable min at zero and an upper Ignored max. The invalidation level defaults to InvalidOutput, and the property semantics to SpinBox.

Parameters
valuethe default value for the property
maxused to construct the max value. The max constraint behavior will be Ignore.

◆ ordinalRefColor()

IVW_CORE_API OrdinalRefPropertyState< vec4 > inviwo::util::ordinalRefColor ( InvalidationLevel invalidationLevel = InvalidationLevel::InvalidOutput)

A factory function for OrdinalProperties representing Colors When instantiating a Ordinal Property for a color value one would need to write something along there lines

color("cubeColor", "Cube Color", vec4(0.11f, 0.42f, 0.63f, 1.0f),
{vec4(1.0f), ConstraintBehavior::Immutable}, vec4(0.01f),
InvalidationLevel::InvalidOutput, PropertySemantics::Color)

by using the helper function most of the boilerplate can be removed:

color{"cubeColor", "Cube Color", util::ordinalColor()}

◆ ordinalRefSymmetricVector()

template<typename T = double, typename U = T>
OrdinalRefPropertyState< T > inviwo::util::ordinalRefSymmetricVector ( const U & minMax = U{100})

A factory function for configuring a OrdinalRefProperty representing a generic vector, with a symmetric range around zero, and Ignored boundary constraints. The invalidation level defaults to InvalidOutput, and the property semantics to SpinBox.

Parameters
valuethe default value for the property
minMaxused to construct the range of the property like min = T{-minMax}, max = T{minMax}. The constraint behavior will be Ignore.

◆ ordinalScale()

template<typename T = double, typename U = T>
OrdinalPropertyState< T > inviwo::util::ordinalScale ( const T & value = T{0},
const U & max = U{100} )

A factory function for configuring a OrdinalProperty representing a scale factor. It will have a Immutable min at epsilon and an upper Ignored max. The invalidation level default to InvalidOutput, and the property semantics to Slider.

Parameters
valuethe default value for the property
maxused to construct the max value. The max constraint behavior will be Ignore.

◆ ordinalSymmetricVector()

template<typename T = double, typename U = T>
OrdinalPropertyState< T > inviwo::util::ordinalSymmetricVector ( const T & value = {0},
const U & minMax = U{100} )

A factory function for configuring a OrdinalProperty representing a generic vector, with a symmetric range around zero, and Ignored boundary constraints. The invalidation level defaults to InvalidOutput, and the property semantics to SpinBox.

Parameters
valuethe default value for the property
minMaxused to construct the range of the property like min = T{-minMax}, max = T{minMax}. The constraint behavior will be Ignore.

◆ parseTypeIdName()

IVW_CORE_API std::string inviwo::util::parseTypeIdName ( const char * name)

Demangle and strip the type ID given in name

Parameters
namemangled type ID name
Returns
demangled type name without class, struct, const, inviwo::, or white space
See also
demangle()

◆ perlinNoise()

template<typename Rand = std::mt19937>
std::shared_ptr< Layer > inviwo::util::perlinNoise ( size2_t dims,
float persistence,
size_t startLevel,
size_t endLevel,
Rand & randomNumberGenerator = Rand() )

Generate a Layer with perlin noise, a cloud like noise using the sum of several white noise layers with different frequencies

Parameters
dimsSize of the output layer
persistencecontrols the amplitude used in the different frequencies
startLevelcontrols the min level used. The level is determining the frequency to use in each white noise layer as 2^level
endLevelcontrolsthe max level used.
randomNumberGeneratorthe Random number generator to use, defaults to the Mersenne Twister engine (std::mt19937)

◆ poissonDisk()

template<typename Rand = std::mt19937>
std::shared_ptr< Layer > inviwo::util::poissonDisk ( size2_t dims,
size_t poissonDotsAlongX,
size_t maxPoints,
Rand & randomNumberGenerator = Rand() )

Generate a Layer with sparse noise based on the perlin noise algorith.

See also
http://devmag.org.za/2009/05/03/poisson-disk-sampling/
Parameters
dimsSize of the output layer
poissonDotsAlongXcontrolls the amount on points there is on average per line, set the minimum distance between points
maxPointsa fallback variable to prevent generating to many points
randomNumberGeneratorthe Random number generator to use, defaults to the Mersenne Twister engine (std::mt19937)

◆ randomLayer()

template<typename T , typename Rand = std::mt19937, typename Dist = typename std::conditional<std::is_integral<T>::value, std::uniform_int_distribution<T>, std::uniform_real_distribution<T>>::type>
std::shared_ptr< Layer > inviwo::util::randomLayer ( size2_t dims,
Rand & randomNumberGenerator = Rand(),
Dist & distribution = Dist(0, 1) )

Generate a Layer with white noise based using a given random number generator and distribution.

Parameters
dimsSize of the output layer
randomNumberGeneratorthe random number generator to use, defaults to the Mersenne Twister engine (std::mt19937)
distributionthe distribution to use for the random numbers, defaults to std::uniform_int/real_distribution between zero and one
See also
randomLayerRAM

◆ randomLayerRAM()

template<typename T , typename Rand = std::mt19937, typename Dist = typename std::conditional<std::is_integral<T>::value, std::uniform_int_distribution<T>, std::uniform_real_distribution<T>>::type>
std::shared_ptr< LayerRAMPrecision< T > > inviwo::util::randomLayerRAM ( size2_t dims,
Rand & randomNumberGenerator = Rand(),
Dist & distribution = Dist(0, 1) )

Generate a LayerRAMPrecision<T> with white noise based using a given random number generator and distribution.

Template Parameters
Tdata type of the random numbers
Randrandom number engine, defaults to the Mersenne Twister engine (std::mt19937)
Distrandom number distribution, defaults to std::uniform_int/real_distribution between zero and one
Parameters
dimsSize of the resulting layer
randomNumberGeneratorthe random number generator to use
distributionthe distribution to use for the random numbers
Returns
LayerRAM with white noise

◆ randomSequence() [1/2]

template<typename T , typename Rand = std::mt19937, typename Dist = typename std::conditional<std::is_integral<T>::value, std::uniform_int_distribution<T>, std::uniform_real_distribution<T>>::type>
void inviwo::util::randomSequence ( std::span< T > data,
Rand & randomNumberGenerator = Rand(),
Dist & distribution = Dist(0, 1) )

Fills a span of type T with numberOfElements random numbers using the given random number generator and distribution

◆ randomSequence() [2/2]

template<typename T , typename Rand = std::mt19937, typename Dist = typename std::conditional<std::is_integral<T>::value, std::uniform_int_distribution<T>, std::uniform_real_distribution<T>>::type>
void inviwo::util::randomSequence ( T * data,
size_t numberOfElements,
Rand & randomNumberGenerator = Rand(),
Dist & distribution = Dist(0, 1) )

Fills a data container of type T with numberOfElements random numbers using the given random number generator and distribution

◆ randomVolume()

template<typename T , typename Rand = std::mt19937, typename Dist = typename std::conditional<std::is_integral<T>::value, std::uniform_int_distribution<T>, std::uniform_real_distribution<T>>::type>
std::shared_ptr< Volume > inviwo::util::randomVolume ( size3_t dims,
Rand & randomNumberGenerator = Rand(),
Dist & distribution = Dist(0, 1) )

Generate an Volume with white noise based using C++ a given random number generator and distribution.

Parameters
dimsSize of the output Volume
randomNumberGeneratorthe Random number generator to use, defaults to the Mersenne Twister engine (std::mt19937)
distributionthe distribution to use for the random numbers, defaults to std::uniform_int/real_distribution between zero and one

◆ remap()

void IVW_MODULE_VOLUME_API inviwo::util::remap ( Volume & volume,
const std::vector< int > & src,
const std::vector< int > & dst,
int missingValue,
bool useMissingValue )

Remap all voxels of volume by mapping values from src to dst.

Parameters
[in,out]volumevoxels of this scalar volume will be remapped
srclist of source indices
dstlist of destination indices matching src
missingValueassigned if a value cannot be found in src and useMissingValue is set
useMissingValueif true, all values not included in src are mapped to missingValue
Exceptions
Exceptionif src and dst have different sizes
Exceptionif src contains duplicated values
Precondition
volume must be a scalar volume
src and dst must have the same length
src must not contain duplicates
dst may contain duplicates
Postcondition
volume only contains voxels with values found in dst

◆ replaceSelectionWithCompositeProcessor()

IVW_CORE_API void inviwo::util::replaceSelectionWithCompositeProcessor ( ProcessorNetwork & network)

Create a CompositeProcessor out of the currently selected processors and replace them with the composite processors. The selected processors are moved from the current network into the sub network of the composite processor. For each port connection between a selected and unselected processor a composite sink or composite source processor is added to the sub network and connections are made from the selected processor to the sink/source and from the composite processor to the unselected processor. For each link between a selected and unselected processor, a super property is added to the composite processor and the link added to it.

◆ reverse()

IVW_CORE_API void inviwo::util::reverse ( BufferBase & b)

Utility function to reverse the orders of the elements in a buffer.

Parameters
bthe buffer to reverse

◆ rtrim()

std::string_view inviwo::util::rtrim ( std::string_view str)
constexprnoexcept

trims str from end by removing white spaces

Parameters
strinput string
Returns
trimmed stringview without trailing white space

◆ saveData() [1/2]

template<typename T >
void inviwo::util::saveData ( const T & data,
const std::filesystem::path & filePath,
const FileExtension & extension,
Overwrite overwrite )

Save data to filePath using the writer given by extension

Parameters
dataObject to save to file
filePathComplete path, name, and extension of the written file
extensionThe extension used to identifier the DataWriter in the factory
overwriteWhether to overwrite any existing file or not
Exceptions
DataWriterExceptionif no write could be found, or if overwrite was violated.

◆ saveData() [2/2]

template<typename T >
std::optional< std::filesystem::path > inviwo::util::saveData ( const T & data,
const std::filesystem::path & path,
std::string_view name,
const std::vector< FileExtension > & extensions,
Overwrite overwrite )

Save data to the filePath given by concatenating path, "/", name, ".", and extension where extensions is the first extension in extensions that we find a matching writer for.

Parameters
dataObject to save to file
pathDirectory where the file will be written
nameName of the file excluding extension
extensionsA list of extensions to use for finding a matching DataWriter
overwriteWhether to overwrite any existing file or not
Returns
The full path to the file written or std::nullopt if no writer was found
Exceptions
DataWriterExceptionif overwrite was violated.

◆ setPosition()

IVW_CORE_API void inviwo::util::setPosition ( Processor * processor,
ivec2 pos )

Set the position of processor to pos

◆ setSelected() [1/2]

IVW_CORE_API void inviwo::util::setSelected ( const std::vector< Processor * > & processors,
bool selected )

Set the listed processors as selected or unSelected.

◆ setSelected() [2/2]

IVW_CORE_API void inviwo::util::setSelected ( Processor * processor,
bool selected )

Set the selection state of processor

◆ splitByFirst() [1/2]

std::pair< std::string_view, std::string_view > inviwo::util::splitByFirst ( std::string_view str,
char delimiter = ' ' )
constexpr

Divide a string into two parts by the first instance of a delimiter.

Parameters
strstring to divide
delimiternot include in either returned strings
Returns
a pair of strings, if the delimiter is not found the first string will be the same as the input str, and the second one will be empty

◆ splitByFirst() [2/2]

std::pair< std::string_view, std::string_view > inviwo::util::splitByFirst ( std::string_view str,
std::string_view delimiter )
constexpr

Divide a string into two parts by the first instance of a delimiter.

Parameters
strstring to divide
delimiternot include in either returned strings
Returns
a pair of strings, if the delimiter is not found the first string will be the same as the input str, and the second one will be empty

◆ splitByLast() [1/2]

std::pair< std::string_view, std::string_view > inviwo::util::splitByLast ( std::string_view str,
char delimiter = ' ' )
constexpr

Divide a string into two parts by the last instance of a delimiter.

Parameters
strstring to divide
delimiternot include in either returned strings
Returns
a pair of strings, if the delimiter is not found the first string will empty, and the second one will be equal to the input str

◆ splitByLast() [2/2]

std::pair< std::string_view, std::string_view > inviwo::util::splitByLast ( std::string_view str,
std::string_view delimiter )
constexpr

Divide a string into two parts by the last instance of a delimiter.

Parameters
strstring to divide
delimiternot include in either returned strings
Returns
a pair of strings, if the delimiter is not found the first string will empty, and the second one will be equal to the input str

◆ splitString()

IVW_CORE_API std::vector< std::string > inviwo::util::splitString ( std::string_view str,
char delimiter = ' ' )

Split string into substrings based on separating delimiter character. Using delimiter ';' on string "aa;bb" will result in a vector contaning aa and bb.

Note
Empty substrings are not skipped, ";;" will generate an element.
Parameters
strThe string to split
delimiterThe character use for splitting (default to space)
Returns
a vector containing the substrings as std::string

◆ splitStringView()

IVW_CORE_API std::vector< std::string_view > inviwo::util::splitStringView ( std::string_view str,
char delimiter = ' ' )

Split string into substrings based on separating delimiter character. Using delimiter ';' on string "aa;bb" will result in a vector contaning aa and bb.

Note
Empty substrings are not skipped, ";;" will generate an element.
Parameters
strThe string to split
delimiterThe character use for splitting (default to space)
Returns
a vector containing the substrings as std::string_view

◆ stripIdentifier()

IVW_CORE_API std::string inviwo::util::stripIdentifier ( std::string_view identifier)

Strip all invalid characters from the given identifier. If the resulting identifier is empty, a single underscore _ is returned.

Valid identifiers follow the C++ and Python variable naming rules. That is

  • case sensitive
  • start with letter or underscore
  • contain letters, numbers, and underscores
  • length > 0

Matching regex: [a-zA-Z_][a-zA-Z0-9_]*

Parameters
identifiername to be stripped and validated
Returns
valid identifier
See also
validateIdentifier

◆ stripModuleFileNameDecoration()

IVW_CORE_API std::string inviwo::util::stripModuleFileNameDecoration ( const std::filesystem::path & filePath)

Removes inviwo-module from module library file name. Turns "/path/to/inviwo-module-yourmodule.dll" into "yourmodule". Returns filename without extension if inviwo-module was not found.

Parameters
filePathPath to module file
Returns
name of the module

◆ toWstring()

IVW_CORE_API std::wstring inviwo::util::toWstring ( std::string_view str)

convert the given std::string to std::wstring. On Windows, MultiByteToWideChar is used for this conversion assuming utf8 encoding. Otherwise, std::mbsrtowcs is used.

Parameters
strmultibyte character string
Returns
input converted to std::wstring

◆ trim()

std::string_view inviwo::util::trim ( std::string_view str)
constexprnoexcept

trims str from beginning and end by removing white spaces

Parameters
strinput string
Returns
trimmed stringview without leading/trailing white space

◆ trySetProperty()

template<typename T , typename V >
T & inviwo::util::trySetProperty ( Processor * proc,
std::string_view identifier,
V && val,
bool recursive = false )

Tries to set a processor's property to a given value.

Template Parameters
TType of proc.
VType of val, deduced.
Parameters
procProcessor that has the target property.
identifierIdentifier of the property to be set.
valValue to be set.
recursiveEnable/Disable recursive search for Processor::getPropertyByIdentifier.
Returns
Reference to set property.
Exceptions
Exception

◆ typedLayerSubSet()

template<typename T >
std::shared_ptr< LayerRAMPrecision< T > > inviwo::util::typedLayerSubSet ( const Layer * in,
ivec2 offset,
size2_t extent,
bool clampBorderOutsideImage = false )

extracts a subregion from a layer and converts it into a new layer

This function extracts a subregion given by offset and extent from the input layer. The values will be converted to type T using util::glm_convert_normalized. If border clamping is enabled, the output region will be clamped to lie completely within the source layer. Otherwise (default), the areas outside the source layer will be filled with zeros.

Parameters
ininput layer
offsetsubregion offset in input layer
extentextent (width and height) of subregion
clampBorderOutsideImageif true, the output region is clamped to the layer boundaries
Returns
std::shared_ptr<LayerRAMPrecision<T>>

◆ unindentMd2doc()

IVW_CORE_API Document inviwo::util::unindentMd2doc ( std::string_view markdown)

Parse a markdown string and convert to an inviwo document. Before the string is parsed as markdown, any leading indentation is removed from the string

See also
Document, indent::unindent
Parameters
markdownA string that will be interpreted as markdown
Returns
an inviwo Document with an html representation of the parsed markdown

◆ updateDefaultState()

template<typename T , typename U >
void inviwo::util::updateDefaultState ( T & property,
const U & state,
OverwriteState overwrite )

Update the default state of property to state and set the current state to state if property is in the default state or overwrite is OverwriteState::Yes

◆ updateOrCreateCameraEyeOffsetProperty()

IVW_CORE_API FloatVec2RefProperty * inviwo::util::updateOrCreateCameraEyeOffsetProperty ( CameraProperty & cameraProperty,
std::function< vec2()> get,
std::function< void(const vec2 &)> set )

Either return an existing eye offset property updated with the provided get and set functions or create a new one. The new one will automatically be added to the camera property.

See also
SkewedPerspectiveCamera

◆ updateOrCreateCameraFovProperty()

IVW_CORE_API FloatRefProperty * inviwo::util::updateOrCreateCameraFovProperty ( CameraProperty & cameraProperty,
std::function< float()> get,
std::function< void(const float &)> set )

Either return an existing vertical fov property updated with the provided get and set functions or create a new one. The new one will automatically be added to the camera property.

See also
PerspectiveCamera
SkewedPerspectiveCamera

◆ updateOrCreateCameraWidthProperty()

IVW_CORE_API FloatRefProperty * inviwo::util::updateOrCreateCameraWidthProperty ( CameraProperty & cameraProperty,
std::function< float()> get,
std::function< void(const float &)> set )

Either return an existing width property updated with the provided get and set functions or create a new one. The new one will automatically be added to the camera property.

See also
OrthographicCamera

◆ validateIdentifier()

IVW_CORE_API void inviwo::util::validateIdentifier ( std::string_view identifier,
std::string_view type,
ExceptionContext context )

Validate the given identifier. If identifier is invalid, throws an Exception with the given exception context context and identifier type for a detailed error message.

Valid identifiers follow the C++ and Python variable naming rules. That is

  • case sensitive
  • start with letter or underscore
  • contain letters, numbers, and underscores
  • length > 0

Matching regex: [a-zA-Z_][a-zA-Z0-9_]*

Parameters
identifiername to be validated
typeidentifier type, only used in case of exception
contextused when throwing an exception
Exceptions
Exceptionif identifier is not valid
See also
stripIdentifier

◆ volumeRAMDistanceTransform()

template<typename T , typename U , typename Predicate , typename ValueTransform , typename ProgressCallback >
void inviwo::util::volumeRAMDistanceTransform ( const VolumeRAMPrecision< T > * inVolume,
VolumeRAMPrecision< U > * outDistanceField,
const Matrix< 3, U > & basis,
const size3_t & upsample,
Predicate predicate,
ValueTransform valueTransform,
ProgressCallback progress )

Implementation of Euclidean Distance Transform according to Saito's algorithm: T. Saito and J.I. Toriwaki. New algorithms for Euclidean distance transformations of an n-dimensional digitized picture with applications. Pattern Recognition, 27(11). pp. 1551-1565, 1994. http://www.cs.jhu.edu/~misha/ReadingSeminar/Papers/Saito94.pdf

Calculates the distance in grid index space

  • Predicate is a function of type (const T &value) -> bool to deside if a value in the input is a "feature".
  • ValueTransform is a function of type (const U& squaredDist) -> U that is appiled to all squared distance values at the end of the calculation.
  • ProcessCallback is a function of type (double progress) -> void that is called with a value from 0 to 1 to indicate the progress of the calculation.

◆ voronoiSegmentation()

IVW_MODULE_BASE_API std::shared_ptr< Volume > inviwo::util::voronoiSegmentation ( const size3_t volumeDimensions,
const mat4 & indexToDataMatrix,
const mat4 & dataToModelMatrix,
const std::vector< std::pair< uint32_t, vec3 > > & seedPointsWithIndices,
const Wrapping3D & wrapping,
const std::optional< std::vector< float > > & weights )

Implementation of Voronoi segmentation.

The function returns a volume with each voxel containing the index for the closest seed point (according to the power distance with or without weights).

* volumeDimensions is the dimensions for the volume.
* indexToDataMatrix is the matrix to transform the voxel positions from index to data
  space.
* dataToModelMatrix is the matrix to transform the voxel positions from data to model
  space.
* seedPointsWithIndices is a vector containing the seed points for the algorithm together
  with their index number on the form {index, position}. The positions are expected be in
  model space.
* wrapping the wrapping mode of the volume, @see Wrapping3D.
* weights is an optional vector containing the weights for each seed point. If set the
  weighted version of voronoi should be used.

◆ voxelVolume()

double IVW_CORE_API inviwo::util::voxelVolume ( const Volume & volume)

calculates the volume of a single voxel, taking the basis and the dimensions into account The units of the result is in the unit as the basis vectors ^3

Returns
volume of one voxel

◆ writeIvfVolumeSequence()

IVW_MODULE_BASE_API std::filesystem::path inviwo::util::writeIvfVolumeSequence ( const VolumeSequence & volumes,
std::string_view name,
const std::filesystem::path & path,
std::string_view relativePathToElements = "",
Overwrite overwrite = Overwrite::Yes )

Writes a volume sequence to disk.

Writes a volume sequence to disk. Will create one main file ([name].ivfs) and a series of ivf volumes ([name]xx.ivf), one for each element in the sequence.

Parameters
volumesThe volume sequence to export
namethe name of the dataset, will be used for to name the output files [name].ivfs and [name]xx.ivf
pathpath to the folder to put the main file
relativePathToElementsrelative path (from the path to the main file) to where the sequence elements will be written
overwritewhether or not to overwrite existing files.
Returns
path to the created main-file
See also
inviwo::IvfSequenceVolumeWriter
inviwo::IvfSequenceVolumeReader

◆ zip()

template<typename... T>
auto inviwo::util::zip ( T &&... args) -> detailzip::zipper<T...>

Iterate over containers in sync. Example use case 1:

std::vector<int> a(10);
std::vector<int> b(10);
for (auto&& i : util::zip(a, b)) {
std::cout << i.first() << " " << i.second() << std::endl;
// alternatively, get<0>(i) and get<1>(i) can be used
}
auto zip(T &&... args) -> detailzip::zipper< T... >
Definition zip.h:430

with C++17 structured bindings:

for (auto&& [i, j] : util::enumerate(vec)) {
std::cout << i << " " << j << std::endl;
}
auto enumerate(T &&cont, Ts &&... conts)
Definition zip.h:571

Variable Documentation

◆ fmtHelp

auto inviwo::util::fmtHelp
constexpr
Initial value:
= IVW_UNINDENT(R"(
To locate the error try breaking on fmt::format_error exceptions,
or put a breakpoint in fmt::detail::error_handler::on_error.
in lldb try "breakpoint set -E c++ -O fmt::format_error"
or "breakpoint set -M fmt::v7::detail::error_handler::on_error".
)")