From: Marko Luukkainen Date: Thu, 4 Apr 2019 13:37:43 +0000 (+0300) Subject: Some api and build changes X-Git-Tag: v1.43.0~270 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F39%2F2839%2F1;p=simantics%2F3d.git Some api and build changes Change-Id: I85b1ffae0255398050dd45d847fe03e26828972c --- diff --git a/org.jcae.opencascade.win32.x86_64/.classpath b/org.jcae.opencascade.win32.x86_64/.classpath index 8a8f1668..bc74aabe 100644 --- a/org.jcae.opencascade.win32.x86_64/.classpath +++ b/org.jcae.opencascade.win32.x86_64/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/org.simantics.g3d.csg/src/org/simantics/g3d/csg/scenegraph2/SchemaBuilder.java b/org.simantics.g3d.csg/src/org/simantics/g3d/csg/scenegraph2/SchemaBuilder.java index b44a7693..0534a314 100644 --- a/org.simantics.g3d.csg/src/org/simantics/g3d/csg/scenegraph2/SchemaBuilder.java +++ b/org.simantics.g3d.csg/src/org/simantics/g3d/csg/scenegraph2/SchemaBuilder.java @@ -1,59 +1,59 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Association for Decentralized Information Management in - * Industry THTH ry. - * 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.g3d.csg.scenegraph2; - -import org.simantics.db.ReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.request.Read; -import org.simantics.objmap.graph.schema.IMappingSchema; -import org.simantics.objmap.graph.schema.MappingSchemas; -import org.simantics.objmap.graph.schema.SimpleSchema; -import org.simantics.Simantics; - -public class SchemaBuilder { - - public static IMappingSchema getSchema() throws DatabaseException{ - return Simantics.getSession().syncRequest(new Read>() { - @Override - public IMappingSchema perform(ReadGraph g) - throws DatabaseException { - return getSchema(g); - } - }); - } - - public static IMappingSchema getSchema(ReadGraph g) throws DatabaseException{ - try { - SimpleSchema schema = new SimpleSchema(); - schema.addLinkType(MappingSchemas.fromAnnotations(g, BarrelNode.class)); - schema.addLinkType(MappingSchemas.fromAnnotations(g, BoxNode.class)); - schema.addLinkType(MappingSchemas.fromAnnotations(g, ConeNode.class)); - schema.addLinkType(MappingSchemas.fromAnnotations(g, CylinderNode.class)); - schema.addLinkType(MappingSchemas.fromAnnotations(g, DifferenceNode.class)); - schema.addLinkType(MappingSchemas.fromAnnotations(g, EllipticCylinderNode.class)); - schema.addLinkType(MappingSchemas.fromAnnotations(g, IntersectionNode.class)); - schema.addLinkType(MappingSchemas.fromAnnotations(g, RectangularSolidNode.class)); - schema.addLinkType(MappingSchemas.fromAnnotations(g, RegularPrismNode.class)); - schema.addLinkType(MappingSchemas.fromAnnotations(g, SphereNode.class)); - schema.addLinkType(MappingSchemas.fromAnnotations(g, TorusNode.class)); - schema.addLinkType(MappingSchemas.fromAnnotations(g, UnionNode.class)); - schema.addLinkType(MappingSchemas.fromAnnotations(g, CSGrootNode.class)); - return schema; - } catch (IllegalAccessException e) { - throw new DatabaseException(e); - } catch (InstantiationException e) { - throw new DatabaseException(e); - } - } - -} +/******************************************************************************* + * Copyright (c) 2012, 2013 Association for Decentralized Information Management in + * Industry THTH ry. + * 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.g3d.csg.scenegraph2; + +import org.simantics.Simantics; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.request.Read; +import org.simantics.objmap.graph.schema.IMappingSchema; +import org.simantics.objmap.graph.schema.MappingSchemas; +import org.simantics.objmap.graph.schema.SimpleSchema; + +public class SchemaBuilder { + + public static IMappingSchema getSchema() throws DatabaseException{ + return Simantics.getSession().syncRequest(new Read>() { + @Override + public IMappingSchema perform(ReadGraph g) + throws DatabaseException { + return getSchema(g); + } + }); + } + + public static IMappingSchema getSchema(ReadGraph g) throws DatabaseException{ + try { + SimpleSchema schema = new SimpleSchema(); + schema.addLinkType(MappingSchemas.fromAnnotations(g, BarrelNode.class)); + schema.addLinkType(MappingSchemas.fromAnnotations(g, BoxNode.class)); + schema.addLinkType(MappingSchemas.fromAnnotations(g, ConeNode.class)); + schema.addLinkType(MappingSchemas.fromAnnotations(g, CylinderNode.class)); + schema.addLinkType(MappingSchemas.fromAnnotations(g, DifferenceNode.class)); + schema.addLinkType(MappingSchemas.fromAnnotations(g, EllipticCylinderNode.class)); + schema.addLinkType(MappingSchemas.fromAnnotations(g, IntersectionNode.class)); + schema.addLinkType(MappingSchemas.fromAnnotations(g, RectangularSolidNode.class)); + schema.addLinkType(MappingSchemas.fromAnnotations(g, RegularPrismNode.class)); + schema.addLinkType(MappingSchemas.fromAnnotations(g, SphereNode.class)); + schema.addLinkType(MappingSchemas.fromAnnotations(g, TorusNode.class)); + schema.addLinkType(MappingSchemas.fromAnnotations(g, UnionNode.class)); + schema.addLinkType(MappingSchemas.fromAnnotations(g, CSGrootNode.class)); + return schema; + } catch (IllegalAccessException e) { + throw new DatabaseException(e); + } catch (InstantiationException e) { + throw new DatabaseException(e); + } + } + +} diff --git a/org.simantics.g3d.feature/feature.xml b/org.simantics.g3d.feature/feature.xml index 5989d5d2..c1595fac 100644 --- a/org.simantics.g3d.feature/feature.xml +++ b/org.simantics.g3d.feature/feature.xml @@ -25,13 +25,6 @@ id="vtk.lib" version="0.0.0"/> - - - - + - - - + implements VTKNodeMap, IMappingListener, RenderListener, NodeListener{ +public abstract class AbstractVTKNodeMap implements VTKNodeMap, IMappingListener, RenderListener, NodeListener{ private static final boolean DEBUG = false; @@ -90,7 +90,7 @@ public abstract class AbstractVTKNodeMap implements VTKNodeM @SuppressWarnings("unchecked") @Override - public Collection getRenderObjects(IG3DNode node) { + public Collection getRenderObjects(INode node) { return nodeToActor.getValues((E)node); } @@ -126,7 +126,7 @@ public abstract class AbstractVTKNodeMap implements VTKNodeM @SuppressWarnings("unchecked") @Override - public void updateRenderObjectsFor(IG3DNode node) { + public void updateRenderObjectsFor(INode node) { List toDelete = new ArrayList(); for (vtkProp prop : nodeToActor.getValues((E)node)) { if (prop.GetVTKId() != 0) { diff --git a/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/VTKNodeMap.java b/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/VTKNodeMap.java index e72ea808..09d380c7 100644 --- a/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/VTKNodeMap.java +++ b/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/VTKNodeMap.java @@ -17,7 +17,7 @@ import org.simantics.g3d.scenegraph.base.INode; import vtk.vtkProp; -public interface VTKNodeMap extends NodeMap{ +public interface VTKNodeMap extends NodeMap{ diff --git a/org.simantics.g3d/src/org/simantics/g3d/preferences/G3DPreferencePage.java b/org.simantics.g3d/src/org/simantics/g3d/preferences/G3DPreferencePage.java index 9aa46bbf..bc58a84b 100644 --- a/org.simantics.g3d/src/org/simantics/g3d/preferences/G3DPreferencePage.java +++ b/org.simantics.g3d/src/org/simantics/g3d/preferences/G3DPreferencePage.java @@ -1,14 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Association for Decentralized Information Management in - * Industry THTH ry. - * 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 - *******************************************************************************/ +/******************************************************************************* + * Copyright (c) 2012, 2013 Association for Decentralized Information Management in + * Industry THTH ry. + * 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.g3d.preferences; import org.eclipse.jface.preference.*; @@ -38,7 +38,7 @@ public class G3DPreferencePage public G3DPreferencePage() { super(GRID); setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription("3D modelling prederences"); + setDescription("3D modelling preferences"); } /** @@ -50,7 +50,7 @@ public class G3DPreferencePage public void createFieldEditors() { addField(new RadioGroupFieldEditor( PreferenceConstants.ORIENTATION_PRESENTATION, - "OrientationPresentation", 1, + "Orientation Presentation", 1, new String[][] { { "&Quaternion", "quat" }, { "&Axis-Angle", "aa" },{ "&Euler", "euler" } }, getFieldEditorParent())); String[][] eulerOrders = new String[Order.values().length][2]; diff --git a/vtk.win32.win32.x86_64/.classpath b/vtk.win32.win32.x86_64/.classpath index 8a8f1668..bc74aabe 100644 --- a/vtk.win32.win32.x86_64/.classpath +++ b/vtk.win32.win32.x86_64/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + +