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.EllipticCylinder)
\r
13 public class EllipticCylinderNode extends CSGnode {
\r
15 private double r1 = 0.5;
\r
16 private double r2 = 1.0;
\r
17 private double h = 1.0;
\r
19 @RelatedSetValue(CSG.URIs.HasMinorRadius)
\r
20 @SetPropertyValue(CSG.URIs.HasMinorRadius)
\r
21 public void setR1(double r1) {
\r
23 firePropertyChanged(CSG.URIs.HasMinorRadius);
\r
26 @RelatedSetValue(CSG.URIs.HasMajorRadius)
\r
27 @SetPropertyValue(CSG.URIs.HasMajorRadius)
\r
28 public void setR2(double r2) {
\r
30 firePropertyChanged(CSG.URIs.HasMajorRadius);
\r
33 @RelatedSetValue(CSG.URIs.HasHeight)
\r
34 @SetPropertyValue(CSG.URIs.HasHeight)
\r
35 public void setH(double h) {
\r
37 firePropertyChanged(CSG.URIs.HasHeight);
\r
40 @RelatedGetValue(CSG.URIs.HasHeight)
\r
41 @GetPropertyValue(value=CSG.URIs.HasHeight, name = "Height")
\r
42 public double getH() {
\r
46 @RelatedGetValue(CSG.URIs.HasMinorRadius)
\r
47 @GetPropertyValue(value=CSG.URIs.HasMinorRadius, name = "Minor Radius")
\r
48 public double getR1() {
\r
52 @RelatedGetValue(CSG.URIs.HasMajorRadius)
\r
53 @GetPropertyValue(value=CSG.URIs.HasMajorRadius, name = "Major Radius")
\r
54 public double getR2() {
\r
59 public TopoDS_Shape getBaseGeometry() {
\r
60 return OccTriangulator.makeEllipticCylinder(h, r1, r2);
\r