-/*******************************************************************************\r
- * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.processeditor.scenegraph;\r
-\r
-import javax.vecmath.AxisAngle4d;\r
-\r
-import org.simantics.db.Graph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.processeditor.ProcessResource;\r
-import org.simantics.processeditor.common.ControlPointTools;\r
-import org.simantics.processeditor.stubs.PipeControlPoint;\r
-import org.simantics.processeditor.stubs.PipelineComponent;\r
-import org.simantics.proconf.g3d.base.ThreeDimensionalEditorBase;\r
-import org.simantics.proconf.g3d.scenegraph.IGraphicsNode;\r
-import org.simantics.proconf.g3d.scenegraph.ParameterizedModelNode;\r
-\r
-\r
-\r
-\r
-public class PipelineComponentNode extends ParameterizedModelNode {\r
-\r
- boolean updating = false;\r
- \r
- public PipelineComponentNode(ThreeDimensionalEditorBase editor, IGraphicsNode parent, Graph graph, Resource resource) {\r
- super(editor,parent,graph, resource, ProcessResource.plant3Dresource.HasGraphics);\r
- PipelineComponent component = new PipelineComponent(graph, resource);\r
- if(!component.isInstanceOf(ProcessResource.plant3Dresource.PipelineComponent))\r
- throw new RuntimeException("Resource must be instance of Inline Component " + resource);\r
- if (!(parent instanceof PipeRunNode))\r
- throw new RuntimeException("Parent must be instance of PipelineNode " + parent.getResource() + " " + resource);\r
-\r
- //PipeControlPoint pcp = component.getControlPoint();\r
-// monitor = new StructuralChangeMonitor(\r
-// new StructuralChangeListener[] { this }, pcp.getResource(), GlobalIdMap\r
-// .get(Layer0Mapping.HAS_PROPERTY));\r
- updateTransform(graph);\r
- }\r
- \r
-// public void handleUpdate(StructuralChangeMonitor monitor, GraphChangeEvent event) {\r
-// if (updating)\r
-// return;\r
-// if (event.getParameter() instanceof InlineComponentNode)\r
-// return;\r
-// if (event.getTransactionId() == null)\r
-// return;\r
-// if (event.getParameter() instanceof AbstractGraphicsNode)\r
-// return;\r
-//\r
-// updating = true;\r
-// updateTransform();\r
-// updating = false;\r
-// }\r
- \r
- public void updateTransform(Graph graph) {\r
- super.updateTransform(graph);\r
- /*\r
- PipelineComponent component = new PipelineComponent(graph,shapeResource);\r
- \r
- PipeControlPoint pcp = component.getControlPoint();\r
- Double angle = component.getAtMostOneRelatedScalarDouble(ProcessResource.plant3Dresource.HasRotationAngle);\r
- double componentAngle = 0.0;\r
- if (angle != null)\r
- componentAngle = angle;\r
-\r
- AxisAngle4d aa = ControlPointTools.getControlPointRotation(pcp, componentAngle);\r
- update(aa);\r
- */\r
- }\r
- \r
- \r
- public void dispose() {\r
- //monitor.dispose();\r
- super.dispose();\r
- }\r
- \r
-\r
- \r
-\r
-}
\ No newline at end of file