Beispiel #1
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init if the tracer module if necessary
            + update module parameters """
        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)
        PartInteractorVis._update(self, negMsgHandler)

        if not hasattr(self, 'importModule'):
            return

        #update params
        # no of starting points
        if self.params.no_startp<12:
            min_start = 1
            max_start = 20
        elif self.params.no_startp<100:
            min_start = 1
            max_start = 2*self.params.no_startp
        else:
            min_start = 0.5 * self.params.no_startp
            max_start = 4 * self.params.no_startp
        self._module.set_no_startp( min_start, max_start, self.params.no_startp )
        # other parameters
        if self.params.alignedRectangle.orthogonalAxis=='line':
            s0 = self.params.alignedRectangle.getStartPoint()
            s1 = self.params.alignedRectangle.getEndPoint()
            self._module.set_startpoint1(s0[0], s0[1], s0[2] )
            self._module.set_startpoint2(s1[0], s1[1], s1[2] )
        else :
            aRectangleIn3d2Ps1Dir = convertAlignedRectangleToGeneral( self.params.alignedRectangle)
            self._module.set_startpoint1(*aRectangleIn3d2Ps1Dir.pointA)
            self._module.set_startpoint2(*aRectangleIn3d2Ps1Dir.pointC)
            self._module.set_direction(*aRectangleIn3d2Ps1Dir.direction)
        self._module.set_trace_len(self.params.len)
        self._module.set_trace_eps(self.params.eps)
        self._module.set_trace_abs(self.params.abs)
        self._module.set_min_vel(self.params.min_vel)
        self._module.set_tdirection(self.params.direction)
        self._module.set_grid_tol(self.params.grid_tol)
        self._module.set_maxOutOfDomain(self.params.maxOutOfDomain)

        if PartColoredVis.currentVariable(self) and PartColoredVis.currentVariable(self) in self.params.colorTableKey and globalKeyHandler().getObject(self.params.colorTableKey[self.currentVariable()]).params.mode==coColorTableParams.LOCAL :
            self._module.set_autoScales('TRUE')
        else :
            self._module.set_autoScales('FALSE')

        self._module.setTitle( self.params.name )
        # init params in case of moving points or pathlines
        if hasattr(self.params, 'duration' ):     self._module.set_stepDuration(self.params.duration)
        if hasattr(self.params, 'sphereRadius' ): self._module.set_SphereRadius(self.params.sphereRadius)
        if hasattr(self.params, 'tubeWidth' ): self._module.set_TubeWidth(self.params.tubeWidth)
        if hasattr(self.params, 'numSteps' ): self._module.set_MaxPoints(self.params.numSteps)
        if hasattr(self.params, 'start_style'): self._module.set_startStyle(self.params.start_style)
        if hasattr(self.params, 'freeStartPoints'): 
            if self.params.freeStartPoints == '':
                if hasattr(self, 'oldFreeStartPoints'):
                    self.params.freeStartPoints = self.oldFreeStartPoints
            self._module.set_FreeStartPoints(self.params.freeStartPoints)
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init if the cutting surface module if necessary
            + update module parameters """
        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)
        PartInteractorVis._update(self, negMsgHandler)

        # other parameters
        aRectangleIn3d1Mid1Norm = convertAlignedRectangleToCutRectangle(
            self.params.alignedRectangle)
        self._module.set_point(*aRectangleIn3d1Mid1Norm.point)
        self._module.set_vertex(*aRectangleIn3d1Mid1Norm.normal)
        self._module.set_option(1)
        self._module.set_vector(self.params.vector)
        if globalKeyHandler().getObject(
                self.params.colorTableKey[self.currentVariable(
                )]).params.mode == coColorTableParams.LOCAL:
            self._module.set_autoScales('TRUE')
        else:
            self._module.set_autoScales('FALSE')
        self._module.setTitle(self.params.name)

        # init params in case of arrows
        if hasattr(self.params, 'length'):
            self._module.set_length(self.params.length)
        if hasattr(self.params, 'scale'):
            self._module.set_scale(0.0, 1.0, self.params.scale)
            self._module.set_num_sectors(3)
        if hasattr(self.params, 'arrow_head_factor'):
            self._module.set_arrow_head_factor(self.params.arrow_head_factor)
        if hasattr(self.params, 'project_arrows'):
            self._module.set_project_lines(str(self.params.project_arrows))
