Ejemplo n.º 1
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))
Ejemplo n.º 2
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))
Ejemplo n.º 3
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)
Ejemplo n.º 4
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 )
Ejemplo n.º 5
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)