-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathreduceCmd.h
58 lines (46 loc) · 1.28 KB
/
reduceCmd.h
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
#pragma once
#ifndef REDUCECMD_H
#define REDUCECMD_H
#include <stdio.h>
#include <maya/MPxCommand.h>
#include <maya/MSyntax.h>
#include <maya/MArgDatabase.h>
#include <maya/MSelectionList.h>
#include <maya/MDagPath.h>
#include <maya/MPointArray.h>
#include <maya/MMeshIntersector.h>
#include <maya/MIntArray.h>
#include <maya/MItMeshPolygon.h>
#include <maya/MItMeshVertex.h>
#include <maya/MGlobal.h>
#include <maya/M3dView.h>
#include <maya/MFnDagNode.h>
#include <maya/MFnMesh.h>
#include <maya/MFnIntArrayData.h>
#include <maya/MItDependencyGraph.h>
class ReduceCmd : public MPxCommand {
public:
ReduceCmd();
virtual ~ReduceCmd();
static void* creater();
virtual MStatus doIt(const MArgList& argList);
virtual bool isUndoable() const;
virtual MStatus redoIt();
virtual MStatus undoIt();
static MSyntax newSyntax();
// user-defined function
void computeAllEdgeCosts();
float computeEdgeCost(int u, int v);
void collapse(unsigned int u, unsigned int v);
unsigned int findMinCostVert();
private:
MStatus getShapeNode(MDagPath &path);
MFloatArray mLeastCost;
MIntArray mCollapseVert;
MIntArray mEdgeFaces;
MString mMesh;
MDagPath m_basePath;
unsigned int m_percentage;
unsigned int m_count;
};
#endif // !ReduceCmd_H