Beispiel #3
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init if the cutting surface module if necessary
            + update module parameters """
        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)
        PartInteractorVis._update(self, negMsgHandler)
        
        # other parameters
        aRectangleIn3d1Mid1Norm = convertAlignedRectangleToCutRectangle( self.params.alignedRectangle)
        self._module.set_point(*aRectangleIn3d1Mid1Norm.point)
        self._module.set_vertex(*aRectangleIn3d1Mid1Norm.normal)
        self._module.set_option(1)
        self._module.set_vector(self.params.vector)
        if globalKeyHandler().getObject(self.params.colorTableKey[self.currentVariable()]).params.mode==coColorTableParams.LOCAL :
            self._module.set_autoScales('TRUE')
        else :
            self._module.set_autoScales('FALSE')
        self._module.setTitle( self.params.name )

        # init params in case of arrows
        if hasattr(self.params, 'length'): self._module.set_length(self.params.length)
        if hasattr(self.params, 'scale'):
            self._module.set_scale(0.0, 1.0, self.params.scale)
            self._module.set_num_sectors(3)
        if hasattr(self.params, 'arrow_head_factor'): self._module.set_arrow_head_factor(self.params.arrow_head_factor)
        if hasattr(self.params, 'project_arrows'): self._module.set_project_lines(str(self.params.project_arrows))
Beispiel #4
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init of the IsoCutter module if necessary
            + update module parameters """
        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)

        # other parameters
        self._module.set_min_Slider(self.params.low_isomin,  self.params.low_isomax,  self.params.low_isovalue)
        self._module.set_max_Slider(self.params.high_isomin, self.params.high_isomax, self.params.high_isovalue)
        self._module.setTitle( self.params.name )
Beispiel #5
0
 def __update(self, negMsgHandler):
     """ __update is called from the run method to update the module parameter before execution
         + do init of the IsoCutter module if necessary
         + update module parameters """
     self.__init(negMsgHandler)
     PartModuleVis._update(self, negMsgHandler)
     if not self.params.variable == 'unset': 
         PartColoredVis._update(self, negMsgHandler)
     else: 
         self._dataInputNames = []
         theNet().disconnect(self.__myColors, 'DataOut0', self.__myCollect, 'DataIn0')
         theNet().disconnect(self._module, 'DataOut0', self.__myColors, 'DataIn0')    
Beispiel #6
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init of the IsoCutter module if necessary
            + update module parameters """
        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)

        # other parameters
        self._module.set_iso_value(self.params.isomin, self.params.isomax, self.params.isovalue)
        self._module.set_cutoff_side(str(self.params.cutoff_side))   # must be done so for bool
        self._module.setTitle( self.params.name )
Beispiel #7
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init of the IsoCutter module if necessary
            + update module parameters """
        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)

        # other parameters
        self._module.set_len(self.params.length)
        self._module.set_skip(self.params.skip)
        self._module.setTitle(self.params.name)
Beispiel #8
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init of the IsoCutter module if necessary
            + update module parameters """
        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)

        # other parameters
        self._module.set_len(self.params.length)
        self._module.set_skip(self.params.skip)
        self._module.setTitle( self.params.name )
Beispiel #9
0
 def __update(self, negMsgHandler):
     """ __update is called from the run method to update the module parameter before execution
         + do init of the IsoCutter module if necessary
         + update module parameters """
     self.__init(negMsgHandler)
     PartModuleVis._update(self, negMsgHandler)
     if not self.params.variable == 'unset':
         PartColoredVis._update(self, negMsgHandler)
     else:
         self._dataInputNames = []
         theNet().disconnect(self.__myColors, 'DataOut0', self.__myCollect,
                             'DataIn0')
         theNet().disconnect(self._module, 'DataOut0', self.__myColors,
                             'DataIn0')
Beispiel #10
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init of the IsoCutter module if necessary
            + update module parameters """
        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)

