API Documentation
Loading...
Searching...
No Matches
GripsModel.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: GripsModel
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/Model.h>
34#if NDEVR_GRIPS
35namespace NDEVR
36{
37 class ModelEditController;
38 class SnapPoint;
39 class DesignObjectLookup;
40 class NDEVR_DESIGN_API GripsModel : public Model
41 {
42 public:
43 enum GripMode
44 {
45 e_no_grips
46 , e_vertex_offset_grips
47 , e_model_scale_grips
48 , e_model_horizontal_offset_grips
49 , e_model_vertical_offset_grips
50 , e_model_rotate_grips
51 , e_default_grips
52 };
53 public:
54 GripsModel(const Model& model);
55 bool processSelection(SelectionInfo& info) const;
56 void processSnapPoint(SnapPoint& point, DesignObjectLookup* lookup, SelectionInfo& info) const;
57#if NDEVR_VIEWPORT
58 GripMode processGripSelection(const SnapPoint& point, const void* lock_ptr);
59 GripMode processGripClicked(const SnapPoint& point, ModelEditController& controller, const void* lock_ptr);
60#endif
61 static UUID CursorID();
62 static constexpr const char* TypeName() { return "grips_model"; }
63 Model target() const;
64 void attachTo(const Model& model);
65 void detatch();
66 void setToDefaultGrips(const void* lock = nullptr);
67 void setToHighlight(const void* lock = nullptr);
68 void setColor(const RGBColor& color, const void* lock = nullptr);
69 Ray<3, fltp08> getIndexNormal(uint04 index);
70 Ray<3, fltp08> getIndexTangent(uint04 index);
71 static RGBColor GripColor(GripMode mode);
72 BitFlag activeGripFlag() const;
73 void setActiveGripFlag(BitFlag flag, const void* lock_ptr = nullptr);
74 protected:
75
76 void setupBoundsModel();
77 void setupDiagonalExpandGrips();
78 void setupExpandGrips();
79 void setupRotationGrips();
80 void setupOffsetGrips(bool horizontal);
81 void setupVertexGrips();
82 void hideAllGrips() const;
83 void showGrip(uint04 index) const;
84 protected:
85 Model m_bounds_model;
86 Model m_diagonal_expand_grips;
87 Model m_expand_grips;
88 Model m_rotation_grips;
89 Model m_horizontal_offset_grips;
90 Model m_vertical_offset_grips;
91 Model m_vertex_grip;
92 static const constexpr uint04 rotate_segs = 128;
93 };
94}
95#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