{"action":"created","comment":{"url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/comments/69463173","id":69463173,"diff_hunk":"@@ -57,45 +57,135 @@ class Listener : public Arcus::SocketListener\n     }\n };\n \n+template <typename T>\n+class SliceDataStruct\n+{\n+public:\n+    SliceDataStruct( const SliceDataStruct& ) = delete;\n+    SliceDataStruct& operator=( const SliceDataStruct& ) = delete;\n+\n+    SliceDataStruct()\n+        : sliced_objects(0)\n+        , current_layer_count(0)\n+        , current_layer_offset(0)\n+    { }\n+\n+    // Number of sliced objects for this sliced object list\n+    int sliced_objects;\n+\n+    // Number of layers sent to the front end so far\n+    // Used for incrementing the current layer in one at a time mode\n+    int current_layer_count;\n+    int current_layer_offset;\n+\n+    std::unordered_map<int, std::shared_ptr<T>> slice_data;\n+};\n+\n class CommandSocket::Private\n {\n public:\n     Private()\n         : socket(nullptr)\n         , object_count(0)\n-        , sliced_objects(0)\n-        , current_layer_count(0)\n-        , current_layer_offset(0)\n     { }\n \n     std::shared_ptr<cura::proto::Layer> getLayerById(int id);\n \n+    std::shared_ptr<cura::proto::LayerOptimized> getOptimizedLayerById(int id);\n+\n     Arcus::Socket* socket;\n     \n     // Number of objects that need to be sliced\n     int object_count;\n \n-    // Number of sliced objects for this sliced object list\n-    int sliced_objects;\n-\n-    // Number of layers sent to the front end so far\n-    // Used for incrementing the current layer in one at a time mode\n-    int current_layer_count;\n-    int current_layer_offset;\n-\n     std::string temp_gcode_file;\n     std::ostringstream gcode_output_stream;\n     \n     // Print object that olds one or more meshes that need to be sliced. \n     std::vector< std::shared_ptr<MeshGroup> > objects_to_slice;\n \n-    std::unordered_map<int, std::shared_ptr<cura::proto::Layer>> sliced_layers;\n+    SliceDataStruct<cura::proto::Layer> sliced_layers;\n+    SliceDataStruct<cura::proto::LayerOptimized> optimized_layers;\n+};\n+\n+class CommandSocket::PathCompiler","path":"src/commandSocket.cpp","position":67,"original_position":67,"commit_id":"c202d1b47a6b1539fe2b9b8c659e84d210ad4569","original_commit_id":"c202d1b47a6b1539fe2b9b8c659e84d210ad4569","user":{"login":"BagelOrb","id":8895761,"avatar_url":"https://avatars.githubusercontent.com/u/8895761?v=3","gravatar_id":"","url":"https://api.github.com/users/BagelOrb","html_url":"https://github.com/BagelOrb","followers_url":"https://api.github.com/users/BagelOrb/followers","following_url":"https://api.github.com/users/BagelOrb/following{/other_user}","gists_url":"https://api.github.com/users/BagelOrb/gists{/gist_id}","starred_url":"https://api.github.com/users/BagelOrb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BagelOrb/subscriptions","organizations_url":"https://api.github.com/users/BagelOrb/orgs","repos_url":"https://api.github.com/users/BagelOrb/repos","events_url":"https://api.github.com/users/BagelOrb/events{/privacy}","received_events_url":"https://api.github.com/users/BagelOrb/received_events","type":"User","site_admin":false},"body":"Please add documentation for this class.","created_at":"2016-07-04T14:11:33Z","updated_at":"2016-07-04T14:11:33Z","html_url":"https://github.com/Ultimaker/CuraEngine/pull/354#discussion_r69463173","pull_request_url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/354","_links":{"self":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/comments/69463173"},"html":{"href":"https://github.com/Ultimaker/CuraEngine/pull/354#discussion_r69463173"},"pull_request":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/354"}}},"pull_request":{"url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/354","id":73771829,"html_url":"https://github.com/Ultimaker/CuraEngine/pull/354","diff_url":"https://github.com/Ultimaker/CuraEngine/pull/354.diff","patch_url":"https://github.com/Ultimaker/CuraEngine/pull/354.patch","issue_url":"https://api.github.com/repos/Ultimaker/CuraEngine/issues/354","number":354,"state":"open","locked":false,"title":"Adding polygon packing feature and change the structure of the layer …","user":{"login":"Johan3DV","id":19808663,"avatar_url":"https://avatars.githubusercontent.com/u/19808663?v=3","gravatar_id":"","url":"https://api.github.com/users/Johan3DV","html_url":"https://github.com/Johan3DV","followers_url":"https://api.github.com/users/Johan3DV/followers","following_url":"https://api.github.com/users/Johan3DV/following{/other_user}","gists_url":"https://api.github.com/users/Johan3DV/gists{/gist_id}","starred_url":"https://api.github.com/users/Johan3DV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Johan3DV/subscriptions","organizations_url":"https://api.github.com/users/Johan3DV/orgs","repos_url":"https://api.github.com/users/Johan3DV/repos","events_url":"https://api.github.com/users/Johan3DV/events{/privacy}","received_events_url":"https://api.github.com/users/Johan3DV/received_events","type":"User","site_admin":false},"body":"…data sent to the front-end to speed up the layer view\r\n\r\nNeeds the corresponding pull requests to Uranium and Cura to work.","created_at":"2016-06-14T16:28:37Z","updated_at":"2016-07-04T14:11:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f7c22dcecc5aebe983981429cd9f2e745e48cc5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/354/commits","review_comments_url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/354/comments","review_comment_url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ultimaker/CuraEngine/issues/354/comments","statuses_url":"https://api.github.com/repos/Ultimaker/CuraEngine/statuses/c202d1b47a6b1539fe2b9b8c659e84d210ad4569","head":{"label":"Johan3DV:layerview_dev","ref":"layerview_dev","sha":"c202d1b47a6b1539fe2b9b8c659e84d210ad4569","user":{"login":"Johan3DV","id":19808663,"avatar_url":"https://avatars.githubusercontent.com/u/19808663?v=3","gravatar_id":"","url":"https://api.github.com/users/Johan3DV","html_url":"https://github.com/Johan3DV","followers_url":"https://api.github.com/users/Johan3DV/followers","following_url":"https://api.github.com/users/Johan3DV/following{/other_user}","gists_url":"https://api.github.com/users/Johan3DV/gists{/gist_id}","starred_url":"https://api.github.com/users/Johan3DV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Johan3DV/subscriptions","organizations_url":"https://api.github.com/users/Johan3DV/orgs","repos_url":"https://api.github.com/users/Johan3DV/repos","events_url":"https://api.github.com/users/Johan3DV/events{/privacy}","received_events_url":"https://api.github.com/users/Johan3DV/received_events","type":"User","site_admin":false},"repo":{"id":60655396,"name":"CuraEngine","full_name":"Johan3DV/CuraEngine","owner":{"login":"Johan3DV","id":19808663,"avatar_url":"https://avatars.githubusercontent.com/u/19808663?v=3","gravatar_id":"","url":"https://api.github.com/users/Johan3DV","html_url":"https://github.com/Johan3DV","followers_url":"https://api.github.com/users/Johan3DV/followers","following_url":"https://api.github.com/users/Johan3DV/following{/other_user}","gists_url":"https://api.github.com/users/Johan3DV/gists{/gist_id}","starred_url":"https://api.github.com/users/Johan3DV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Johan3DV/subscriptions","organizations_url":"https://api.github.com/users/Johan3DV/orgs","repos_url":"https://api.github.com/users/Johan3DV/repos","events_url":"https://api.github.com/users/Johan3DV/events{/privacy}","received_events_url":"https://api.github.com/users/Johan3DV/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Johan3DV/CuraEngine","description":"CuraEngine is a powerful, fast and robust engine for processing 3D models into 3D printing instruction for Ultimaker and other GCode based 3D printers. It is part of the larger open source project called \"Cura\".","fork":true,"url":"https://api.github.com/repos/Johan3DV/CuraEngine","forks_url":"https://api.github.com/repos/Johan3DV/CuraEngine/forks","keys_url":"https://api.github.com/repos/Johan3DV/CuraEngine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Johan3DV/CuraEngine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Johan3DV/CuraEngine/teams","hooks_url":"https://api.github.com/repos/Johan3DV/CuraEngine/hooks","issue_events_url":"https://api.github.com/repos/Johan3DV/CuraEngine/issues/events{/number}","events_url":"https://api.github.com/repos/Johan3DV/CuraEngine/events","assignees_url":"https://api.github.com/repos/Johan3DV/CuraEngine/assignees{/user}","branches_url":"https://api.github.com/repos/Johan3DV/CuraEngine/branches{/branch}","tags_url":"https://api.github.com/repos/Johan3DV/CuraEngine/tags","blobs_url":"https://api.github.com/repos/Johan3DV/CuraEngine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Johan3DV/CuraEngine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Johan3DV/CuraEngine/git/refs{/sha}","trees_url":"https://api.github.com/repos/Johan3DV/CuraEngine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Johan3DV/CuraEngine/statuses/{sha}","languages_url":"https://api.github.com/repos/Johan3DV/CuraEngine/languages","stargazers_url":"https://api.github.com/repos/Johan3DV/CuraEngine/stargazers","contributors_url":"https://api.github.com/repos/Johan3DV/CuraEngine/contributors","subscribers_url":"https://api.github.com/repos/Johan3DV/CuraEngine/subscribers","subscription_url":"https://api.github.com/repos/Johan3DV/CuraEngine/subscription","commits_url":"https://api.github.com/repos/Johan3DV/CuraEngine/commits{/sha}","git_commits_url":"https://api.github.com/repos/Johan3DV/CuraEngine/git/commits{/sha}","comments_url":"https://api.github.com/repos/Johan3DV/CuraEngine/comments{/number}","issue_comment_url":"https://api.github.com/repos/Johan3DV/CuraEngine/issues/comments{/number}","contents_url":"https://api.github.com/repos/Johan3DV/CuraEngine/contents/{+path}","compare_url":"https://api.github.com/repos/Johan3DV/CuraEngine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Johan3DV/CuraEngine/merges","archive_url":"https://api.github.com/repos/Johan3DV/CuraEngine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Johan3DV/CuraEngine/downloads","issues_url":"https://api.github.com/repos/Johan3DV/CuraEngine/issues{/number}","pulls_url":"https://api.github.com/repos/Johan3DV/CuraEngine/pulls{/number}","milestones_url":"https://api.github.com/repos/Johan3DV/CuraEngine/milestones{/number}","notifications_url":"https://api.github.com/repos/Johan3DV/CuraEngine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Johan3DV/CuraEngine/labels{/name}","releases_url":"https://api.github.com/repos/Johan3DV/CuraEngine/releases{/id}","deployments_url":"https://api.github.com/repos/Johan3DV/CuraEngine/deployments","created_at":"2016-06-08T00:13:16Z","updated_at":"2016-06-08T00:13:18Z","pushed_at":"2016-06-15T22:13:55Z","git_url":"git://github.com/Johan3DV/CuraEngine.git","ssh_url":"git@github.com:Johan3DV/CuraEngine.git","clone_url":"https://github.com/Johan3DV/CuraEngine.git","svn_url":"https://github.com/Johan3DV/CuraEngine","homepage":"https://ultimaker.com/en/products/cura-software","size":39840,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Ultimaker:master","ref":"master","sha":"4bce36550f9ef5d25e9fa5a0137c532d5a55fea8","user":{"login":"Ultimaker","id":499557,"avatar_url":"https://avatars.githubusercontent.com/u/499557?v=3","gravatar_id":"","url":"https://api.github.com/users/Ultimaker","html_url":"https://github.com/Ultimaker","followers_url":"https://api.github.com/users/Ultimaker/followers","following_url":"https://api.github.com/users/Ultimaker/following{/other_user}","gists_url":"https://api.github.com/users/Ultimaker/gists{/gist_id}","starred_url":"https://api.github.com/users/Ultimaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ultimaker/subscriptions","organizations_url":"https://api.github.com/users/Ultimaker/orgs","repos_url":"https://api.github.com/users/Ultimaker/repos","events_url":"https://api.github.com/users/Ultimaker/events{/privacy}","received_events_url":"https://api.github.com/users/Ultimaker/received_events","type":"Organization","site_admin":false},"repo":{"id":8556864,"name":"CuraEngine","full_name":"Ultimaker/CuraEngine","owner":{"login":"Ultimaker","id":499557,"avatar_url":"https://avatars.githubusercontent.com/u/499557?v=3","gravatar_id":"","url":"https://api.github.com/users/Ultimaker","html_url":"https://github.com/Ultimaker","followers_url":"https://api.github.com/users/Ultimaker/followers","following_url":"https://api.github.com/users/Ultimaker/following{/other_user}","gists_url":"https://api.github.com/users/Ultimaker/gists{/gist_id}","starred_url":"https://api.github.com/users/Ultimaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ultimaker/subscriptions","organizations_url":"https://api.github.com/users/Ultimaker/orgs","repos_url":"https://api.github.com/users/Ultimaker/repos","events_url":"https://api.github.com/users/Ultimaker/events{/privacy}","received_events_url":"https://api.github.com/users/Ultimaker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ultimaker/CuraEngine","description":"CuraEngine is a powerful, fast and robust engine for processing 3D models into 3D printing instruction for Ultimaker and other GCode based 3D printers. It is part of the larger open source project called \"Cura\".","fork":false,"url":"https://api.github.com/repos/Ultimaker/CuraEngine","forks_url":"https://api.github.com/repos/Ultimaker/CuraEngine/forks","keys_url":"https://api.github.com/repos/Ultimaker/CuraEngine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ultimaker/CuraEngine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ultimaker/CuraEngine/teams","hooks_url":"https://api.github.com/repos/Ultimaker/CuraEngine/hooks","issue_events_url":"https://api.github.com/repos/Ultimaker/CuraEngine/issues/events{/number}","events_url":"https://api.github.com/repos/Ultimaker/CuraEngine/events","assignees_url":"https://api.github.com/repos/Ultimaker/CuraEngine/assignees{/user}","branches_url":"https://api.github.com/repos/Ultimaker/CuraEngine/branches{/branch}","tags_url":"https://api.github.com/repos/Ultimaker/CuraEngine/tags","blobs_url":"https://api.github.com/repos/Ultimaker/CuraEngine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ultimaker/CuraEngine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ultimaker/CuraEngine/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ultimaker/CuraEngine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ultimaker/CuraEngine/statuses/{sha}","languages_url":"https://api.github.com/repos/Ultimaker/CuraEngine/languages","stargazers_url":"https://api.github.com/repos/Ultimaker/CuraEngine/stargazers","contributors_url":"https://api.github.com/repos/Ultimaker/CuraEngine/contributors","subscribers_url":"https://api.github.com/repos/Ultimaker/CuraEngine/subscribers","subscription_url":"https://api.github.com/repos/Ultimaker/CuraEngine/subscription","commits_url":"https://api.github.com/repos/Ultimaker/CuraEngine/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ultimaker/CuraEngine/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ultimaker/CuraEngine/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ultimaker/CuraEngine/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ultimaker/CuraEngine/contents/{+path}","compare_url":"https://api.github.com/repos/Ultimaker/CuraEngine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ultimaker/CuraEngine/merges","archive_url":"https://api.github.com/repos/Ultimaker/CuraEngine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ultimaker/CuraEngine/downloads","issues_url":"https://api.github.com/repos/Ultimaker/CuraEngine/issues{/number}","pulls_url":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls{/number}","milestones_url":"https://api.github.com/repos/Ultimaker/CuraEngine/milestones{/number}","notifications_url":"https://api.github.com/repos/Ultimaker/CuraEngine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ultimaker/CuraEngine/labels{/name}","releases_url":"https://api.github.com/repos/Ultimaker/CuraEngine/releases{/id}","deployments_url":"https://api.github.com/repos/Ultimaker/CuraEngine/deployments","created_at":"2013-03-04T14:12:08Z","updated_at":"2016-07-03T18:48:10Z","pushed_at":"2016-07-04T11:54:52Z","git_url":"git://github.com/Ultimaker/CuraEngine.git","ssh_url":"git@github.com:Ultimaker/CuraEngine.git","clone_url":"https://github.com/Ultimaker/CuraEngine.git","svn_url":"https://github.com/Ultimaker/CuraEngine","homepage":"https://ultimaker.com/en/products/cura-software","size":42448,"stargazers_count":368,"watchers_count":368,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":315,"mirror_url":null,"open_issues_count":68,"forks":315,"open_issues":68,"watchers":368,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/354"},"html":{"href":"https://github.com/Ultimaker/CuraEngine/pull/354"},"issue":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/issues/354"},"comments":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/issues/354/comments"},"review_comments":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/354/comments"},"review_comment":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/pulls/354/commits"},"statuses":{"href":"https://api.github.com/repos/Ultimaker/CuraEngine/statuses/c202d1b47a6b1539fe2b9b8c659e84d210ad4569"}}}}
{"actor":{"display_login":"BagelOrb"}}