/usr/include/Savitar/Scene.h is in libsavitar-dev 3.1.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | /*
* This file is part of libSavitar
*
* Copyright (C) 2017 Ultimaker b.v. <j.vankessel@ultimaker.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SCENE_H
#define SCENE_H
#include "SavitarExport.h"
#include "SceneNode.h"
#include <vector> // For std::vector
#include <map> // For std::map
#include <string> // For std::string
// Forward declaration
namespace pugi
{
class xml_node;
}
namespace Savitar
{
class SAVITAR_EXPORT Scene
{
public:
/**
* A Scene is an object that holds a number of SceneNodes, but also has some meta data entries. It also defines a unit in which the data is expressed.
*/
Scene();
virtual ~Scene();
/**
* Get the scene nodes in this scene.
* \return The scene nodes that are in the scene.
*/
std::vector<SceneNode*> getSceneNodes();
std::vector<SceneNode*> getAllSceneNodes();
/**
* Add a scene node to the scene.
* \param node The SceneNode to be added.
*/
void addSceneNode(SceneNode* node);
/**
* Set the data of this SceneNode by giving it a xml node
*/
void fillByXMLNode(pugi::xml_node xml_node);
/**
* Set a meta data entry of the scene.
*
* Note that this not adhere to the full 3mf spec yet. All keys are accepted.
*
* \param key The key of the meta data.
* \param value The value of the meta data.
*/
void setMetaDataEntry(std::string key, std::string value);
/**
* Get all meta data entries
*/
std::map<std::string, std::string> getMetadata();
/**
* Get the unit (milimeter, inch, etc) of the scene.
* This is in milimeter by default.
*/
std::string getUnit();
void setUnit(std::string unit);
protected:
std::vector< SceneNode*> scene_nodes;
std::map<std::string, std::string> metadata;
std::string unit;
/**
* Used to recursively create SceneNode objects based on xml nodes.
* Because 3mf uses references, we also need to provide the root_node, so it's know what the reference points to
* \returns The created SceneNode.
*/
SceneNode* createSceneNodeFromObject(pugi::xml_node root_node, pugi::xml_node object_node);
};
}
#endif
|