Ejemplo n.º 1
0
    def __init(self, negMsgHandler):
        if os.getenv('VR_PREPARE_DEBUG_RUN'):
            print("PartTracerVis.__init")
        """ __init is called from __update

            + start TracerComp module if it does not already exist and connect output to COVER
            + set default parameters of Tracer
            + set default boundingBox which is also used in the GUI to set borders of the float sliders
            + send params to the gui
        """
        if self.__firstTime == True:
            self.__firstTime = False

            # disable sampling if import is transient
            if self.importModule.getIsTransient():
                self._geoSampleNames = []
                self._dataSampleNames = []

            PartModuleVis._init(self, negMsgHandler, USER_DEFINED)
            PartColoredVis._init(self, negMsgHandler, self._module,
                                 'colorMapIn')
            PartInteractorVis._init(self, negMsgHandler)
            self.__register(negMsgHandler)

            #init params
            self._module.set_taskType(self.params.taskType)

            # spread initial line in between bounding box
            # but not when unpickled or values will be overwritten
            if hasattr(
                    self.params, 'start_style'
            ) and self.params.start_style == 1 and not self.fromRecreation:
                self.params.alignedRectangle.setStartEndPoint(
                    self.params.boundingBox.getXMin() / 2.0,
                    self.params.boundingBox.getYMin() / 2.0,
                    self.params.boundingBox.getZMax(),
                    self.params.boundingBox.getXMax() / 2.0,
                    self.params.boundingBox.getYMax() / 2.0,
                    self.params.boundingBox.getZMax())

            # send params to gui
            self.sendParams()
Ejemplo n.º 2
0
    def __init(self, negMsgHandler):
        if os.getenv('VR_PREPARE_DEBUG_RUN'):
            print("PartCuttingSurfaceVis.__init")
        """ __init is called from __update
            + start CuttingSurfaceComp module if it does not already exist and connect output to COVER
            + set default parameters of cuttingsurface
            + set default boundingBox which is also used in the GUI to set borders of the float sliders
            + send params to the gui
        """
        if self.__firstTime == True:
            self.__firstTime = False

            # disable sampling if import is transient
            if self.importModule.getIsTransient():
                self._geoSampleNames = []
                self._dataSampleNames = []

                # special case for PartVectorVis:
                # transient data cannot have sample modules attached to, so do not try to connect CuttingSurface module to sample modules
                if self.params.vector == 3:
                    PartModuleVis._initBase(self, CuttingSurfaceComp,
                                            ['GridIn0'], [], [], [],
                                            ['DataIn0'], [], [], USER_DEFINED)

            PartModuleVis._init(self, negMsgHandler)
            PartColoredVis._init(self, negMsgHandler, self._module)
            PartInteractorVis._init(self, negMsgHandler)
            self.__register(negMsgHandler)

            #init params
            self._module.set_option(1)  # plane
            self._module.set_vector(self.params.vector)

            if hasattr(self.params.boundingBox, 'getXMin') and hasattr(
                    self.params, 'scale'):
                if self.params.scale < 0:
                    self.params.scale = self.params.boundingBox.getMaxEdgeLength(
                    ) * 0.1

            # send params to gui
            self.sendParams()
Ejemplo n.º 3
0
    def __init(self, negMsgHandler):
        """ __init is called from __update

            + start probe3D module if it does not already exist and connect output to COVER
            + set default parameters of Tracer
            + set default boundingBox which is also used in the GUI to set borders of the float sliders
            + send params to the gui
        """
        if self.__firstTime==True:
            PartModuleVis._init(self, negMsgHandler)
            PartColoredVis._init(self, negMsgHandler, self._module, 'colorMapIn')
            PartInteractorVis._init(self, negMsgHandler)      
            self.__register(negMsgHandler)

            #init params
            self._module.set_dimensionality(1) 
            self._module.set_probe_type(self.params.type)
            self._module.set_startpoint1(self.params.startpoint[0],self.params.startpoint[1],self.params.startpoint[2])
            self._module.set_startpoint2(self.params.startpoint[0],self.params.startpoint[1],self.params.startpoint[2])

            # send params to gui
            self.sendParams()
Ejemplo n.º 4
0
    def __init(self, negMsgHandler):
        if os.getenv('VR_PREPARE_DEBUG_RUN'):
            print("PartTracerVis.__init")
            
        """ __init is called from __update

            + start TracerComp module if it does not already exist and connect output to COVER
            + set default parameters of Tracer
            + set default boundingBox which is also used in the GUI to set borders of the float sliders
            + send params to the gui
        """
        if self.__firstTime==True:
            self.__firstTime = False

            # disable sampling if import is transient
            if self.importModule.getIsTransient():
                self._geoSampleNames  = []
                self._dataSampleNames = []

            PartModuleVis._init(self, negMsgHandler, USER_DEFINED)
            PartColoredVis._init(self, negMsgHandler, self._module, 'colorMapIn')
            PartInteractorVis._init(self, negMsgHandler)
            self.__register(negMsgHandler)

            #init params
            self._module.set_taskType(self.params.taskType)

            # spread initial line in between bounding box
            # but not when unpickled or values will be overwritten
            if hasattr(self.params, 'start_style') and self.params.start_style == 1 and not self.fromRecreation:
                self.params.alignedRectangle.setStartEndPoint(self.params.boundingBox.getXMin() / 2.0,
                                                              self.params.boundingBox.getYMin() / 2.0,
                                                              self.params.boundingBox.getZMax(),
                                                              self.params.boundingBox.getXMax() / 2.0,
                                                              self.params.boundingBox.getYMax() / 2.0,
                                                              self.params.boundingBox.getZMax())

            # send params to gui
            self.sendParams()
Ejemplo n.º 5
0
    def __init(self, negMsgHandler):
        if os.getenv('VR_PREPARE_DEBUG_RUN'):
            print("PartCuttingSurfaceVis.__init")
        """ __init is called from __update
            + start CuttingSurfaceComp module if it does not already exist and connect output to COVER
            + set default parameters of cuttingsurface
            + set default boundingBox which is also used in the GUI to set borders of the float sliders
            + send params to the gui
        """
        if self.__firstTime==True:
            self.__firstTime = False

            # disable sampling if import is transient
            if self.importModule.getIsTransient():
                self._geoSampleNames  = []
                self._dataSampleNames = []

                # special case for PartVectorVis:
                # transient data cannot have sample modules attached to, so do not try to connect CuttingSurface module to sample modules
                if self.params.vector == 3:
                    PartModuleVis._initBase(self, CuttingSurfaceComp, ['GridIn0'], [], [], [], ['DataIn0'], [], [], USER_DEFINED)

            PartModuleVis._init(self, negMsgHandler)
            PartColoredVis._init(self, negMsgHandler, self._module)  
            PartInteractorVis._init(self, negMsgHandler)
            self.__register(negMsgHandler)  

            #init params
            self._module.set_option(1) # plane
            self._module.set_vector(self.params.vector)

            if hasattr(self.params.boundingBox, 'getXMin' ) and hasattr(self.params, 'scale'):
                if self.params.scale < 0:
                    self.params.scale = self.params.boundingBox.getMaxEdgeLength() * 0.1

            # send params to gui
            self.sendParams()