Package com.j3d.engine.scene.copy
GObject references.
Copying
GObjects aren't usually copied but in the event that they do need to this package provides the utilities needed to do so.
Process
If generic copying via selection is needed, rather
Otherwise the setup is as follows:
- Collect all GObjects which need to be copied.
-
Create a new
CopyProperties. -
Call
GObject.copy(CopyProperties).
Make sure to call on the points first, then the liens then the tris to ensure that all dependencies are copied before their dependents, preventing
InvalidCopyExceptiondue to missing references.This should be wrapped in a try-catch block to catch
InvalidCopyExceptionand hence clear all references that got made in the process before the exception occured. Otherwise, this exception will be rethrown byStaticRefs.getErrs().
Classes
-
CanCopy, the interface which enforces that implementing objects provide aCanCopy.copy(CopyProperties)method with their own implementation. This is usually only used by GObjects anyways. -
CopyProperties, the properties of a copy operation which hold booleans related to the copy operation, the current list of copied objects linked to their original object's UUID and management of fetching and getting. A singleCopyPropertiesinstance should be made and passed into the multiple GObjects that would like to be copied in a single operation. -
Copy, a record that encapsulates an original object'sUUIDand its corresponding copiedGObjectinstance. It's used internally byCopyPropertiesto track which original objects have been copied and to what new instances.
Copy.equals(java.lang.Object)andCopy.hashCode()only useCopy.original()(the original object's UUID). -
CopyPropertiesBuilder, a builder class for creatingCopyPropertiesinstances. It provides an API to configure various properties related to the copying ofGObjectinstances. -
InvalidCopyException, an exception thrown when an attempt to copy objects fails, typically indicating an issue during the deep copying process or with missing dependencies.
- Author:
- Lehlogonolo Poole
- See Also:
-
ClassDescriptionInterface for objects that can be copied.Represents a copy of a
GObject, linking it back to its original.The properties used when a copy operation is applied.A builder class for creatingCopyPropertiesinstances.Exception thrown when an attempt to copy objects fails.