forked from miho/JCSG
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCSGDatabase.java
More file actions
83 lines (77 loc) · 2.12 KB
/
CSGDatabase.java
File metadata and controls
83 lines (77 loc) · 2.12 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
package eu.mihosoft.vrl.v3d.parametrics;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import eu.mihosoft.vrl.v3d.CSG;
public class CSGDatabase {
private static CSGDatabaseInstance instance ;
// public static void set(String key, Parameter value) {
// getInstance().set(key, value);
// }
//
// public static Parameter get(String key) {
// return getInstance().get(key);
// }
//
// public static void clear() {
// getInstance().clear();
// }
//
// public static void addParameterListener(String key, IParameterChanged l) {
// getInstance().addParameterListener(key, l);
// }
//
// public static void clearParameterListeners(String key) {
// getInstance().clearParameterListeners(key);
// }
//
// public static void removeParameterListener(String key, IParameterChanged l) {
// getInstance().removeParameterListener(key, l);
// }
//
// public static CopyOnWriteArrayList<IParameterChanged> getParamListeners(String key) {
// return getInstance().getParamListeners(key);
// }
//
// public static void delete(String key) {
// getInstance().delete(key);
// }
//
// public static void loadDatabaseFromFile(File f) {
// getInstance().loadDatabaseFromFile(f);
// }
//
// public static String getDataBaseString() {
// return getInstance().getDataBaseString();
// }
//
// public static void saveDatabase() {
// getInstance().saveDatabase();
// }
//
//
// public static File getDbFile() {
// return getInstance().getDbFile();
// }
//
// public static void reLoadDbFile() {
// getInstance().reLoadDbFile();
// }
public static CSGDatabaseInstance getInstance() {
new Exception("Depricated database access!").printStackTrace();
if(instance==null) {
try {
instance = new CSGDatabaseInstance( Files.createTempFile("CSGDatabase", ".json").toFile());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return instance;
}
public static void setInstance(CSGDatabaseInstance instance) {
System.out.println("\n\nCSG Instance Set here to "+instance.getDbFile().getAbsolutePath()+"\n\n");
CSGDatabase.instance = instance;
}
}