示例#1
0
    def setParams(self, params, negMsgHandler=None, sendToCover=True):
        """ set parameters from outside
            + init cutting surface module if necessary
            + mainly receive parameter changes from Gui
            + send status messages to COVER if state has changed
        """
        _infoer.function = str(self.setParams)
        _infoer.write("setParams")

        realChange = ParamsDiff(self.params, params)

        PartModuleVis.setParams(self, params, negMsgHandler, sendToCover,
                                realChange)
        PartColoredVis.setParams(self, params, negMsgHandler, sendToCover,
                                 realChange)
        PartInteractorVis.setParams(self, params, negMsgHandler, sendToCover,
                                    realChange)

        if 'isVisible' in realChange:
            if self.params.isVisible:
                self.sendClipPlane()
            else:
                self.sendClipPlaneOFF()

        if (('attachedClipPlane_index' in realChange)
                or ('attachedClipPlane_offset' in realChange)
                or ('attachedClipPlane_flip' in realChange)):
            self.sendClipPlane()
示例#2
0
    def __init__(self):
        PartModuleVis.__init__(self, VectorField, VIS_VECTORFIELD, self.__class__.__name__,['meshIn'],[],[],[],['vdataIn'])
        PartColoredVis.__init__(self)
        PartTransform.__init__(self, True)

        self.params = PartVectorFieldVisParams()
        self.__initBase()
示例#3
0
 def __init__(self):
     PartModuleVis.__init__(self,Collect, VIS_2D_RAW, self.__class__.__name__,['GridIn0'],[],[],[],[],[],[],1,False, False)
     PartColoredVis.__init__(self, False)
     PartTransform.__init__(self)
     self.params = Part2DRawVisParams()
     self.params.isVisible = True
     self.__initBase()
示例#4
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)
示例#5
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))
示例#6
0
 def __init__(self):
     if os.getenv('VR_PREPARE_DEBUG_RUN'):
         print("PartIsoSurfaceVis.__init__")
     PartModuleVis.__init__(self,IsoSurfaceComp, VIS_ISOPLANE, self.__class__.__name__,['GridIn0'],[],[],[],['DataIn0'],['DataIn1'])
     PartColoredVis.__init__(self)
     self.params = PartIsoSurfaceVisParams()
     self.__initBase()
示例#7
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     PartMagmaTraceVisParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     self.__initBase()
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, MagmaTrace, ['geo_in'],[],[],[],['data_in'] )
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self,True)
示例#8
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()
示例#9
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()
示例#10
0
    def run(self, runmode, negMsgHandler):
        """ create a new visulisation
            + register for events from Covise if not done yet
            + runmode RUN_GEO and RUN_OCT are ignored
            + update module parameter
            + exec the module
        """
        assert negMsgHandler

        if runmode == RUN_ALL:
            _infoer.function = str(self.run)
            _infoer.write("go")

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

            self.__update(negMsgHandler)

            PartColoredVis.run(
                self, runmode, negMsgHandler, self._module,
                self.fromRecreation)  # self._module is not used!
            PartModuleVis.run(self, runmode, negMsgHandler)
            #self._sendMatrix()

            if self.params.coloringOption == RGB_COLOR:
                self.__sendColor()
