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 /**--------------------------------------------------------------------------------------------------
40 \brief A Model which represents a series of DrillHoles layed out in a specific pattern.
41 **/
42 class NDEVR_DESIGN_API DrillPattern : public Model
43 {
44 public:
45 struct HoleLayout
46 {
47 NDEVR_DESIGN_API HoleLayout();
48 NDEVR_DESIGN_API HoleLayout(const JSONNode& node);
49 TranslatedString row_name_format;
50 TranslatedString hole_name_format;
51 fltp08 row_spacing;
52 fltp08 hole_spacing;
53 fltp08 row_skew;
54 uint04 row_count;
55 uint04 holes_per_row;
56 bool stagger;
57 NDEVR_DESIGN_API Vertex<3, fltp08> rowOffset(uint04 row) const;
58 NDEVR_DESIGN_API Vertex<3, fltp08> holeOffset(uint04 hole) const;
59 bool operator!=(const HoleLayout& pattern) const
60 {
61 return row_name_format != pattern.row_name_format
62 || hole_name_format != pattern.hole_name_format
63 || row_spacing != pattern.row_spacing
64 || hole_spacing != pattern.hole_spacing
65 || row_skew != pattern.row_skew
66 || row_count != pattern.row_count
67 || holes_per_row != pattern.holes_per_row
68 || stagger != pattern.stagger;
69 }
70 };
71 DrillPattern();
72 DrillPattern(const Model& root, fltp08 default_radius = Constant<fltp08>::Invalid);
73 DrillHole addCollar(TranslatedString collar_name = TranslatedString());
74 DrillHole addCollar(uint04 collar_number);
75 void setupCollar(Model& collar);
76 void addHolePath(const TranslatedString& collar_name, const TranslatedString& path_name, const Buffer<fltp08>& data, fltp08 radius = Constant<fltp08>::Invalid);
77 void addHolePath(const TranslatedString& collar_name, const TranslatedString& path_name, const Buffer<Vertex<3, fltp08>>& data, fltp08 radius = Constant<fltp08>::Invalid);
78
79 void addHolePath(const TranslatedString& row_name, const TranslatedString& collar_name, const TranslatedString& path_name, const Buffer<fltp08>& data, fltp08 radius = Constant<fltp08>::Invalid);
80 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);
81
82 void setPathVisible(const TranslatedString& path, bool is_visible);
83 Model addRow(const TranslatedString& row_name);
84 Model addRow(const uint04& row_number, bool auto_offset);
85 Model addHole(const uint04& row_number);
86 static TranslatedString DefaultRowName(uint04 row_number, TranslatedString row_name_format = TranslatedString());
87 static TranslatedString DefaultHoleName(uint04 row_number, uint04 hole_number, TranslatedString hole_name_format = TranslatedString());
88
89 HoleLayout getLayout() const;
90 bool hasRows() const;
91 uint04 rowCount() const;
92 Buffer<Model> rows() const;
93 Model unusedPool();
94 fltp08 defaultRadius() const;
95
96 void layoutPattern(const HoleLayout& layout, Buffer<Model>& added_models, Buffer<Model>& unused_models);
97
98 //Uses keywords [hole_number], [row_number], [row_name], [pattern_name]
99 TranslatedString holeNamingConvension() const;
100 void setHoleNamingConvension(const TranslatedString& value);
101 void autoNameHoles();
102
103 TranslatedString rowNamingConvension() const;
104 void setRowNamingConvension(const TranslatedString& value);
105 void autoNameRows();
106
107 static constexpr const char* TypeName() { return "drill_pattern"; }
108 static constexpr const char* RowTypeName() { return "drill_pattern_row"; }
109 protected:
110 fltp08 m_default_radius;
111 };
112}
113#endif
#define NDEVR_DESIGN_API
Definition DLLInfo.h:55
bool operator!=(const VkVertexInputAttributeDescription &a, const VkVertexInputAttributeDescription &b)
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:96
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149