MeshLib Documentation
Loading...
Searching...
No Matches
MRToolsLibrary.h
Go to the documentation of this file.
1#pragma once
2#include "MRMesh/MRMeshFwd.h"
3#include "exports.h"
4#include <vector>
5#include <string>
6#include <filesystem>
7
8namespace MR
9{
10
11// class for storing CNC tools
12class MRVIEWER_CLASS GcodeToolsLibrary
13{
14public:
15 MRVIEWER_API GcodeToolsLibrary( const std::string& libraryName );
16
17 // draw interface for interacting with storage (based on UI::combo)
18 MRVIEWER_API bool drawInterface();
19
20 // get selected tool as ObjectMesh
21 MRVIEWER_API const std::shared_ptr<ObjectMesh>& getToolObject();
22
23 // set object specific size for automatic resize default object
24 MRVIEWER_API void setAutoSize( float size );
25private:
26
27 // storage folder
28 std::filesystem::path getFolder_();
29 // get valid files in storage folder
30 void updateFilesList_();
31 // add new tool in storage from file with mesh
32 void addNewToolFromFile_();
33 // add new tool in storage from exist ObjectMesh
34 void addNewToolFromMesh_( const std::shared_ptr<ObjectMesh>& objMesh );
35 // draw popup with ObjectMeshes available for adding
36 void drawSelectMeshPopup_();
37 // choose mesh from storage (and load it)
38 bool loadMeshFromFile_( const std::string& filename );
39
40 std::string libraryName_;
41 std::vector<std::string> filesList_;
42 std::string selectedFileName_;
43 std::shared_ptr<ObjectMesh> toolMesh_;
44 std::shared_ptr<ObjectMesh> defaultToolMesh_; // default mesh
45 float autoSize_ = 0.f; // object specific size for automatic resize default object
46};
47
48}
Definition MRToolsLibrary.h:13
MRVIEWER_API const std::shared_ptr< ObjectMesh > & getToolObject()
MRVIEWER_API void setAutoSize(float size)
MRVIEWER_API bool drawInterface()
MRVIEWER_API GcodeToolsLibrary(const std::string &libraryName)
Definition MRCameraOrientationPlugin.h:8