예제 #1
0
    def setVertexProperties(this, dictPar=None, **kwargs):
        """
        Set the vertices and how/whether vertices are drawn in OpenGL.

        Accepted are the optional (keyword) parameters:
        - Vs,
        - radius,
        - color.
        - Ns.
        Either these parameters are specified as part of kwargs or as key value
        pairs in the dictionary dictPar.
        If they are not specified (or equal to None) they are not changed.
        See getVertexProperties for the explanation of the keywords.
        The output of getVertexProperties can be used as the dictPar parameter.
        This can be used to copy settings from one shape to another.
        If dictPar is used and kwargs, then only the dictPar will be used.
        """
        if this.dbgTrace:
            print '%s.setVertexProperties(%s,..):' % (this.__class__,
                                                      this.name)
        if dictPar != None or kwargs != {}:
            if dictPar != None:
                dict = dictPar
            else:
                dict = kwargs
            if 'Vs' in dict and dict['Vs'] != None:
                this.Vs = [GeomTypes.Vec4(v) for v in dict['Vs']]
            if 'Ns' in dict and dict['Ns'] != None:
                this.Ns = [GeomTypes.Vec4(n) for n in dict['Ns']]
                #assert len(this.Ns) == len(this.Vs)
            if 'radius' in dict and dict['radius'] != None:
                this.v.radius = dict['radius']
            if 'color' in dict and dict['color'] != None:
                this.v.col = dict['color']
            this.projectedTo3D = False
예제 #2
0
 def onFloat(this, e):
     #ctrlId = e.GetId()
     vEvent = VectorUpdatedEvent(myEVT_VECTOR_UPDATED, this.GetId())
     vEvent.SetEventObject(this)
     vEvent.SetVector(
         GeomTypes.Vec4([
             this.__v[0].GetValue(), this.__v[1].GetValue(),
             this.__v[2].GetValue(), this.__v[3].GetValue()
         ]))
     this.__v[this.__ctrlIdIndex].GetEventHandler().ProcessEvent(vEvent)
예제 #3
0
 def GetValue(this):
     return GeomTypes.Vec4([
         this.__v[0].GetValue(), this.__v[1].GetValue(),
         this.__v[2].GetValue(), this.__v[3].GetValue()
     ])