@@ -0,0 +1,1921 @@
+/*%0A * JaamSim Discrete Event Simulation%0A * Copyright (C) 2017 JaamSim Software Inc.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.jaamsim.Commands;%0A%0Aimport java.util.ArrayList;%0A%0Aimport com.jaamsim.Graphics.DisplayEntity;%0Aimport com.jaamsim.input.InputAgent;%0Aimport com.jaamsim.input.KeywordIndex;%0Aimport com.jaamsim.math.Vec3d;%0A%0Apublic class CoordinateCommand extends KeywordCommand %7B%0A%0A%09private final DisplayEntity dispEnt;%0A%09private final Vec3d globalPos;%0A%09private final ArrayList%3CVec3d%3E globalPts;%0A%0A%09public CoordinateCommand(DisplayEntity ent, KeywordIndex... kws) %7B%0A%09%09super(ent, kws);%0A%09%09dispEnt = ent;%0A%09%09globalPos = ent.getGlobalPosition();%0A%09%09ArrayList%3CVec3d%3E pts = ent.getPoints();%0A%09%09if (pts == null %7C%7C pts.isEmpty()) %7B%0A%09%09%09globalPts = null;%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09globalPts = ent.getGlobalPosition(pts);%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public void execute() %7B%0A%09%09super.execute();%0A%09%09resetPosition();%0A%09%7D%0A%0A%09@Override%0A%09public void undo() %7B%0A%09%09super.undo();%0A%09%09resetPosition();%0A%09%7D%0A%0A%09private void resetPosition() %7B%0A%09%09Vec3d localPos = dispEnt.getLocalPosition(globalPos);%0A%09%09KeywordIndex posKw = InputAgent.formatPointInputs(%22Position%22, localPos, %22m%22);%0A%09%09InputAgent.apply(dispEnt, posKw);%0A%0A%09%09if (globalPts != null) %7B%0A%09%09%09ArrayList%3CVec3d%3E localPts = dispEnt.getLocalPosition(globalPts);%0A%09%09%09KeywordIndex ptsKw = InputAgent.formatPointsInputs(%22Points%22, localPts, new Vec3d());%0A%09%09%09InputAgent.apply(dispEnt, ptsKw);%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

add CoordinateCommand