PeriDyno 1.0.0
Loading...
Searching...
No Matches
QuadPickerNode.h
Go to the documentation of this file.
1#pragma once
2#include "Node.h"
3#include "Topology/QuadSet.h"
9
10namespace dyno
11{
12 template<typename TDataType>
13 class QuadPickerNode : public Node
14 {
16 public:
17 typedef typename TDataType::Real Real;
18 typedef typename TDataType::Coord Coord;
19
21
22 DEF_ARRAY_STATE(int, QuadIndex, DeviceType::GPU, "");
23 DEF_ARRAY_STATE(int, EdgeIndex, DeviceType::GPU, "");
24 DEF_ARRAY_STATE(int, PointIndex, DeviceType::GPU, "");
25 DEF_ARRAY_STATE(int, Sur2PointIndex, DeviceType::GPU, "");
26
27 DECLARE_ENUM(PickingElementTypeSelection,
28 Surface = 0,
29 Edge = 1,
30 Point = 2,
31 All = 3
32 );
33
34 DEF_ENUM(PickingElementTypeSelection, PickingElementType, PickingElementTypeSelection::All, "");
35
36 DECLARE_ENUM(PickingTypeSelection,
37 Click = 0,
38 Drag = 1,
39 Both = 2
40 );
41
42 DEF_ENUM(PickingTypeSelection, PickingType, PickingTypeSelection::Both, "");
43
44 DECLARE_ENUM(MultiSelectionType,
45 OR = 0,
46 XOR = 1,
47 C = 2
48 );
49
50 DEF_ENUM(MultiSelectionType, MultiSelectionType, MultiSelectionType::OR, "");
51
52 DEF_VAR(bool, ToggleFlood, false, "The toggle of surface flood selection");
53
54 DEF_VAR(bool, ToggleVisibleFilter, true, "The toggle of visible filter");
55
56 DEF_VAR(bool, ToggleIndexOutput, true, "The toggle of index output");
57
58 DEF_VAR(Real, FloodAngle, 1.0f, "The angle limit of surface flood selection");
59
60 DEF_VAR(Real, InteractionRadius, 0.002f, "The radius of interaction");
61
62 DEF_VAR(Real, PointSelectedSize, 0.006f, "");
63 DEF_VAR(Real, PointOtherSize, 0.005f, "");
64
65 DEF_VAR(Real, EdgeSelectedSize, 0.002f, "");
66 DEF_VAR(Real, EdgeOtherSize, 0.0015, "");
67
69 ~QuadPickerNode() override;
70
71 std::string getNodeType();
72
73 void resetStates() override;
74
76 void changePickingType();
78
79 private:
80 std::shared_ptr<SurfaceInteraction<TDataType>> surfaceInteractor;
81 std::shared_ptr<EdgeInteraction<TDataType>> edgeInteractor;
82 std::shared_ptr<PointInteraction<TDataType>> pointInteractor;
83 std::shared_ptr<QuadSetToTriangleSet<TDataType>> mapper;
84 };
85}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
DEF_VAR(bool, ToggleFlood, false, "The toggle of surface flood selection")
DEF_VAR(Real, PointOtherSize, 0.005f, "")
DEF_VAR(Real, EdgeOtherSize, 0.0015, "")
DEF_ARRAY_STATE(int, PointIndex, DeviceType::GPU, "")
std::shared_ptr< EdgeInteraction< TDataType > > edgeInteractor
DECLARE_ENUM(PickingElementTypeSelection, Surface=0, Edge=1, Point=2, All=3)
DEF_ARRAY_STATE(int, Sur2PointIndex, DeviceType::GPU, "")
DEF_VAR(Real, PointSelectedSize, 0.006f, "")
DEF_INSTANCE_IN(QuadSet< TDataType >, Topology, "")
DEF_VAR(bool, ToggleIndexOutput, true, "The toggle of index output")
void resetStates() override
std::shared_ptr< PointInteraction< TDataType > > pointInteractor
DECLARE_ENUM(PickingTypeSelection, Click=0, Drag=1, Both=2)
std::shared_ptr< QuadSetToTriangleSet< TDataType > > mapper
DEF_ENUM(PickingElementTypeSelection, PickingElementType, PickingElementTypeSelection::All, "")
DEF_VAR(Real, FloodAngle, 1.0f, "The angle limit of surface flood selection")
TDataType::Real Real
DEF_ARRAY_STATE(int, QuadIndex, DeviceType::GPU, "")
DECLARE_ENUM(MultiSelectionType, OR=0, XOR=1, C=2)
DEF_VAR(Real, InteractionRadius, 0.002f, "The radius of interaction")
DEF_ENUM(MultiSelectionType, MultiSelectionType, MultiSelectionType::OR, "")
std::shared_ptr< SurfaceInteraction< TDataType > > surfaceInteractor
DEF_ENUM(PickingTypeSelection, PickingType, PickingTypeSelection::Both, "")
DEF_VAR(Real, EdgeSelectedSize, 0.002f, "")
TDataType::Coord Coord
DEF_VAR(bool, ToggleVisibleFilter, true, "The toggle of visible filter")
DEF_ARRAY_STATE(int, EdgeIndex, DeviceType::GPU, "")
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
@ Point
Definition VehicleInfo.h:37