@@ -239,9 +239,9 @@ public CSG setColor(Color color) {
239239 }
240240
241241 public void setMeshColor (Color color ) {
242- if (current != null ) {
242+ if (getCurrentMeshView () != null ) {
243243 PhongMaterial m = new PhongMaterial (color );
244- current .setMaterial (m );
244+ getCurrentMeshView () .setMaterial (m );
245245 }
246246 }
247247
@@ -251,9 +251,9 @@ public void setMeshColor(Color color) {
251251 * @param color the new Temporary color
252252 */
253253 public CSG setTemporaryColor (Color color ) {
254- if (current != null ) {
254+ if (getCurrentMeshView () != null ) {
255255 PhongMaterial m = new PhongMaterial (color );
256- current .setMaterial (m );
256+ getCurrentMeshView () .setMaterial (m );
257257 }
258258 return this ;
259259 }
@@ -269,9 +269,9 @@ public CSG setManipulator(javafx.scene.transform.Affine manipulator) {
269269 return this ;
270270 Affine old = manipulator ;
271271 this .manipulator = manipulator ;
272- if (current != null ) {
273- current .getTransforms ().clear ();
274- current .getTransforms ().add (manipulator );
272+ if (getCurrentMeshView () != null ) {
273+ getCurrentMeshView () .getTransforms ().clear ();
274+ getCurrentMeshView () .getTransforms ().add (manipulator );
275275 }
276276 return this ;
277277 }
@@ -282,10 +282,10 @@ public CSG setManipulator(javafx.scene.transform.Affine manipulator) {
282282 * @return the mesh
283283 */
284284 public MeshView getMesh () {
285- if (current != null )
286- return current ;
287- current = newMesh ();
288- return current ;
285+ if (getCurrentMeshView () != null )
286+ return getCurrentMeshView () ;
287+ setCurrentMeshView ( newMesh () );
288+ return getCurrentMeshView () ;
289289 }
290290
291291 /**
@@ -3451,4 +3451,12 @@ public static void setMinPolygonsForOffloading(int minPolygonsForOffloading) {
34513451 MinPolygonsForOffloading = minPolygonsForOffloading ;
34523452 }
34533453
3454+ public MeshView getCurrentMeshView () {
3455+ return current ;
3456+ }
3457+
3458+ public void setCurrentMeshView (MeshView current ) {
3459+ this .current = current ;
3460+ }
3461+
34543462}
0 commit comments