1 import "G3D/Math/Tuple3d"
2 import "G3D/Math/Quat4d"
3 import "G3D/Math/Vector3d"
4 import "G3D/Math/Point3d"
6 include "G3D/Scenegraph/Node"
7 include "G3D/Scenegraph/G3DNode"
11 import "JavaBuiltin" as Java
13 importJava "org.simantics.plant3d.scenegraph.PipelineComponent" where
14 data PipelineComponent
17 getPipeRun' :: PipelineComponent -> <Proc> PipeRun
19 setPipeRun' :: PipelineComponent -> PipeRun -> <Proc> ()
21 @JavaName getAlternativePipeRun
22 getAlternativePipeRun' :: PipelineComponent -> <Proc> Maybe PipeRun
23 @JavaName setAlternativePipeRun
24 setAlternativePipeRun' :: PipelineComponent -> PipeRun -> <Proc> ()
26 @JavaName updateParameters
27 updateParameters' :: PipelineComponent -> ()
30 getNext' :: PipelineComponent -> Maybe PipelineComponent
32 setNext' :: PipelineComponent -> Maybe PipelineComponent -> <Proc> ()
35 getPrevious' :: PipelineComponent -> <Proc> Maybe PipelineComponent
37 setPrevious' :: PipelineComponent -> Maybe PipelineComponent -> <Proc> ()
40 getBranch0' :: PipelineComponent -> <Proc> Maybe PipelineComponent
42 setBranch0' :: PipelineComponent -> Maybe PipelineComponent -> <Proc> ()
45 getType' :: PipelineComponent -> <Proc> String
47 @JavaName getControlPoint
48 getControlPoint' :: PipelineComponent -> <Proc> PipeControlPoint
51 remove' :: PipelineComponent -> <Proc> ()
53 @JavaName getFlowLength
54 getFlowLength' :: PipelineComponent -> <Proc> Maybe Double
56 getEnds' :: PipelineComponent -> MTuple3d -> MTuple3d -> <Proc> ()
57 @JavaName getEndDirections
58 getEndDirections' :: PipelineComponent -> MTuple3d -> MTuple3d -> <Proc> ()
61 getVolume' :: PipelineComponent -> <Proc> Double
64 getCentroid' :: PipelineComponent -> MTuple3d -> <Proc> ()
66 class PipelineComponentClass a where
67 asPipelineComponent :: a -> PipelineComponent
68 asPipelineComponent = Java.unsafeCoerce
70 getPipeRun :: a -> <Proc> PipeRun
71 getPipeRun c = getPipeRun' (asPipelineComponent c)
72 setPipeRun :: a -> PipeRun -> <Proc> ()
73 setPipeRun c = setPipeRun' (asPipelineComponent c)
75 getAlternativePipeRun :: a -> <Proc> Maybe PipeRun
76 getAlternativePipeRun c = getAlternativePipeRun' (asPipelineComponent c)
77 setAlternativePipeRun :: a -> PipeRun -> <Proc> ()
78 setAlternativePipeRun c = setAlternativePipeRun' (asPipelineComponent c)
80 updateParameters :: a -> <Proc> ()
81 updateParameters c = updateParameters' (asPipelineComponent c)
83 getNext :: a -> <Proc> Maybe PipelineComponent
84 getNext c = getNext' (asPipelineComponent c)
85 setNext :: a -> Maybe PipelineComponent -> <Proc> ()
86 setNext c = setNext' (asPipelineComponent c)
88 getPrevious :: a -> <Proc> Maybe PipelineComponent
89 getPrevious c = getPrevious' (asPipelineComponent c)
90 setPrevious :: a -> Maybe PipelineComponent -> <Proc> ()
91 setPrevious c = setPrevious' (asPipelineComponent c)
93 getBranch0 :: a -> <Proc> Maybe PipelineComponent
94 getBranch0 c = getBranch0' (asPipelineComponent c)
95 setBranch0 :: a -> Maybe PipelineComponent -> <Proc> ()
96 setBranch0 c = setBranch0' (asPipelineComponent c)
98 getType :: a -> <Proc> String
99 getType c = getType' (asPipelineComponent c)
101 getControlPoint :: a -> <Proc> PipeControlPoint
102 getControlPoint c = getControlPoint (asPipelineComponent c)
104 remove :: a -> <Proc> ()
105 remove c = remove' (asPipelineComponent c)
107 getFlowLength :: a -> <Proc> Maybe Double
108 getFlowLength c = getFlowLength' (asPipelineComponent c)
110 getEnds :: a -> <Proc> (Vector3d, Vector3d)
111 getEnds c = runProc let
112 p1 = defaultMVector3d
113 p2 = defaultMVector3d
114 getEnds' (asPipelineComponent c) (asMTuple p1) (asMTuple p2)
115 in (freeze p1, freeze p2)
117 getEndDirections :: a -> <Proc> (Vector3d, Vector3d)
118 getEndDirections c = runProc let
119 p1 = defaultMVector3d
120 p2 = defaultMVector3d
121 getEndDirections' (asPipelineComponent c) (asMTuple p1) (asMTuple p2)
122 in (freeze p1, freeze p2)
124 getVolume :: a -> <Proc> Double
125 getVolume c = getVolume' (asPipelineComponent c)
127 getCentroid :: a -> <Proc> Vector3d
128 getCentroid c = runProc let
130 getCentroid' (asPipelineComponent c) (asMTuple p)
133 instance NodeClass PipelineComponent
134 instance G3DNodeClass PipelineComponent
135 instance P3DNodeClass PipelineComponent
136 instance PipelineComponentClass PipelineComponent where
137 asPipelineComponent = id
139 importJava "org.simantics.plant3d.scenegraph.controlpoint.PipeControlPoint$PointType" where
146 importJava "org.simantics.plant3d.scenegraph.controlpoint.PipeControlPoint$Direction" where
152 DPREVIOUS :: Direction
154 importJava "org.simantics.plant3d.scenegraph.controlpoint.PipeControlPoint$PositionType" where
158 PREVIOUS :: PositionType
159 SPLIT :: PositionType
162 importJava "org.simantics.plant3d.scenegraph.controlpoint.PipeControlPoint" where
163 data PipeControlPoint
165 getPipelineComponent :: PipeControlPoint -> PipelineComponent
168 //getPointType :: PipeControlPoint -> PointType
170 isFixed :: PipeControlPoint -> <Proc> Boolean
172 getSubPoint :: PipeControlPoint -> <Proc> [PipeControlPoint]
173 getParentPoint :: PipeControlPoint -> <Proc> Maybe PipeControlPoint
175 importJava "org.simantics.plant3d.scenegraph.PipeRun" where
178 getTurnRadius :: PipeRun -> <Proc> Double
179 setTurnRadius :: PipeRun -> Double -> <Proc> ()
181 getPipeDiameter :: PipeRun -> <Proc> Double
182 setPipeDiameter :: PipeRun -> Double -> <Proc> ()
184 addChild :: PipeRun -> PipelineComponent -> <Proc> ()
185 getChild :: PipeRun -> <Proc> [PipelineComponent]
186 remChild :: PipeRun -> PipelineComponent -> <Proc> ()
188 getSortedChild :: PipeRun -> <Proc> [PipelineComponent]
190 instance NodeClass PipeRun
191 instance ParentNodeClass PipeRun
192 instance G3DNodeClass PipeRun
193 instance P3DNodeClass PipeRun