MeshLib C++ Docs
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{
12
13
14struct EndMillTool;
15
17class MRVIEWER_CLASS GcodeToolsLibrary
18{
19public:
20 MRVIEWER_API GcodeToolsLibrary( const std::string& libraryName );
21
23 MRVIEWER_API bool drawInterface();
24
27 MRVIEWER_API bool drawCreateToolDialog();
28
30 [[nodiscard]] MRVIEWER_API const std::shared_ptr<ObjectMesh>& getToolObject();
31
33 [[nodiscard]] const std::shared_ptr<EndMillTool>& getEndMillTool() const { return endMillTool_; }
34
36 MRVIEWER_API void setAutoSize( float size );
37private:
38
40 std::filesystem::path getFolder_();
42 void updateFilesList_();
44 void addNewToolFromFile_();
46 void addNewToolFromMesh_( const std::shared_ptr<ObjectMesh>& objMesh );
48 void addNewTool_( const std::string& name, const EndMillTool& tool );
50 void removeSelectedTool_();
52 void drawSelectMeshPopup_();
54 bool loadFromFile_( const std::string& filename );
55
56 std::string libraryName_;
57 std::vector<std::string> filesList_;
58 std::string selectedFileName_;
59 std::shared_ptr<ObjectMesh> toolMesh_;
60 std::shared_ptr<ObjectMesh> defaultToolMesh_;
61 std::shared_ptr<EndMillTool> endMillTool_;
62 float autoSize_ = 0.f;
63
65 bool createToolDialogIsOpen_ = false;
66 std::string createToolName_ = "Flat End Mill D2";
67 int createToolType_ = 0;
68 float createToolLength_ = 8.f;
69 float createToolDiameter_ = 2.f;
70 float createToolCornerRadius_ = 0.5f;
71 float createToolCuttingAngle_ = 90.f;
72 float createToolEndDiameter_ = 0.f;
73};
74
75}
class for storing CNC tools
Definition MRToolsLibrary.h:18
MRVIEWER_API const std::shared_ptr< ObjectMesh > & getToolObject()
get selected tool as ObjectMesh
MRVIEWER_API void setAutoSize(float size)
set object specific size for automatic resize default object
MRVIEWER_API bool drawInterface()
draw interface for interacting with storage (based on UI::combo)
MRVIEWER_API GcodeToolsLibrary(const std::string &libraryName)
MRVIEWER_API bool drawCreateToolDialog()
const std::shared_ptr< EndMillTool > & getEndMillTool() const
get selected tool as EndMillTool (if available)
Definition MRToolsLibrary.h:33
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
end mill tool specifications
Definition MREndMill.h:42