Example #1
0
 public void loadDetector(String detector) {
   if (detector.compareTo("FTOF") == 0) {
     MeshStore store = GeometryLoader.getGeometryGemc();
     for (Map.Entry<String, MeshView> item : store.getMap().entrySet()) {
       // item.getValue().setMaterial(mat);
       root.getChildren().add(item.getValue());
     }
   }
 }
Example #2
0
 public void testFTOF() {
   PhongMaterial mat = new PhongMaterial();
   mat.setDiffuseColor(new Color(0.1, 0.1, 0.8, 0.5));
   mat.setSpecularColor(new Color(0.1, 0.1, 0.8, 0.5));
   MeshStore store = GeometryLoader.getGeometryGemc();
   for (Map.Entry<String, MeshView> item : store.getMap().entrySet()) {
     // item.getValue().setMaterial(mat);
     root.getChildren().add(item.getValue());
   }
 }
Example #3
0
  public void test() {
    MeshStore store = new MeshStore();
    Mesh3D box = Mesh3D.box(100, 25, 35);

    // Geant4Basic  shape = new Geant4Basic("","box",20,20,80);
    // MeshView mesh = Geant4Mesh.makeMeshBox(shape);
    // box.translateXYZ(40.0, 0.0, 120.0);
    box.rotateZ(Math.toRadians(30.0));
    MeshView mesh = box.getMeshView();
    mesh.setMaterial(store.getMaterials().get(2));
    this.root.getChildren().add(mesh);
  }
Example #4
0
  public void addDetector(String name) {

    TreeItem<String> clasROOT = new TreeItem<String>("CLAS12");

    this.treeView.setEditable(true);
    this.treeView.setCellFactory(CheckBoxTreeCell.<String>forTreeView());
    for (int sector = 1; sector <= 6; sector++) {
      MeshStore store = GeometryLoader.getGeometry("FTOF", sector, 1);
      store.setMaterial(0.6, 0.2, 0.2, 0.4);
      this.meshStores.put(store.getName(), store);
      // treeView = new TreeView<String>();
      // this.treeView.setRoot(store.getMeshTree());
      clasROOT.getChildren().add(store.getMeshTree());
      for (Map.Entry<String, MeshView> entry : store.getMap().entrySet()) {
        root.getChildren().add(entry.getValue());
      }
    }

    for (int sector = 1; sector <= 6; sector++) {
      MeshStore store = GeometryLoader.getGeometry("FTOF", sector, 2);
      store.setMaterial(0.1, 0.1, 0.4, 0.4);
      this.meshStores.put(store.getName(), store);
      // treeView = new TreeView<String>();
      clasROOT.getChildren().add(store.getMeshTree());
      for (Map.Entry<String, MeshView> entry : store.getMap().entrySet()) {
        root.getChildren().add(entry.getValue());
      }
    }

    for (int sector = 1; sector <= 6; sector++) {
      MeshStore store = GeometryLoader.getGeometry("FTOF", sector, 3);
      // store.setVisible(false);

      store.setMaterial(0.1, 0.4, 0.1, 0.4);
      this.meshStores.put(store.getName(), store);
      // treeView = new TreeView<String>();
      clasROOT.getChildren().add(store.getMeshTree());
      for (Map.Entry<String, MeshView> entry : store.getMap().entrySet()) {
        root.getChildren().add(entry.getValue());
      }
    }

    this.treeView.setRoot(clasROOT);
  }