-
Notifications
You must be signed in to change notification settings - Fork 1
/
DarkFieldPointCloudViewer.java
64 lines (39 loc) · 1.49 KB
/
DarkFieldPointCloudViewer.java
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
package edu.stanford.rsl.science.darkfield.FlorianDarkField;
import java.util.ArrayList;
import edu.stanford.rsl.apps.gui.opengl.PointCloudViewer;
import edu.stanford.rsl.conrad.geometry.shapes.simple.PointND;
import edu.stanford.rsl.conrad.numerics.SimpleMatrix;
public class DarkFieldPointCloudViewer {
ArrayList<PointND> points;
PointCloudViewer pointCloudViewer;
public void showPoints(){
showPoints(true);
}
public void showPoints(boolean flag){
pointCloudViewer.setVisible(flag);
}
public DarkFieldPointCloudViewer(SimpleMatrix myPoints) {
this(myPoints,"");
}
public DarkFieldPointCloudViewer(SimpleMatrix myPoints, String title) {
assert(myPoints.getRows()==3) : new Exception("Dimension of data points has to be 3!");
assert(myPoints.getCols()!=0) : new Exception("Dimension of data points has to be larger 0!");
ArrayList<PointND> myPointList = new ArrayList<PointND>();
for(int pointInd = 0; pointInd < myPoints.getCols(); pointInd++){
PointND myPoint = new PointND(myPoints.getCol(pointInd));
myPointList.add(myPoint);
}
initData(myPointList,title);
}
private void initData(ArrayList<PointND> points, String title){
this.points = points;
// Open new PointCloudViewer Object
pointCloudViewer = new PointCloudViewer(title, points);
}
public DarkFieldPointCloudViewer(ArrayList<PointND> points){
this(points,"");
}
public DarkFieldPointCloudViewer(ArrayList<PointND> points, String title){
initData(points, title);
}
}