X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.processeditor%2Fsrc%2Forg%2Fsimantics%2Fprocesseditor%2Fanimations%2FResourcePipeAnimationController.java;fp=org.simantics.processeditor%2Fsrc%2Forg%2Fsimantics%2Fprocesseditor%2Fanimations%2FResourcePipeAnimationController.java;h=0000000000000000000000000000000000000000;hb=6b6fcff5d6c326feef07ccf8401f97911778fffe;hp=1a0eb31f53a5963808c48aacca943e88cec0c86a;hpb=504c111db40d78f4913badddd126b283b5504dbb;p=simantics%2F3d.git diff --git a/org.simantics.processeditor/src/org/simantics/processeditor/animations/ResourcePipeAnimationController.java b/org.simantics.processeditor/src/org/simantics/processeditor/animations/ResourcePipeAnimationController.java deleted file mode 100644 index 1a0eb31f..00000000 --- a/org.simantics.processeditor/src/org/simantics/processeditor/animations/ResourcePipeAnimationController.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007- VTT Technical Research Centre of Finland. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.processeditor.animations; - -import org.simantics.db.Graph; -import org.simantics.db.Resource; -import org.simantics.processeditor.stubs.PipeRun; -import org.simantics.proconf.g3d.base.JmeRenderingComponent; - -import com.jme.renderer.ColorRGBA; - - -// TODO : this class won't work with valueSets -public class ResourcePipeAnimationController extends PipeAnimationController { - Resource color; - Resource velocity; - - ColorRGBA minColor = new ColorRGBA(0.f,0.f,1.f,1.f); - ColorRGBA maxColor = new ColorRGBA(1.f,0.f,0.f,1.f); - ColorRGBA currentColor = new ColorRGBA(1.f,1.f,1.f,1.f); - - double colorMin; - double colorMax; - double iColorRange; - - double velMin; - double velMax; - double iVelRange; - public ResourcePipeAnimationController(JmeRenderingComponent component, PipeRun pipeline, Resource color,double colorMin, double colorMax, Resource velocity, double velMin, double velMax) { - super(component, pipeline); - this.color = color; - this.velocity = velocity; - - this.colorMin = colorMin; - this.colorMax = colorMax; - this.iColorRange = 1.0/(colorMax-colorMin); - this.velMin = velMin; - this.velMax = velMax; - this.iVelRange = 1.0/(velMax-velMin); - } - - private double getVelocity(Graph graph) { - return graph.getScalarDouble(velocity); - //velocity.getDoubleScalarValue(); - } - - private double getColor(Graph graph) { - return graph.getScalarDouble(color); - } - public void updateAnimation(Graph g,double frameTime) { - double d = (getVelocity(g)-velMin)*iVelRange; - float f = (float)((getColor(g)-colorMin)*iColorRange); - currentColor.interpolate(minColor, maxColor, f); - for (PipeFlowAnimation a : animatables) { - a.animate(d,frameTime); - //a.getParticleGeometry().setDefaultColor(currentColor); - a.getParticleGeometry().setStartColor(currentColor); - a.getParticleGeometry().setEndColor(currentColor); - } - } - - - -}