示例#11
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()
示例#12
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ overload recreate() since Sampling inputs arent used """
     self.PartTracerVisinitBase()    # call __initBase from PartTracerVis
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, TracerComp,
                           ['meshIn'],['octtreesIn'],[],[],['dataIn'],['fieldIn'],['pointsIn'] )
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self,True)
示例#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

        #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)
示例#14
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     PartIsoCutterVisParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     self.__initBase()
     PartModuleVis.recreate(self, negMsgHandler, parentKey,offset,IsoCutter, ['inPolygons'],[],[],[],['inData'] )
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self,True)
示例#15
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()
示例#16
0
    def setParams( self, params, negMsgHandler=None, sendToCover=True):
        """ set parameters from outside
            + init cutting surface module if necessary
            + mainly receive parameter changes from Gui
            + send status messages to COVER if state has changed
        """
        _infoer.function = str(self.setParams)
        _infoer.write("setParams")

        realChange = ParamsDiff( self.params, params )

        PartModuleVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
        PartColoredVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
        PartInteractorVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
        
        if 'isVisible' in realChange:
            if self.params.isVisible:
                self.sendClipPlane()
            else:
                self.sendClipPlaneOFF()

        if (   ('attachedClipPlane_index' in realChange)
            or ('attachedClipPlane_offset' in realChange)
            or ('attachedClipPlane_flip' in realChange)):
            self.sendClipPlane()
示例#17
0
    def run(self, runmode, negMsgHandler):
        if os.getenv('VR_PREPARE_DEBUG_RUN'):
            print("PartTracerVis.run")
        """ create a new visulisation
            + register for events from Covise if not done yet
            + runmode RUN_GEO and RUN_OCT are ignored
            + update module parameter
            + exec the tracer module
        """
        assert negMsgHandler

        if runmode == RUN_ALL:

            _infoer.function = str(self.run)
            _infoer.write("go")

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

            self.__update(negMsgHandler)

            PartColoredVis.run(self, runmode, negMsgHandler, self._module,
                               self.fromRecreation)
            PartModuleVis.run(self, runmode, negMsgHandler)
            PartInteractorVis.run(self, runmode, negMsgHandler)
示例#18
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     Part__TEMPLATE__VisParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     self.__initBase()
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, __TEMPLATE__, ['Geometry_in'],[],[],[],['Scalar_in'] )
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self,True)
示例#19
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))
示例#20
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     PartClipIntervalVisParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     self.__initBase()
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, ClipInterval, ['GridIn0'],[],[],[],['DataIn0'] )
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self,True)
示例#21
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     self.__initBase()
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset,
                            IsoSurfaceComp, ['GridIn0'], [], [], [],
                            ['DataIn0'], ['DataIn1'])
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self, True)
示例#22
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     PartVectorFieldVisParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     self.__initBase()
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, VectorField, ['meshIn'],[],[],[],['vdataIn'] )
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self,True)
     PartTransform.recreate(self, negMsgHandler, parentKey, offset)  
示例#23
0
    def __init__(self):
        PartModuleVis.__init__(self, IsoCutter, VIS_ISOCUTTER,
                               self.__class__.__name__, ['inPolygons'], [], [],
                               [], ['inData'])
        PartColoredVis.__init__(self)

        self.params = PartIsoCutterVisParams()
        self.__initBase()
示例#24
0
 def recreate(self, negMsgHandler, parentKey, geoInput=[], geoSampleInput=[], dataSampleInput=[], dataInInput=[], sampleType=MAX_FLT, offset=0):
     """ recreate is called after all classes of the session have been unpickled """
     self.__initBase()
     self.params.setMoreParams()
     PartInteractorVis.setFormat(self, 1)
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, CuttingSurfaceComp, geoInput, [], geoSampleInput, dataSampleInput, dataInInput, [], [], sampleType)
     PartColoredVis.recreate(self,negMsgHandler, parentKey, offset )
     PartColoredVis.setColorMap(self,True)
示例#25
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ overload recreate() since Sampling inputs arent used """
     self.PartTracerVisinitBase()  # call __initBase from PartTracerVis
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset,
                            TracerComp, ['meshIn'], ['octtreesIn'], [], [],
                            ['dataIn'], ['fieldIn'], ['pointsIn'])
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self, True)
示例#26
0
    def __init__(self):
        PartModuleVis.__init__(self, __TEMPLATE__, VIS___TEMPLATE__,
                               self.__class__.__name__, ['Geometry_in'], [],
                               [], [], ['Scalar_in'])
        PartColoredVis.__init__(self)

        self.params = Part__TEMPLATE__VisParams()
        self.__initBase()
示例#27
0
 def __init__(self, geoInput=[], geoSampleInput=[], dataSampleInput=[], dataInInput=[], sampleType=MAX_FLT):
     if os.getenv('VR_PREPARE_DEBUG_RUN'):
         print("PartCuttingSurfaceVis.__init__")
     PartModuleVis.__init__(self,CuttingSurfaceComp, VIS_PLANE, self.__class__.__name__, geoInput, [], geoSampleInput, dataSampleInput, dataInInput, [], [], sampleType)
     PartColoredVis.__init__(self)
     PartInteractorVis.__init__(self, 1) # mode 1 means cuttingsurface interactor
     self.params = PartPlaneVisParams()
     self.__initBase()
示例#28
0
    def recreate(self, negMsgHandler, parentKey, offset):

        return # TODO: probe is not working at the moment: stuck in saveExecute (data or grid missing)

        """ recreate is called after all classes of the session have been unpickled """
        self.__initBase()
        PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, Probe3D, ['meshIn'],['gOcttreesIn'],[],[],['gdataIn'],['gdataIn'])
        PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
