-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
157 additions
and
39 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
api/src/main/java/com/github/skjolber/packing/api/HorizontalSupport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.github.skjolber.packing.api; | ||
|
||
import java.io.Serializable; | ||
|
||
public class HorizontalSupport implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private final SupportPlacement3D negative; | ||
private final SupportPlacement3D positive; | ||
|
||
private final long area; | ||
|
||
public HorizontalSupport(SupportPlacement3D negative, SupportPlacement3D positive, long area) { | ||
super(); | ||
this.negative = negative; | ||
this.positive = positive; | ||
this.area = area; | ||
} | ||
|
||
public SupportPlacement3D getNegative() { | ||
return negative; | ||
} | ||
|
||
public SupportPlacement3D getPositive() { | ||
return positive; | ||
} | ||
|
||
public long getArea() { | ||
return area; | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
api/src/main/java/com/github/skjolber/packing/api/SupportPlacement3D.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.github.skjolber.packing.api; | ||
|
||
import java.util.List; | ||
|
||
import com.github.skjolber.packing.api.Surface.Label; | ||
|
||
public interface SupportPlacement3D extends Placement3D { | ||
|
||
List<VerticalSupport> getBottomSupports(); | ||
|
||
List<VerticalSupport> getTopSupports(); | ||
|
||
List<HorizontalSupport> getLeftSupports(); | ||
|
||
List<HorizontalSupport> getRightSupports(); | ||
|
||
List<HorizontalSupport> getFrontSupports(); | ||
|
||
List<HorizontalSupport> getRearSupports(); | ||
|
||
} |
59 changes: 59 additions & 0 deletions
59
api/src/main/java/com/github/skjolber/packing/api/SupportStackPlacement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.github.skjolber.packing.api; | ||
|
||
import java.util.List; | ||
|
||
public class SupportStackPlacement extends StackPlacement implements SupportPlacement3D { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
protected List<VerticalSupport> bottomSupports; | ||
|
||
protected List<VerticalSupport> topSupports; | ||
|
||
protected List<HorizontalSupport> leftSupports; | ||
|
||
protected List<HorizontalSupport> rightSupports; | ||
|
||
protected List<HorizontalSupport> frontSupports; | ||
|
||
protected List<HorizontalSupport> rearSupports; | ||
|
||
public SupportStackPlacement() { | ||
super(); | ||
} | ||
|
||
public SupportStackPlacement(Stackable stackable, StackValue value, int x, int y, int z) { | ||
super(stackable, value, x, y, z); | ||
} | ||
|
||
@Override | ||
public List<VerticalSupport> getBottomSupports() { | ||
return bottomSupports; | ||
} | ||
|
||
@Override | ||
public List<VerticalSupport> getTopSupports() { | ||
return topSupports; | ||
} | ||
|
||
@Override | ||
public List<HorizontalSupport> getLeftSupports() { | ||
return leftSupports; | ||
} | ||
|
||
@Override | ||
public List<HorizontalSupport> getRightSupports() { | ||
return rightSupports; | ||
} | ||
|
||
@Override | ||
public List<HorizontalSupport> getFrontSupports() { | ||
return frontSupports; | ||
} | ||
|
||
@Override | ||
public List<HorizontalSupport> getRearSupports() { | ||
return rearSupports; | ||
} | ||
|
||
} |
23 changes: 0 additions & 23 deletions
23
api/src/main/java/com/github/skjolber/packing/api/SupportedPlacement3D.java
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
api/src/main/java/com/github/skjolber/packing/api/SupportedStackPlacement.java
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
api/src/main/java/com/github/skjolber/packing/api/VerticalSupport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.github.skjolber.packing.api; | ||
|
||
import java.io.Serializable; | ||
|
||
public class VerticalSupport implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private final SupportPlacement3D negative; | ||
private final SupportPlacement3D positive; | ||
|
||
private final long area; | ||
|
||
private int weightLimit; | ||
|
||
public VerticalSupport(SupportPlacement3D negative, SupportPlacement3D positive, long area, int weightLimit) { | ||
super(); | ||
this.negative = negative; | ||
this.positive = positive; | ||
this.area = area; | ||
this.weightLimit = weightLimit; | ||
} | ||
|
||
public SupportPlacement3D getNegative() { | ||
return negative; | ||
} | ||
|
||
public SupportPlacement3D getPositive() { | ||
return positive; | ||
} | ||
|
||
public long getArea() { | ||
return area; | ||
} | ||
|
||
public void decrementWeightLimit(int weightLimit) { | ||
this.weightLimit -= weightLimit; | ||
} | ||
|
||
public int getWeightLimit() { | ||
return weightLimit; | ||
} | ||
|
||
} |