NDEVR
API Documentation
StationModel.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: StationModel
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/Model.h>
34#if NDEVR_STATION_MODEL
35namespace NDEVR
36{
37 class Text;
38 class TextConstructor;
52 class NDEVR_DESIGN_API StationModel : public Model
53 {
54 public:
58 enum StationLayout
59 {
60 e_line
61 , e_spiral
62 , e_block
63 };
67 enum OrientationMode
68 {
69 e_none
70 , e_angle
71 , e_back_point
72 , e_two_point
73 };
74 public:
78 StationModel();
84 explicit StationModel(const Model& model, const void* lock = nullptr);
88 void hideGrid() {};
93 void setLocation(const Vector<3, fltp08>& location);
98 Vertex<3, fltp08> getLocation() const;
103 bool isRectangular() const;
108 bool isCircular() const;
114 void setRectangular(bool rectangular, const void* lock = nullptr);
119 void setPreferredSegmentDistance(fltp08 distance);
125 void setCircular(bool circular, const void* lock = nullptr);
130 void updateStation(const void* lock_ptr = nullptr);
135 void updateStation(DesignObjectLookup* lookup);
140 void setFont(const Font& font);
145 fltp08 preferredSegmentDistance() const;
150 fltp08 stationRadius() const;
155 Model stationLayer() const;
160 bool areAxisLabelsVisible() const;
165 bool areDistanceLabelsVisible() const;
170 bool isDistanceLineworkVisible() const;
175 bool isAxesLineworkVisible() const;
176
181 void setTextFaceCamera(bool face_camera);
187 static TranslatedString DefaultStationName(uint04 station_number);
194 static StationModel CreateDefault(Model target, DesignObjectLookup* lookup);
200 static StationModel CreateDefault(Model target);
207 static StationModel CreateDefault(Model target, const Buffer<Model>& other_stations);
216 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());
221 static Vertex<3, fltp08> DefaultStationLocation();
226 void ensureModelFormat();
231 Model stationVisuals() const;
236 Text stationTitle() const;
241 Model circles() const;
246 Model distanceText() const;
251 Model boldCircles() const;
256 Model axis() const;
261 Model azimuthModel();
266 Text text0Degree();
271 Text text90Degree();
276 Text text180Degree();
281 Text text270Degree();
286 const Text text0Degree() const;
291 const Text text90Degree() const;
296 const Text text180Degree() const;
301 const Text text270Degree() const;
306 Model rectangleRoot() const;
311 void invalidateVisuals(const void* lock = nullptr);
316 void invalidateFont(const void* lock = nullptr);
321 static constexpr StringView TypeName() { return StringView("station"); }
326 Model getRow() const;
331 Model getPattern() const;
336 uint04 getRowNumber() const;
341 uint04 getHoleNumber() const;
346 void setRowNumber(uint04 number);
351 void setHoleNumber(uint04 number);
356 void setAllowHeadingAdjustment(bool allow);
361 bool allowHeadingAdjustment() const;
366 void setAllowPlannedDeployment(bool allow);
371 bool allowPlannedDeployment() const;
376 void setAllowRelativePosition(bool allow);
381 bool allowRelativePositionAdjustment() const;
382 private:
386 void setupRectangular();
390 void setupCircular();
396 void setDistanceTextVisible(bool visible, const void* lock = nullptr);
402 void setTitleVisible(bool visible, const void* lock = nullptr);
408 void setAxesLabelsVisible(bool visible, const void* lock = nullptr);
414 void setDistanceLineworkVisible(bool visible, const void* lock = nullptr);
420 void setAxesLineworkVisible(bool visible, const void* lock = nullptr);
426 bool shouldShowTitle(bool is_selected) const;
432 bool shouldShowDistanceText(bool is_selected) const;
438 bool shouldShowDistanceLinework(bool is_selected) const;
444 bool shouldShowAxes(bool is_selected) const;
450 bool shouldShowAxesText(bool is_selected) const;
459 void updateVisualModels(bool is_selected, bool coord_space_changed, const Bounds<3, fltp08>& bounds, fltp08 station_radius, const void* lock_ptr);
463 void initializeStation();
467 void setupStationVisuals();
472 void updateTitle(const void* lock_ptr);
476 void updateAxisText();
480 void setupAxis();
485 uint04 circleGeoIndex() const;
489 void setupAzimuthModel();
498 void updateAllDistanceText(fltp08 station_radius, fltp08 epsilon, fltp08 text_size, bool force, bool selected);
504 void updateRings(fltp08 station_radius, fltp08 epsilon);
510 void updateRing(uint04 normal_index, fltp08 distance);
516 void updateBoldRing(uint04 bold_index, fltp08 distance);
525 void updateDistanceText(uint04 text_index, fltp08 distance, fltp08 bold_scale, bool make_bold, bool force);
526 private:
527 mutable uint04 m_circle_geometry_index;
528 mutable fltp08 m_preferred_segment_distance;
529
530 };
531}
532#endif
A core class where all Design Objects including models, materials, and geometries are stored.
A core class that represents a node on model hierarchy.
Definition Model.h:292
The primary namespace for the NDEVR SDK.
@ e_angle
Angular measurement (e.g., degrees, radians).
Definition Unit.h:17
@ e_none
No defined value type.
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.
@ e_line
A single-line range sensor measuring along one axis.
Definition RangeSensor.h:41