#        self._module.set_scale(self.params.minScalingValue, self.params.maxScalingValue, self.params.scalingValue)
        self._module.set_scale(self.params.scalingValue-1.0, self.params.scalingValue+1.0, self.params.scalingValue)
        self._module.set_length(self.params.scalingType + 1)    # +1 because covise choices start from 1
        self._module.set_arrow_head_factor(self.params.arrowHeadFactor)
        self._module.set_num_sectors(3)
        self._module.setTitle( self.params.name )
Beispiel #11
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init of the IsoCutter module if necessary
            + update module parameters """
        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)

        # other parameters
        self._module.set_iso_value(self.params.isomin, self.params.isomax,
                                   self.params.isovalue)
        self._module.set_cutoff_side(str(
            self.params.cutoff_side))  # must be done so for bool
        self._module.setTitle(self.params.name)
Beispiel #12
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init of the IsoCutter module if necessary
            + update module parameters """
        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)

        # other parameters
        self._module.set_min_Slider(self.params.low_isomin,
                                    self.params.low_isomax,
                                    self.params.low_isovalue)
        self._module.set_max_Slider(self.params.high_isomin,
                                    self.params.high_isomax,
                                    self.params.high_isovalue)
        self._module.setTitle(self.params.name)
Beispiel #13
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init if the tracer module if necessary
            + update module parameters """
        self.__init(negMsgHandler)

        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)
        PartInteractorVis._update(self, negMsgHandler)           
        
        if not hasattr(self, 'importModule'):
             return

        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])

        self._module.setTitle( self.params.name )
Beispiel #14
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init of the IsoCutter module if necessary
            + update module parameters """
        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)

        #        self._module.set_scale(self.params.minScalingValue, self.params.maxScalingValue, self.params.scalingValue)
        self._module.set_scale(self.params.scalingValue - 1.0,
                               self.params.scalingValue + 1.0,
                               self.params.scalingValue)
        self._module.set_length(self.params.scalingType +
                                1)  # +1 because covise choices start from 1
        self._module.set_arrow_head_factor(self.params.arrowHeadFactor)
        self._module.set_num_sectors(3)
        self._module.setTitle(self.params.name)
Beispiel #15
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init if the tracer module if necessary
            + update module parameters """
        
        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)
        
        #colorTable = globalKeyHandler().getObject(self.params.colorTableKey[self.params.variable])
        #if colorTable.params.mode==coColorTableParams.LOCAL :
        #    self._module.set_autominmax('TRUE')
        #else :
        #    self._module.set_autominmax('FALSE')

        # other parameters
        self._module.set_isovalue(self.params.isomin,self.params.isomax,self.params.isovalue)
        self._module.setTitle( self.params.name )
Beispiel #16
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init if the tracer module if necessary
            + update module parameters """

        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)

        #colorTable = globalKeyHandler().getObject(self.params.colorTableKey[self.params.variable])
        #if colorTable.params.mode==coColorTableParams.LOCAL :
        #    self._module.set_autominmax('TRUE')
        #else :
        #    self._module.set_autominmax('FALSE')

        # other parameters
        self._module.set_isovalue(self.params.isomin, self.params.isomax,
                                  self.params.isovalue)
        self._module.setTitle(self.params.name)
