Commit 527b5d87 authored by Nico Mack's avatar Nico Mack

Revert "New Branch for TULIP version used for SUCCESS Demo"

This reverts commit bb3b7b54.
parents bb3b7b54 02708a13
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/${PROJECT_DIR_NAME}/python</path>
</pydev_pathproperty>
</pydev_project>
......@@ -96,11 +96,12 @@
</dependencies>
<repositories>
<repository>
<id>LIST</id>
<name>Artifacts</name>
<url>https://artefacts.list.lu/libs-release-local</url>
</repository>
</repositories>
<repository>
<id>Kenai</id>
<name>Kenai</name>
<url>file:///Users/mack/.m2/repository</url>
</repository>
</repositories>
</project>
\ No newline at end of file
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -224,9 +224,7 @@ public abstract class Variable<V> implements Cloneable {
* The {@link InputChangeListener} to add.
*/
public void addListener(InputChangeListener listener) {
if (!listeners.contains(listener)) {
listeners.add(listener);
}
listeners.add(listener);
}
/**
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -25,15 +25,13 @@ public class SelectorWidget extends ValueWidget {
/** The currently selected position */
protected int currentPosition = NONE;
protected int presetPosition = NONE;
protected float presetAngleOffset = 0;
protected boolean isPersistent = false;
// ***************************************************************************
// * Constants *
// ***************************************************************************
public static final int NONE = -1;
private static final double TWO_PI = 2 * Math.PI;
public static int NONE = -1;
private static double TWO_PI = 2 * Math.PI;
// ---------------------------------------------------------------------------
// ***************************************************************************
......@@ -64,7 +62,7 @@ public class SelectorWidget extends ValueWidget {
// ***************************************************************************
// ---------------------------------------------------------------------------
protected int getNumberOfPositions() {
private int getNumberOfPositions() {
List<IndexedCorona> selectableCoronas = getCoronas(IndexedCorona.class);
HashSet<Integer> alreadySeen = new HashSet<>();
......@@ -79,16 +77,6 @@ public class SelectorWidget extends ValueWidget {
// ---------------------------------------------------------------------------
protected float moduloTwoPi(float rawAngle) {
double angle = rawAngle % TWO_PI;
if (angle < 0)
angle += TWO_PI;
return (float) angle;
}
// ---------------------------------------------------------------------------
@Override
protected void updateFromRotation(double angle) {
......@@ -96,12 +84,10 @@ public class SelectorWidget extends ValueWidget {
// ---------------------------------------------------------------------------
protected int getCurrentPosition(float currentAngle) {
private int getCurrentPosition(float angle) {
double segment = TWO_PI / numberOfPositions;
int current = 0;
float angle = this.moduloTwoPi(currentAngle);
// detect in which segment the current rotation is
for (int position = 0; position < numberOfPositions; position++) {
double minrot = (position - 0.5) * segment;
......@@ -118,7 +104,7 @@ public class SelectorWidget extends ValueWidget {
// ---------------------------------------------------------------------------
protected float getCurrentAngle(int position) {
private float getCurrentAngle(int position) {
double segment = TWO_PI / numberOfPositions;
float angle = 0;
......@@ -133,7 +119,7 @@ public class SelectorWidget extends ValueWidget {
// ---------------------------------------------------------------------------
protected void selectPosition(int position) {
private void selectPosition(int position) {
if (position != currentPosition) {
this.getCoronas(IndexedCorona.class).forEach(indexed -> indexed.setSelected(indexed.getIndex() == position));
......@@ -152,18 +138,6 @@ public class SelectorWidget extends ValueWidget {
// ***************************************************************************
// ---------------------------------------------------------------------------
public void reset() {
if (isPersistent) {
this.selectPosition(presetPosition);
Point centre = this.getPosition();
if (centre != null) {
presetAngleOffset = this.moduloTwoPi(this.getCurrentAngle(currentPosition) - (centre.getAngle() - presetAngleOffset));
}
}
}
// ---------------------------------------------------------------------------
public void setSelectedPosition(int position) {
currentPosition = position;
}
......@@ -186,13 +160,9 @@ public class SelectorWidget extends ValueWidget {
@Override
public void actionMove(TangibleObject tuioObject) {
super.actionMove(tuioObject);
double angle = this.moduloTwoPi(tuioObject.getAngle() + presetAngleOffset);
TangibleObject clone = tuioObject.constrainedClone(new Point(tuioObject.getX(), tuioObject.getY(), (float) angle));
super.actionMove(clone);
int position = getCurrentPosition(clone.getAngle());
int position = getCurrentPosition(tuioObject.getAngle());
int widgetId = tuioObject.getObjectId();
StateManager manager = states.get(widgetId);
......@@ -223,12 +193,10 @@ public class SelectorWidget extends ValueWidget {
@Override
public void actionDrop(TangibleObject tuioObject) {
isPersistent = this.isPersistent(tuioObject.getObjectId());
int position = (isPersistent) ? currentPosition : presetPosition;
presetAngleOffset = (isPersistent) ? this.moduloTwoPi(this.getCurrentAngle(position) - tuioObject.getAngle()) : 0;
int position = (this.isPersistent(tuioObject.getObjectId())) ? currentPosition : presetPosition;
float angle = this.getCurrentAngle(position);
TangibleObject clone = tuioObject.constrainedClone(new Point(tuioObject.getX(), tuioObject.getY(), presetAngleOffset));
TangibleObject clone = tuioObject.constrainedClone(new Point(tuioObject.getX(), tuioObject.getY(), angle));
super.actionDrop(clone);
this.selectPosition(position);
......@@ -248,7 +216,7 @@ public class SelectorWidget extends ValueWidget {
public void actionLift(TangibleObject tuioObject) {
super.actionLift(tuioObject);
if (!isPersistent) {
if (!this.isPersistent(tuioObject.getObjectId())) {
this.selectPosition(NONE);
}
}
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
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