Skip to content
Snippets Groups Projects
Commit b1583cce authored by Radek Ošlejšek's avatar Radek Ošlejšek
Browse files

Merge branch 'mirror' into 'master'

mirror cuts in both single and 1:1 views

See merge request grp-fidentis/analyst2!132
parents 512a1dfc 2d1f6280
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ public class Scene { ...@@ -18,6 +18,7 @@ public class Scene {
private final List<DrawableFeaturePoints> drawableFeaturePoints = new ArrayList<>(); private final List<DrawableFeaturePoints> drawableFeaturePoints = new ArrayList<>();
private final List<DrawablePlane> drawableSymmetryPlanes = new ArrayList<>(); private final List<DrawablePlane> drawableSymmetryPlanes = new ArrayList<>();
private final List<DrawablePlane> drawableCuttingPlanes = new ArrayList<>(); private final List<DrawablePlane> drawableCuttingPlanes = new ArrayList<>();
private final List<DrawablePlane> drawableMirrorPlanes = new ArrayList<>();
private final List<Drawable> otherDrawables = new ArrayList<>(); private final List<Drawable> otherDrawables = new ArrayList<>();
/** /**
...@@ -40,6 +41,7 @@ public class Scene { ...@@ -40,6 +41,7 @@ public class Scene {
} }
drawableSymmetryPlanes.add(null); drawableSymmetryPlanes.add(null);
drawableCuttingPlanes.add(null); drawableCuttingPlanes.add(null);
drawableMirrorPlanes.add(null);
setDefaultColors(); setDefaultColors();
} }
...@@ -78,9 +80,11 @@ public class Scene { ...@@ -78,9 +80,11 @@ public class Scene {
drawableSymmetryPlanes.add(null); drawableSymmetryPlanes.add(null);
drawableCuttingPlanes.add(null); drawableCuttingPlanes.add(null);
drawableMirrorPlanes.add(null);
drawableSymmetryPlanes.add(null); drawableSymmetryPlanes.add(null);
drawableCuttingPlanes.add(null); drawableCuttingPlanes.add(null);
drawableMirrorPlanes.add(null);
setDefaultColors(); setDefaultColors();
} }
...@@ -142,7 +146,7 @@ public class Scene { ...@@ -142,7 +146,7 @@ public class Scene {
* Returns drawable symmetry plane. * Returns drawable symmetry plane.
* *
* @param index Index of the face * @param index Index of the face
* @return drawable face or {@code null} * @return drawable plane or {@code null}
*/ */
public DrawablePlane getDrawableSymmetryPlane(int index) { public DrawablePlane getDrawableSymmetryPlane(int index) {
return (index >= 0 && index < getNumFaces()) ? drawableSymmetryPlanes.get(index) : null; return (index >= 0 && index < getNumFaces()) ? drawableSymmetryPlanes.get(index) : null;
...@@ -195,7 +199,7 @@ public class Scene { ...@@ -195,7 +199,7 @@ public class Scene {
* Returns drawable cutting plane. * Returns drawable cutting plane.
* *
* @param index Index of the face * @param index Index of the face
* @return drawable face or {@code null} * @return drawable plane or {@code null}
*/ */
public DrawablePlane getDrawableCuttingPlane(int index) { public DrawablePlane getDrawableCuttingPlane(int index) {
return (index >= 0 && index < getNumFaces()) ? drawableCuttingPlanes.get(index) : null; return (index >= 0 && index < getNumFaces()) ? drawableCuttingPlanes.get(index) : null;
...@@ -244,6 +248,59 @@ public class Scene { ...@@ -244,6 +248,59 @@ public class Scene {
hideShowCuttingPlanes(false); hideShowCuttingPlanes(false);
} }
/**
* Returns drawable mirror plane.
*
* @param index Index of the face
* @return drawable face or {@code null}
*/
public DrawablePlane getDrawableMirrorPlane(int index) {
return (index >= 0 && index < getNumFaces()) ? drawableMirrorPlanes.get(index) : null;
}
/**
* Sets the drawable mirror plane.
*
* @param index Index of the face
* @param mPlane New mirror plane
*/
public void setDrawableMirrorPlane(int index, DrawablePlane mPlane) {
if (index >= 0 && index < getNumFaces() && mPlane != null) {
this.drawableMirrorPlanes.set(index, mPlane);
}
}
/**
* Helper function for showing or hiding all mirror planes
*
* @param show determines whether to hide or show the planes
*/
private void hideShowMirrorPlanes(boolean show) {
for (int i = 0; i < drawableMirrorPlanes.size(); ++i) {
if (drawableMirrorPlanes.get(i) != null) {
if (show) {
drawableMirrorPlanes.get(i).show();
} else {
drawableMirrorPlanes.get(i).hide();
}
}
}
}
/**
* Show all mirror planes
*/
public void showMirrorPlanes() {
hideShowMirrorPlanes(true);
}
/**
* Hide all mirror planes
*/
public void hideMirrorPlanes() {
hideShowMirrorPlanes(false);
}
/** /**
* Adds new drawable object to the scene. * Adds new drawable object to the scene.
* *
...@@ -269,6 +326,7 @@ public class Scene { ...@@ -269,6 +326,7 @@ public class Scene {
ret.addAll(this.drawableFeaturePoints); ret.addAll(this.drawableFeaturePoints);
ret.addAll(this.drawableSymmetryPlanes); ret.addAll(this.drawableSymmetryPlanes);
ret.addAll(this.drawableCuttingPlanes); ret.addAll(this.drawableCuttingPlanes);
ret.addAll(this.drawableMirrorPlanes);
ret.addAll(this.otherDrawables); ret.addAll(this.otherDrawables);
while (ret.remove(null)) {} while (ret.remove(null)) {}
return ret; return ret;
......
...@@ -26,10 +26,13 @@ public class PolylinePanel extends JPanel { ...@@ -26,10 +26,13 @@ public class PolylinePanel extends JPanel {
private static final Color PRIMARY_COLOR = Color.green; private static final Color PRIMARY_COLOR = Color.green;
private static final Color SECONDARY_COLOR = Color.blue; private static final Color SECONDARY_COLOR = Color.blue;
private static final Stroke GRAPH_STROKE = new BasicStroke(3f); private static final Stroke GRAPH_STROKE = new BasicStroke(3f);
private List<Point3d> primary; private List<Point3d> primaryPoints;
private List<Point3d> secondary; private List<Point3d> secondaryPoints;
private List<Point3d> primaryMirrorPoints;
private List<Point3d> secondaryMirrorPoints;
private boolean alignProfiles = false; private boolean alignProfiles = false;
private double primaryOffsetZ = 0; private double primaryOffsetZ = 0;
private boolean mirrorCuts = false;
private double scale = Double.POSITIVE_INFINITY; private double scale = Double.POSITIVE_INFINITY;
...@@ -58,18 +61,18 @@ public class PolylinePanel extends JPanel { ...@@ -58,18 +61,18 @@ public class PolylinePanel extends JPanel {
* Constructor for one face * Constructor for one face
*/ */
public PolylinePanel(List<Point3d> values) { public PolylinePanel(List<Point3d> values) {
this.primary = values; this.primaryPoints = values;
Collections.sort(this.primary, new CompareY()); Collections.sort(this.primaryPoints, new CompareY());
} }
/** /**
* Constructor for two faces * Constructor for two faces
*/ */
public PolylinePanel(List<Point3d> primary, List<Point3d> secondary) { public PolylinePanel(List<Point3d> primaryPoints, List<Point3d> secondaryPoints) {
this.primary = primary; this.primaryPoints = primaryPoints;
this.secondary = secondary; this.secondaryPoints = secondaryPoints;
Collections.sort(this.primary, new CompareY()); Collections.sort(this.primaryPoints, new CompareY());
Collections.sort(this.secondary, new CompareY()); Collections.sort(this.secondaryPoints, new CompareY());
} }
protected void drawFace(Graphics2D g2, List<Point3d> values, Color faceColor, boolean isPrimary) { protected void drawFace(Graphics2D g2, List<Point3d> values, Color faceColor, boolean isPrimary) {
...@@ -77,6 +80,7 @@ public class PolylinePanel extends JPanel { ...@@ -77,6 +80,7 @@ public class PolylinePanel extends JPanel {
double maxZ = Double.NEGATIVE_INFINITY; double maxZ = Double.NEGATIVE_INFINITY;
double minY = Double.POSITIVE_INFINITY; double minY = Double.POSITIVE_INFINITY;
double maxY = Double.NEGATIVE_INFINITY; double maxY = Double.NEGATIVE_INFINITY;
double offsetZ = 0;
for (int i = 0; i < values.size(); i++) { for (int i = 0; i < values.size(); i++) {
if (values.get(i).z < minZ) { if (values.get(i).z < minZ) {
...@@ -101,12 +105,24 @@ public class PolylinePanel extends JPanel { ...@@ -101,12 +105,24 @@ public class PolylinePanel extends JPanel {
scale = ((double) PREF_H - 2 * BORDER_GAP) / (maxY - minY); scale = ((double) PREF_H - 2 * BORDER_GAP) / (maxY - minY);
} }
if (isPrimary) { //Calculate the offsets
this.primaryOffsetZ = (PREF_W * 0.7) - (maxZ * scale); if (mirrorCuts) {
if (secondaryPoints == null) {
//Mirror cuts with single face - center the face
this.primaryOffsetZ = (PREF_W * 0.7) - (maxZ * scale);
offsetZ = this.primaryOffsetZ;
} else {
//Mirror cuts with two faces - separate primary and secondary
offsetZ = isPrimary ? (PREF_W * 0.4) - (maxZ * scale) : (PREF_W * 0.9) - (maxZ * scale);
}
} else {
//No mirror cuts - center all faces
if (isPrimary) {
this.primaryOffsetZ = (PREF_W * 0.7) - (maxZ * scale);
}
offsetZ = this.alignProfiles ? (PREF_W * 0.7) - (maxZ * scale) : this.primaryOffsetZ;
} }
double offsetZ = this.alignProfiles ? (PREF_W * 0.7) - (maxZ * scale) : this.primaryOffsetZ;
//Draw lines //Draw lines
g2.setColor(faceColor); g2.setColor(faceColor);
g2.setStroke(GRAPH_STROKE); g2.setStroke(GRAPH_STROKE);
...@@ -125,12 +141,22 @@ public class PolylinePanel extends JPanel { ...@@ -125,12 +141,22 @@ public class PolylinePanel extends JPanel {
super.paintComponent(g); super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g; Graphics2D g2 = (Graphics2D)g;
drawFace(g2, primary, PRIMARY_COLOR, true);
if (secondary != null) { if (mirrorCuts) {
drawFace(g2, secondary, SECONDARY_COLOR, false); drawFace(g2, primaryPoints, PRIMARY_COLOR, true);
} drawFace(g2, primaryMirrorPoints, SECONDARY_COLOR, true);
if (secondaryPoints != null) {
drawFace(g2, secondaryPoints, PRIMARY_COLOR, false);
drawFace(g2, secondaryMirrorPoints, SECONDARY_COLOR, false);
}
} else {
drawFace(g2, primaryPoints, PRIMARY_COLOR, true);
if (secondaryPoints != null) {
drawFace(g2, secondaryPoints, SECONDARY_COLOR, false);
}
}
} }
/** /**
...@@ -139,8 +165,20 @@ public class PolylinePanel extends JPanel { ...@@ -139,8 +165,20 @@ public class PolylinePanel extends JPanel {
* @param points primary points * @param points primary points
*/ */
public void setPrimaryPoints(List<Point3d> points) { public void setPrimaryPoints(List<Point3d> points) {
this.primary = points; this.primaryPoints = points;
Collections.sort(this.primary, new CompareY()); Collections.sort(this.primaryPoints, new CompareY());
repaint();
}
/**
* Sets primary mirror points.
* Only draws them if mirrorCuts is checked
*
* @param points primary mirror points
*/
public void setPrimaryMirrorPoints(List<Point3d> points) {
this.primaryMirrorPoints = points;
Collections.sort(this.primaryMirrorPoints, new CompareY());
repaint(); repaint();
} }
...@@ -150,8 +188,20 @@ public class PolylinePanel extends JPanel { ...@@ -150,8 +188,20 @@ public class PolylinePanel extends JPanel {
* @param points secondary points * @param points secondary points
*/ */
public void setSecondaryPoints(List<Point3d> points) { public void setSecondaryPoints(List<Point3d> points) {
this.secondary = points; this.secondaryPoints = points;
Collections.sort(this.secondary, new CompareY()); Collections.sort(this.secondaryPoints, new CompareY());
repaint();
}
/**
* Sets secondary mirror points.
* Only draws them if mirrorCuts is checked
*
* @param points secondary mirror points
*/
public void setSecondaryMirrorPoints(List<Point3d> points) {
this.secondaryMirrorPoints = points;
Collections.sort(this.secondaryMirrorPoints, new CompareY());
repaint(); repaint();
} }
...@@ -165,6 +215,16 @@ public class PolylinePanel extends JPanel { ...@@ -165,6 +215,16 @@ public class PolylinePanel extends JPanel {
repaint(); repaint();
} }
/**
* Displays the mirror cuts
*
* @param mirror
*/
public void setMirrorCuts(boolean mirror) {
this.mirrorCuts = mirror;
repaint();
}
@Override @Override
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(PREF_W, PREF_H); return new Dimension(PREF_W, PREF_H);
......
...@@ -33,6 +33,8 @@ public class ProfilesAction extends ControlPanelAction { ...@@ -33,6 +33,8 @@ public class ProfilesAction extends ControlPanelAction {
*/ */
private List<Point3d> primaryPoints; private List<Point3d> primaryPoints;
private List<Point3d> secondaryPoints; private List<Point3d> secondaryPoints;
private List<Point3d> primaryMirrorPoints;
private List<Point3d> secondaryMirrorPoints;
/** /**
* Constructor. * Constructor.
...@@ -50,9 +52,11 @@ public class ProfilesAction extends ControlPanelAction { ...@@ -50,9 +52,11 @@ public class ProfilesAction extends ControlPanelAction {
recomputeSecondaryProfile(); recomputeSecondaryProfile();
controlPanel = new ProfilesPanel(this, this.primaryPoints, this.secondaryPoints); controlPanel = new ProfilesPanel(this, this.primaryPoints, this.secondaryPoints);
controlPanel.setSecondaryMirrorPoints(this.secondaryMirrorPoints);
} else { } else {
controlPanel = new ProfilesPanel(this, this.primaryPoints); controlPanel = new ProfilesPanel(this, this.primaryPoints);
} }
controlPanel.setPrimaryMirrorPoints(this.primaryMirrorPoints);
// Place control panel to the topControlPanel // Place control panel to the topControlPanel
this.topControlPanel.addTab(controlPanel.getName(), controlPanel.getIcon(), controlPanel); this.topControlPanel.addTab(controlPanel.getName(), controlPanel.getIcon(), controlPanel);
...@@ -64,11 +68,17 @@ public class ProfilesAction extends ControlPanelAction { ...@@ -64,11 +68,17 @@ public class ProfilesAction extends ControlPanelAction {
if (controlPanel.isShowPlaneChecked()) { if (controlPanel.isShowPlaneChecked()) {
getCanvas().getScene().showCuttingPlanes(); getCanvas().getScene().showCuttingPlanes();
} }
if (controlPanel.isMirrorCutsChecked()) {
getCanvas().getScene().showMirrorPlanes();
}
} else { } else {
getCanvas().getScene().hideCuttingPlanes(); getCanvas().getScene().hideCuttingPlanes();
getCanvas().getScene().hideMirrorPlanes();
} }
}); });
getCanvas().getScene().hideCuttingPlanes(); getCanvas().getScene().hideCuttingPlanes();
getCanvas().getScene().hideMirrorPlanes();
} }
private void exportProfile(List<Point3d> points, String title) { private void exportProfile(List<Point3d> points, String title) {
...@@ -107,21 +117,46 @@ public class ProfilesAction extends ControlPanelAction { ...@@ -107,21 +117,46 @@ public class ProfilesAction extends ControlPanelAction {
} }
} }
void recomputePrimaryProfile() { private void recomputePrimaryProfile() {
CrossSection cs1 = new CrossSection(getScene().getDrawableCuttingPlane(0).getFacets().get(0)); //Main profile
getPrimaryDrawableFace().getModel().compute(cs1); CrossSection cs = new CrossSection(getScene().getDrawableCuttingPlane(0).getFacets().get(0));
this.primaryPoints = cs1.getPoints(); getPrimaryDrawableFace().getModel().compute(cs);
this.primaryPoints = cs.getPoints();
//Mirror profile
CrossSection mcs = new CrossSection(getScene().getDrawableMirrorPlane(0).getFacets().get(0));
getPrimaryDrawableFace().getModel().compute(mcs);
this.primaryMirrorPoints = mcs.getPoints();
} }
void recomputeSecondaryProfile() { private void recomputeSecondaryProfile() {
//Main profile
CrossSection cs = new CrossSection(getScene().getDrawableCuttingPlane(1).getFacets().get(0)); CrossSection cs = new CrossSection(getScene().getDrawableCuttingPlane(1).getFacets().get(0));
getSecondaryDrawableFace().getModel().compute(cs); getSecondaryDrawableFace().getModel().compute(cs);
this.secondaryPoints = cs.getPoints(); this.secondaryPoints = cs.getPoints();
//Mirror profile
CrossSection mcs = new CrossSection(getScene().getDrawableMirrorPlane(1).getFacets().get(0));
getSecondaryDrawableFace().getModel().compute(mcs);
this.secondaryMirrorPoints = mcs.getPoints();
} }
void setCuttingPlaneOffset(int index, double value) { private void recomputeProfiles() {
recomputePrimaryProfile();
controlPanel.setPrimaryPoints(this.primaryPoints);
controlPanel.setPrimaryMirrorPoints(this.primaryMirrorPoints);
if (getSecondaryDrawableFace() != null) {
recomputeSecondaryProfile();
controlPanel.setSecondaryPoints(this.secondaryPoints);
controlPanel.setSecondaryMirrorPoints(this.secondaryMirrorPoints);
}
}
private void setCuttingPlaneOffset(int index, double value) {
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
getScene().getDrawableCuttingPlane(index).getFacets().get(0).getVertex(i).getPosition().x = value; getScene().getDrawableCuttingPlane(index).getFacets().get(0).getVertex(i).getPosition().x = value;
getScene().getDrawableMirrorPlane(index).getFacets().get(0).getVertex(i).getPosition().x = value * -1.0;
} }
} }
...@@ -144,28 +179,31 @@ public class ProfilesAction extends ControlPanelAction { ...@@ -144,28 +179,31 @@ public class ProfilesAction extends ControlPanelAction {
} }
break; break;
case ProfilesPanel.ACTION_OFFSET_CUTTING_PLANE: case ProfilesPanel.ACTION_OFFSET_CUTTING_PLANE:
double value = Double.parseDouble(controlPanel.getOffsetValue()); double value = controlPanel.getOffsetValue();
double multiplier = 150; double multiplier = 150;
setCuttingPlaneOffset(0, multiplier * (value - 0.5)); setCuttingPlaneOffset(0, multiplier * (value - 0.5));
//TODO translation needs to be done differently, maybe recalculate upon change
if (getSecondaryDrawableFace() != null) { if (getSecondaryDrawableFace() != null) {
setCuttingPlaneOffset(1, multiplier * (value - 0.5)); setCuttingPlaneOffset(1, multiplier * (value - 0.5));
} }
recomputeProfiles();
break; break;
case ProfilesPanel.ACTION_COMMAND_RECOMPUTE: case ProfilesPanel.ACTION_COMMAND_RECOMPUTE:
recomputePrimaryProfile(); recomputeProfiles();
controlPanel.setPrimaryPoints(this.primaryPoints);
if (getSecondaryDrawableFace() != null){
recomputeSecondaryProfile();
controlPanel.setSecondaryPoints(this.secondaryPoints);
}
break; break;
case ProfilesPanel.ACTION_ALIGN_PROFILES: case ProfilesPanel.ACTION_ALIGN_PROFILES:
controlPanel.setAlignProfiles(); controlPanel.setAlignProfiles();
break; break;
case ProfilesPanel.ACTION_MIRROR_CUTS:
controlPanel.setMirrorCuts();
if (controlPanel.isMirrorCutsChecked()) {
getCanvas().getScene().showMirrorPlanes();
} else {
getCanvas().getScene().hideMirrorPlanes();
}
break;
default: default:
// do nothing // do nothing
} }
......
...@@ -26,6 +26,7 @@ public class ProfilesPanel extends ControlPanel { ...@@ -26,6 +26,7 @@ public class ProfilesPanel extends ControlPanel {
private JCheckBox alignProfiles; private JCheckBox alignProfiles;
private JCheckBox showCuttingPlane; private JCheckBox showCuttingPlane;
private PolylinePanel polylinePanel; private PolylinePanel polylinePanel;
private JCheckBox mirrorCuts;
/* /*
* Handled actions * Handled actions
...@@ -35,6 +36,7 @@ public class ProfilesPanel extends ControlPanel { ...@@ -35,6 +36,7 @@ public class ProfilesPanel extends ControlPanel {
public static final String ACTION_COMMAND_EXPORT = "export"; public static final String ACTION_COMMAND_EXPORT = "export";
public static final String ACTION_OFFSET_CUTTING_PLANE = "offset_plane"; public static final String ACTION_OFFSET_CUTTING_PLANE = "offset_plane";
public static final String ACTION_ALIGN_PROFILES = "align_profiles"; public static final String ACTION_ALIGN_PROFILES = "align_profiles";
public static final String ACTION_MIRROR_CUTS = "mirror-cuts";
/* /*
* Mandatory design elements * Mandatory design elements
...@@ -91,22 +93,27 @@ public class ProfilesPanel extends ControlPanel { ...@@ -91,22 +93,27 @@ public class ProfilesPanel extends ControlPanel {
}); });
builder.addLine(); builder.addLine();
alignProfiles = builder.addCheckBoxOptionLine( showCuttingPlane = builder.addCheckBoxOptionLine(
null, null,
"Align profiles", "Show cutting plane",
false, true,
createListener(action, ACTION_ALIGN_PROFILES) createListener(action, ACTION_COMMAND_SHOW_HIDE_PLANE)
); );
builder.addLine(); builder.addLine();
builder.addCaptionLine("Computation options:"); mirrorCuts = builder.addCheckBoxOptionLine(
null,
"Mirror cuts",
false,
createListener(action, ACTION_MIRROR_CUTS)
);
builder.addLine(); builder.addLine();
showCuttingPlane = builder.addCheckBoxOptionLine( alignProfiles = builder.addCheckBoxOptionLine(
null, null,
"Show cutting plane", "Align profiles",
true, false,
createListener(action, ACTION_COMMAND_SHOW_HIDE_PLANE) createListener(action, ACTION_ALIGN_PROFILES)
); );
builder.addLine(); builder.addLine();
...@@ -159,8 +166,19 @@ public class ProfilesPanel extends ControlPanel { ...@@ -159,8 +166,19 @@ public class ProfilesPanel extends ControlPanel {
return showCuttingPlane.isSelected(); return showCuttingPlane.isSelected();
} }
public String getOffsetValue() { public boolean isMirrorCutsChecked() {
return cuttingOffset.getText(); return mirrorCuts.isSelected();
}
public double getOffsetValue() {
return ControlPanelBuilder.parseLocaleDouble(cuttingOffset);
}
/**
* Sets the mirrorCuts boolean based on the checkbox
*/
public void setMirrorCuts() {
this.polylinePanel.setMirrorCuts(this.mirrorCuts.isSelected());
} }
/** /**
...@@ -179,6 +197,15 @@ public class ProfilesPanel extends ControlPanel { ...@@ -179,6 +197,15 @@ public class ProfilesPanel extends ControlPanel {
this.polylinePanel.setPrimaryPoints(points); this.polylinePanel.setPrimaryPoints(points);
} }
/**
* Sets the primary mirror points in the polyline panel
*
* @param points primary mirror points
*/
public void setPrimaryMirrorPoints(List<Point3d> points) {
this.polylinePanel.setPrimaryMirrorPoints(points);
}
/** /**
* Sets the secondary points in the polyline panel * Sets the secondary points in the polyline panel
* *
...@@ -188,4 +215,13 @@ public class ProfilesPanel extends ControlPanel { ...@@ -188,4 +215,13 @@ public class ProfilesPanel extends ControlPanel {
this.polylinePanel.setSecondaryPoints(points); this.polylinePanel.setSecondaryPoints(points);
} }
/**
* Sets the secondary mirror points in the polyline panel
*
* @param points secondary mirror points
*/
public void setSecondaryMirrorPoints(List<Point3d> points) {
this.polylinePanel.setSecondaryMirrorPoints(points);
}
} }
...@@ -79,6 +79,8 @@ public class SymmetryAction extends ControlPanelAction { ...@@ -79,6 +79,8 @@ public class SymmetryAction extends ControlPanelAction {
new DrawablePlane(primaryEstimator.getSymmetryPlaneMesh(), primaryEstimator.getSymmetryPlane())); new DrawablePlane(primaryEstimator.getSymmetryPlaneMesh(), primaryEstimator.getSymmetryPlane()));
getCanvas().getScene().setDrawableCuttingPlane(0, getCanvas().getScene().setDrawableCuttingPlane(0,
new DrawablePlane(primaryEstimator.getSymmetryPlaneMesh(), primaryEstimator.getSymmetryPlane())); new DrawablePlane(primaryEstimator.getSymmetryPlaneMesh(), primaryEstimator.getSymmetryPlane()));
getCanvas().getScene().setDrawableMirrorPlane(0,
new DrawablePlane(primaryEstimator.getSymmetryPlaneMesh(), primaryEstimator.getSymmetryPlane()));
if (getSecondaryDrawableFace() != null) { if (getSecondaryDrawableFace() != null) {
SymmetryEstimator secondaryEstimator = new SymmetryEstimator(controlPanel.getSymmetryConfig()); SymmetryEstimator secondaryEstimator = new SymmetryEstimator(controlPanel.getSymmetryConfig());
...@@ -88,6 +90,8 @@ public class SymmetryAction extends ControlPanelAction { ...@@ -88,6 +90,8 @@ public class SymmetryAction extends ControlPanelAction {
new DrawablePlane(secondaryEstimator.getSymmetryPlaneMesh(), secondaryEstimator.getSymmetryPlane())); new DrawablePlane(secondaryEstimator.getSymmetryPlaneMesh(), secondaryEstimator.getSymmetryPlane()));
getCanvas().getScene().setDrawableCuttingPlane(1, getCanvas().getScene().setDrawableCuttingPlane(1,
new DrawablePlane(secondaryEstimator.getSymmetryPlaneMesh(), secondaryEstimator.getSymmetryPlane())); new DrawablePlane(secondaryEstimator.getSymmetryPlaneMesh(), secondaryEstimator.getSymmetryPlane()));
getCanvas().getScene().setDrawableMirrorPlane(1,
new DrawablePlane(secondaryEstimator.getSymmetryPlaneMesh(), secondaryEstimator.getSymmetryPlane()));
} }
getCanvas().getScene().hideSymmetryPlanes(); getCanvas().getScene().hideSymmetryPlanes();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment