1 # Copyright (C) 2010-2011 Richard Lincoln
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to
5 # deal in the Software without restriction, including without limitation the
6 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 # sell copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 from CIM15
.Element
import Element
23 class DiagramObjectGluePoint(Element
):
24 """This is used for grouping DiagramObjectPoints from different DiagramObjects that are considered to be ‘glued’ together in a diagram even if they are not at the exact same coordinates.This is used for grouping DiagramObjectPoints from different DiagramObjects that are considered to be ‘glued’ together in a diagram even if they are not at the exact same coordinates.
27 def __init__(self
, DiagramObjectPoints
=None, *args
, **kw_args
):
28 """Initialises a new 'DiagramObjectGluePoint' instance.
30 @param DiagramObjectPoints: A diagram object glue point is associated with 2 or more object points that are considered to be 'glued' together.
32 self
._DiagramObjectPoints
= []
33 self
.DiagramObjectPoints
= [] if DiagramObjectPoints
is None else DiagramObjectPoints
35 super(DiagramObjectGluePoint
, self
).__init
__(*args
, **kw_args
)
41 _refs
= ["DiagramObjectPoints"]
42 _many_refs
= ["DiagramObjectPoints"]
44 def getDiagramObjectPoints(self
):
45 """A diagram object glue point is associated with 2 or more object points that are considered to be 'glued' together.
47 return self
._DiagramObjectPoints
49 def setDiagramObjectPoints(self
, value
):
50 for x
in self
._DiagramObjectPoints
:
51 x
.DiagramObjectGluePoint
= None
53 y
._DiagramObjectGluePoint
= self
54 self
._DiagramObjectPoints
= value
56 DiagramObjectPoints
= property(getDiagramObjectPoints
, setDiagramObjectPoints
)
58 def addDiagramObjectPoints(self
, *DiagramObjectPoints
):
59 for obj
in DiagramObjectPoints
:
60 obj
.DiagramObjectGluePoint
= self
62 def removeDiagramObjectPoints(self
, *DiagramObjectPoints
):
63 for obj
in DiagramObjectPoints
:
64 obj
.DiagramObjectGluePoint
= None