1 /*******************************************************************************
\r
2 * Copyright (c) 2012, 2013 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.g3d.csg.scenegraph2;
\r
14 import org.jcae.opencascade.jni.TopoDS_Shape;
\r
15 import org.simantics.g3d.csg.ontology.CSG;
\r
16 import org.simantics.g3d.property.annotations.GetPropertyValue;
\r
17 import org.simantics.g3d.property.annotations.SetPropertyValue;
\r
18 import org.simantics.objmap.graph.annotations.GraphType;
\r
19 import org.simantics.objmap.graph.annotations.RelatedGetValue;
\r
20 import org.simantics.objmap.graph.annotations.RelatedSetValue;
\r
21 import org.simantics.opencascade.OccTriangulator;
\r
23 @GraphType(CSG.URIs.Sphere)
\r
24 public class SphereNode extends CSGnode {
\r
26 private double r = 1.0;
\r
28 @RelatedSetValue(CSG.URIs.HasRadius)
\r
29 @SetPropertyValue(CSG.URIs.HasRadius)
\r
30 public void setR(double r) {
\r
32 firePropertyChanged(CSG.URIs.HasRadius);
\r
35 @RelatedGetValue(CSG.URIs.HasRadius)
\r
36 @GetPropertyValue(value=CSG.URIs.HasRadius, name="Radius")
\r
37 public double getR() {
\r
42 public TopoDS_Shape getBaseGeometry() {
\r
43 return OccTriangulator.makeSphere(0, 0, 0, r);
\r