API Documentation
Loading...
Searching...
No Matches
StationModel.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: StationModel
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/Model.h>
34#include <NDEVR/TextConstructor.h>
35#if NDEVR_STATION_MODEL
36namespace NDEVR
37{
38 class Text;
39 class TextConstructor;
40 class DesignObjectLookup;
41 class NDEVR_DESIGN_API StationModel : public Model
42 {
43 public:
44 enum StationLayout
45 {
46 e_line
47 , e_spiral
48 , e_block
49 };
50 enum OrientationMode
51 {
52 e_none
53 , e_angle
54 , e_back_point
55 , e_two_point
56 };
57 public:
58 StationModel();
59 explicit StationModel(const Model& model, const DynamicPointer<TextConstructor>& text_constructor = DynamicPointer<TextConstructor>());
60 void hideGrid() {};
61
62
63 void setLocation(const Vector<3, fltp08>& location);
64 Vertex<3, fltp08> getLocation() const;
65 bool isRectangular() const;
66 bool isCircular() const;
67 void setRectangular(bool rectangular, const void* lock = nullptr);
68 void setPreferredSegmentDistance(fltp08 distance);
69 void setCircular(bool circular, const void* lock = nullptr);
70 void update(const void* lock_ptr = nullptr);
71 void update(DesignObjectLookup* lookup);
72 void setFont(const Font& font);
73 fltp08 preferredSegmentDistance() const;
74
75
76
77 fltp08 stationRadius() const;
78
79 Model stationLayer() const;
80 bool areAxisLabelsVisible() const;
81 bool areDistanceLabelsVisible() const;
82 bool isDistanceLineworkVisible() const;
83 bool isAxesLineworkVisible() const;
84 void setupRectangular();
85 void setupCircular();
86 void setTextFaceCamera(bool face_camera);
87 static TranslatedString DefaultStationName(uint04 station_number);
88 static StationModel CreateDefault(DesignObjectLookup* lookup);
89 static StationModel CreateDefault(Model& parent);
90 static StationModel CreateDefault(const Buffer<Model>& other_stations, Model parent = Model());
91 static Vertex<3, fltp08> CalculateDefaultLocation(const StationModel& new_station, const Buffer<Model>& other_stations, StationLayout layout = StationLayout::e_spiral, Vector<3, fltp08> starting_offset = DefaultStationLocation());
92 static Vertex<3, fltp08> DefaultStationLocation();
93 DynamicPointer<TextConstructor> textConstructor() const;
94 void ensureModelFormat();
95 Model stationVisuals() const;
96 Text stationTitle() const;
97 Model circles() const;
98 Model distanceText() const;
99 Model boldCircles() const;
100 Model axis() const;
101 Model azimuthModel();
102 Text text0Degree();
103 Text text90Degree();
104 Text text180Degree();
105 Text text270Degree();
106 const Text text0Degree() const;
107 const Text text90Degree() const;
108 const Text text180Degree() const;
109 const Text text270Degree() const;
110 Model rectangleRoot() const;
111
112 void invalidateVisuals(const void* lock = nullptr);
113 void invalidateFont(const void* lock = nullptr);
114 static constexpr const char* TypeName() { return "station"; }
115 //If parent is row type, return row, otherwise invalid model
116 Model getRow() const;
117 Model getPattern() const;
118 uint04 getRowNumber() const;
119 uint04 getHoleNumber() const;
120 void setRowNumber(uint04 number);
121 void setHoleNumber(uint04 number);
122 void setAllowHeadingAdjustment(bool allow);
123 bool allowHeadingAdjustment() const;
124 void setAllowPlannedDeployment(bool allow);
125 bool allowPlannedDeployment() const;
126 void setAllowRelativePosition(bool allow);
127 bool allowRelativePositionAdjustment() const;
128 protected:
129 void setDistanceTextVisible(bool visible, const void* lock = nullptr);
130 void setTitleVisible(bool visible, const void* lock = nullptr);
131 void setAxesLabelsVisible(bool visible, const void* lock = nullptr);
132 void setDistanceLineworkVisible(bool visible, const void* lock = nullptr);
133 void setAxesLineworkVisible(bool visible, const void* lock = nullptr);
134
135 bool shouldShowTitle(bool is_selected) const;
136 bool shouldShowDistanceText(bool is_selected) const;
137 bool shouldShowDistanceLinework(bool is_selected) const;
138 bool shouldShowAxes(bool is_selected) const;
139 bool shouldShowAxesText(bool is_selected) const;
140
141 void updateVisualModels(bool is_selected, bool coord_space_changed, const Bounds<3, fltp08>& bounds, fltp08 station_radius, const void* lock_ptr);
142 void initializeStation();
143 void setupStationVisuals();
144 void updateTitle(const void* lock_ptr);
145 void updateAxisText();
146 void setupAxis();
147 uint04 circleGeoIndex() const;
148 void setupAzimuthModel();
149 void updateAllDistanceText(fltp08 station_radius, fltp08 epsilon, fltp08 text_size, bool force, bool selected);
150 void updateRings(fltp08 station_radius, fltp08 epsilon);
151 void updateRing(uint04 normal_index, fltp08 distance);
152 void updateBoldRing(uint04 bold_index, fltp08 distance);
153 void updateDistanceText(uint04 text_index, fltp08 distance, fltp08 bold_scale, bool make_bold, bool force);
154 protected:
155 DynamicPointer<TextConstructor> m_text_constructor;
156
157 mutable uint04 m_circle_geometry_index;
158 mutable fltp08 m_preferred_segment_distance;
159
160 };
161}
162#endif
#define NDEVR_DESIGN_API
Definition DLLInfo.h:77
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
@ e_line
Definition RangeSensor.h:38