Commit c9c4e974 authored by Ivan Dages's avatar Ivan Dages
Browse files

config params : doc

parent 2e006d94
......@@ -10,21 +10,40 @@ import javafx.scene.transform.Scale;
import javafx.scene.transform.Transform;
/**
* Class gathering the configuration-specific parameters of a component.
* @author dages
*/
public class ConfigParams {
/** Component owning this configuration. */
private Component owner;
/** Name of this configuration. */
private String configuration;
/** true is the component can move in this configuration, false if it cannot. */
private boolean fixed;
/** Visibility of the component in this configuration. */
private boolean visible;
/** Translation of the configuration, in global coordinates. */
private Affine translation;
/** Rotation of the configuration, in global coordinates. */
private Affine rotation;
/** Scale of the configuration, in global coordinates. */
private Scale scale;
/** Axis value of the configuration. */
private double axisValue;
/** Mate group of the configuration. */
private ArrayList<Mate> mateGroup;
/**
* Default constructor.
* Constructor.
* @param owner Owner of the configuration
*/
public ConfigParams(Component owner) {
this.owner = owner;
......@@ -38,66 +57,130 @@ public class ConfigParams {
this.mateGroup = new ArrayList<>();
}
/**
* Gets the owner.
* @return The owner
*/
public Component getOwner() {
return owner;
}
/**
* Gets the name of the configuration.
* @return The name
*/
public String getConfiguration() {
return configuration;
}
/**
* gets the mobility of the configuration
* @return true if the component is fixed, false otherwise
*/
public boolean isFixed() {
return fixed;
}
/**
* Gets the visibility of the configuration
* @return true if the component is visible, false otherwise
*/
public boolean isVisible() {
return visible;
}
/**
* Gets the translation transform
* @return The translation transform
*/
public Affine getTranslation() {
return translation;
}
/**
* Gets the rotation transform
* @return The rotation transform
*/
public Affine getRotation() {
return rotation;
}
/**
* Gets the scale transform.
* @return The scale transform
*/
public Scale getScale() {
return scale;
}
/**
* Gets the axis value.
* @return The axis value
*/
public double getAxisValue() {
return axisValue;
}
/**
* Gets the mate group.
* @return The mate group
*/
public ArrayList<Mate> getMateGroup() {
return mateGroup;
}
/**
* Sets the name of the configuration.
* @param configuration New name
*/
public void setConfiguration(String configuration) {
this.configuration = configuration;
}
/**
* Sets the mobility of the configuration.
* @param fixed New mobility
*/
public void setFixed(boolean fixed) {
this.fixed = fixed;
}
/**
* Sets the visibility of the configuration.
* @param visible New visibility
*/
public void setVisible(boolean visible) {
this.visible = visible;
}
/**
* Sets the translation transform.
* @param translation New translation transform
*/
public void setTranslation(Affine translation) {
this.translation = translation;
}
/**
* Sets the rotation transform.
* @param rotation New rotation transform
*/
public void setRotation(Affine rotation) {
this.rotation = rotation;
}
/**
* Sets the scale transform.
* @param scale New scale transform
*/
public void setScale(Scale scale) {
this.scale = scale;
}
/**
* Sets the translation and rotation transform, based on one affine transform
* @param transform Input transform
*/
public void setTransform(Transform transform) {
Point3D translation = transform.transform(Point3D.ZERO);
Point3D xRotation = transform.transform(Rotate.X_AXIS).subtract(translation);
......@@ -121,14 +204,26 @@ public class ConfigParams {
this.rotation.setMzz(zRotation.getZ());
}
/**
* Sets the axis value.
* @param axisValue New axis value
*/
public void setAxisValue(double axisValue) {
this.axisValue = axisValue;
}
/**
* Adds a mate to the configuration's mate group.
* @param mate New mate
*/
public void addMate(Mate mate) {
this.mateGroup.add(mate);
}
/**
* Converts the rotation transform to an axis-angle perspective.
* @return The axis-angle rotation transform
*/
public Rotate axisAngleRotation() {
// https://en.wikipedia.org/wiki/Rotation_formalisms_in_three_dimensions#Rotation_matrix_.E2.86.94_Euler_axis.2Fangle
double epsilon = 1e-10;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment