Examples of SlicePlane


Examples of cc.sketchchair.geometry.SlicePlane

    this.slicePlanesSlatSlices.destroyPlanes();
    this.slicePlanesSlatSlices.empty();

    //clear all slots
    for (int j = 0; j < this.getSlicePlanesY().size(); j++) {
      SlicePlane tempPlane = this.getSlicePlanesY().get(j);
      tempPlane.getSketch().getSlots().empty();
    }

    //what does this do?
    for (int s = 0; s < this.crossSliceSelections.l.size(); s++) {
      CrossSliceSelection crossSliceSelection;

      crossSliceSelection = (CrossSliceSelection) this.crossSliceSelections.l
          .get(s);

      //destroy selection
      if (crossSliceSelection.path != null
          && crossSliceSelection.path.isDestroying() == true)
        crossSliceSelection.destroy(null);

      Object sketch = crossSliceSelection.path;
      SketchShape guideSpline = (SketchShape) sketch;

      //if (guideSpline == null || guideSpline.size() < 2)
      //  return;

      if (crossSliceSelection != null
          && crossSliceSelection.type == CrossSliceSelection.SLICES
          || crossSliceSelection.type == CrossSliceSelection.LEG
          || crossSliceSelection.type == CrossSliceSelection.SINGLE_SLICE)
        GeometryOperations.generateSlices(this.slicePlanesY,
            this.slicePlanesSlatSlices, crossSliceSelection,
            guideSpline);

      if (crossSliceSelection != null
          && (crossSliceSelection.type == CrossSliceSelection.PLANE_ON_EDGE || crossSliceSelection.type == CrossSliceSelection.PLANE))
        GeometryOperations.generateSlat(this.slicePlanesY,
            this.slicePlanesSlatSlices, crossSliceSelection,
            guideSpline, this);

      if (crossSliceSelection != null
          && crossSliceSelection.type == CrossSliceSelection.SLATSLICES)
        GeometryOperations.generateSlatSlices(this.slicePlanesY,
            this.slicePlanesSlatSlices, crossSliceSelection,
            guideSpline, this);

    }

    //this.slicePlanesSlatSlices.checkForCollisions();
    if (SETTINGS.useSliceCollisionDetection)
      this.slicePlanesY.checkForCollisions();
   
   
    selectedPlanes.empty();
   

    for (int i = 0; i < slicePlanesSlatSlices.size(); i++) {
      SlicePlane plane = slicePlanesSlatSlices.get(i);
      if(plane.getCrossSliceSelection() != null && plane.getCrossSliceSelection().selected){
        selectedPlanes.add(plane);
      }else{
        plane.unselect();
      }
    }
   
   
    for (int i = 0; i < slicePlanesY.size(); i++) {
      SlicePlane plane = slicePlanesY.get(i);
      if(plane.isSelected()){
        selectedPlanes.add(plane);
      }else{
        plane.unselect();
      }
    }

    //this.slicePlanesSlatSlices.unselectAll();
View Full Code Here

Examples of cc.sketchchair.geometry.SlicePlane

    float spacing = this.getWidth() / (numSlices);
   
   

    for (float i = (-this.getWidth() / 2); i < (this.getWidth() / 2); i += spacing) {
      SlicePlane slicePlane = new SlicePlane(new Plane(
          new Vec3D(0, 0, i), new Vec3D(0, 0, -1)));
      this.getSlicePlanesY().add(slicePlane);
    }

    //this.updateCollisionShape();
View Full Code Here

Examples of cc.sketchchair.geometry.SlicePlane

   */
  private Vec3D getCentreOfMass() {
    Vec3D centre = new Vec3D();
    int planeCount = 0;
    for (int i = 0; i < this.getSlicePlanesY().size(); i++) {
      SlicePlane slicePlane = this.getSlicePlanesY().get(i);
      if (slicePlane.getCentreOfMass() != null) {
        centre.addSelf(slicePlane.getCentreOfMass());
        planeCount++;
      }
    }

    centre.x /= planeCount;
View Full Code Here

Examples of cc.sketchchair.geometry.SlicePlane

    return this.selectedPlanes.getOverShapes(x, y);
  }

  public SlicePlane getPlanePickBuffer(int col) {

    SlicePlane plane = this.slicePlanesSlatSlices.getPlanePickBuffer(col);
    if (plane != null)
      return plane;
    else
      return this.getSlicePlanesY().getPlanePickBuffer(col);
  }
View Full Code Here

Examples of cc.sketchchair.geometry.SlicePlane

      float offsetY, float offsetZ) {

    TriangleIndexVertexArray triangleArray = new TriangleIndexVertexArray();

    for (int i = 0; i < this.getSlicePlanesY().getList().size(); i++) {
      SlicePlane slicePlane = this.getSlicePlanesY().getList().get(i);
      IndexedMesh vertexArray = slicePlane.getIndexedMesh(offsetX,
          offsetY, offsetZ);
      if (vertexArray != null)
        triangleArray.addIndexedMesh(vertexArray);
      // slicePlane.getIndexedMesh();
    }

    for (int i = 0; i < this.slicePlanesSlatSlices.getList().size(); i++) {
      SlicePlane slicePlane = this.slicePlanesSlatSlices.getList().get(i);
      IndexedMesh vertexArray = slicePlane.getIndexedMesh(offsetX,
          offsetY, offsetZ);
      if (vertexArray != null) {
        triangleArray.addIndexedMesh(vertexArray);
      }
      // slicePlane.getIndexedMesh();
View Full Code Here

Examples of cc.sketchchair.geometry.SlicePlane

   
    //add initial
    if (!this.initailSliceAdded && getMass() > 0) {
      LOGGER.debug("initailSliceAdded");

      SlicePlane extrudeSlice = this.getSlicePlanesY().getFirst();
      Object spline = extrudeSlice.getSketch().getLast();

      if (spline != null && spline instanceof SketchPath
          && !((SketchPath) spline).getClosed())
        return;

      this.initailSliceAdded = true;

      if (spline != null && spline instanceof SketchSpline) {
       

        SketchSpline sketchSpline = (SketchSpline) spline;
        CrossSliceSelection sliceSelection = new CrossSliceSelection(
            sketchSpline.getCentrePath(), extrudeSlice, 0, 1,
            SETTINGS.DEFAULT_SLAT_SPACING, this);
        sliceSelection.cropToCurrentShape = true;
        this.crossSliceSelections.add(sliceSelection);
       
       
       
      }

      if (spline instanceof SketchSpline) {

      }

      if (spline != null && spline instanceof SketchPath) {
        SketchPath path = (SketchPath) spline;
        path.setClosed(true);
        this.crossSliceSelections.add(new CrossSliceSelection(path,
            extrudeSlice, this.endCoverPercent,
            this.startCoverPercent, SETTINGS.DEFAULT_SLAT_SPACING,
            this));
        GLOBAL.uiTools.setCurrentTool(UITools.CROSSSLICE_EDIT);
      }
    } else {
      if (GLOBAL.uiTools.SketchTools.getCurrentTool() == SketchTools.LEG_TOOL
          && SETTINGS.addLegSlices) {

        SlicePlane extrudeSlice = this.selectedPlanes.getFirst();
        Object spline = extrudeSlice.getSketch().getLast();
        //CrossSliceSelection lastSliceSelection = this.crossSliceSelections.getLast();

        //build a list of all leg splines
        List legSplines = new ArrayList();
       
View Full Code Here

Examples of cc.sketchchair.geometry.SlicePlane

           

            if (child.getAttributeValue("planeId") != null){
              int planeId = Integer.parseInt(child.getAttributeValue("planeId"));
              //LOGGER.info(linkedPlanes + "linkedPlanes");
              SlicePlane linkedPlane = (SlicePlane) linkedPlanes.getById(planeId);
             
              if(linkedPlane != null)
              this.tiedToPlanes.add(linkedPlane);
             
            }
View Full Code Here

Examples of cc.sketchchair.geometry.SlicePlane

    }
   
    if(this.tiedToPlanes !=null){
     
      for(int i = 0; i < slicePlanes.size(); i++){
        SlicePlane slicePlane = (SlicePlane)slicePlanes.get(i);
      }
     
      for(int i = 0; i < this.tiedToPlanes.size(); i++){
        SlicePlane slicePlane = (SlicePlane)this.tiedToPlanes.get(i);
        SlicePlane linkedSlicePlane = (SlicePlane) slicePlanes.getById(slicePlane.getId());
                        if(linkedSlicePlane != null)
      newCrossSliceSelection.tiedToPlanes.add(linkedSlicePlane);
      }
     
    }
View Full Code Here

Examples of cc.sketchchair.geometry.SlicePlane

          .valueOf(this.legSpline.getId())));
     
     
      Element planeElement = new Element("legPlanes");
      for (int i = 0; i < this.tiedToPlanes.size(); i++) {
        SlicePlane curSlice = (SlicePlane)this.tiedToPlanes.get(i);
        Element legPlane = new Element("legPlane");
       
        legPlane.addAttribute(new Attribute("planeId", String
            .valueOf(curSlice.getId())));
       
        planeElement.appendChild(legPlane);

      }
     
View Full Code Here

Examples of cc.sketchchair.geometry.SlicePlane

      }
     

      Object obj = PickBuffer.getInstance().getObject(mouseX, mouseY);
      if (obj instanceof SlicePlane) {
        SlicePlane splane = (SlicePlane) obj;

       
        if (splane.getCrossSliceSelection() == null) {
          GLOBAL.planesWidget.planeClickedOn(splane);
        } else {
          if (GLOBAL.designToolbarAdvanced != null)
            GLOBAL.designToolbarAdvanced.selectTab("slices");

          GLOBAL.slicesWidget.selectSlice(splane
              .getCrossSliceSelection());

        }
       
        GLOBAL.previewWidget.rebuildPatternPreview();
      } else {
        if(!GLOBAL.previewWidget.isMouseOver()){
        GLOBAL.slicesWidget.unselectAll();
        GLOBAL.planesWidget.unselectAll();
        }
      }
    }
   
   
    //IF no planes are selected we can select one with the slat tools
   
    if((this.getCurrentTool() == UITools.SLICES_GROUP_SLICES ||
        this.getCurrentTool() == UITools.SLICES_SINGLE_SLAT ||
        this.getCurrentTool() == UITools.SLICES_SINGLE_SLICE ||
        this.getCurrentTool() == UITools.SLICES_SLATSLICE_GROUP) &&
        (GLOBAL.sketchChairs.getCurChair() != null &&
        GLOBAL.sketchChairs.getCurChair().selectedPlanes.size() == 0)
        ){
      Object obj = PickBuffer.getInstance().getObject(mouseX, mouseY);
      if (obj instanceof SlicePlane) {
        SlicePlane splane = (SlicePlane) obj;

       
        if (splane.getCrossSliceSelection() == null) {
          GLOBAL.planesWidget.planeClickedOn(splane);
         
        }
     
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.