Call this method to load a Sphere files.
- Parameters
-
filename | the name of the file in the RessourceRepository to read data from. |
data | pass a object of this type (or inherit one) to load the file in caller's data structures |
- Returns
- wheter the loading succeded.
class MySphereData : public SphereLoaderDataHook { std::vector<double> mx; public: void addSpere(SReal px, SReal py, SReal pz, SReal r) override { mx.push_back(px); } void finalizeLoading(bool isOk) override { if(!isOk) mx.clear(); } };
MySphereData loadedData; SphereLoader::Load("myfile.sphere", loadedData);
#ifndef SOFA_HELPER_IO_SPHERELOADER_H
#define SOFA_HELPER_IO_SPHERELOADER_H
#include <sofa/helper/config.h>
#include <sofa/type/Vec.h>
{
class SOFA_HELPER_API SphereLoaderDataHook
{
public:
virtual ~SphereLoaderDataHook(){}
virtual void finalizeLoading(const bool isOk){ SOFA_UNUSED(isOk); }
virtual void setNumSpheres(const int n) { SOFA_UNUSED(n); }
virtual void addSphere(const SReal , const SReal , const SReal , const SReal ) {}
};
class SOFA_HELPER_API SphereLoader
{
public:
static bool Load(const std::string& filename, SphereLoaderDataHook& data);
};
}
#endif
This allow MeshTrian to interact with the messaging system.
Definition: MeshLoader.h:31