-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIsolineMaker.h
48 lines (40 loc) · 1.45 KB
/
IsolineMaker.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
#pragma once
#include <GT/GT_DataArray.h>
#include <GU/GU_Detail.h>
#include <GU/GU_DetailHandle.h>
#include <SYS/SYS_Math.h>
class IsolineMaker {
public:
IsolineMaker(GU_DetailHandle GdpHandle, float Peak, int SubdivisionLevel);
IsolineMaker(GU_DetailHandle GdpHandle, UT_DMatrix4 Transform, float Peak,
int SubdivisionLevel);
// function which calculates isoline positions
bool calculateAttributeArrays();
// arrays for gl rendering
void getAttributeArrays(UT_Vector3FArray &OutPositions,
UT_Vector3FArray &OutColors,
UT_Vector3FArray &OutNormals);
// constructs polyline geo in the target gdp
void createGeometry(GU_Detail *TargetGdp);
private:
// Checks if incoming geo only has primitives with n-vertices > 2
bool isValidGeo();
// Adds n = output geometry elements into attribute arrays
void fillAttributeArrays();
// evaluates opensubdiv functions to find the limit surface
void getLimitSurfacePositions();
// writes positions into attribute array
void applyLimitSurfacePositions();
const GU_Detail *gdp();
float getPeakProportional();
GU_DetailHandle GdpHandle;
const bool UsesTransform;
const UT_DMatrix4 Transform;
const float Peak;
const int SubdivisionLevel;
UT_Vector3FArray Positions, Colors, Normals;
UT_Array<int> FaceIndices, ReferenceIndices;
UT_Array<float> U, V;
bool HasCrease = false;
GT_DataArrayHandle Surface, LimitNormals;
};