Skip to content

Commit c0dd7b9

Browse files
authored
BRAYNS-643 Fix mesh loader. (#1265)
1 parent 7cf4165 commit c0dd7b9

File tree

4 files changed

+14
-18
lines changed

4 files changed

+14
-18
lines changed

brayns/io/loaders/mesh/MeshLoader.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <filesystem>
4343
#include <fstream>
4444
#include <sstream>
45+
#include "MeshLoader.h"
4546

4647
namespace
4748
{
@@ -191,6 +192,11 @@ std::vector<std::string> MeshLoader::getExtensions() const
191192
return _parsers.getAllSupportedExtensions();
192193
}
193194

195+
bool MeshLoader::canLoadBinary() const
196+
{
197+
return true;
198+
}
199+
194200
std::vector<std::shared_ptr<Model>> MeshLoader::loadBinary(const BinaryRequest &request)
195201
{
196202
auto format = std::string(request.format);

brayns/io/loaders/mesh/MeshLoader.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ class MeshLoader : public Loader<EmptyLoaderParams>
124124
*/
125125
std::vector<std::string> getExtensions() const override;
126126

127+
/**
128+
* @brief Supports binary
129+
*
130+
* @return true
131+
*/
132+
bool canLoadBinary() const override;
133+
127134
/**
128135
* @brief Import the mesh in the given scene from the given binary data.
129136
*

plugins/CircuitExplorer/io/bbploader/CellLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ std::vector<CellCompartments> CellLoader::load(
175175

176176
auto colorData = ColorDataFactory::create(context);
177177

178-
if (loadSoma && !loadAxon && !loadDend)
178+
if (!loadSoma && !loadAxon && !loadDend)
179179
{
180180
return SomaImporter::import(context, model, std::move(colorData));
181181
}

plugins/CircuitExplorer/io/bbploader/ParameterCheck.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -114,29 +114,12 @@ class ReportChecker
114114
}
115115
}
116116
};
117-
118-
class NeuronSectionsChecker
119-
{
120-
public:
121-
static void check(const BBPLoaderParameters &input)
122-
{
123-
const auto &morphSettings = input.neuron_morphology_parameters;
124-
const auto loadSoma = morphSettings.load_soma;
125-
const auto loadAxon = morphSettings.load_axon;
126-
const auto loadDend = morphSettings.load_dendrites;
127-
if (!loadSoma && !loadAxon && !loadDend)
128-
{
129-
throw std::invalid_argument("All neuron sections cannot be disabled");
130-
}
131-
}
132-
};
133117
} // namespace
134118

135119
void ParameterCheck::checkInput(const brion::BlueConfig &config, const BBPLoaderParameters &input)
136120
{
137121
InputGidSettingsChecker::check(input);
138122
TargetChecker::check(config, input);
139123
ReportChecker::check(config, input);
140-
NeuronSectionsChecker::check(input);
141124
}
142125
} // namespace bbploader

0 commit comments

Comments
 (0)