-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapiMeshShapeUI.h
More file actions
98 lines (84 loc) · 3.05 KB
/
apiMeshShapeUI.h
File metadata and controls
98 lines (84 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//-
// ==========================================================================
// Copyright 2015 Autodesk, Inc. All rights reserved.
//
// Use of this software is subject to the terms of the Autodesk
// license agreement provided at the time of installation or download,
// or which otherwise accompanies this software in either electronic
// or hard copy form.
// ==========================================================================
//+
///////////////////////////////////////////////////////////////////////////////
//
// apiMeshShapeUI.h
//
// Encapsulates the UI portion of a user defined shape. All of the
// drawing and selection code goes here.
//
////////////////////////////////////////////////////////////////////////////////
#include <maya/MPxSurfaceShapeUI.h>
#include "apiMeshShape.h"
class apiMeshUI : public MPxSurfaceShapeUI
{
public:
apiMeshUI();
virtual ~apiMeshUI();
/////////////////////////////////////////////////////////////////////
//
// Overrides
//
/////////////////////////////////////////////////////////////////////
// Puts draw request on the draw queue
//
virtual void getDrawRequests( const MDrawInfo & info,
bool objectAndActiveOnly,
MDrawRequestQueue & requests );
// Main draw routine. Gets called by maya with draw requests.
//
virtual void draw( const MDrawRequest & request,
M3dView & view ) const;
// Main draw routine for UV editor. This is called by maya when the
// shape is selected and the UV texture window is visible.
//
virtual void drawUV( M3dView &view, const MTextureEditorDrawInfo & ) const;
virtual bool canDrawUV() const;
// Main selection routine
//
virtual bool select( MSelectInfo &selectInfo,
MSelectionList &selectionList,
MPointArray &worldSpaceSelectPts ) const;
/////////////////////////////////////////////////////////////////////
//
// Helper routines
//
/////////////////////////////////////////////////////////////////////
void drawWireframe( const MDrawRequest & request, M3dView & view ) const;
void drawShaded( const MDrawRequest & request, M3dView & view ) const;
void drawVertices( const MDrawRequest & request, M3dView & view ) const;
void drawBoundingBox( const MDrawRequest & request, M3dView & view ) const;
// for userInteraction example code
//
void drawRedPointAtCenter( const MDrawRequest & request, M3dView & view ) const;
bool selectVertices( MSelectInfo &selectInfo,
MSelectionList &selectionList,
MPointArray &worldSpaceSelectPts ) const;
static void * creator();
private:
void drawUVWireframe( apiMeshGeom *, M3dView &,
const MTextureEditorDrawInfo &info ) const;
void drawUVMapCoord( M3dView &, int uv, float u, float v, bool ) const;
void drawUVMapCoordNum( apiMeshGeom *, M3dView &,
const MTextureEditorDrawInfo &info, bool ) const;
// Draw Tokens
//
enum {
kDrawVertices, // component token
kDrawWireframe,
kDrawWireframeOnShaded,
kDrawSmoothShaded,
kDrawFlatShaded,
kDrawBoundingBox,
kDrawRedPointAtCenter, // for userInteraction example code
kLastToken
};
};