Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/core changes #245

Merged
merged 7 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions misc/graphviz/src/graphvizsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void layoutNetwork(ProcessorNetwork* net, glm::dvec2 sep, bool alignSources, boo
createDotGraph(buff, net, sep, alignSources, alignSinks);

calculateLayout(buff, net, [](Processor* p, const dvec2 pos) {
if (auto* meta = p->getMetaData<ProcessorMetaData>(ProcessorMetaData::CLASS_IDENTIFIER)) {
if (auto* meta = p->getMetaData<ProcessorMetaData>(ProcessorMetaData::classIdentifier)) {
meta->setPosition(snap(pos));
}
});
Expand Down Expand Up @@ -221,7 +221,7 @@ GraphvizSettings::GraphvizSettings(InviwoApplication* app)
calculateLayout(buff, app_->getProcessorNetwork(), [](Processor* p, const dvec2 pos) {
dvec2 cpos{-1, -1};
if (auto* meta =
p->getMetaData<ProcessorMetaData>(ProcessorMetaData::CLASS_IDENTIFIER)) {
p->getMetaData<ProcessorMetaData>(ProcessorMetaData::classIdentifier)) {
cpos = meta->getPosition();
}
LogInfo(fmt::format("{:30} New: {:20} Snapped: {:20} Current: {:20}",
Expand All @@ -244,12 +244,12 @@ void GraphvizSettings::autoLayoutNetwork() {

void GraphvizSettings::onProcessorNetworkDidAddProcessor(Processor* processor) {
autoLayoutNetwork();
auto meta = processor->getMetaData<ProcessorMetaData>(ProcessorMetaData::CLASS_IDENTIFIER);
auto* meta = processor->getMetaData<ProcessorMetaData>(ProcessorMetaData::classIdentifier);
meta->addObserver(this);
}
void GraphvizSettings::onProcessorNetworkDidRemoveProcessor(Processor* processor) {
autoLayoutNetwork();
auto meta = processor->getMetaData<ProcessorMetaData>(ProcessorMetaData::CLASS_IDENTIFIER);
auto* meta = processor->getMetaData<ProcessorMetaData>(ProcessorMetaData::classIdentifier);
meta->removeObserver(this);
}
void GraphvizSettings::onProcessorNetworkDidAddConnection(const PortConnection&) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,4 @@ struct EnumTraits<NanoVGContext::Alignment> {
static std::string name() { return "Text Alignment"; }
};

} // namespace inviwo
} // namespace inviwo
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef _IVW_MODULE_NANOVGUTILS_DEFINE_H_
#define _IVW_MODULE_NANOVGUTILS_DEFINE_H_
#pragma once

#ifdef INVIWO_ALL_DYN_LINK // DYNAMIC
// If we are building DLL files we must declare dllexport/dllimport
Expand All @@ -19,5 +18,3 @@
#else // STATIC
#define IVW_MODULE_NANOVGUTILS_API
#endif

#endif // _IVW_MODULE_NANOVGUTILS_DEFINE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
namespace inviwo {
class IVW_MODULE_NANOVGUTILS_API NanoVGFontProperty : public CompositeProperty {
public:
virtual std::string getClassIdentifier() const override;
static const std::string classIdentifier;
virtual std::string_view getClassIdentifier() const override;
static constexpr std::string_view classIdentifier{"org.inviwo.NanoVGFontProperty"};

NanoVGFontProperty(std::string identifier, std::string displayName);
NanoVGFontProperty(const NanoVGFontProperty& rhs);
virtual NanoVGFontProperty* clone() const override { return new NanoVGFontProperty(*this); }
virtual ~NanoVGFontProperty() = default;

Check notice on line 21 in misc/nanovgutils/include/inviwo/nanovgutils/properties/nanovgfontproperty.h

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

in instantiation of member function 'inviwo::OptionProperty<inviwo::NanoVGContext::Alignment>::~OptionProperty' requested here

Check notice on line 21 in misc/nanovgutils/include/inviwo/nanovgutils/properties/nanovgfontproperty.h

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

in instantiation of member function 'inviwo::OptionProperty<inviwo::NanoVGContext::Alignment>::~OptionProperty' requested here

using CompositeProperty::set;
void set(float fontSize, const vec4& fontColor, const std::string& fontFace,
Expand Down
4 changes: 2 additions & 2 deletions misc/nanovgutils/src/properties/nanovgfontproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <inviwo/core/network/networklock.h>

namespace inviwo {
const std::string NanoVGFontProperty::classIdentifier{"org.inviwo.NanoVGFontProperty"};
std::string NanoVGFontProperty::getClassIdentifier() const { return classIdentifier; }

std::string_view NanoVGFontProperty::getClassIdentifier() const { return classIdentifier; }

auto NanoVGFontProperty::props() {
return std::tie(fontSize_, fontColor_, fontFace_, fontAlignment_, enableFontBlur_,
Expand Down Expand Up @@ -87,3 +87,3 @@
getFontBlur());
}

Expand Down
52 changes: 25 additions & 27 deletions misc/openmesh/include/inviwo/openmesh/utils/openmeshconverters.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
namespace inviwo {

struct CustomMeshTraits : public OpenMesh::DefaultTraits {
typedef OpenMesh::Vec4f Color;
using Color = OpenMesh::Vec4f;

VertexAttributes(OpenMesh::Attributes::Normal | OpenMesh::Attributes::TexCoord3D |
OpenMesh::Attributes::Color);
Expand All @@ -68,37 +68,35 @@ struct CustomMeshTraits : public OpenMesh::DefaultTraits {
using TriMesh = OpenMesh::TriMesh_ArrayKernelT<CustomMeshTraits>;

namespace openmeshutil {
namespace detail {

template <typename T>
struct BufferConvertHelper {
using type = Buffer<T>;
using value_type = T;
static T convertValue(const T& v) { return v; }
};

template <typename T, unsigned D>
struct BufferConvertHelper<OpenMesh::VectorT<T, D>> {
using type = Buffer<Vector<D, T>>;
using value_type = Vector<D, T>;
static glm::vec<D, T> convertValue(const OpenMesh::VectorT<T, D>& v) {
glm::vec<D, T> res;
for (unsigned i = 0; i < D; i++) {
res[i] = v[i];
}
return res;
}
};
namespace detail {

template <typename T, typename OM_Mesh, typename Func>
void convertOMtoInviwoBuffer(inviwo::Mesh& ivwMesh, const OM_Mesh& omMesh, BufferType bufferType,
Func callback) {
using Helper = typename detail::BufferConvertHelper<T>;
auto vertices = std::make_shared<typename Helper::type>();
auto& vec = vertices->getEditableRAMRepresentation()->getDataContainer();
ivwMesh.addBuffer(bufferType, vertices);
for (const OpenMesh::VertexHandle& v_it : omMesh.vertices()) {
vec.push_back(Helper::convertValue(callback(v_it)));
if constexpr (std::is_arithmetic_v<T>) {
auto vertices = std::make_shared<Buffer<T>>();
auto& vec = vertices->getEditableRAMRepresentation()->getDataContainer();
ivwMesh.addBuffer(bufferType, vertices);
for (const OpenMesh::VertexHandle& v_it : omMesh.vertices()) {
vec.push_back(callback(v_it));
}
} else {
using value_type = glm::vec<T::dim(), typename T::value_type, glm::defaultp>;
auto convertValue = [](const T& v) {
value_type res{0};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostics

  • variable 'res' of type 'fmt::path::value_type' (aka 'char') can be declared 'const' [misc-const-correctness]
Suggested change
value_type res{0};
value_type const res{0};

clang-tidy diagnostic

misc/openmesh/include/inviwo/openmesh/utils/openmeshconverters.h:85:37: error: [clang-diagnostic-error]

template argument for non-type template parameter must be an expression

   85 |         using value_type = glm::vec<typename T::value_type, T::dim(), glm::defaultp>;
      |                                     ^~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/modules/modules/build/vcpkg_installed/x64-linux-dynamic/include/glm/ext/../detail/qualifier.hpp:35:20: note: template parameter is declared here
   35 |         template<length_t L, typename T, qualifier Q = defaultp> struct vec;
      |                           ^

clang-tidy diagnostic

misc/openmesh/include/inviwo/openmesh/utils/openmeshconverters.h:87:13: error: [clang-diagnostic-error]

unknown type name 'value_type'; did you mean 'fmt::path::value_type'?

   87 |             value_type res{0};
      |             ^
/home/runner/work/modules/modules/llvm/bin/../include/c++/v1/__filesystem/path.h:462:16: note: 'fmt::path::value_type' declared here
  462 |   typedef char value_type;
      |                ^
note: this fix will not be applied because it overlaps with another fix

clang-tidy diagnostic

misc/openmesh/include/inviwo/openmesh/utils/openmeshconverters.h:87:13: error: [clang-diagnostic-error]

use of undeclared identifier 'value_type'; did you mean 'util::value_type'?

   87 |             value_type res{0};
      |             ^
/home/runner/work/modules/modules/inviwo/include/inviwo/core/util/glmutils.h:104:8: note: 'util::value_type' declared here
  104 | struct value_type {
      |        ^
note: this fix will not be applied because it overlaps with another fix

for (int i = 0; i < T::dim(); i++) {
res[i] = v[i];
}
return res;
};

auto vertices = std::make_shared<Buffer<value_type>>();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy diagnostics

  • use of undeclared identifier 'value_type'; did you mean 'util::value_type'? [clang-diagnostic-error]
Suggested change
auto vertices = std::make_shared<Buffer<value_type>>();
auto vertices = std::make_shared<Buffer<util::value_type>>();

clang-tidy diagnostic

misc/openmesh/include/inviwo/openmesh/utils/openmeshconverters.h:89:20: error: [clang-diagnostic-error]

subscripted value is not an array, pointer, or vector

   89 |                 res[i] = v[i];
      |                 ~~~^~

clang-tidy diagnostic

misc/openmesh/include/inviwo/openmesh/utils/openmeshconverters.h:94:49: error: [clang-diagnostic-error]

use of undeclared identifier 'value_type'

   94 |         auto vertices = std::make_shared<Buffer<value_type>>();
      |                                                 ^

auto& vec = vertices->getEditableRAMRepresentation()->getDataContainer();
ivwMesh.addBuffer(bufferType, vertices);
for (const OpenMesh::VertexHandle& v_it : omMesh.vertices()) {
vec.push_back(convertValue(callback(v_it)));
}
}
};

Expand Down
25 changes: 12 additions & 13 deletions misc/openmesh/src/utils/openmeshconverters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
#include <inviwo/core/util/zip.h>
#include <inviwo/core/datastructures/geometry/simplemesh.h>

namespace inviwo {
namespace openmeshutil {
namespace detail {
namespace inviwo::openmeshutil {

namespace {

void createVertexBuffers(TriMesh& mesh, const BasicMesh& inmesh, TransformCoordinates transform) {
auto& vertices = inmesh.getVertices()->getRAMRepresentation()->getDataContainer();
Expand All @@ -50,9 +50,9 @@
m = inmesh.getCoordinateTransformer().getDataToWorldMatrix();
}

for (const auto& [pos, normal, texCoord, color] :

Check notice on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

previous declaration is here

Check warning on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

loop variable '[pos, normal, texCoord, color]' binds to a temporary value produced by a range of type 'detailzip::zipper<const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<4, float, glm::packed_highp>, allocator<vec<4, float, glm::packed_highp>>> &>'

Check notice on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

use non-reference type 'reference' (aka 'proxy<const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<4, float, glm::packed_highp> &>')

Check notice on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

previous declaration is here

Check warning on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

loop variable '[pos, normal, texCoord, color]' binds to a temporary value produced by a range of type 'detailzip::zipper<const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<4, float, glm::packed_highp>, allocator<vec<4, float, glm::packed_highp>>> &>'

Check notice on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

use non-reference type 'reference' (aka 'proxy<const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<4, float, glm::packed_highp> &>')

Check notice on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

previous declaration is here

Check warning on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

loop variable '[pos, normal, texCoord, color]' binds to a temporary value produced by a range of type 'detailzip::zipper<const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<4, float, glm::packed_highp>, allocator<vec<4, float, glm::packed_highp>>> &>'

Check notice on line 53 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

use non-reference type 'reference' (aka 'proxy<const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<4, float, glm::packed_highp> &>')
util::zip(vertices, normals, texCoords, colors)) {
auto i = [&](const auto& pos) {

Check warning on line 55 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

declaration shadows a structured binding

Check warning on line 55 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

declaration shadows a structured binding

Check warning on line 55 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

declaration shadows a structured binding
if (transform == TransformCoordinates::NoTransform) {
return mesh.add_vertex({pos.x, pos.y, pos.z});
} else {
Expand Down Expand Up @@ -80,8 +80,8 @@
m = inmesh.getCoordinateTransformer().getDataToWorldMatrix();
}

for (const auto& [pos, texCoord, color] : util::zip(vertices, texCoords, colors)) {

Check notice on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

previous declaration is here

Check warning on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

loop variable '[pos, texCoord, color]' binds to a temporary value produced by a range of type 'detailzip::zipper<const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<4, float, glm::packed_highp>, allocator<vec<4, float, glm::packed_highp>>> &>'

Check notice on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

use non-reference type 'reference' (aka 'proxy<const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<4, float, glm::packed_highp> &>')

Check notice on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

previous declaration is here

Check warning on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

loop variable '[pos, texCoord, color]' binds to a temporary value produced by a range of type 'detailzip::zipper<const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<4, float, glm::packed_highp>, allocator<vec<4, float, glm::packed_highp>>> &>'

Check notice on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

use non-reference type 'reference' (aka 'proxy<const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<4, float, glm::packed_highp> &>')

Check notice on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

previous declaration is here

Check warning on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

loop variable '[pos, texCoord, color]' binds to a temporary value produced by a range of type 'detailzip::zipper<const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<3, float, glm::packed_highp>, allocator<vec<3, float, glm::packed_highp>>> &, const vector<vec<4, float, glm::packed_highp>, allocator<vec<4, float, glm::packed_highp>>> &>'

Check notice on line 83 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

use non-reference type 'reference' (aka 'proxy<const glm::vec<3, float, glm::packed_highp> &, const glm::vec<3, float, glm::packed_highp> &, const glm::vec<4, float, glm::packed_highp> &>')
auto i = [&](const auto& pos) {

Check warning on line 84 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Regression

declaration shadows a structured binding

Check warning on line 84 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Debug)

declaration shadows a structured binding

Check warning on line 84 in misc/openmesh/src/utils/openmeshconverters.cpp

View workflow job for this annotation

GitHub Actions / Build (macos, dynamic, Release)

declaration shadows a structured binding
if (transform == TransformCoordinates::NoTransform) {
return mesh.add_vertex({pos.x, pos.y, pos.z});
} else {
Expand Down Expand Up @@ -188,22 +188,22 @@
}
}

} // namespace detail
} // namespace

TriMesh fromInviwo(const Mesh& inmesh, TransformCoordinates transform) {
TriMesh mesh;

if (auto bm = dynamic_cast<const BasicMesh*>(&inmesh)) {
detail::createVertexBuffers(mesh, *bm, transform);
} else if (auto sm = dynamic_cast<const SimpleMesh*>(&inmesh)) {
detail::createVertexBuffers(mesh, *sm, transform);
createVertexBuffers(mesh, *bm, transform);
} else if (const auto* sm = dynamic_cast<const SimpleMesh*>(&inmesh)) {
createVertexBuffers(mesh, *sm, transform);
} else {
detail::createVertexBuffers(mesh, inmesh, transform);
createVertexBuffers(mesh, inmesh, transform);
}

for (auto& ib : inmesh.getIndexBuffers()) {
if (ib.first.dt == DrawType::Triangles) {
meshutil::forEachTriangle(ib.first, *ib.second,
for (auto&& [meshInfo, buffer] : inmesh.getIndexBuffers()) {
if (meshInfo.dt == DrawType::Triangles) {
meshutil::forEachTriangle(meshInfo, *buffer,
[&mesh](uint32_t i0, uint32_t i1, uint32_t i2) {
using VH = OpenMesh::VertexHandle;
mesh.add_face(VH(i0), VH(i1), VH(i2));
Expand All @@ -214,5 +214,4 @@
return mesh;
}

} // namespace openmeshutil
} // namespace inviwo
} // namespace inviwo::openmeshutil
9 changes: 3 additions & 6 deletions misc/vtk/include/inviwo/vtk/ports/vtkinport.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class IVW_MODULE_VTK_API VtkInport : public Inport {

virtual bool canConnectTo(const Port* port) const override;
virtual size_t getMaxNumberOfConnections() const override;
virtual std::string getClassIdentifier() const override;
virtual std::string_view getClassIdentifier() const override;
virtual glm::uvec3 getColorCode() const override;
virtual Document getInfo() const override;

Expand All @@ -72,13 +72,10 @@ class IVW_MODULE_VTK_API VtkInport : public Inport {

template <>
struct PortTraits<vtk::VtkInport> {
static const std::string& classIdentifier() {
static std::string id{"org.inviwo.vtk.inport"};
return id;
}
static constexpr std::string_view classIdentifier() { return "org.inviwo.vtk.inport"; }
};

inline std::string vtk::VtkInport::getClassIdentifier() const {
inline std::string_view vtk::VtkInport::getClassIdentifier() const {
return PortTraits<vtk::VtkInport>::classIdentifier();
}

Expand Down
10 changes: 4 additions & 6 deletions misc/vtk/include/inviwo/vtk/ports/vtkoutport.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class IVW_MODULE_VTK_API VtkOutport : public Outport {

using type = vtkDataObject;

virtual std::string getClassIdentifier() const override;
virtual std::string_view getClassIdentifier() const override;
virtual glm::uvec3 getColorCode() const override;
virtual Document getInfo() const override;

Expand All @@ -75,12 +75,10 @@ class IVW_MODULE_VTK_API VtkOutport : public Outport {

template <>
struct PortTraits<vtk::VtkOutport> {
static const std::string& classIdentifier() {
static std::string id{"org.inviwo.vtk.outport"};
return id;
}
static constexpr std::string_view classIdentifier() { return "org.inviwo.vtk.outport"; }
};
inline std::string vtk::VtkOutport::getClassIdentifier() const {

inline std::string_view vtk::VtkOutport::getClassIdentifier() const {
return PortTraits<vtk::VtkOutport>::classIdentifier();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ namespace inviwo {

template <>
struct DataTraits<molvis::MolecularStructure> {
static std::string classIdentifier() { return "org.inviwo.molvis.MolecularStructure"; }
static std::string dataName() { return "Molecular Structure"; }
static uvec3 colorCode() { return uvec3(56, 127, 66); }
static constexpr std::string_view classIdentifier() {
return "org.inviwo.molvis.MolecularStructure";
}
static constexpr std::string_view dataName() { return "Molecular Structure"; }
static constexpr uvec3 colorCode() { return {56, 127, 66}; }
static Document info(const molvis::MolecularStructure& data) {
using H = utildoc::TableBuilder::Header;
using P = Document::PathComponent;
Expand Down
2 changes: 2 additions & 0 deletions molvis/molvispython/bindings/src/pymolvis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
#include <inviwo/molvisbase/util/aminoacid.h>
#include <inviwo/molvisbase/util/chain.h>
#include <modules/python3/pyportutils.h>
#include <modules/python3/opaquetypes.h>
#include <modules/python3/polymorphictypehooks.h>

#include <fmt/format.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ using InvariantSpaceOutport = DataOutport<InvariantSpace>;

template <>
struct DataTraits<InvariantSpace> {
static std::string classIdentifier() { return "org.inviwo.InvariantSpace"; }
static std::string dataName() { return "InvariantSpace"; }
static uvec3 colorCode() { return uvec3(10, 150, 235); }
static constexpr std::string_view classIdentifier() { return "org.inviwo.InvariantSpace"; }
static constexpr std::string_view dataName() { return "InvariantSpace"; }
static constexpr uvec3 colorCode() { return {10, 150, 235}; }
static Document info(const InvariantSpace& data) {
std::ostringstream oss;
oss << data.getDataInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ class IVW_MODULE_TENSORVISBASE_API TensorField2D {

template <>
struct DataTraits<TensorField2D> {
static std::string classIdentifier() { return "org.inviwo.TensorField2D"; }
static std::string dataName() { return "TensorField2D"; }
static uvec3 colorCode() { return uvec3(10, 150, 135); }
static constexpr std::string_view classIdentifier() { return "org.inviwo.TensorField2D"; }
static constexpr std::string_view dataName() { return "TensorField2D"; }
static constexpr uvec3 colorCode() { return {10, 150, 135}; }
static Document info(const TensorField2D& data) {
Document doc;
doc.append("b", "TensorField2D", {{"style", "color:white;"}});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ class IVW_MODULE_TENSORVISBASE_API TensorField3D : public StructuredGridEntity<3

template <>
struct DataTraits<TensorField3D> {
static std::string classIdentifier() { return "org.inviwo.TensorField3D"; }
static std::string dataName() { return "TensorField3D"; }
static uvec3 colorCode() { return uvec3(10, 150, 135); }
static constexpr std::string_view classIdentifier() { return "org.inviwo.TensorField3D"; }
static constexpr std::string_view dataName() { return "TensorField3D"; }
static constexpr uvec3 colorCode() { return {10, 150, 135}; }
static Document info(const TensorField3D& data) {
Document doc;
doc.append("b", "TensorField3D", {{"style", "color:white;"}});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ namespace inviwo {
*/
class IVW_MODULE_TENSORVISBASE_API EigenValueProperty : public CompositeProperty {
public:
virtual std::string getClassIdentifier() const override;
static const std::string classIdentifier;
virtual std::string_view getClassIdentifier() const override;
static constexpr std::string_view classIdentifier{"org.inviwo.EigenValueProperty"};

EigenValueProperty(std::string identifier = std::string("eigenValueProperty"),
std::string displayName = std::string("Eigenvalues"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ namespace inviwo {
*/
class IVW_MODULE_TENSORVISBASE_API TensorGlyphProperty : public CompositeProperty {
public:
virtual std::string getClassIdentifier() const override;
static const std::string classIdentifier;
virtual std::string_view getClassIdentifier() const override;
static constexpr std::string_view classIdentifier{"org.inviwo.TensorGlyphProperty"};

enum class GlyphType {
Reynolds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@

namespace inviwo {

const std::string EigenValueProperty::classIdentifier{"org.inviwo.EigenValueProperty"};
std::string EigenValueProperty::getClassIdentifier() const { return classIdentifier; }
std::string_view EigenValueProperty::getClassIdentifier() const { return classIdentifier; }

EigenValueProperty::EigenValueProperty(std::string identifier, std::string displayName)
: CompositeProperty(identifier, displayName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#include <inviwo/tensorvisbase/datastructures/deformablecylinder.h>

namespace inviwo {
const std::string TensorGlyphProperty::classIdentifier{"org.inviwo.TensorGlyphProperty"};
std::string TensorGlyphProperty::getClassIdentifier() const { return classIdentifier; }

std::string_view TensorGlyphProperty::getClassIdentifier() const { return classIdentifier; }

// constexpr std::array<std::array<dvec2, 3>, 10> TensorGlyphProperty::tri_uv;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ std::basic_ostream<Elem, Traits>& operator<<(std::basic_ostream<Elem, Traits>& s

template <>
struct DataTraits<topology::ContourTreeData> {
static std::string classIdentifier() { return "org.inviwo.topology.contourtreedata"; }
static std::string dataName() { return "TTK Contour Tree"; }
static uvec3 colorCode() { return uvec3(94, 152, 224); }
static constexpr std::string_view classIdentifier() {
return "org.inviwo.topology.contourtreedata";
}
static constexpr std::string_view dataName() { return "TTK Contour Tree"; }
static constexpr uvec3 colorCode() { return {94, 152, 224}; }
static Document info(const topology::ContourTreeData& data) {
using H = utildoc::TableBuilder::Header;
using P = Document::PathComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ struct IVW_MODULE_TOPOLOGYTOOLKIT_API MorseSmaleComplexData {

template <>
struct DataTraits<topology::MorseSmaleComplexData> {
static std::string classIdentifier() { return "org.inviwo.topology.morsesmalecomplexdata"; }
static std::string dataName() { return "TTK Morse-Smale Complex"; }
static uvec3 colorCode() { return uvec3(105, 152, 188); }
static constexpr std::string_view classIdentifier() {
return "org.inviwo.topology.morsesmalecomplexdata";
}
static constexpr std::string_view dataName() { return "TTK Morse-Smale Complex"; }
static constexpr uvec3 colorCode() { return {105, 152, 188}; }
static Document info(const topology::MorseSmaleComplexData& data) {
using H = utildoc::TableBuilder::Header;
using P = Document::PathComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ void TriangulationData::setScalarValues(std::vector<T>&& values) {

template <>
struct DataTraits<topology::TriangulationData> {
static std::string classIdentifier() { return "TriangulationData"; }
static std::string dataName() { return "TriangulationData"; }
static uvec3 colorCode() { return uvec3(34, 96, 150); }
static constexpr std::string_view classIdentifier() { return "TriangulationData"; }
static constexpr std::string_view dataName() { return "TriangulationData"; }
static constexpr uvec3 colorCode() { return {34, 96, 150}; }
static Document info(const topology::TriangulationData& data) {
using H = utildoc::TableBuilder::Header;
using P = Document::PathComponent;
Expand Down
Loading
Loading