示例#29
0
    def __init__(self):
        PartModuleVis.__init__(self, DomainSurface, VIS_DOMAINSURFACE,
                               self.__class__.__name__, ['GridIn0'], [], [],
                               [], ['DataIn0'], [], [], 1, False, False)
        PartColoredVis.__init__(self)

        self.params = PartDomainSurfaceVisParams()
        self.__initBase()
示例#30
0
    def __init__(self):
        PartModuleVis.__init__(self, MagmaTrace, VIS_MAGMATRACE,
                               self.__class__.__name__, ['geo_in'], [], [], [],
                               ['data_in'])
        PartColoredVis.__init__(self)

        self.params = PartMagmaTraceVisParams()
        self.__initBase()
示例#31
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     PartMagmaTraceVisParams.mergeDefaultParams(
         self.params)  # explicitly call mergeDefaultParams of this class
     self.__initBase()
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset,
                            MagmaTrace, ['geo_in'], [], [], [], ['data_in'])
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self, True)
示例#32
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     self.__initBase()
     self.__correctParams()
     PartInteractorVis.setFormat(self, 0)
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, TracerComp, 
                           ['meshIn'],['octtreesIn'],['SampleGeom'],['SampleData'],['dataIn'],['fieldIn'],['pointsIn'] )
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self,True)
示例#33
0
 def __init__(self):
     if os.getenv('VR_PREPARE_DEBUG_RUN'):
         print("PartIsoSurfaceVis.__init__")
     PartModuleVis.__init__(self, IsoSurfaceComp, VIS_ISOPLANE,
                            self.__class__.__name__, ['GridIn0'], [], [],
                            [], ['DataIn0'], ['DataIn1'])
     PartColoredVis.__init__(self)
     self.params = PartIsoSurfaceVisParams()
     self.__initBase()
示例#34
0
    def __init__(self):
        PartModuleVis.__init__(self, VectorField, VIS_VECTORFIELD,
                               self.__class__.__name__, ['meshIn'], [], [], [],
                               ['vdataIn'])
        PartColoredVis.__init__(self)
        PartTransform.__init__(self, True)

        self.params = PartVectorFieldVisParams()
        self.__initBase()
示例#35
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     PartIsoCutterVisParams.mergeDefaultParams(
         self.params)  # explicitly call mergeDefaultParams of this class
     self.__initBase()
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset,
                            IsoCutter, ['inPolygons'], [], [], [],
                            ['inData'])
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self, True)
示例#36
0
 def recreate(self, negMsgHandler, parentKey, offset):
     self.__initBase()
     self.params.mergeDefaultParams()
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self,False)
     PartTransform.recreate(self, negMsgHandler, parentKey, offset)
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, Collect, ['GridIn0'],[],[],[],[],[],[],1,False, False )
     if (self.params.name == "Part2DRawVisParams") or (self.params.name == "Appearance"):
         # The name of Part2DRawVis was never changed in previous versions. Copy it from parent if it's the default name.
         self.params.name = globalKeyHandler().getObject(parentKey).params.name
示例#37
0
    def setParams( self, params, negMsgHandler=None, sendToCover=True):
        """ set parameters from outside
            + init module if necessary
            + mainly receive parameter changes from Gui
            + send status messages to COVER if state has changed
        """
        realChange = ParamsDiff( self.params, params )  

        PartModuleVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
        PartColoredVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
示例#38
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     Part__TEMPLATE__VisParams.mergeDefaultParams(
         self.params)  # explicitly call mergeDefaultParams of this class
     self.__initBase()
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset,
                            __TEMPLATE__, ['Geometry_in'], [], [], [],
                            ['Scalar_in'])
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self, True)
示例#39
0
    def __init__(self):
        if os.getenv('VR_PREPARE_DEBUG_RUN'):
            print("PartTracerVis.__init__")

        PartModuleVis.__init__(self, TracerComp, VIS_STREAMLINE, self.__class__.__name__, ['meshIn'],['octtreesIn'],['SampleGeom'],['SampleData'],['dataIn'],['fieldIn'],['pointsIn'], USER_DEFINED)
        PartColoredVis.__init__(self)
        PartInteractorVis.__init__(self)

        self.params = PartStreamlineVisParams()
        self.__initBase()
        self.oldFreeStartPoints = ''
