예제 #1
0
    def __init__(
            self,
            format: BitmapFormat,
            reference: str,  # name of the bitmap file in the topic folder
            location: Point,
            normal: Direction,
            upVector: Direction,
            height: float,
            containingElement=None,
            state: State.States = State.States.ORIGINAL):
        """ Initialisation function of Bitmap """

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        XMLName.__init__(self)
        self.format = format
        self.reference = reference
        self.location = location
        self.normal = normal
        self.upVector = upVector
        self.height = height

        # set containingObject of complex members
        if self.location is not None:
            self.location.containingObject = self
        if self.normal is not None:
            self.normal.containingObject = self
        if self.upVector is not None:
            self.upVector.containingObject = self
예제 #2
0
    def __init__(self,
                 guid: UUID,
                 date: datetime,
                 author: str,
                 comment: str,
                 viewpoint: ViewpointReference = None,
                 modDate: datetime = None,
                 modAuthor: str = "",
                 containingElement=None,
                 state: State.States = State.States.ORIGINAL):
        """ Initialisation function of Comment """

        Hierarchy.__init__(self, containingElement)
        XMLIdentifiable.__init__(self, guid)
        State.__init__(self, state)
        XMLName.__init__(self)
        Identifiable.__init__(self)
        self._comment = SimpleElement(comment, "Comment", "", self)
        self.viewpoint = viewpoint
        self._date = ModificationDate(date, self)
        self._author = ModificationAuthor(author, self)
        self._modDate = ModificationDate(modDate, self,
                                         ModificationType.MODIFICATION)
        self._modAuthor = ModificationAuthor(modAuthor, self,
                                             ModificationType.MODIFICATION)
예제 #3
0
    def __init__(self,
                 id: UUID,
                 components: Components = None,
                 oCamera: OrthogonalCamera = None,
                 pCamera: PerspectiveCamera = None,
                 lines: List[Line] = list(),
                 clippingPlanes: List[ClippingPlane] = list(),
                 bitmaps: List[Bitmap] = list(),
                 containingElement=None,
                 state: State.States = State.States.ORIGINAL):

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        XMLName.__init__(self, "VisualizationInfo")
        Identifiable.__init__(self)
        XMLIdentifiable.__init__(self, id)
        self.components = components
        self.oCamera = oCamera
        self.pCamera = pCamera
        self.lines = lines
        self.clippingPlanes = clippingPlanes
        self.bitmaps = bitmaps

        # set containingObject for complex members
        if self.components is not None:
            self.components.containingObject = self
        if self.oCamera is not None:
            self.oCamera.containingObject = self
        if self.pCamera is not None:
            self.pCamera.containingObject = self
        listSetContainingElement(self.lines, self)
        listSetContainingElement(self.bitmaps, self)
        listSetContainingElement(self.clippingPlanes, self)
예제 #4
0
    def __init__(self,
                 topic: Topic,
                 header: Header = None,
                 comments: List[Comment] = list(),
                 viewpoints: List[ViewpointReference] = list(),
                 snapshotFiles: List[str] = list(),
                 containingElement=None,
                 state: State.States = State.States.ORIGINAL):
        """ Initialization function for Markup """

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        XMLName.__init__(self)
        Identifiable.__init__(self)
        self.header = header
        self.topic = topic
        self.comments = comments
        self.viewpoints = viewpoints
        self.snapshotFiles = snapshotFiles

        # set containing object of members.
        listSetContainingElement(self.viewpoints, self)
        listSetContainingElement(self.comments, self)
        if self.topic is not None:
            self.topic.containingObject = self
        if self.header is not None:
            self.header.containingObject = self
예제 #5
0
    def __init__(self,
                 viewPoint: Point,
                 direction: Direction,
                 upVector: Direction,
                 containingElement=None,
                 state: State.States = State.States.ORIGINAL,
                 xmlName: str = ""):
        """ Initialisation function of Camera """

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        XMLName.__init__(self, xmlName)
        self.viewPoint = viewPoint
        self.viewPoint.xmlName = "CameraViewpoint"
        self.direction = direction
        self.direction.xmlName = "CameraDirection"
        self.upVector = upVector
        self.upVector.xmlName = "CameraUpVector"

        # set containingObject of complex members
        if self.viewPoint is not None:
            self.viewPoint.containingObject = self
        if self.direction is not None:
            self.direction.containingObject = self
        if self.upVector is not None:
            self.upVector.containingObject = self
예제 #6
0
    def __init__(self,
                 uri: str,
                 containingElement=None,
                 state: State.States = State.States.ORIGINAL):

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        Identifiable.__init__(self)
        self.uri = uri
예제 #7
0
    def __init__(self,
                 openingsVisible: bool = False,
                 spacesVisible: bool = False,
                 spaceBoundariesVisible: bool = False,
                 containingElement=None,
                 state: State.States = State.States.ORIGINAL):

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        XMLName.__init__(self)
        self.openingsVisible = openingsVisible
        self.spaceBoundariesVisible = spaceBoundariesVisible
        self.spacesVisible = spacesVisible
예제 #8
0
 def __init__(self,
              value,
              xmlName,
              defaultValue,
              containingElement,
              state=State.States.ORIGINAL):
     XMLName.__init__(self, xmlName)
     Hierarchy.__init__(self, containingElement)
     State.__init__(self, state)
     Identifiable.__init__(self)
     # set value to default if it is None
     self._value = value if value else defaultValue
     self.defaultValue = defaultValue
예제 #9
0
    def __init__(self,
                 ifcId: UUID = None,
                 originatingSystem: str = "",
                 authoringtoolId: str = "",
                 containingElement=None,
                 state: State.States = State.States.ORIGINAL):

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        XMLName.__init__(self)
        self.ifcId = ifcId
        self.originatingSystem = originatingSystem
        self.authoringtoolId = authoringtoolId
