NDEVR
API Documentation
DrillPattern.h
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;
49 class NDEVR_DESIGN_API DrillPattern : public Model
50 {
51 public:
55 struct HoleLayout
56 {
58 NDEVR_DESIGN_API HoleLayout();
61 NDEVR_DESIGN_API HoleLayout(const JSONNode& node);
62 TranslatedString row_name_format;
63 TranslatedString hole_name_format;
64 fltp08 row_spacing;
65 fltp08 hole_spacing;
66 fltp08 row_skew;
67 uint04 row_count;
68 uint04 holes_per_row;
69 bool stagger;
73 NDEVR_DESIGN_API Vertex<3, fltp08> rowOffset(uint04 row) const;
77 NDEVR_DESIGN_API Vertex<3, fltp08> holeOffset(uint04 hole) const;
81 bool operator!=(const HoleLayout& pattern) const
82 {
83 return row_name_format != pattern.row_name_format
84 || hole_name_format != pattern.hole_name_format
85 || row_spacing != pattern.row_spacing
86 || hole_spacing != pattern.hole_spacing
87 || row_skew != pattern.row_skew
88 || row_count != pattern.row_count
89 || holes_per_row != pattern.holes_per_row
90 || stagger != pattern.stagger;
91 }
92 };
94 DrillPattern();
98 DrillPattern(const Model& root, fltp08 default_radius = Constant<fltp08>::Invalid);
102 DrillHole addCollar(TranslatedString collar_name = TranslatedString());
106 DrillHole addCollar(uint04 collar_number);
109 void setupCollar(Model& collar);
115 void addHolePath(const TranslatedString& collar_name, const TranslatedString& path_name, const Buffer<fltp08>& data, fltp08 radius = Constant<fltp08>::Invalid);
121 void addHolePath(const TranslatedString& collar_name, const TranslatedString& path_name, const Buffer<Vertex<3, fltp08>>& data, fltp08 radius = Constant<fltp08>::Invalid);
122
129 void addHolePath(const TranslatedString& row_name, const TranslatedString& collar_name, const TranslatedString& path_name, const Buffer<fltp08>& data, fltp08 radius = Constant<fltp08>::Invalid);
136 void addHolePath(const TranslatedString& row_name, const TranslatedString& collar_name, const TranslatedString& path_name, const Buffer<Vertex<3, fltp08>>& data, fltp08 radius = Constant<fltp08>::Invalid);
137
141 void setPathVisible(const TranslatedString& path, bool is_visible);
145 Model getRow(const StringView& row_name);
149 Model getRow(const TranslatedString& row_name);
153 Model addRow(const StringView& row_name);
157 Model addRow(const TranslatedString& row_name);
162 Model addRow(const uint04& row_number, bool auto_offset);
166 Model addHole(const uint04& row_number);
171 static TranslatedString DefaultRowName(uint04 row_number, TranslatedString row_name_format = TranslatedString());
177 static TranslatedString DefaultHoleName(uint04 row_number, uint04 hole_number, TranslatedString hole_name_format = TranslatedString());
178
181 HoleLayout getLayout() const;
184 bool hasRows() const;
187 uint04 rowCount() const;
190 Buffer<Model> rows() const;
193 Model unusedPool();
196 fltp08 defaultRadius() const;
197
202 void layoutPattern(const HoleLayout& layout, Buffer<Model>& added_models, Buffer<Model>& unused_models);
203
208 TranslatedString holeNamingConvention() const;
211 void setHoleNamingConvention(const TranslatedString& value);
213 void autoNameHoles();
214
217 TranslatedString rowNamingConvention() const;
220 void setRowNamingConvention(const TranslatedString& value);
222 void autoNameRows();
223
226 static constexpr StringView TypeName() { return "drill_pattern"; }
229 static constexpr StringView RowTypeName() { return "drill_pattern_row"; }
230 protected:
231 fltp08 m_default_radius;
232 };
233}
234#endif
JavaScript Object Notation or JSON is an open - standard file format that uses human - readable text ...
Definition JSONParser.h:149
A core class that represents a node on model hierarchy.
Definition Model.h:292
The primary namespace for the NDEVR SDK.
constexpr bool operator!=(const Vector< t_dims, t_type > &vec_a, const Vector< t_dims, t_type > &vec_b)
Inequality operator.
Definition Vector.hpp:673
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.