/*
 * JaamSim Discrete Event Simulation
 * Copyright (C) 2002-2011 Ausenco Engineering Canada Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.jaamsim.Graphics;

import com.jaamsim.math.Quaternion;
import com.jaamsim.math.Transform;

public class Region extends DisplayEntity {

	{
		this.addSynonym(positionInput, "Origin");

		desc.setHidden(true);
		regionInput.setHidden(true);
		relativeEntity.setHidden(true);
	}

	public Region() {}

	@Override
	public void setInputsForDragAndDrop() {}

	/**
	 * Return the transformation that converts the local coordinates for a
	 * point to global coordinates.
	 * @return transformation to global coordinates
	 */
	public Transform getRegionTrans() {
		Quaternion rot = new Quaternion();
		rot.setEuler3(getOrientation());
		return new Transform(getPosition(), rot, 1.0d);
	}

	/**
	 * Return the transformation that converts the local coordinates for a
	 * vector to global coordinates.
	 * @return transformation to global coordinates
	 */
	public Transform getRegionTransForVectors() {
		Quaternion rot = new Quaternion();
		rot.setEuler3(getOrientation());
		return new Transform(null, rot, 1.0d);
	}

	/**
	 * Return the transformation that converts the global coordinates for a
	 * point to local coordinates for the region.
	 * @return transformation to global coordinates
	 */
	public Transform getInverseRegionTrans() {
		Transform trans = new Transform();
		this.getRegionTrans().inverse(trans);
		return trans;
	}

	/**
	 * Return the transformation that converts the global coordinates for a
	 * vector to local coordinates for the region.
	 * @return transformation to global coordinates
	 */
	public Transform getInverseRegionTransForVectors() {
		Transform trans = new Transform();
		this.getRegionTransForVectors().inverse(trans);
		return trans;
	}

}

@@ -92,19 +92,63 @@
 da Inc.%0A
+ * Copyright (C) 2019 JaamSim Software Inc.%0A
  *%0A
-
  * Licen
@@ -729,16 +729,87 @@
 phics;%0A%0A
+import com.jaamsim.input.Keyword;%0Aimport com.jaamsim.input.ValueInput;%0A
 import c
@@ -870,16 +870,60 @@
 ansform;
+%0Aimport com.jaamsim.units.DimensionlessUnit;
 %0A%0Apublic
@@ -961,16 +961,166 @@
 tity %7B%0A%0A
+%09@Keyword(description = %22If TRUE, the object is displayed in the View windows.%22,%0A%09         exampleList = %7B%22FALSE%22%7D)%0A%09private final ValueInput scale;%0A%0A
 %09%7B%0A%09%09thi
@@ -1247,16 +1247,140 @@
 n(true);
+%0A%0A%09%09scale = new ValueInput(%22Scale%22, KEY_INPUTS, 1.0d);%0A%09%09scale.setUnitType(DimensionlessUnit.class);%0A%09%09this.addInput(scale);
 %0A%09%7D%0A%0A%09pu
@@ -1451,16 +1451,75 @@
 p() %7B%7D%0A%0A
+%09public double getScale() %7B%0A%09%09return scale.getValue();%0A%09%7D%0A%0A
 %09/**%0A%09 *
@@ -1822,28 +1822,34 @@
 ion(), rot, 
-1.0d
+getScale()
 );%0A%09%7D%0A%0A%09/**%0A
@@ -2161,20 +2161,26 @@
 l, rot, 
-1.0d
+getScale()
 );%0A%09%7D%0A%0A%09

add keyword 'Scale' to Region