示例#40
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     self.__initBase()
     self.__correctParams()
     PartInteractorVis.setFormat(self, 0)
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset,
                            TracerComp, ['meshIn'], ['octtreesIn'],
                            ['SampleGeom'], ['SampleData'], ['dataIn'],
                            ['fieldIn'], ['pointsIn'])
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self, True)
示例#41
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     PartVectorFieldVisParams.mergeDefaultParams(
         self.params)  # explicitly call mergeDefaultParams of this class
     self.__initBase()
     PartModuleVis.recreate(self, negMsgHandler, parentKey, offset,
                            VectorField, ['meshIn'], [], [], [],
                            ['vdataIn'])
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self, True)
     PartTransform.recreate(self, negMsgHandler, parentKey, offset)
示例#42
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')    
示例#43
0
    def setParams(self, params, negMsgHandler=None, sendToCover=True):
        """ set parameters from outside
            + init module if necessary
            + mainly receive parameter changes from Gui
            + send status messages to COVER if state has changed
        """
        realChange = ParamsDiff(self.params, params)

        PartModuleVis.setParams(self, params, negMsgHandler, sendToCover,
                                realChange)
        PartColoredVis.setParams(self, params, negMsgHandler, sendToCover,
                                 realChange)
示例#44
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 )
示例#45
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 )
示例#46
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)
示例#47
0
 def recreate(self, negMsgHandler, parentKey, offset):
     """ recreate is called after all classes of the session have been unpickled """
     PartDomainSurfaceVisParams.mergeDefaultParams(self.params) # explicitly call mergeDefaultParams of this class
     self.__initBase()
     
     if self.params.variable == None or self.params.variable == 'unset': 
         PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, DomainSurface, ['GridIn0'],[],[],[],[], [], [], 1, False, False)        
     else: 
         PartModuleVis.recreate(self, negMsgHandler, parentKey, offset, DomainSurface, ['GridIn0'],[],[],[],['DataIn0'], [], [], 1, False, False)
         
     PartColoredVis.recreate(self, negMsgHandler, parentKey, offset)
     PartColoredVis.setColorMap(self,True)
示例#48
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 )
示例#49
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')
示例#50
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)
示例#51
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 )
示例#52
0
    def __init__(self):
        if os.getenv('VR_PREPARE_DEBUG_RUN'):
            print("PartTracerVis.__init__")

        PartModuleVis.__init__(self, TracerComp, VIS_STREAMLINE,
                               self.__class__.__name__, ['meshIn'],
                               ['octtreesIn'], ['SampleGeom'], ['SampleData'],
                               ['dataIn'], ['fieldIn'], ['pointsIn'],
                               USER_DEFINED)
        PartColoredVis.__init__(self)
        PartInteractorVis.__init__(self)

        self.params = PartStreamlineVisParams()
        self.__initBase()
        self.oldFreeStartPoints = ''
示例#53
0
    def setParams( self, params, negMsgHandler=None, sendToCover=True):
        """ set parameters from outside
            + init tracer module if necessary
            + mainly receive parameter changes from Gui
            + send status messages to COVER if state has changed
        """
        _infoer.function = str(self.setParams)
        _infoer.write("setParams")

        realChange = ParamsDiff( self.params, params )

        PartModuleVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
        PartColoredVis.setParams(self, params, negMsgHandler, sendToCover, realChange)
        PartInteractorVis.setParams(self, params, negMsgHandler, sendToCover, realChange)

        if 'use2DPartKey' in realChange: PartInteractorVis.sendInteractorPosibility(self)
示例#54
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)
示例#55
0
    def run(self, runmode, negMsgHandler=None):
        if os.getenv('VR_PREPARE_DEBUG_RUN'):
            print("coColorCreator.run")
        if runmode==RUN_ALL:
            _infoer.function = str(self.run)
            _infoer.write("go Part2DRawVis")


            self.__update(negMsgHandler)


            #if a variable is chosen, run PartColoredVis
            if self.params.variable!=None and self.params.variable!= 'Select a variable' and self.params.color == VARIABLE:
                # At the moment the collect might be executed twice.
                # The "pre-run"-disconnect of PartColoredVis does not work here,
                # because our collect is connected to a different port of the colors module (compared to all the other visualizers).
                colorExecuted = PartColoredVis.run(self, runmode, negMsgHandler, self._module)

            PartModuleVis.run(self, runmode, negMsgHandler)

            if self.params.color==MATERIAL:
                self.__sendMaterial()
            elif self.params.color==RGB_COLOR:
                    self.__sendColor()
            self.__sendTransparency()
            if (self.params.shaderFilename != ""):
                self.__sendShader()

            self.__runChildren(runmode, negMsgHandler)