Beispiel #17
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init
            + update module parameters """
        self.__init(negMsgHandler)

        PartModuleVis._update(self, negMsgHandler)
        if self.params.color==VARIABLE:
            PartColoredVis._update(self, negMsgHandler)
        self._setTransform()

        if not hasattr(self, 'importModule'):
            return

        #set color for variable
        if not self.__lastColorConnection==None:
            disconnect(self.__lastColorConnection, ConnectionPoint(self._module, 'DataIn0'))
            self.__lastColorConnection=None
        if self.__lastColorConnection==None and self.params.variable!=None \
            and self.params.variable!='Select a variable' and self.params.color == VARIABLE and len(self.objects)>0:
            _infoer.function = str(self.__update)
            _infoer.write("connection color for variable %s " % self.params.variable)
            self.__lastColorConnection =  (self.objects[0]).colorContConnectionPoint()
            connect(self.__lastColorConnection, ConnectionPoint(self._module, 'DataIn0'))
Beispiel #18
0
    def __update(self, negMsgHandler):
        """ __update is called from the run method to update the module parameter before execution
            + do init if the tracer module if necessary
            + update module parameters """
        self.__init(negMsgHandler)
        PartModuleVis._update(self, negMsgHandler)
        PartColoredVis._update(self, negMsgHandler)
        PartInteractorVis._update(self, negMsgHandler)

        if not hasattr(self, 'importModule'):
            return

        #update params
        # no of starting points
        if self.params.no_startp < 12:
            min_start = 1
            max_start = 20
        elif self.params.no_startp < 100:
            min_start = 1
            max_start = 2 * self.params.no_startp
        else:
            min_start = 0.5 * self.params.no_startp
            max_start = 4 * self.params.no_startp
        self._module.set_no_startp(min_start, max_start, self.params.no_startp)
        # other parameters
        if self.params.alignedRectangle.orthogonalAxis == 'line':
            s0 = self.params.alignedRectangle.getStartPoint()
            s1 = self.params.alignedRectangle.getEndPoint()
            self._module.set_startpoint1(s0[0], s0[1], s0[2])
            self._module.set_startpoint2(s1[0], s1[1], s1[2])
        else:
            aRectangleIn3d2Ps1Dir = convertAlignedRectangleToGeneral(
                self.params.alignedRectangle)
            self._module.set_startpoint1(*aRectangleIn3d2Ps1Dir.pointA)
            self._module.set_startpoint2(*aRectangleIn3d2Ps1Dir.pointC)
            self._module.set_direction(*aRectangleIn3d2Ps1Dir.direction)
        self._module.set_trace_len(self.params.len)
        self._module.set_trace_eps(self.params.eps)
        self._module.set_trace_abs(self.params.abs)
        self._module.set_min_vel(self.params.min_vel)
        self._module.set_tdirection(self.params.direction)
        self._module.set_grid_tol(self.params.grid_tol)
        self._module.set_maxOutOfDomain(self.params.maxOutOfDomain)

        if PartColoredVis.currentVariable(
                self) and PartColoredVis.currentVariable(
                    self) in self.params.colorTableKey and globalKeyHandler(
                    ).getObject(self.params.colorTableKey[self.currentVariable(
                    )]).params.mode == coColorTableParams.LOCAL:
            self._module.set_autoScales('TRUE')
        else:
            self._module.set_autoScales('FALSE')

        self._module.setTitle(self.params.name)
        # init params in case of moving points or pathlines
        if hasattr(self.params, 'duration'):
            self._module.set_stepDuration(self.params.duration)
        if hasattr(self.params, 'sphereRadius'):
            self._module.set_SphereRadius(self.params.sphereRadius)
        if hasattr(self.params, 'tubeWidth'):
            self._module.set_TubeWidth(self.params.tubeWidth)
        if hasattr(self.params, 'numSteps'):
            self._module.set_MaxPoints(self.params.numSteps)
        if hasattr(self.params, 'start_style'):
            self._module.set_startStyle(self.params.start_style)
        if hasattr(self.params, 'freeStartPoints'):
            if self.params.freeStartPoints == '':
                if hasattr(self, 'oldFreeStartPoints'):
                    self.params.freeStartPoints = self.oldFreeStartPoints
            self._module.set_FreeStartPoints(self.params.freeStartPoints)