├── .gitattributes
├── src
├── RepoCore
├── RepoLogger
├── Repo3DDiff
├── RepoAPIKey
├── RepoCSV
├── RepoPCA
├── RepoBSON
├── RepoCoreGlobal
├── RepoEigen
├── RepoGridFS
├── RepoImage
├── RepoRole
├── RepoUser
├── RepoWrapperAssimp
├── RepoBinary
├── RepoGraphScene
├── RepoNodeMesh
├── RepoNodeTypes
├── RepoWrapperMongo
├── RepoCollStats
├── RepoGraphHistory
├── RepoNodeAbstract
├── RepoNodeMetadata
├── RepoNodeRevision
├── RepoGraphAbstract
├── RepoGraphOptimizer
├── RepoNodeReference
├── RepoAbstractListener
├── RepoAbstractNotifier
├── RepoProjectSettings
├── RepoTranscoderBSON
├── RepoNodeTransformation
├── RepoTranscoderString
├── repocore.cpp
├── primitives
│ ├── repoabstractlistener.cpp
│ ├── reporole.cpp
│ ├── repoabstractnotifier.cpp
│ ├── repoimage.cpp
│ ├── reposeverity.cpp
│ ├── repostreambuffer.cpp
│ ├── reporole.h
│ ├── repoimage.h
│ ├── repoabstractlistener.h
│ ├── repoabstractnotifier.h
│ ├── repocollstats.cpp
│ ├── repostreambuffer.h
│ ├── repo_binary.h
│ ├── repocollstats.h
│ ├── repo_binary.cpp
│ ├── repobson.h
│ ├── repobson.cpp
│ ├── reposeverity.h
│ └── repoprojectsettings.h
├── api
│ ├── repo_apikey.cpp
│ └── repo_apikey.h
├── repocore.h
├── compute
│ ├── render.h
│ ├── repographoptimizer.h
│ ├── repocsv.cpp
│ ├── repocsv.h
│ └── repographoptimizer.cpp
├── sha256
│ ├── LICENSE.txt
│ ├── sha256.h
│ └── sha256.cpp
├── graph
│ ├── sha256
│ │ ├── LICENSE.txt
│ │ ├── sha256.h
│ │ └── sha256.cpp
│ ├── repo_node_types.h
│ ├── repo_graph_history.cpp
│ ├── repo_graph_history.h
│ ├── repo_bounding_box.cpp
│ ├── repo_bounding_box.h
│ ├── repo_node_texture.h
│ ├── repo_node_metadata.h
│ ├── repo_node_reference.cpp
│ ├── repo_graph_abstract.h
│ ├── repo_node_texture.cpp
│ └── repo_node_camera.h
├── diff
│ ├── repo3ddiff.h
│ └── repo3ddiff.cpp
├── conversion
│ ├── repo_transcoder_string.cpp
│ ├── repo_transcoder_string.h
│ └── repo_transcoder_bson.cpp
├── mongo
│ ├── repogridfs.h
│ └── repogridfs.cpp
├── repologger.h
├── repocoreglobal.h
├── cli.cpp
└── repologger.cpp
├── submodules
├── mongo-cxx-driver.creator
├── mongo-cxx-driver.config
├── make_mongo.bat
└── mongo-cxx-driver.includes
├── .gitignore
├── .gitmodules
├── header.pri
├── assimp.pri
├── boost.pri
├── mongo.pri
├── 3drepocli.pro
├── 3drepocore.pro
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/RepoCore:
--------------------------------------------------------------------------------
1 | #include "repocore.h"
2 |
--------------------------------------------------------------------------------
/src/RepoLogger:
--------------------------------------------------------------------------------
1 | #include "repologger.h"
2 |
--------------------------------------------------------------------------------
/src/Repo3DDiff:
--------------------------------------------------------------------------------
1 | #include "diff/repo3ddiff.h"
2 |
--------------------------------------------------------------------------------
/src/RepoAPIKey:
--------------------------------------------------------------------------------
1 | #include "api/repo_apikey.h"
2 |
--------------------------------------------------------------------------------
/src/RepoCSV:
--------------------------------------------------------------------------------
1 | #include "compute/repocsv.h"
2 |
--------------------------------------------------------------------------------
/src/RepoPCA:
--------------------------------------------------------------------------------
1 | #include "compute/repo_pca.h"
2 |
--------------------------------------------------------------------------------
/src/RepoBSON:
--------------------------------------------------------------------------------
1 | #include "primitives/repobson.h"
2 |
--------------------------------------------------------------------------------
/src/RepoCoreGlobal:
--------------------------------------------------------------------------------
1 | #include "repocoreglobal.h"
2 |
--------------------------------------------------------------------------------
/src/RepoEigen:
--------------------------------------------------------------------------------
1 | #include "compute/repo_eigen.h"
2 |
--------------------------------------------------------------------------------
/src/RepoGridFS:
--------------------------------------------------------------------------------
1 | #include "mongo/repogridfs.h"
2 |
--------------------------------------------------------------------------------
/src/RepoImage:
--------------------------------------------------------------------------------
1 | #include "primitives/repoimage.h"
2 |
--------------------------------------------------------------------------------
/src/RepoRole:
--------------------------------------------------------------------------------
1 | #include "primitives/reporole.h"
2 |
--------------------------------------------------------------------------------
/src/RepoUser:
--------------------------------------------------------------------------------
1 | #include "primitives/repo_user.h"
2 |
--------------------------------------------------------------------------------
/src/RepoWrapperAssimp:
--------------------------------------------------------------------------------
1 | #include "assimpwrapper.h"
2 |
--------------------------------------------------------------------------------
/submodules/mongo-cxx-driver.creator:
--------------------------------------------------------------------------------
1 | [General]
2 |
--------------------------------------------------------------------------------
/src/RepoBinary:
--------------------------------------------------------------------------------
1 | #include "primitives/repo_binary.h"
2 |
--------------------------------------------------------------------------------
/src/RepoGraphScene:
--------------------------------------------------------------------------------
1 | #include "graph/repo_graph_scene.h"
2 |
--------------------------------------------------------------------------------
/src/RepoNodeMesh:
--------------------------------------------------------------------------------
1 | #include "graph/repo_node_mesh.h"
2 |
--------------------------------------------------------------------------------
/src/RepoNodeTypes:
--------------------------------------------------------------------------------
1 | #include "graph/repo_node_types.h"
2 |
--------------------------------------------------------------------------------
/src/RepoWrapperMongo:
--------------------------------------------------------------------------------
1 | #include "mongoclientwrapper.h"
2 |
--------------------------------------------------------------------------------
/src/RepoCollStats:
--------------------------------------------------------------------------------
1 | #include "primitives/RepoCollStats.h"
2 |
--------------------------------------------------------------------------------
/src/RepoGraphHistory:
--------------------------------------------------------------------------------
1 | #include "graph/repo_graph_history.h"
2 |
--------------------------------------------------------------------------------
/src/RepoNodeAbstract:
--------------------------------------------------------------------------------
1 | #include "graph/repo_node_abstract.h"
2 |
--------------------------------------------------------------------------------
/src/RepoNodeMetadata:
--------------------------------------------------------------------------------
1 | #include "graph/repo_node_metadata.h"
2 |
--------------------------------------------------------------------------------
/src/RepoNodeRevision:
--------------------------------------------------------------------------------
1 | #include "graph/repo_node_revision.h"
2 |
--------------------------------------------------------------------------------
/src/RepoGraphAbstract:
--------------------------------------------------------------------------------
1 | #include "graph/repo_graph_abstract.h"
2 |
--------------------------------------------------------------------------------
/src/RepoGraphOptimizer:
--------------------------------------------------------------------------------
1 | #include "compute/repographoptimizer.h"
2 |
--------------------------------------------------------------------------------
/src/RepoNodeReference:
--------------------------------------------------------------------------------
1 | #include "graph/repo_node_reference.h"
2 |
--------------------------------------------------------------------------------
/src/RepoAbstractListener:
--------------------------------------------------------------------------------
1 | #include "primitives/repoabstractlistener.h"
2 |
--------------------------------------------------------------------------------
/src/RepoAbstractNotifier:
--------------------------------------------------------------------------------
1 | #include "primitives/repoabstractnotifier.h"
2 |
--------------------------------------------------------------------------------
/src/RepoProjectSettings:
--------------------------------------------------------------------------------
1 | #include "primitives/repoprojectsettings.h"
2 |
--------------------------------------------------------------------------------
/src/RepoTranscoderBSON:
--------------------------------------------------------------------------------
1 | #include "conversion/repo_transcoder_bson.h"
2 |
--------------------------------------------------------------------------------
/src/RepoNodeTransformation:
--------------------------------------------------------------------------------
1 | #include "graph/repo_node_transformation.h"
2 |
--------------------------------------------------------------------------------
/src/RepoTranscoderString:
--------------------------------------------------------------------------------
1 | #include "conversion/repo_transcoder_string.h"
2 |
--------------------------------------------------------------------------------
/submodules/mongo-cxx-driver.config:
--------------------------------------------------------------------------------
1 | // Add predefined macros for your project here. For example:
2 | // #define THE_ANSWER 42
3 | #define _CRT_SECURE_NO_WARNINGS
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /*.user
2 | lib3drepocore.so
3 | lib3drepocore.so.1
4 | lib3drepocore.so.1.0
5 | lib3drepocore.so.1.0.0
6 | *.o
7 | Makefile
8 | Makefile.*
9 | repo_cli
10 | repo_cli_debug
11 | *.obj
12 | *.mtl
13 |
14 | /lib
15 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "submodules/assimp"]
2 | path = submodules/assimp
3 | url = https://github.com/3drepo/assimp/
4 | [submodule "submodules/mongo-cxx-driver"]
5 | path = submodules/mongo-cxx-driver
6 | url = https://github.com/mongodb/mongo-cxx-driver
7 |
--------------------------------------------------------------------------------
/submodules/make_mongo.bat:
--------------------------------------------------------------------------------
1 | cd mongo-cxx-driver
2 | scons -j2 --full --64 --mute --sharedclient --dynamic-windows --use-system-boost --extrapath=c:\local\boost_1_56_0 --cpppath=c:\local\boost_1_56_0 --libpath=c:\local\boost_1_56_0\lib64-msvc-12.0 install-mongoclient
3 |
--------------------------------------------------------------------------------
/src/repocore.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2014 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | #include "repocore.h"
19 | #include "repologger.h"
20 |
21 | repo::core::RepoCore::RepoCore()
22 | {
23 | }
24 |
25 | repo::core::RepoCore::~RepoCore()
26 | {
27 | }
28 |
--------------------------------------------------------------------------------
/src/primitives/repoabstractlistener.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2014 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | #include "repoabstractlistener.h"
19 |
20 | //------------------------------------------------------------------------------
21 | repo::core::RepoAbstractListener::~RepoAbstractListener() {}
22 |
--------------------------------------------------------------------------------
/header.pri:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2014 3D Repo Ltd
2 | #
3 | # This program is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU Affero General Public License as
5 | # published by the Free Software Foundation, either version 3 of the
6 | # License, or (at your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU Affero General Public License for more details.
12 | #
13 | # You should have received a copy of the GNU Affero General Public License
14 | # along with this program. If not, see .
15 |
16 | # http://qt-project.org/doc/qt-5/qmake-variable-reference.html
17 | # http://google-styleguide.googlecode.com/svn/trunk/cppguide.html
18 |
19 | unix:QMAKE_CXXFLAGS += -fpermissive -std=c++11
20 | unix:QMAKE_CXXFLAGS_DEBUG -= -O1
21 | unix:QMAKE_CXXFLAGS_DEBUG += -O0
22 |
23 | macx{
24 | CONFIG += c++11
25 | }
--------------------------------------------------------------------------------
/src/primitives/reporole.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 |
19 | #include "reporole.h"
20 |
21 | repo::core::RepoRole::RepoRole() : RepoBSON() {}
22 |
23 | repo::core::RepoRole::RepoRole(const mongo::BSONObj &obj) : RepoBSON(obj) {}
24 |
25 | repo::core::RepoRole::~RepoRole() {}
26 |
27 | std::string repo::core::RepoRole::getName() const
28 | {
29 | return getField(REPO_LABEL_ROLE).str();
30 | }
31 |
--------------------------------------------------------------------------------
/submodules/mongo-cxx-driver.includes:
--------------------------------------------------------------------------------
1 | mongo-cxx-driver/src/mongo
2 | mongo-cxx-driver/src/mongo/base
3 | mongo-cxx-driver/src/mongo/bson
4 | mongo-cxx-driver/src/mongo/bson/util
5 | mongo-cxx-driver/src/mongo/client
6 | mongo-cxx-driver/src/mongo/db
7 | mongo-cxx-driver/src/mongo/dbtests/mock
8 | mongo-cxx-driver/src/mongo/logger
9 | mongo-cxx-driver/src/mongo/platform
10 | mongo-cxx-driver/src/mongo/s
11 | mongo-cxx-driver/src/mongo/unittest
12 | mongo-cxx-driver/src/mongo/util
13 | mongo-cxx-driver/src/mongo/util/concurrency
14 | mongo-cxx-driver/src/mongo/util/mongoutils
15 | mongo-cxx-driver/src/mongo/util/net
16 | mongo-cxx-driver/src/third_party/gtest-1.7.0/fused-src/gtest
17 | mongo-cxx-driver/src/third_party/gtest-1.7.0/include/gtest
18 | mongo-cxx-driver/src/third_party/gtest-1.7.0/include/gtest/internal
19 | mongo-cxx-driver/src/third_party/gtest-1.7.0/samples
20 | mongo-cxx-driver/src/third_party/gtest-1.7.0/src
21 | mongo-cxx-driver/src/third_party/gtest-1.7.0/test
22 | mongo-cxx-driver/src/third_party/gtest-1.7.0/xcode/Samples/FrameworkSample
23 | mongo-cxx-driver/src/third_party/murmurhash3
24 | mongo-cxx-driver/src/third_party/tz
25 |
--------------------------------------------------------------------------------
/assimp.pri:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2014 3D Repo Ltd
2 | #
3 | # This program is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU Affero General Public License as
5 | # published by the Free Software Foundation, either version 3 of the
6 | # License, or (at your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU Affero General Public License for more details.
12 | #
13 | # You should have received a copy of the GNU Affero General Public License
14 | # along with this program. If not, see .
15 |
16 | #-------------------------------------------------------------------------------
17 | # Assimp
18 | win32:CONFIG(release, debug|release): LIBS += -L$$PWD/lib/ -lassimp
19 | else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/lib/ -lassimpd
20 | else:unix: LIBS += -L$$PWD/submodules/assimp/build/code -lassimp
21 |
22 | INCLUDEPATH += $$PWD/submodules/assimp/include
23 | DEPENDPATH += $$PWD/submodules/assimp/include
24 |
--------------------------------------------------------------------------------
/boost.pri:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2014 3D Repo Ltd
2 | #
3 | # This program is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU Affero General Public License as
5 | # published by the Free Software Foundation, either version 3 of the
6 | # License, or (at your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU Affero General Public License for more details.
12 | #
13 | # You should have received a copy of the GNU Affero General Public License
14 | # along with this program. If not, see .
15 |
16 | #-------------------------------------------------------------------------------
17 | # Boost
18 | win32: LIBS += -LC:/local/boost_1_56_0/lib64-msvc-12.0/
19 | win32:INCLUDEPATH += C:/local/boost_1_56_0/
20 | win32:DEPENDPATH += C:/local/boost_1_56_0/
21 |
22 | macx {
23 | _BOOST_PATH = /usr/local/Cellar/boost/1.56.0
24 | INCLUDEPATH += "$${_BOOST_PATH}/include/"
25 | LIBS += -L$${_BOOST_PATH}/lib
26 | LIBS += -lboost_chrono-mt -lboost_system -lboost_filesystem
27 | }
28 |
--------------------------------------------------------------------------------
/src/api/repo_apikey.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 |
19 | #include "repo_apikey.h"
20 |
21 | repo::core::RepoAPIKey::RepoAPIKey()
22 | : uuid(boost::uuids::random_generator()())
23 | {
24 | }
25 |
26 | repo::core::RepoAPIKey::~RepoAPIKey()
27 | {
28 | }
29 |
30 | std::string repo::core::RepoAPIKey::toString() const
31 | {
32 | std::string str = to_string(uuid);
33 | str.erase(std::remove(str.begin(), str.end(), '-'), str.end()); // remove hyphens
34 | return str;
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/src/repocore.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2014 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 |
19 | #ifndef REPO_CORE_H
20 | #define REPO_CORE_H
21 |
22 | //------------------------------------------------------------------------------
23 | #include "repocoreglobal.h"
24 | //------------------------------------------------------------------------------
25 |
26 | namespace repo {
27 | namespace core {
28 |
29 | //------------------------------------------------------------------------------
30 | class REPO_CORE_EXPORT RepoCore
31 | {
32 |
33 | public:
34 | RepoCore();
35 |
36 | ~RepoCore();
37 |
38 | }; // end class
39 |
40 | } // end namespace core
41 | } // end namespace repo
42 |
43 | #endif // REPO_CORE_H
44 |
--------------------------------------------------------------------------------
/mongo.pri:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2014 3D Repo Ltd
2 | #
3 | # This program is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU Affero General Public License as
5 | # published by the Free Software Foundation, either version 3 of the
6 | # License, or (at your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU Affero General Public License for more details.
12 | #
13 | # You should have received a copy of the GNU Affero General Public License
14 | # along with this program. If not, see .
15 |
16 | #-------------------------------------------------------------------------------
17 | # MongoDB C++ Driver
18 |
19 | win32:DEFINES += WIN32_LEAN_AND_MEAN VC_EXTRALEAN
20 | win32:LIBS += -lws2_32
21 |
22 | win32:CONFIG(release, debug|release): LIBS += -L$$PWD/lib/ -lmongoclient
23 | else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/lib/ -lmongoclientd
24 | else:unix:!macx: LIBS += -L$$PWD/submodules/mongo-cxx-driver/lib -lmongoclient
25 | else:macx: LIBS += -L$$PWD/submodules/mongo-cxx-driver/build/darwin/64/osx-version-min_10.9/use-system-boost -lmongoclient
26 |
27 | unix:INCLUDEPATH += $$PWD/submodules/mongo-cxx-driver/include
28 | else:INCLUDEPATH += $$PWD/submodules/mongo-cxx-driver/src
29 |
30 | DEPENDPATH += $$PWD/submodules/mongo-cxx-driver/src
31 |
--------------------------------------------------------------------------------
/src/primitives/repoabstractnotifier.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2014 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | #include "repoabstractnotifier.h"
19 |
20 | //------------------------------------------------------------------------------
21 | repo::core::RepoAbstractNotifier::~RepoAbstractNotifier() {}
22 |
23 | void repo::core::RepoAbstractNotifier::addListener(
24 | RepoAbstractListener *l)
25 | {
26 | listeners.insert(l);
27 | }
28 |
29 | void repo::core::RepoAbstractNotifier::removeListener(
30 | RepoAbstractListener *l)
31 | {
32 | listeners.erase(l);
33 | }
34 |
35 | void repo::core::RepoAbstractNotifier::notifyListeners(const std::string &msg)
36 | {
37 | std::set::iterator it;
38 | for (it = listeners.begin(); it != listeners.end(); ++it)
39 | {
40 | RepoAbstractListener *l = *it;
41 | l->messageGenerated(msg);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/compute/render.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | #ifndef RENDER_H
19 | #define RENDER_H
20 |
21 | #include "../mongoclientwrapper.h"
22 | #include "../graph/repo_graph_scene.h"
23 | #include "../graph/repo_node_abstract.h"
24 | #include "../graph/repo_node_mesh.h"
25 | #include "../conversion/repo_transcoder_bson.h"
26 | #include "mongo/bson/bsontypes.h"
27 |
28 |
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 |
35 | #include
36 | #include
37 |
38 | #include "../repocoreglobal.h"
39 |
40 | #include
41 |
42 | namespace repo {
43 | namespace core {
44 |
45 | class REPO_CORE_EXPORT Renderer
46 | {
47 | private:
48 | RepoGraphScene *scene;
49 |
50 | public:
51 | Renderer(RepoGraphScene *scene) : scene(scene) {}
52 |
53 | void renderToBSONs(std::vector &out);
54 | };
55 |
56 | }
57 | }
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/3drepocli.pro:
--------------------------------------------------------------------------------
1 | # Copyright (C) 2014 3D Repo Ltd
2 | #
3 | # This program is free software: you can redistribute it and/or modify
4 | # it under the terms of the GNU Affero General Public License as
5 | # published by the Free Software Foundation, either version 3 of the
6 | # License, or (at your option) any later version.
7 | #
8 | # This program is distributed in the hope that it will be useful,
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | # GNU Affero General Public License for more details.
12 | #
13 | # You should have received a copy of the GNU Affero General Public License
14 | # along with this program. If not, see .
15 |
16 | # http://qt-project.org/doc/qt-5/qmake-variable-reference.html
17 | # http://google-styleguide.googlecode.com/svn/trunk/cppguide.html
18 |
19 | include(header.pri)
20 | include(boost.pri)
21 | include(assimp.pri)
22 | include(mongo.pri)
23 |
24 | TEMPLATE = app
25 | #CONFIG += debug_and_release
26 | #release: TARGET = repo_cli
27 | #debug: TARGET = repo_cli_debug
28 |
29 | QT += core gui # TODO: remove Qt dependencies, ie it should be -=
30 |
31 | #-------------------------------------------------------------------------------
32 | # 3drepocore
33 |
34 | win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/release/ -l3drepocore
35 | else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/debug/ -l3drepocore
36 | else:unix: LIBS += -L$$OUT_PWD/ -lboost_system -l3drepocore
37 |
38 | INCLUDEPATH += $$PWD/src
39 | DEPENDPATH += $$PWD/src
40 |
41 | #-------------------------------------------------------------------------------
42 | # Input
43 | #HEADERS +=
44 | SOURCES += src/cli.cpp
45 | #-------------------------------------------------------------------------------
46 |
--------------------------------------------------------------------------------
/src/api/repo_apikey.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 |
19 | #ifndef REPO_API_KEY_H
20 | #define REPO_API_KEY_H
21 |
22 | #include
23 | #include
24 | //------------------------------------------------------------------------------
25 | #include "../repocoreglobal.h"
26 | //------------------------------------------------------------------------------
27 | #include // uuid class
28 | #include // generators
29 | #include // streaming operators etc
30 | //------------------------------------------------------------------------------
31 |
32 | namespace repo {
33 | namespace core {
34 |
35 |
36 | class REPO_CORE_EXPORT RepoAPIKey
37 | {
38 |
39 | public:
40 |
41 | RepoAPIKey();
42 |
43 | ~RepoAPIKey();
44 |
45 | std::string toString() const;
46 |
47 | private :
48 |
49 | boost::uuids::uuid uuid;
50 |
51 | }; // end class
52 |
53 | } // end namespace core
54 | } // end namespace repo
55 |
56 | #endif // REPO_API_KEY_H
57 |
--------------------------------------------------------------------------------
/src/primitives/repoimage.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public Listd::cerrnse as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 |
19 | #include "repoimage.h"
20 |
21 | repo::core::RepoImage::RepoImage(const unsigned char *bytes,
22 | unsigned int bytesLength,
23 | unsigned int width,
24 | unsigned int height,
25 | const string &mediaType)
26 | : RepoBinary(bytes, bytesLength, mediaType)
27 | {
28 | mongo::BSONObjBuilder builder;
29 | builder.appendElements(*this);
30 |
31 | //--------------------------------------------------------------------------
32 | // Width
33 | if (width)
34 | builder << REPO_LABEL_WIDTH << width;
35 |
36 | //--------------------------------------------------------------------------
37 | // Height
38 | if (height)
39 | builder << REPO_LABEL_HEIGHT << height;
40 |
41 | //--------------------------------------------------------------------------
42 | // Add to the parent object
43 | *this = builder.obj();
44 | }
45 |
--------------------------------------------------------------------------------
/src/sha256/LICENSE.txt:
--------------------------------------------------------------------------------
1 | /*
2 | * Updated to C++, zedwood.com 2012
3 | * Based on Olivier Gay's version
4 | * See Modified BSD License below:
5 | *
6 | * FIPS 180-2 SHA-224/256/384/512 implementation
7 | * Issue date: 04/30/2005
8 | * http://www.ouah.org/ogay/sha2/
9 | *
10 | * Copyright (C) 2005, 2007 Olivier Gay
11 | * All rights reserved.
12 | *
13 | * Redistribution and use in source and binary forms, with or without
14 | * modification, are permitted provided that the following conditions
15 | * are met:
16 | * 1. Redistributions of source code must retain the above copyright
17 | * notice, this list of conditions and the following disclaimer.
18 | * 2. Redistributions in binary form must reproduce the above copyright
19 | * notice, this list of conditions and the following disclaimer in the
20 | * documentation and/or other materials provided with the distribution.
21 | * 3. Neither the name of the project nor the names of its contributors
22 | * may be used to endorse or promote products derived from this software
23 | * without specific prior written permission.
24 | *
25 | * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 | * SUCH DAMAGE.
36 | */
37 |
--------------------------------------------------------------------------------
/src/graph/sha256/LICENSE.txt:
--------------------------------------------------------------------------------
1 | /*
2 | * Updated to C++, zedwood.com 2012
3 | * Based on Olivier Gay's version
4 | * See Modified BSD License below:
5 | *
6 | * FIPS 180-2 SHA-224/256/384/512 implementation
7 | * Issue date: 04/30/2005
8 | * http://www.ouah.org/ogay/sha2/
9 | *
10 | * Copyright (C) 2005, 2007 Olivier Gay
11 | * All rights reserved.
12 | *
13 | * Redistribution and use in source and binary forms, with or without
14 | * modification, are permitted provided that the following conditions
15 | * are met:
16 | * 1. Redistributions of source code must retain the above copyright
17 | * notice, this list of conditions and the following disclaimer.
18 | * 2. Redistributions in binary form must reproduce the above copyright
19 | * notice, this list of conditions and the following disclaimer in the
20 | * documentation and/or other materials provided with the distribution.
21 | * 3. Neither the name of the project nor the names of its contributors
22 | * may be used to endorse or promote products derived from this software
23 | * without specific prior written permission.
24 | *
25 | * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 | * SUCH DAMAGE.
36 | */
37 |
--------------------------------------------------------------------------------
/src/graph/repo_node_types.h:
--------------------------------------------------------------------------------
1 | #ifndef REPO_NODE_TYPES
2 | #define REPO_NODE_TYPES
3 |
4 | //-----------------------------------------------------------------------------
5 | //
6 | // Required fields
7 | //
8 | //-----------------------------------------------------------------------------
9 | #define REPO_NODE_LABEL_ID "_id" //!< required
10 | #define REPO_NODE_LABEL_SHARED_ID "shared_id" //!< required
11 | #define REPO_NODE_LABEL_TYPE "type" //!< required
12 | #define REPO_NODE_LABEL_API "api" //!< required
13 | #define REPO_NODE_LABEL_PATHS "paths" //!< required
14 | //-----------------------------------------------------------------------------
15 | #define REPO_NODE_API_LEVEL_0 0 //!< unknown api level
16 | #define REPO_NODE_API_LEVEL_1 1 //!< original api level
17 | #define REPO_NODE_API_LEVEL_2 2 //!< triangles only api level
18 | #define REPO_NODE_API_LEVEL_3 3 //!< compressed api level
19 |
20 | //-----------------------------------------------------------------------------
21 | //
22 | // Optional nevertheless common fields
23 | //
24 | //-----------------------------------------------------------------------------
25 | #define REPO_NODE_LABEL_NAME "name" //!< optional bson field label
26 | #define REPO_NODE_LABEL_PARENTS "parents" //!< optional field label
27 | //-----------------------------------------------------------------------------
28 | #define REPO_NODE_TYPE_ANIMATION "animation"
29 | #define REPO_NODE_TYPE_BONE "bone"
30 | #define REPO_NODE_TYPE_CAMERA "camera"
31 | #define REPO_NODE_TYPE_COMMENT "comment"
32 | #define REPO_NODE_TYPE_LIGHT "light"
33 | #define REPO_NODE_TYPE_LOCK "lock"
34 | #define REPO_NODE_TYPE_METADATA "meta"
35 | #define REPO_NODE_TYPE_REVISION "revision"
36 | #define REPO_NODE_TYPE_SHADER "shader"
37 | #define REPO_NODE_TYPE_TEXTURE "texture"
38 | #define REPO_NODE_TYPE_TRANSFORMATION "transformation"
39 | #define REPO_NODE_TYPE_UNKNOWN "unknown" // reserved UUID ext 00
40 | //-----------------------------------------------------------------------------
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/src/sha256/sha256.h:
--------------------------------------------------------------------------------
1 | #ifndef SHA256_H
2 | #define SHA256_H
3 | #include
4 |
5 | class SHA256
6 | {
7 | protected:
8 | typedef unsigned char uint8;
9 | typedef unsigned int uint32;
10 | typedef unsigned long long uint64;
11 |
12 | const static uint32 sha256_k[];
13 | static const unsigned int SHA224_256_BLOCK_SIZE = (512/8);
14 | public:
15 | void init();
16 | void update(const unsigned char *message, unsigned int len);
17 | void final(unsigned char *digest);
18 | static const unsigned int DIGEST_SIZE = ( 256 / 8);
19 |
20 | protected:
21 | void transform(const unsigned char *message, unsigned int block_nb);
22 | unsigned int m_tot_len;
23 | unsigned int m_len;
24 | unsigned char m_block[2*SHA224_256_BLOCK_SIZE];
25 | uint32 m_h[8];
26 | };
27 |
28 | std::string sha256(std::string input);
29 |
30 | #define SHA2_SHFR(x, n) (x >> n)
31 | #define SHA2_ROTR(x, n) ((x >> n) | (x << ((sizeof(x) << 3) - n)))
32 | #define SHA2_ROTL(x, n) ((x << n) | (x >> ((sizeof(x) << 3) - n)))
33 | #define SHA2_CH(x, y, z) ((x & y) ^ (~x & z))
34 | #define SHA2_MAJ(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
35 | #define SHA256_F1(x) (SHA2_ROTR(x, 2) ^ SHA2_ROTR(x, 13) ^ SHA2_ROTR(x, 22))
36 | #define SHA256_F2(x) (SHA2_ROTR(x, 6) ^ SHA2_ROTR(x, 11) ^ SHA2_ROTR(x, 25))
37 | #define SHA256_F3(x) (SHA2_ROTR(x, 7) ^ SHA2_ROTR(x, 18) ^ SHA2_SHFR(x, 3))
38 | #define SHA256_F4(x) (SHA2_ROTR(x, 17) ^ SHA2_ROTR(x, 19) ^ SHA2_SHFR(x, 10))
39 | #define SHA2_UNPACK32(x, str) \
40 | { \
41 | *((str) + 3) = (uint8) ((x) ); \
42 | *((str) + 2) = (uint8) ((x) >> 8); \
43 | *((str) + 1) = (uint8) ((x) >> 16); \
44 | *((str) + 0) = (uint8) ((x) >> 24); \
45 | }
46 | #define SHA2_PACK32(str, x) \
47 | { \
48 | *(x) = ((uint32) *((str) + 3) ) \
49 | | ((uint32) *((str) + 2) << 8) \
50 | | ((uint32) *((str) + 1) << 16) \
51 | | ((uint32) *((str) + 0) << 24); \
52 | }
53 | #endif
54 |
--------------------------------------------------------------------------------
/src/graph/sha256/sha256.h:
--------------------------------------------------------------------------------
1 | #ifndef SHA256_H
2 | #define SHA256_H
3 | #include
4 |
5 | class SHA256
6 | {
7 | protected:
8 | typedef unsigned char uint8;
9 | typedef unsigned int uint32;
10 | typedef unsigned long long uint64;
11 |
12 | const static uint32 sha256_k[];
13 | static const unsigned int SHA224_256_BLOCK_SIZE = (512/8);
14 | public:
15 | void init();
16 | void update(const unsigned char *message, unsigned int len);
17 | void final(unsigned char *digest);
18 | static const unsigned int DIGEST_SIZE = ( 256 / 8);
19 |
20 | protected:
21 | void transform(const unsigned char *message, unsigned int block_nb);
22 | unsigned int m_tot_len;
23 | unsigned int m_len;
24 | unsigned char m_block[2*SHA224_256_BLOCK_SIZE];
25 | uint32 m_h[8];
26 | };
27 |
28 | std::string sha256(std::string input);
29 |
30 | #define SHA2_SHFR(x, n) (x >> n)
31 | #define SHA2_ROTR(x, n) ((x >> n) | (x << ((sizeof(x) << 3) - n)))
32 | #define SHA2_ROTL(x, n) ((x << n) | (x >> ((sizeof(x) << 3) - n)))
33 | #define SHA2_CH(x, y, z) ((x & y) ^ (~x & z))
34 | #define SHA2_MAJ(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
35 | #define SHA256_F1(x) (SHA2_ROTR(x, 2) ^ SHA2_ROTR(x, 13) ^ SHA2_ROTR(x, 22))
36 | #define SHA256_F2(x) (SHA2_ROTR(x, 6) ^ SHA2_ROTR(x, 11) ^ SHA2_ROTR(x, 25))
37 | #define SHA256_F3(x) (SHA2_ROTR(x, 7) ^ SHA2_ROTR(x, 18) ^ SHA2_SHFR(x, 3))
38 | #define SHA256_F4(x) (SHA2_ROTR(x, 17) ^ SHA2_ROTR(x, 19) ^ SHA2_SHFR(x, 10))
39 | #define SHA2_UNPACK32(x, str) \
40 | { \
41 | *((str) + 3) = (uint8) ((x) ); \
42 | *((str) + 2) = (uint8) ((x) >> 8); \
43 | *((str) + 1) = (uint8) ((x) >> 16); \
44 | *((str) + 0) = (uint8) ((x) >> 24); \
45 | }
46 | #define SHA2_PACK32(str, x) \
47 | { \
48 | *(x) = ((uint32) *((str) + 3) ) \
49 | | ((uint32) *((str) + 2) << 8) \
50 | | ((uint32) *((str) + 1) << 16) \
51 | | ((uint32) *((str) + 0) << 24); \
52 | }
53 | #endif
54 |
--------------------------------------------------------------------------------
/src/primitives/reposeverity.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2014 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | #include "reposeverity.h"
19 |
20 | using namespace repo::core;
21 |
22 | RepoSeverity::RepoSeverity(
23 | const std::string &color,
24 | const std::string &level,
25 | int value)
26 | : color(color)
27 | , level(level)
28 | , value(value) {}
29 |
30 | RepoSeverity::RepoSeverity()
31 | : color("green")
32 | , level("INFO")
33 | , value(REPO_INFO_NUM) {}
34 |
35 | const RepoSeverity RepoSeverity::REPO_PANIC =
36 | RepoSeverity("red", "PANIC", REPO_PANIC_NUM);
37 |
38 | const RepoSeverity RepoSeverity::REPO_ALERT =
39 | RepoSeverity("red", "ALERT", REPO_ALERT_NUM);
40 |
41 | const RepoSeverity RepoSeverity::REPO_CRITICAL =
42 | RepoSeverity("red", "CRITICAL", REPO_CRITICAL_NUM);
43 |
44 | const RepoSeverity RepoSeverity::REPO_ERROR =
45 | RepoSeverity("red", "ERROR", REPO_ERROR_NUM);
46 |
47 | const RepoSeverity RepoSeverity::REPO_WARNING =
48 | RepoSeverity("orange", "WARNING", REPO_WARNING_NUM);
49 |
50 | const RepoSeverity RepoSeverity::REPO_NOTICE =
51 | RepoSeverity("blue", "NOTICE", REPO_NOTICE_NUM);
52 |
53 | const RepoSeverity RepoSeverity::REPO_INFO =
54 | RepoSeverity("green", "INFO", REPO_INFO_NUM);
55 |
56 | const RepoSeverity RepoSeverity::REPO_DEBUG =
57 | RepoSeverity("purple", "DEBUG", REPO_DEBUG_NUM);
58 |
--------------------------------------------------------------------------------
/src/primitives/repostreambuffer.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2014 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | #include "repostreambuffer.h"
19 |
20 | repo::core::RepoStreamBuffer::RepoStreamBuffer(
21 | RepoAbstractListener *interceptor,
22 | std::ostream &stream)
23 | : listener(interceptor)
24 | , originalBuffer(0)
25 | , originalStream(stream)
26 | , redirectStream(0)
27 | {
28 | originalBuffer = originalStream.rdbuf(this);
29 | redirectStream = new std::ostream(originalBuffer);
30 | }
31 |
32 |
33 | repo::core::RepoStreamBuffer::~RepoStreamBuffer()
34 | {
35 | // Revert back as it was originally
36 | originalStream.rdbuf(originalBuffer);
37 |
38 | // Delete redundant stream
39 | delete redirectStream;
40 | }
41 |
42 | std::ostream &repo::core::RepoStreamBuffer::getRedirectStream() const
43 | {
44 | return *(redirectStream);
45 | }
46 |
47 | //------------------------------------------------------------------------------
48 | //
49 | // Protected
50 | //
51 | //------------------------------------------------------------------------------
52 |
53 | int repo::core::RepoStreamBuffer::overflow(int_type c)
54 | {
55 | return c;
56 | }
57 |
58 | std::streamsize repo::core::RepoStreamBuffer::xsputn(
59 | const char *msg,
60 | std::streamsize count)
61 | {
62 | std::string message(msg, count);
63 |
64 | //--------------------------------------------------------------------------
65 | listener->messageGenerated(&originalStream, message);
66 |
67 | return count;
68 | }
69 |
70 |
--------------------------------------------------------------------------------
/src/primitives/reporole.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | #ifndef REPO_ROLE_H
19 | #define REPO_ROLE_H
20 |
21 | //------------------------------------------------------------------------------
22 | #include // the MongoDB driver
23 | //------------------------------------------------------------------------------
24 | #include "../conversion/repo_transcoder_bson.h"
25 | #include "../conversion/repo_transcoder_string.h"
26 | //------------------------------------------------------------------------------
27 | #include "../repocoreglobal.h"
28 | #include "repobson.h"
29 |
30 | namespace repo {
31 | namespace core {
32 |
33 | //------------------------------------------------------------------------------
34 | //
35 | // Fields specific to role only
36 | //
37 | //------------------------------------------------------------------------------
38 |
39 |
40 | class REPO_CORE_EXPORT RepoRole : public RepoBSON
41 | {
42 |
43 | public :
44 |
45 | //! Default empty constructor.
46 | RepoRole();
47 |
48 | //! Constructor from Mongo BSON objects.
49 | RepoRole(const mongo::BSONObj &obj);
50 |
51 | //! Default empty destructor.
52 | ~RepoRole();
53 |
54 | //! Returns a new full (and owned) copy of the object.
55 | inline RepoRole copy() const { return RepoRole(RepoBSON::copy()); }
56 |
57 | //! Returns the name of the role if any.
58 | std::string getName() const;
59 |
60 | }; // end class
61 |
62 | } // end namespace core
63 | } // end namespace repo
64 |
65 | #endif // end REPO_ROLE_H
66 |
67 |
--------------------------------------------------------------------------------
/src/compute/repographoptimizer.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 |
19 | #ifndef REPO_GRAPH_OPTIMIZER_H
20 | #define REPO_GRAPH_OPTIMIZER_H
21 |
22 | #include "../repocoreglobal.h"
23 | #include "../graph/repo_graph_scene.h"
24 | #include "../graph/repo_node_mesh.h"
25 | #include "../graph/repo_node_metadata.h"
26 | #include "../graph/repo_node_transformation.h"
27 |
28 | //------------------------------------------------------------------------------
29 |
30 | namespace repo {
31 | namespace core {
32 |
33 | class REPO_CORE_EXPORT RepoGraphOptimizer
34 | {
35 |
36 | public:
37 |
38 | RepoGraphOptimizer(RepoGraphScene* scene);
39 |
40 | ~RepoGraphOptimizer() {}
41 |
42 | //! Collapses all single mesh transformations in a scene graph.
43 | void collapseSingleMeshTransformations();
44 |
45 | //! Recursive collapse until not more possible.
46 | void collapseSingleMeshTransformations(RepoNodeMesh* mesh);
47 |
48 | //! Resursive collapse of transformations that have no meshes as children. Disregards
49 | void collapseZeroMeshTransformations();
50 |
51 | //! Returns processed scene.
52 | RepoGraphScene* getScene() const { return scene; }
53 |
54 | //! Returns a transformation if it is a single parent, NULL otherwise.
55 | static RepoNodeTransformation* getSingleParentTransformation(RepoNodeAbstract *node);
56 |
57 | private :
58 |
59 | RepoGraphScene* scene;
60 |
61 | }; // end class
62 |
63 | } // end namespace core
64 | } // end namespace repo
65 |
66 | #endif // REPOGRAPHOPTIMIZER_H
67 |
--------------------------------------------------------------------------------
/src/primitives/repoimage.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 |
19 | #ifndef REPO_IMAGE_H
20 | #define REPO_IMAGE_H
21 |
22 |
23 | //------------------------------------------------------------------------------
24 | #include "../repocoreglobal.h"
25 | #include "repo_binary.h"
26 | //------------------------------------------------------------------------------
27 |
28 | namespace repo {
29 | namespace core {
30 |
31 | /*!
32 | * See http://www.iana.org/assignments/media-types/media-types.xhtml#image
33 | */
34 | class REPO_CORE_EXPORT RepoImage : public RepoBinary
35 | {
36 |
37 | public:
38 |
39 | RepoImage() : RepoBinary() {}
40 |
41 | RepoImage(const mongo::BSONObj &obj) : RepoBinary(obj) {}
42 |
43 | RepoImage(const unsigned char* bytes,
44 | unsigned int bytesLength,
45 | unsigned int width,
46 | unsigned int height,
47 | const string &mediaType);
48 |
49 | ~RepoImage() {}
50 |
51 | //--------------------------------------------------------------------------
52 |
53 | //! Returns a new full (and owned) copy of the object.
54 | inline RepoImage copy() const { return RepoImage(RepoBinary::copy()); }
55 |
56 | //! Returns the height of the image if set.
57 | int getHeight() const
58 | { return getField(REPO_LABEL_HEIGHT).Int(); }
59 |
60 | //! Returns the width of the image if set.
61 | int getWidth() const
62 | { return getField(REPO_LABEL_WIDTH).Int(); }
63 |
64 |
65 | }; // end class
66 |
67 | } // end namespace core
68 | } // end namespace repo
69 |
70 | #endif // REPO_IMAGE_H
71 |
--------------------------------------------------------------------------------
/src/primitives/repoabstractlistener.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2014 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 |
19 | #ifndef REPO_ABSTRACT_LISTENER_H
20 | #define REPO_ABSTRACT_LISTENER_H
21 |
22 | //------------------------------------------------------------------------------
23 | #include "../repocoreglobal.h"
24 | //------------------------------------------------------------------------------
25 |
26 | #include
27 |
28 |
29 | namespace repo {
30 | namespace core {
31 |
32 | //------------------------------------------------------------------------------
33 | //! Pure abstract class that provides intercept call for standard messages.
34 | class REPO_CORE_EXPORT RepoAbstractListener
35 | {
36 |
37 | public:
38 |
39 | //--------------------------------------------------------------------------
40 | //
41 | // Constructor
42 | //
43 | //--------------------------------------------------------------------------
44 |
45 | //! Default empty constructor.
46 | inline RepoAbstractListener() {}
47 |
48 | //--------------------------------------------------------------------------
49 | //
50 | // Destructor
51 | //
52 | //--------------------------------------------------------------------------
53 |
54 | //! Empty pure virtual destructor for proper cleanup.
55 | /*!
56 | * \sa RepoInterceptor()
57 | */
58 | virtual ~RepoAbstractListener() = 0;
59 |
60 | virtual void messageGenerated(const std::string &) {}
61 |
62 | virtual void messageGenerated(const std::ostream *, const std::string &) {}
63 |
64 | }; // end class
65 |
66 | } // end namespace core
67 | } // end namespace repo
68 |
69 | #endif // REPO_ABSTRACT_LISTENER_H
70 |
--------------------------------------------------------------------------------
/src/primitives/repoabstractnotifier.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2014 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 |
19 | #ifndef REPO_ABSTRACT_NOTIFIER_H
20 | #define REPO_ABSTRACT_NOTIFIER_H
21 |
22 | //------------------------------------------------------------------------------
23 | #include "../repocoreglobal.h"
24 | #include "repoabstractlistener.h"
25 | //------------------------------------------------------------------------------
26 | #include
27 |
28 | namespace repo {
29 | namespace core {
30 |
31 | //------------------------------------------------------------------------------
32 |
33 | class REPO_CORE_EXPORT RepoAbstractNotifier
34 | {
35 |
36 | public:
37 |
38 | //--------------------------------------------------------------------------
39 | //
40 | // Constructor
41 | //
42 | //--------------------------------------------------------------------------
43 |
44 | //! Default empty constructor.
45 | inline RepoAbstractNotifier() {}
46 |
47 | //--------------------------------------------------------------------------
48 | //
49 | // Destructor
50 | //
51 | //--------------------------------------------------------------------------
52 |
53 | //! Empty pure virtual destructor for proper cleanup.
54 | /*!
55 | * \sa RepoAbstractNotifier()
56 | */
57 | virtual ~RepoAbstractNotifier() = 0;
58 |
59 | virtual void addListener(RepoAbstractListener *);
60 |
61 | virtual void removeListener(RepoAbstractListener *);
62 |
63 | virtual void notifyListeners(const std::string &);
64 |
65 | private:
66 |
67 | std::set listeners;
68 |
69 |
70 | }; // end class
71 |
72 | } // end namespace core
73 | } // end namespace repo
74 |
75 | #endif // REPO_ABSTRACT_NOTIFIER_H
76 |
77 |
--------------------------------------------------------------------------------
/src/diff/repo3ddiff.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2015 3D Repo Ltd
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU Affero General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU Affero General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Affero General Public License
15 | * along with this program. If not, see .
16 | */
17 |
18 | #ifndef REPO_3D_DIFF_H
19 | #define REPO_3D_DIFF_H
20 |
21 | #include
22 | #include