API Documentation
Loading...
Searching...
No Matches
DrillPattern.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Design
28File: DrillPattern
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/DrillHole.h>
35#if NDEVR_DRILL_HOLE
36namespace NDEVR
37{
38 class JSONNode;
39 class NDEVR_DESIGN_API DrillPattern : public Model
40 {
41 public:
42 struct HoleLayout
43 {
44 NDEVR_DESIGN_API HoleLayout();
45 NDEVR_DESIGN_API HoleLayout(const JSONNode& node);
46 TranslatedString row_name_format;
47 TranslatedString hole_name_format;
48 fltp08 row_spacing;
49 fltp08 hole_spacing;
50 fltp08 row_skew;
51 uint04 row_count;
52 uint04 holes_per_row;
53 bool stagger;
54 NDEVR_DESIGN_API Vertex<3, fltp08> rowOffset(uint04 row) const;
55 NDEVR_DESIGN_API Vertex<3, fltp08> holeOffset(uint04 hole) const;
56 bool operator!=(const HoleLayout& pattern) const
57 {
58 return row_name_format != pattern.row_name_format
59 || hole_name_format != pattern.hole_name_format
60 || row_spacing != pattern.row_spacing
61 || hole_spacing != pattern.hole_spacing
62 || row_skew != pattern.row_skew
63 || row_count != pattern.row_count
64 || holes_per_row != pattern.holes_per_row
65 || stagger != pattern.stagger;
66 }
67 };
68 DrillPattern();
69 DrillPattern(const Model& root, fltp08 default_radius = Constant<fltp08>::NaN);
70 DrillHole addCollar(TranslatedString collar_name = TranslatedString());
71 DrillHole addCollar(uint04 collar_number);
72 void setupCollar(Model& collar);
73 void addHolePath(const TranslatedString& collar_name, const TranslatedString& path_name, const Buffer<fltp08>& data, fltp08 radius = Constant<fltp08>::NaN);
74 void addHolePath(const TranslatedString& collar_name, const TranslatedString& path_name, const Buffer<Vertex<3, fltp08>>& data, fltp08 radius = Constant<fltp08>::NaN);
75
76 void addHolePath(const TranslatedString& row_name, const TranslatedString& collar_name, const TranslatedString& path_name, const Buffer<fltp08>& data, fltp08 radius = Constant<fltp08>::NaN);
77 void addHolePath(const TranslatedString& row_name, const TranslatedString& collar_name, const TranslatedString& path_name, const Buffer<Vertex<3, fltp08>>& data, fltp08 radius = Constant<fltp08>::NaN);
78
79 void setPathVisible(const TranslatedString& path, bool is_visible);
80 Model addRow(const TranslatedString& row_name);
81 Model addRow(const uint04& row_number, bool auto_offset);
82 Model addHole(const uint04& row_number);
83 static TranslatedString DefaultRowName(uint04 row_number, TranslatedString row_name_format = TranslatedString());
84 static TranslatedString DefaultHoleName(uint04 row_number, uint04 hole_number, TranslatedString hole_name_format = TranslatedString());
85
86 HoleLayout getLayout() const;
87 bool hasRows() const;
88 uint04 rowCount() const;
89 Buffer<Model> rows() const;
90 Model unusedPool();
91 fltp08 defaultRadius() const;
92
93 void layoutPattern(const HoleLayout& layout, Buffer<Model>& added_models, Buffer<Model>& unused_models);
94
95 //Uses keywords [hole_number], [row_number], [row_name], [pattern_name]
96 TranslatedString holeNamingConvension() const;
97 void setHoleNamingConvension(const TranslatedString& value);
98 void autoNameHoles();
99
100 TranslatedString rowNamingConvension() const;
101 void setRowNamingConvension(const TranslatedString& value);
102 void autoNameRows();
103
104 static constexpr const char* TypeName() { return "drill_pattern"; }
105 static constexpr const char* RowTypeName() { return "drill_pattern_row"; }
106 protected:
107 fltp08 m_default_radius;
108 };
109}
110#endif
#define NDEVR_DESIGN_API
Definition DLLInfo.h:77
bool operator!=(const VkVertexInputAttributeDescription &a, const VkVertexInputAttributeDescription &b)
Definition VulkanRenderObject.cpp:10
Definition ACIColor.h:37
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:181