HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
GU_EdgeSlide.h
Go to the documentation of this file.
1
/*
2
* PROPRIETARY INFORMATION. This software is proprietary to
3
* Side Effects Software Inc., and is not to be reproduced,
4
* transmitted, or disclosed in any way without written permission.
5
*
6
* NAME: SOP Library (C++)
7
*
8
* COMMENTS: Interface for computing sliding of edges.
9
*/
10
11
#ifndef __GU_EdgeSlide_h__
12
#define __GU_EdgeSlide_h__
13
14
#include "
GU_API.h
"
15
#include "
GU_Detail.h
"
16
#include <
UT/UT_Map.h
>
17
#include <
UT/UT_Set.h
>
18
19
class
GU_RayIntersect
;
20
21
enum
GU_SlideMode
22
{
23
GU_SLIDE_BLEND
,
24
GU_SLIDE_EDGE
,
25
GU_SLIDE_MATCHPROFILE
,
26
GU_SLIDE_MATCHOPPOSITEPROFILE
,
27
GU_SLIDE_SURFACE
,
28
GU_SLIDE_UNIFORMDISTANCE
,
29
GU_SLIDE_NUM_MODES
30
};
31
32
class
GU_API
GU_SlideData
33
{
34
public
:
35
GU_SlideData
(
const
GU_Detail
&geo);
36
37
// start sliding in response to dragging on a point
38
bool
startSlidingPoint(
GU_SlideMode
mode
,
GA_Index
idx,
39
const
UT_Set<GA_Index>
&sel,
const
UT_Vector3
&orig,
40
const
UT_Vector3
&dir,
const
UT_Vector3
&nml,
41
const
UT_Matrix4D
&to_world);
42
43
// start sliding in response to dragging on a primitive
44
bool
startSlidingPrimitive(
GU_SlideMode
mode,
GA_Index
idx,
45
const
UT_Set<GA_Index>
&sel,
const
UT_Vector3
&orig,
46
const
UT_Vector3
&dir,
const
UT_Vector3
&nml,
47
const
UT_Matrix4D
&to_world);
48
49
// start sliding in response to dragging on an edge
50
bool
startSlidingEdge(
GU_SlideMode
mode,
GA_Index
idx0,
GA_Index
idx1,
51
const
UT_Set
<std::pair<GA_Index, GA_Index> > &sel,
const
UT_Vector3
&orig,
52
const
UT_Vector3
&dir,
const
UT_Vector3
&nml,
53
const
UT_Matrix4D
&to_world);
54
55
// return edits and snapping resulting from drag
56
bool
getSlidePositions(
UT_Map<GA_Index, UT_Vector3>
&edit_pos,
57
UT_Map<GA_Index, GA_Index>
&snapped,
const
UT_Vector3
&orig,
58
const
UT_Vector3
&dir);
59
60
// finish sliding in response to ending a drag
61
void
endSliding();
62
63
// returns the slide surface
64
const
GU_Detail
*
getGeo
()
const
{
return
myGeo.get(); }
65
66
// support for providing visual feedback
67
const
UT_Set<std::pair<GA_Index, GA_Index>
> &
getUnusedEdges
()
const
68
{
return
myUnusedEdges; }
69
const
UT_Set<std::pair<GA_Index, GA_Index>
> &
getProfileEdges
()
const
70
{
return
myProfileEdges; }
71
72
private
:
73
GU_RayIntersect
*getRayIntersect();
74
75
void
setGrip(
GU_SlideMode
mode,
const
UT_Vector3
&grip,
76
const
UT_Vector3
&nml,
const
UT_Matrix4D
&to_local);
77
78
void
recordPoint(
GA_Index
idx);
79
80
void
setSnapped(
UT_Map<GA_Index, GA_Index>
&snapped,
81
GA_Index
idx,
GA_Index
goal)
const
;
82
83
struct
SlideEdge
84
{
85
SlideEdge(
const
UT_Vector3
&
c
,
const
UT_Vector3
&p0,
const
UT_Vector3
&p1,
GA_Index
s0,
GA_Index
s1)
86
: myPosC(c), myPos0(p0), myPos1(p1), mySnap0(s0), mySnap1(s1) {}
87
88
UT_Vector3
myPosC;
89
UT_Vector3
myPos0;
90
UT_Vector3
myPos1;
91
GA_Index
mySnap0;
92
GA_Index
mySnap1;
93
};
94
95
UT_UniquePtr<GU_Detail>
myGeo;
96
//UT_Map<GA_Index, UT_Set<GA_Index> > mySnappedPointsLookup;
97
UT_UniquePtr<GU_RayIntersect>
myRayIntersect;
98
99
bool
myIsSliding;
100
GA_Index
myGripPt0;
101
GA_Index
myGripPt1;
102
fpreal
myGripU;
103
GU_SlideMode
myMode;
104
UT_Vector3
myGrip;
// world space grip position
105
UT_Vector3
myNormal;
// world space normal of slide plane
106
UT_Matrix4D
myXform;
// xform to object space
107
108
UT_Map<GA_Index, UT_Vector3>
myPoints;
109
UT_Map<GA_Index, SlideEdge>
myEdges;
110
UT_Set<std::pair<GA_Index, GA_Index>
> myUnusedEdges;
111
UT_Set<std::pair<GA_Index, GA_Index>
> myProfileEdges;
112
};
113
114
#endif
UT_Matrix4T< fpreal64 >
UT_Set
Definition:
UT_Set.h:58
UT_Map
Unsorted map container.
Definition:
UT_Map.h:107
GU_SLIDE_BLEND
Definition:
GU_EdgeSlide.h:23
GU_SlideMode
GU_SlideMode
Definition:
GU_EdgeSlide.h:21
GU_SLIDE_MATCHPROFILE
Definition:
GU_EdgeSlide.h:25
GU_SlideData::getUnusedEdges
const UT_Set< std::pair< GA_Index, GA_Index > > & getUnusedEdges() const
Definition:
GU_EdgeSlide.h:67
UT_Vector3T< float >
GU_Detail.h
GU_SLIDE_EDGE
Definition:
GU_EdgeSlide.h:24
UT_UniquePtr
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition:
UT_UniquePtr.h:39
UT_Set.h
UT_Map.h
GU_SlideData::getProfileEdges
const UT_Set< std::pair< GA_Index, GA_Index > > & getProfileEdges() const
Definition:
GU_EdgeSlide.h:69
GU_SLIDE_UNIFORMDISTANCE
Definition:
GU_EdgeSlide.h:28
GU_API
#define GU_API
Definition:
GU_API.h:14
GU_SLIDE_NUM_MODES
Definition:
GU_EdgeSlide.h:29
GA_Index
GA_Size GA_Index
Define the strictness of GA_Offset/GA_Index.
Definition:
GA_Types.h:640
GU_SLIDE_MATCHOPPOSITEPROFILE
Definition:
GU_EdgeSlide.h:26
mode
GLenum mode
Definition:
glcorearb.h:99
GU_SLIDE_SURFACE
Definition:
GU_EdgeSlide.h:27
fpreal
fpreal64 fpreal
Definition:
SYS_Types.h:277
GU_Detail
Definition:
GU_Detail.h:154
nanovdb::io::c
c
Definition:
IO.h:328
GU_API.h
GU_SlideData::getGeo
const GU_Detail * getGeo() const
Definition:
GU_EdgeSlide.h:64
GU_RayIntersect
Definition:
GU_RayIntersect.h:355
GU_SlideData
Definition:
GU_EdgeSlide.h:32
GU
GU_EdgeSlide.h
Generated on Sun Nov 17 2024 03:01:17 for HDK by
1.8.6