API Documentation
Loading...
Searching...
No Matches
SnapsManager.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: SnapsManager
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/SnapPoint.h>
35#include <NDEVR/LineSegment.h>
36#include <NDEVR/Triangle.h>
37#include <NDEVR/Dictionary.h>
38#include <NDEVR/UUID.h>
39#include <NDEVR/Buffer.h>
40namespace NDEVR
41{
42 class DesignObjectLookup;
43 class SelectionInfo;
44 class String;
45
47 {
48 public:
50 void setSensitivity(SnapPoint::SnapLocationType type, fltp08 sensitivity);
51 void setPriority(SnapPoint::SnapLocationType type, uint04 priority);
52 SnapPoint getSnapPoint(const DesignObjectLookup* manager, const SelectionInfo& info, bool use_worldspace) const;
53 void getSnapPoint(SnapPoint& current, const DesignObjectLookup* manager, const SelectionInfo& info, bool use_worldspace) const;
54 SnapPoint getSnapLinePoint(const DesignObjectLookup* manager, const SelectionInfo& info, const SnapPoint& last, const Buffer<std::pair<UUID, uint04>>& locations_of_interest, bool use_worldspace) const;
55 void getSnapLinePoint(SnapPoint& current, const DesignObjectLookup* manager, const SelectionInfo& info, const SnapPoint& last, const Buffer<std::pair<UUID, uint04>>& locations_of_interest, bool use_worldspace) const;
56
57 bool checkVertex(SnapPoint::SnapLocationType snap, const SelectionInfo& info, const Vertex<3, fltp08>& point, SnapPoint& closest_snap, UUID id, uint04 index) const;
58 bool checkLine(const SelectionInfo& info, const LineSegment<3, fltp08>& seg, bool infinite_length, SnapPoint& closest_snap, SnapPoint::SnapLocationType line_snap, SnapPoint::SnapLocationType edge_snap, UUID id, uint04 index, bool is_smooth) const;
59 bool checkTriangle(const SelectionInfo& info, const Triangle<3, fltp08>& tri, SnapPoint& closest_snap, UUID id, uint04 index, bool is_smooth) const;
60
61 bool isSnapEnabled(SnapPoint::SnapLocationType snap) const { return m_enabled_snaps[snap]; }
62 void setSnapEnabled(SnapPoint::SnapLocationType snap, bool use_snap) { m_enabled_snaps[snap] = use_snap; }
63 void setAllEnabled(bool use_snap);
64 static String SnapIcon(SnapPoint::SnapLocationType snap_type);
65 protected:
69 };
70}
71
72
73
#define NDEVR_DESIGN_API
Definition DLLInfo.h:77
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition DesignObjectLookup.h:61
Definition Dictionary.h:48
A line segment represented by two vertices, a start and end.
Definition Line.hpp:55
Definition Selector.h:46
Definition SnapPoint.h:41
SnapLocationType
Definition SnapPoint.h:44
Definition SnapsManager.h:47
Dictionary< SnapPoint::SnapLocationType, fltp08 > m_sensitivity
Definition SnapsManager.h:67
Dictionary< SnapPoint::SnapLocationType, uint04 > m_priority
Definition SnapsManager.h:68
void setSnapEnabled(SnapPoint::SnapLocationType snap, bool use_snap)
Definition SnapsManager.h:62
bool isSnapEnabled(SnapPoint::SnapLocationType snap) const
Definition SnapsManager.h:61
Dictionary< SnapPoint::SnapLocationType, bool > m_enabled_snaps
Definition SnapsManager.h:66
Definition String.h:40
Definition Triangle.hpp:143
Definition UUID.h:66
A vertex.
Definition Vertex.hpp:54
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