1 package org.simantics.g3d.csg.scenegraph2;
\r
3 import org.jcae.opencascade.jni.TopoDS_Shape;
\r
4 import org.simantics.g3d.csg.ontology.CSG;
\r
5 import org.simantics.g3d.property.annotations.GetPropertyValue;
\r
6 import org.simantics.g3d.property.annotations.SetPropertyValue;
\r
7 import org.simantics.objmap.graph.annotations.GraphType;
\r
8 import org.simantics.objmap.graph.annotations.RelatedGetValue;
\r
9 import org.simantics.objmap.graph.annotations.RelatedSetValue;
\r
10 import org.simantics.opencascade.OccTriangulator;
\r
12 @GraphType(CSG.URIs.Sphere)
\r
13 public class SphereNode extends CSGnode {
\r
15 private double r = 1.0;
\r
17 @RelatedSetValue(CSG.URIs.HasRadius)
\r
18 @SetPropertyValue(CSG.URIs.HasRadius)
\r
19 public void setR(double r) {
\r
21 firePropertyChanged(CSG.URIs.HasRadius);
\r
24 @RelatedGetValue(CSG.URIs.HasRadius)
\r
25 @GetPropertyValue(value=CSG.URIs.HasRadius, name="Radius")
\r
26 public double getR() {
\r
31 public TopoDS_Shape getBaseGeometry() {
\r
32 return OccTriangulator.makeSphere(0, 0, 0, r);
\r