Changing license to MIT.
[PyCIM.git] / CIM15 / IEC61970 / Graphics / DiagramObjectGluePoint.py
blobfa3f1351f3558e66facf04a2675376d1190db8a4
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
19 # IN THE SOFTWARE.
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.
25 """
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.
31 """
32 self._DiagramObjectPoints = []
33 self.DiagramObjectPoints = [] if DiagramObjectPoints is None else DiagramObjectPoints
35 super(DiagramObjectGluePoint, self).__init__(*args, **kw_args)
37 _attrs = []
38 _attr_types = {}
39 _defaults = {}
40 _enums = {}
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.
46 """
47 return self._DiagramObjectPoints
49 def setDiagramObjectPoints(self, value):
50 for x in self._DiagramObjectPoints:
51 x.DiagramObjectGluePoint = None
52 for y in value:
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