Source code: com/trapezium/chisel/codeveloper/CreateCpd.java
1 /*
2 * @(#)CreateCpd.java
3 *
4 * Copyright (c) 1998 by Trapezium Development LLC. All Rights Reserved.
5 *
6 * The information in this file is the property of Trapezium Development LLC
7 * and may be used only in accordance with the terms of the license granted
8 * by Trapezium.
9 *
10 */
11 package com.trapezium.chisel.codeveloper;
12
13 import java.io.File;
14 import java.io.FileOutputStream;
15 import java.io.ObjectOutputStream;
16 import com.trapezium.chisel.ChiselSetDescriptor;
17
18 // class to create ChiselPluginDescriptor serialized objects for
19 // plugin architecture.
20
21 public class CreateCpd {
22 public static void main( String[] args ) {
23
24 // this is actually how the "MUTATE" category gets added into chisel!
25
26 ChiselSetDescriptor csd = new ChiselSetDescriptor( "MUTATE", "Modify the geometry in the current world", false, "mutate", true );
27 csd.addChiselEntry( "com.trapezium.chisel.mutators.Cubist",
28 "Cubist", false );
29 csd.addChiselEntry( "com.trapezium.chisel.mutators.Origami",
30 "Origami", false );
31 csd.addChiselEntry( "com.trapezium.chisel.mutators.IFS_Triangulator",
32 "Triangulate", false );
33 csd.addChiselEntry( "com.trapezium.chisel.mutators.IFS_Smasher",
34 "Flatten", false );
35 csd.addChiselEntry( "com.trapezium.chisel.mutators.IFS_FaceToLineSet",
36 "Wireframe", false );
37 csd.addChiselEntry( "com.trapezium.chisel.mutators.IFS_FaceToPointSet",
38 "Point cloud", false );
39 serialize( csd, "mutators.cpd" );
40
41 csd = new ChiselSetDescriptor( "3DLAND", "You put your category here", false, "3dland", true );
42 csd.addChiselEntry( "com.trapezium.chisel.codeveloper.J3dland_chisel",
43 "main title here", false );
44 serialize( csd, "3dland.cpd" );
45
46 }
47
48 static public void serialize( ChiselSetDescriptor csd, String fileName ) {
49 File f = new File( fileName );
50 try {
51 FileOutputStream fos = new FileOutputStream( f );
52 ObjectOutputStream oos = new ObjectOutputStream( fos );
53 oos.writeObject( csd );
54 } catch ( Exception e ) {
55 System.out.println( "** Exception " + e );
56 e.printStackTrace();
57 }
58 }
59 }