示例#1
0
    def __init(self, negMsgHandler):
        """ __init is called from __update
            + start _module module if it does not already exist and connect output to COVER
            + set default parameters of module
            + set default boundingBox which is also used in the GUI to set borders of the float sliders
            + set color inport and corresponding module
            + send params to the gui
        """
        if self.__firstTime == True:
            self.__firstTime = False
            PartModuleVis._init(self, negMsgHandler)
            PartColoredVis._init(self, negMsgHandler, self.__myColors, 'ColormapIn0')
            
            # make my custom connections between further self created modules here
            theNet().connect(self._module, 'GridOut0', self.__myCollect, 'GridIn0')
            if not self.params.variable == 'unset': 
                theNet().connect(self.__myColors, 'DataOut0', self.__myCollect, 'DataIn0')
                theNet().connect(self._module, 'DataOut0', self.__myColors, 'DataIn0')
            else: 
                theNet().disconnect(self.__myColors, 'DataOut0', self.__myCollect, 'DataIn0')
                theNet().disconnect(self._module, 'DataOut0', self.__myColors, 'DataIn0')
                    

            # send params to gui
            self.sendParams()
示例#2
0
    def __init(self, negMsgHandler):
        """ __init is called from __update
            + start _module module if it does not already exist and connect output to COVER
            + set default parameters of module
            + set default boundingBox which is also used in the GUI to set borders of the float sliders
            + set color inport and corresponding module
            + send params to the gui
        """
        if self.__firstTime == True:
            self.__firstTime = False
            PartModuleVis._init(self, negMsgHandler)
            PartColoredVis._init(self, negMsgHandler, self.__myColors,
                                 'ColormapIn0')

            # make my custom connections between further self created modules here
            theNet().connect(self._module, 'GridOut0', self.__myCollect,
                             'GridIn0')
            if not self.params.variable == 'unset':
                theNet().connect(self.__myColors, 'DataOut0', self.__myCollect,
                                 'DataIn0')
                theNet().connect(self._module, 'DataOut0', self.__myColors,
                                 'DataIn0')
            else:
                theNet().disconnect(self.__myColors, 'DataOut0',
                                    self.__myCollect, 'DataIn0')
                theNet().disconnect(self._module, 'DataOut0', self.__myColors,
                                    'DataIn0')

            # send params to gui
            self.sendParams()
示例#3
0
    def __init(self, negMsgHandler):
        """ __init is called from __update
            + start _module module if it does not already exist and connect output to COVER
            + set default parameters of module
            + set default boundingBox which is also used in the GUI to set borders of the float sliders
            + set color inport and corresponding module
            + send params to the gui
        """
        if self.__firstTime == True:
            self.__firstTime = False
            PartModuleVis._init(self, negMsgHandler)
            PartColoredVis._init(self, negMsgHandler, self.__myColors,
                                 'ColormapIn0')
            self.__register(negMsgHandler)

            # make my custom connections between further self created modules here
            theNet().connect(self._module, 'linesOut', self.__myCollect,
                             'GridIn0')
            theNet().connect(self.__myColors, 'DataOut0', self.__myCollect,
                             'DataIn0')
            theNet().connect(self._module, 'dataOut', self.__myColors,
                             'DataIn0')

            # adjust slider range from bounding box
            # done only once, range wont change anymore
            #            maxSideLength = self.params.boundingBox.getMaxEdgeLength()
            #            self.params.minScalingValue = -maxSideLength
            #            self.params.maxScalingValue =  maxSideLength

            # append variable name to real name if not fromRecreation
            if not self.fromRecreation:
                self.params.name = self.params.name + " (" + self.params.variable + ")"

            # send params to gui
            self.sendParams()
