123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
- /*
- * resource.h
- * Copyright (C) 2016 Fran??ois Gautrais <francois@gautrais.eu>
- *
- * histodex is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * histodex 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- #ifndef _RESOURCE_H_
- #define _RESOURCE_H_
- #include <iostream>
- #include "number3d.h"
- #include <json/json.h>
- #include "data.h"
- #define TYPE_3D 0
- #define TYPE_IMAGE 1
- #define TYPE_AUDIO 2
- #define TYPE_VIDEO 3
- class Resource : public Data
- {
- public:
- Resource();
- Resource(Json::Value v);
- virtual ~Resource();
- const Resource& operator=(const Resource& a);
-
- const std::string& getName();
- const std::string& getComments();
- const std::string& getType();
- const std::string& getFile() {return m_file;}
- Number3d getPosition();
- Number3d getRotation();
- Number3d getScale();
- int getStage();
- const std::string& getTitle() {return m_title;}
- void setName(const std::string& n);
- void setComments(const std::string& n);
- void setType(const std::string& n);
- void setPosition(const Number3d& n);
- void setRotation(const Number3d& n);
- void setScale(const Number3d& n);
- void setStage(int n);
- void setTitle(const std::string& n) {m_title=n;}
- void setFile(const std::string& n) {m_file=n;}
- Json::Value getJson(bool genFinal=false);
-
- static Resource&
- cast(Data& d);
- void set(Json::Value& v);
- protected:
- std::string m_name;
- int m_stage;
- Number3d m_position;
- Number3d m_rotation;
- Number3d m_scale;
- std::string m_comments;
- std::string m_type;
- std::string m_title;
- std::string m_file;
-
- private:
- };
- #endif // _RESOURCE_H_
|