Class DistanceCondition
Object
DistanceCondition
- All Implemented Interfaces:
BeforeCondition
A
BeforeCondition
that checks if two ObjectMask
s are within a specified maximum
distance.-
Constructor Summary
ConstructorsConstructorDescriptionDistanceCondition
(Optional<UnitValueDistance> maxDistance, boolean suppressZ, MessageLogger logger) Creates a newDistanceCondition
instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
accept
(ObjectMask source, ObjectMask destination, Optional<UnitConverter> unitConverter) Checks if the source and destination objects satisfy the condition for merging.
-
Constructor Details
-
DistanceCondition
public DistanceCondition(Optional<UnitValueDistance> maxDistance, boolean suppressZ, MessageLogger logger) Creates a newDistanceCondition
instance.- Parameters:
maxDistance
- The maximum allowed distance between objects.suppressZ
- Whether to ignore the Z-dimension when calculating distances.logger
- Logger for outputting messages.
-
-
Method Details
-
accept
public boolean accept(ObjectMask source, ObjectMask destination, Optional<UnitConverter> unitConverter) throws OperationFailedException Description copied from interface:BeforeCondition
Checks if the source and destination objects satisfy the condition for merging.- Specified by:
accept
in interfaceBeforeCondition
- Parameters:
source
- the sourceObjectMask
to be mergeddestination
- the destinationObjectMask
to be merged intounitConverter
- an optionalUnitConverter
for unit conversions- Returns:
- true if the objects satisfy the condition for merging, false otherwise
- Throws:
OperationFailedException
- if the condition check fails
-