29#include <assimp/Importer.hpp>
30#include <assimp/scene.h>
58 Assimp::Importer _importer;
59 const aiScene * _scene;
62 void renderNode(
GLManager *gl,
const aiNode *nd)
const;
63 void calculateBounds(
const aiNode *nd, glm::mat4 transform = glm::mat4(1.0f));
64 glm::mat4 getMatrix(
const aiNode *nd)
const;
68 void DrawBoundingBox(
GLManager *gl)
const;
69 int Load(
const std::string &path);
70 glm::vec3 BoundsMin()
const {
return _min; }
71 glm::vec3 BoundsMax()
const {
return _max; }
72 glm::vec3 Center()
const {
return (_min + _max) / 2.f; }
76 struct ModelInstance {
79 glm::vec3 translate = glm::vec3(0.f);
80 glm::vec3 rotate = glm::vec3(0.f);
81 glm::vec3 scale = glm::vec3(1.f);
82 glm::vec3 origin = glm::vec3(0.f);
85 std::vector<ModelInstance> _instances;
86 std::map<int, std::vector<ModelInstance>> _keyframes;
87 std::map<std::string, Model *> _models;
91 int Load(
const std::string &path);
92 void Render(GLManager *gl,
const int ts = 0);
93 glm::vec3 Center()
const;
96 std::vector<ModelInstance> getInstances(
const int ts)
const;
97 int createSceneFromModelFile(
const std::string &path);
98 int loadSceneFile(
const std::string &path);
99 int handleInstanceNode(XmlNode *node, ModelInstance *instance);
100 int handleTimeNode(XmlNode *node);
101 int handleVectorNode(XmlNode *node, glm::vec3 *v);
102 int handleFloatAttribute(XmlNode *node,
const std::string &name,
float *f);
103 int parseIntString(
const std::string &str,
int *i)
const;
104 ModelInstance getInitInstance(
const std::string &name)
const;
105 bool doesInstanceExist(
const std::string &name)
const;
106 bool isModelCached(
const std::string &file)
const;
110 std::string _cachedFile;
112 void _renderNode(
const aiNode *node);
A cache based data reader.
Class that draws the contours (contours) as specified by IsolineParams.
virtual int _paintGL(bool fast)
All OpenGL rendering is performed in the pure virtual paintGL method.
static string GetClassType()
ModelRenderer(const ParamsMgr *pm, string winName, string dataSetName, string instName, DataMgr *dataMgr)
virtual int _initializeGL()
virtual void _clearCache()
A singleton class for managing Params instances.
A class that performs rendering in a Visualizer.
Contains references to context scope OpenGL data.