예제 #10
0
    def __init__(self,
                 x: float,
                 y: float,
                 z: float,
                 containingElement=None,
                 state: State.States = State.States.ORIGINAL,
                 xmlName: str = ""):

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        XMLName.__init__(self, xmlName)
        self.x = x
        self.y = y
        self.z = z
예제 #11
0
    def __init__(self,
                 files: List[HeaderFile] = list(),
                 containingElement=None,
                 state: State = State.States.ORIGINAL):

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        XMLName.__init__(self)
        Identifiable.__init__(self)
        self.files = files

        # set containingObject to itself for every file to perserve correct
        # Hierarchy
        for f in files:
            f.containingObject = self
예제 #12
0
    def __init__(self,
                 location: Point,
                 direction: Direction,
                 containingElement=None,
                 state: State.States = State.States.ORIGINAL):

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        XMLName.__init__(self)
        self.location = location
        self.direction = direction

        # set containingObject of complex members
        if self.location is not None:
            self.location.containingObject = self
        if self.direction is not None:
            self.direction.containingObject = self
예제 #13
0
    def __init__(self,
                 start: Point,
                 end: Point,
                 containingElement=None,
                 state: State.States = State.States.ORIGINAL):

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        XMLName.__init__(self)
        self.start = start
        self.end = end

        # set containingObject of complex members
        if self.start is not None:
            self.start.containingObject = self
        if self.end is not None:
            self.end.containingObject = self
예제 #14
0
    def __init__(
            self,
            colour: str,
            components: List[Component],  # has to have at least one element
            containingElement=None,
            state: State.States = State.States.ORIGINAL):

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        XMLName.__init__(self, "Coloring")
        if len(components) == 0:
            raise ValueError("`components` has to have at least one element")
        self.colour = colour
        self.components = components

        # set containingObject of complex members
        listSetContainingElement(self.components, self)
예제 #15
0
    def __init__(self,
                 uuid: UUID,
                 name: str = "",
                 extSchemaSrc: Uri = None,
                 xmlName: str = "Project",
                 state: State.States = State.States.ORIGINAL):
        """ Initialisation function of Project """

        Hierarchy.__init__(self, None)  # Project is the topmost element
        State.__init__(self, state)
        XMLName.__init__(self, xmlName)
        XMLIdentifiable.__init__(self, uuid)
        Identifiable.__init__(self)
        self._name = SimpleElement(name, "Name", "", self)
        self._extSchemaSrc = SimpleElement(extSchemaSrc, "ExtensionSchema",
                                           None, self)
        self.topicList = list()
예제 #16
0
    def __init__(self,
                 id: UUID,
                 file: Uri = None,
                 snapshot: Uri = None,
                 index: int = -1,
                 containingElement=None,
                 state: State.States = State.States.ORIGINAL):
        """ Initialisation function of ViewpointReference """

        Hierarchy.__init__(self, containingElement)
        XMLIdentifiable.__init__(self, id)
        State.__init__(self, state)
        XMLName.__init__(self, "Viewpoints")
        Identifiable.__init__(self)
        self._file = SimpleElement(file, "Viewpoint", None, self)
        self._snapshot = SimpleElement(snapshot, "Snapshot", None, self)
        self._index = SimpleElement(index, "Index", -1, self)
        self._viewpoint = None
예제 #17
0
    def __init__(self,
                 data=[],
                 xmlName="",
                 defaultValue=None,
                 containingElement=None,
                 state=State.States.ORIGINAL):

        simpleElementList = list()
        for item in data:
            newSimpleElement = SimpleElement(item, xmlName, defaultValue,
                                             containingElement, state)
            simpleElementList.append(newSimpleElement)

        list.__init__(self, simpleElementList)
        XMLName.__init__(self, xmlName)
        State.__init__(self, state)
        Hierarchy.__init__(self, containingElement)
        Identifiable.__init__(self)
        self.defaultListElement = defaultValue
예제 #18
0
    def __init__(self,
                 ifcProjectId: str = "",
                 ifcSpatialStructureElement: str = "",
                 isExternal: bool = True,
                 filename: str = "",
                 time: datetime = None,
                 reference: str = "",
                 state: State.States = State.States.ORIGINAL,
                 containingElement=None):

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        XMLName.__init__(self, "File")
        Identifiable.__init__(self)
        self._ifcProjectId = Attribute(ifcProjectId, "IfcProject", "", self)
        self._ifcSpatialStructureElement = Attribute(
            ifcSpatialStructureElement, "IfcSpatialStructureElement", "", self)
        self._external = Attribute(isExternal, "isExternal", True, self)
        self._filename = SimpleElement(filename, "Filename", "", self)
        self._time = SimpleElement(time, "Date", None, self)
        self._reference = SimpleElement(reference, "Reference", "", self)
예제 #19
0
    def __init__(self,
                 visibilityDefault: bool,
                 visibilityExceptions: List[Component],
                 selection: List[Component] = list(),
                 viewSetuphints: ViewSetupHints = None,
                 colouring: List[ComponentColour] = list(),
                 containingElement=None,
                 state: State.States = State.States.ORIGINAL):

        Hierarchy.__init__(self, containingElement)
        State.__init__(self, state)
        XMLName.__init__(self)
        self.viewSetuphints = viewSetuphints
        self.selection = selection
        self.visibilityDefault = visibilityDefault
        self.visibilityExceptions = visibilityExceptions
        self.colouring = colouring

        # set containingObject for complex members
        if self.viewSetuphints is not None:
            self.viewSetuphints.containingObject = self
        listSetContainingElement(self.selection, self)
        listSetContainingElement(self.colouring, self)
        listSetContainingElement(self.visibilityExceptions, self)