Update README.rst
[PyCIM.git] / CIM15 / IEC61970 / Informative / InfGMLSupport / GmlTopologyStyle.py
blob8f80a0f4df0f4adc3951bbf86e0166dd6c33e211
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.IEC61970.Core.IdentifiedObject import IdentifiedObject
23 class GmlTopologyStyle(IdentifiedObject):
24 """The style for one topology property. Similarly to the Geometry style, a feature can have multiple topology properties, thus multiple topology style descriptors can be specified within one feature style.The style for one topology property. Similarly to the Geometry style, a feature can have multiple topology properties, thus multiple topology style descriptors can be specified within one feature style.
25 """
27 def __init__(self, GmlLableStyle=None, GmlFeatureStyle=None, *args, **kw_args):
28 """Initialises a new 'GmlTopologyStyle' instance.
30 @param GmlLableStyle:
31 @param GmlFeatureStyle:
32 """
33 self._GmlLableStyle = None
34 self.GmlLableStyle = GmlLableStyle
36 self._GmlFeatureStyle = None
37 self.GmlFeatureStyle = GmlFeatureStyle
39 super(GmlTopologyStyle, self).__init__(*args, **kw_args)
41 _attrs = []
42 _attr_types = {}
43 _defaults = {}
44 _enums = {}
45 _refs = ["GmlLableStyle", "GmlFeatureStyle"]
46 _many_refs = []
48 def getGmlLableStyle(self):
50 return self._GmlLableStyle
52 def setGmlLableStyle(self, value):
53 if self._GmlLableStyle is not None:
54 filtered = [x for x in self.GmlLableStyle.GmlTopologyStyles if x != self]
55 self._GmlLableStyle._GmlTopologyStyles = filtered
57 self._GmlLableStyle = value
58 if self._GmlLableStyle is not None:
59 if self not in self._GmlLableStyle._GmlTopologyStyles:
60 self._GmlLableStyle._GmlTopologyStyles.append(self)
62 GmlLableStyle = property(getGmlLableStyle, setGmlLableStyle)
64 def getGmlFeatureStyle(self):
66 return self._GmlFeatureStyle
68 def setGmlFeatureStyle(self, value):
69 if self._GmlFeatureStyle is not None:
70 filtered = [x for x in self.GmlFeatureStyle.GmlTobologyStyles if x != self]
71 self._GmlFeatureStyle._GmlTobologyStyles = filtered
73 self._GmlFeatureStyle = value
74 if self._GmlFeatureStyle is not None:
75 if self not in self._GmlFeatureStyle._GmlTobologyStyles:
76 self._GmlFeatureStyle._GmlTobologyStyles.append(self)
78 GmlFeatureStyle = property(getGmlFeatureStyle, setGmlFeatureStyle)