/
IMultiShape.java
79 lines (73 loc) · 2.44 KB
/
IMultiShape.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*******************************************************************************
* Copyright (c) 2011, 2015 itemis AG and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Alexander Nyßen (itemis AG) - initial API and implementation
*
*******************************************************************************/
package org.eclipse.gef4.geometry.planar;
/**
* <p>
* In contradiction to the relation of the IPolyCurve to the ICurve interfaces,
* the IMultiShape interface does not extend the IShape interface. Anyhow, they
* share their interface methods. You can test an IGeometry for containment
* using the contains(IGeometry) method and the outline segments can be
* retrieved via the getOutlineSegments() method.
* </p>
*
* @author anyssen
*
*/
public interface IMultiShape extends IGeometry {
/**
* Checks if the given {@link IGeometry} is fully contained by this
* {@link IMultiShape}.
*
* @param g
* The {@link IGeometry} which is tested for containment.
* @return <code>true</code> if the {@link IGeometry} is contained by this
* {@link IMultiShape}, otherwise <code>false</code>
*/
public boolean contains(final IGeometry g);
/**
* <p>
* Computes the outlines of this {@link IMultiShape}.
* </p>
*
* <p>
* The outlines are returned as an array of {@link ICurve}s. For every
* closed outline of this {@link IMultiShape} one {@link ICurve} is
* returned.
* </p>
*
* @return an array of {@link ICurve}s, one for each closed outline
*/
public ICurve[] getOutlines();
/**
* <p>
* Computes the outline segments of this {@link IMultiShape}.
* </p>
*
* <p>
* Each {@link ICurve} segment of the outline of the internal {@link IShape}
* s can be either an inner segment or an outer segment. This method
* extracts only the outer segments. The segments bordering voids are
* considered to be outer segments, too.
* </p>
*
* @return the outline segments of this {@link IMultiShape}
*/
public ICurve[] getOutlineSegments();
/**
* Returns the {@link IShape}s that constitute this {@link IMultiShape}.
*
* @return an array of {@link IShape}s, representing the parts that make up
* this {@link IMultiShape}.
*/
IShape[] getShapes();
}