示例#4
0
    def __init(self, negMsgHandler):
        """ __init is called from __update
            + start _module module if it does not already exist and connect output to COVER
            + set default parameters of module
            + set default boundingBox which is also used in the GUI to set borders of the float sliders
            + set color inport and corresponding module
            + send params to the gui
        """
        if self.__firstTime == True:
            self.__firstTime = False
            PartModuleVis._init(self, negMsgHandler)
            PartColoredVis._init(self, negMsgHandler, self.__myColors, 'ColormapIn0')
            self.__register(negMsgHandler)

            # make my custom connections between further self created modules here
            theNet().connect(self._module, 'linesOut', self.__myCollect, 'GridIn0')
            theNet().connect(self.__myColors, 'DataOut0', self.__myCollect, 'DataIn0')
            theNet().connect(self._module, 'dataOut', self.__myColors, 'DataIn0')

            # adjust slider range from bounding box
            # done only once, range wont change anymore
#            maxSideLength = self.params.boundingBox.getMaxEdgeLength()
#            self.params.minScalingValue = -maxSideLength
#            self.params.maxScalingValue =  maxSideLength

            # append variable name to real name if not fromRecreation
            if not self.fromRecreation:
                self.params.name = self.params.name + " (" + self.params.variable + ")"

            # send params to gui
            self.sendParams()
示例#5
0
    def __init(self, negMsgHandler):
        """ __init is called from __update"""
        if self.__firstTime == True:
            self.__firstTime = False

            PartModuleVis._init(self, negMsgHandler)
            PartColoredVis._initColor(self, negMsgHandler)
示例#6
0
    def __init(self, negMsgHandler):
        """ __init is called from __update
            + start _module module if it does not already exist and connect output to COVER
            + set default parameters of module
            + set default boundingBox which is also used in the GUI to set borders of the float sliders
            + set color inport and corresponding module
            + send params to the gui
        """
        if self.__firstTime == True:
            self.__firstTime = False
            PartModuleVis._init(self, negMsgHandler)
            PartColoredVis._init(self, negMsgHandler, self._module, 'cmapIn')
            self.__register(negMsgHandler)

            # make my custom connections between further self created modules here

            # send params to gui
            self.sendParams()
示例#7
0
    def __init(self, negMsgHandler):
        """ __init is called from __update
            + start _module module if it does not already exist and connect output to COVER
            + set default parameters of module
            + set default boundingBox which is also used in the GUI to set borders of the float sliders
            + set color inport and corresponding module
            + send params to the gui
        """
        if self.__firstTime == True:
            self.__firstTime = False
            PartModuleVis._init(self, negMsgHandler)
            PartColoredVis._init(self, negMsgHandler, self._module, 'cmapIn')
            self.__register(negMsgHandler)

            # make my custom connections between further self created modules here

            # send params to gui
            self.sendParams()
示例#8
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()
示例#9
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()
示例#10
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()
示例#11
0
    def __init(self, negMsgHandler):
        if os.getenv('VR_PREPARE_DEBUG_RUN'):
            print("PartIsoSurfaceVis.__init")
        """ __init is called from __update

            + start _module 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
            PartModuleVis._init(self, negMsgHandler)
            PartColoredVis._init(self, negMsgHandler, self._module) 
            self.__register(negMsgHandler)

            #init params, the both are static at the moment
            self._module.set_Interactor(self.params.Interactor) 
            self._module.set_vector(self.params.vector)

            # send params to gui
            self.sendParams()
示例#12
0
    def __init(self, negMsgHandler):
        if os.getenv('VR_PREPARE_DEBUG_RUN'):
            print("PartIsoSurfaceVis.__init")
        """ __init is called from __update

            + start _module 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
            PartModuleVis._init(self, negMsgHandler)
            PartColoredVis._init(self, negMsgHandler, self._module)
            self.__register(negMsgHandler)

            #init params, the both are static at the moment
            self._module.set_Interactor(self.params.Interactor)
            self._module.set_vector(self.params.vector)

            # send params to gui
            self.sendParams()
示例#13
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()
示例#14
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()
示例#15
0
 def __init(self, negMsgHandler):
     """ start COVISE Module and connect output to COVER """
     if self.__firstTime == True:
         self.__firstTime = False
         PartModuleVis._init(self, negMsgHandler)