PeriDyno 1.2.1
Loading...
Searching...
No Matches
SceneLoaderXML.h
Go to the documentation of this file.
1#pragma once
2#include "Node.h"
4#include "tinyxml/tinyxml2.h"
5#include <variant>
6
7#define STRINGIFY(x) #x
8#define TOSTRING(x) STRINGIFY(x)
9
10namespace dyno {
11
13 {
23
24 public:
25 LoadResult load(const std::string filename) override;
26
27 bool save(std::shared_ptr<SceneGraph> scn, const std::string filename) override;
28
29 private:
30 std::shared_ptr<Node> processNode(tinyxml2::XMLElement* nodeXML);
31
32 void processModule(tinyxml2::XMLElement* moduleXml, std::shared_ptr<Pipeline> pipeline, std::vector<Module*>& modules);
33
34 bool ConstructPipeline(std::shared_ptr<Node> node, std::shared_ptr<Pipeline> pipeline, tinyxml2::XMLElement* nodeXML, std::vector<std::shared_ptr<Node>> nodes);
35
36 bool ConstructNodePipeline(std::shared_ptr<Node> node, tinyxml2::XMLElement* nodeXML, std::vector<std::shared_ptr<Node>> nodes);
37
38 std::string encodeVec3f(const Vec3f v);
39 Vec3f decodeVec3f(const std::string str);
40
41 std::string encodeVec2f(const Vec2f v);
42 Vec2f decodeVec2f(const std::string str);
43
44 virtual bool canLoadFileByExtension(const std::string extension);
45
46 std::vector<std::vector<ConnectionInfo>> mConnectionInfo;
47
49 FBase* fieldSrc,
50 tinyxml2::XMLDocument& doc,
51 std::map<ObjectId, uint> indices,
52 std::shared_ptr<Node> node,
53 uint ToIndex,
54 tinyxml2::XMLElement* nodeConnectionsXml
55 );
56 };
57}
std::variant< std::shared_ptr< SceneGraph >, std::string > LoadResult
bool ConstructNodePipeline(std::shared_ptr< Node > node, tinyxml2::XMLElement *nodeXML, std::vector< std::shared_ptr< Node > > nodes)
Vec3f decodeVec3f(const std::string str)
std::string encodeVec2f(const Vec2f v)
virtual bool canLoadFileByExtension(const std::string extension)
bool ConstructPipeline(std::shared_ptr< Node > node, std::shared_ptr< Pipeline > pipeline, tinyxml2::XMLElement *nodeXML, std::vector< std::shared_ptr< Node > > nodes)
void processModule(tinyxml2::XMLElement *moduleXml, std::shared_ptr< Pipeline > pipeline, std::vector< Module * > &modules)
std::shared_ptr< Node > processNode(tinyxml2::XMLElement *nodeXML)
LoadResult load(const std::string filename) override
void NodeFieldInputConnection(FBase *fieldSrc, tinyxml2::XMLDocument &doc, std::map< ObjectId, uint > indices, std::shared_ptr< Node > node, uint ToIndex, tinyxml2::XMLElement *nodeConnectionsXml)
Vec2f decodeVec2f(const std::string str)
std::string encodeVec3f(const Vec3f v)
bool save(std::shared_ptr< SceneGraph > scn, const std::string filename) override
std::vector< std::vector< ConnectionInfo > > mConnectionInfo
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Vector< float, 2 > Vec2f
Definition Vector2D.h:81
Vector< float, 3 > Vec3f
Definition Vector3D.h:93
unsigned int uint
Definition VkProgram.h:14