当前位置: 首页>>代码示例>>Python>>正文


Python coin.SoBaseColor方法代码示例

本文整理汇总了Python中pivy.coin.SoBaseColor方法的典型用法代码示例。如果您正苦于以下问题:Python coin.SoBaseColor方法的具体用法?Python coin.SoBaseColor怎么用?Python coin.SoBaseColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pivy.coin的用法示例。


在下文中一共展示了coin.SoBaseColor方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pivy import coin [as 别名]
# 或者: from pivy.coin import SoBaseColor [as 别名]
def __init__(self):
        super(textArea, self).__init__()
        
        self.trans = coin.SoTranslation()
        self.trans.translation = (-0.98,0.95,0)

        self.font = coin.SoFont()
        self.font.name = "osiFont,FreeSans,sans"
        self.font.size.setValue(16.0)
        
        self.str  = coin.SoText2()
        self.str.string = ""

        self.color = coin.SoBaseColor()
        self.color.rgb = (0,0,0)
        
        self.addChild(self.trans)
        self.addChild(self.color)
        self.addChild(self.font)
        self.addChild(self.str) 
开发者ID:tomate44,项目名称:CurvesWB,代码行数:22,代码来源:HUD.py

示例2: displaysphere

# 需要导入模块: from pivy import coin [as 别名]
# 或者: from pivy.coin import SoBaseColor [as 别名]
def displaysphere(self,point,radius=5,color=(1,1,1)):
    
    try:
        sg=self._sg
    except:
        sg    = SoSeparator()
        self._sg= sg

        root=FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
        root.addChild(sg)

    p=point
    #say(point,color,"##########")

    trans = coin.SoTranslation()
    trans.translation.setValue(p.x,p.y,p.z)
    cub = coin.SoSphere()
    cub.radius.setValue(radius)
    col = coin.SoBaseColor()
    col.rgb=color
    myCustomNode = coin.SoSeparator()
    myCustomNode.addChild(col)
    myCustomNode.addChild(trans)
    myCustomNode.addChild(cub)
    sg.addChild(myCustomNode) 
开发者ID:microelly2,项目名称:NodeEditor,代码行数:27,代码来源:cointools.py

示例3: __init__

# 需要导入模块: from pivy import coin [as 别名]
# 或者: from pivy.coin import SoBaseColor [as 别名]
def __init__(self,pl=None, scale=[100,100,20],offset=100,name='ARROW'):
    # define main properties
    self.view=FreeCADGui.ActiveDocument.ActiveView
    self.sg=self.view.getSceneGraph()
    self.cb=self.view.addEventCallbackPivy(coin.SoMouseButtonEvent.getClassTypeId(), self.pickCB)
    # define OpenInventor properties
    self.node=coin.SoSeparator() #self.node=coin.SoSelection()
    self.name=name
    self.node.setName(self.name)
    self.color=coin.SoBaseColor(); self.color.rgb=0,0.8,0
    self.transform=coin.SoTransform(); self.transform.scaleFactor.setValue(scale)
    self.cone=coin.SoCone()
    # create children of node
    self.node.addChild(self.color)
    self.node.addChild(self.transform)
    self.node.addChild(self.cone)
    # draw the arrow and move it to its Placement with the specified offset
    self.sg.addChild(self.node)
    self.offset=offset
    if not pl:
      pl=FreeCAD.Placement()
    self.moveto(pl) 
开发者ID:oddtopus,项目名称:flamingo,代码行数:24,代码来源:polarUtilsCmd.py

示例4: attach

# 需要导入模块: from pivy import coin [as 别名]
# 或者: from pivy.coin import SoBaseColor [as 别名]
def attach(self, obj):
        #debug("Comb : ViewProviderComb.attach ")

        self.oldx = 0
        self.oldy = 0
        self.wireframe = coin.SoGroup()

        self.combColor  =  coin.SoBaseColor()
        self.curveColor =  coin.SoBaseColor()
        self.combColor.rgb  = (obj.CombColor[0],obj.CombColor[1],obj.CombColor[2])
        self.curveColor.rgb = (obj.CurveColor[0],obj.CurveColor[1],obj.CurveColor[2])
        self.points = coin.SoCoordinate3()
        self.combLines = coin.SoIndexedLineSet()
        self.curveLines = coin.SoIndexedLineSet()
        self.wireframe.addChild(self.points)
        self.wireframe.addChild(self.combColor)
        self.wireframe.addChild(self.combLines)
        self.wireframe.addChild(self.curveColor)
        self.wireframe.addChild(self.curveLines)
        
        #self.selectionNode = coin.SoType.fromName("SoFCSelection").createInstance()
        #self.selectionNode.documentName.setValue(FreeCAD.ActiveDocument.Name)
        #self.selectionNode.objectName.setValue(obj.Object.Name) # here obj is the ViewObject, we need its associated App Object
        #self.selectionNode.subElementName.setValue("Comb")
        #self.selectionNode.addChild(self.curveLines)
            

        #self.wireframe.addChild(self.selectionNode)
        obj.addDisplayMode(self.wireframe,"Wireframe")
        #self.onChanged(obj,"Color") 
开发者ID:tomate44,项目名称:CurvesWB,代码行数:32,代码来源:ParametricComb.py

示例5: __init__

# 需要导入模块: from pivy import coin [as 别名]
# 或者: from pivy.coin import SoBaseColor [as 别名]
def __init__(self):
        super(Axis, self).__init__()
        self.xAxisSep = coin.SoSeparator()
        self.yAxisSep = coin.SoSeparator()
        self.zAxisSep = coin.SoSeparator()
        self.xaxisColor = coin.SoBaseColor()
        self.yaxisColor = coin.SoBaseColor()
        self.zaxisColor = coin.SoBaseColor()
        self.xaxisColor.rgb  = (0.8,0,0)
        self.xpts = [] #[[p[0]-1000,p[1],p[2]],[p[0]+1000,p[1],p[2]]]
        self.yaxisColor.rgb  = (0,0.8,0)
        self.ypts = [] #[[p[0],p[1]-1000,p[2]],[p[0],p[1]+1000,p[2]]]
        self.zaxisColor.rgb  = (0,0,0.8)
        self.zpts = [] #[[p[0],p[1],p[2]-1000],[p[0],p[1],p[2]+1000]]
        self.xaxis = coin.SoLineSet()
        self.xaxisPoints = coin.SoCoordinate3()
        self.xaxisPoints.point.setValue(0,0,0)
        self.xaxisPoints.point.setValues(0,len(self.xpts),self.xpts)
        self.xAxisSep.addChild(self.xaxisColor)
        self.xAxisSep.addChild(self.xaxisPoints)
        self.xAxisSep.addChild(self.xaxis)
        self.yaxis = coin.SoLineSet()
        self.yaxisPoints = coin.SoCoordinate3()
        self.yaxisPoints.point.setValue(0,0,0)
        self.yaxisPoints.point.setValues(0,len(self.ypts),self.ypts)
        self.yAxisSep.addChild(self.yaxisColor)
        self.yAxisSep.addChild(self.yaxisPoints)
        self.yAxisSep.addChild(self.yaxis)
        self.zaxis = coin.SoLineSet()
        self.zaxisPoints = coin.SoCoordinate3()
        self.zaxisPoints.point.setValue(0,0,0)
        self.zaxisPoints.point.setValues(0,len(self.zpts),self.zpts)
        self.zAxisSep.addChild(self.zaxisColor)
        self.zAxisSep.addChild(self.zaxisPoints)
        self.zAxisSep.addChild(self.zaxis)
        self.xState = False
        self.yState = False
        self.zState = False 
开发者ID:tomate44,项目名称:CurvesWB,代码行数:40,代码来源:loooMarkers.py

示例6: main

# 需要导入模块: from pivy import coin [as 别名]
# 或者: from pivy.coin import SoBaseColor [as 别名]
def main():
    app = QApplication(sys.argv)

    root = SoSeparator()
    col = SoBaseColor()
    col.rgb = SbColor(1, 1, 0)
    root.addChild(col)
    root.addChild(SoCone())

    viewer = QuarterWidget()
    viewer.setSceneGraph(root)

    viewer.setWindowTitle("minimal")
    viewer.show()
    sys.exit(app.exec_()) 
开发者ID:coin3d,项目名称:pivy,代码行数:17,代码来源:minimal.py

示例7: __init__

# 需要导入模块: from pivy import coin [as 别名]
# 或者: from pivy.coin import SoBaseColor [as 别名]
def __init__(self, mlist):
        self.colorRed = coin.SoBaseColor()
        self.colorRed.rgb=(1,0,0)
        self.colorGreen = coin.SoBaseColor()
        self.colorGreen.rgb=(0,1,0)
        self.colorBlue = coin.SoBaseColor()
        self.colorBlue.rgb=(0,0,1)
        self.colorYellow = coin.SoBaseColor()
        self.colorYellow.rgb=(1,1,0)
        self.colorPurple = coin.SoBaseColor()
        self.colorPurple.rgb=(1,0,1)
        self.colorCyan = coin.SoBaseColor()
        self.colorCyan.rgb=(0,1,1)
        self.colorWhite = coin.SoBaseColor()
        self.colorWhite.rgb=(1,1,1)
        self.colorBlack = coin.SoBaseColor()
        self.colorBlack.rgb=(0,0,0)
        self.Ulen = len(mlist)
        self.Vlen = len(mlist[0])
        self.pts = []
        for row in mlist:
            for pt in row:
                self.pts.append(pt.points[0])
        num = []
        for u in range(self.Ulen):
            for v in range(self.Vlen):
                num.append(u*self.Vlen+v)
            num.append(-1)
        num2 = []
        for v in range(self.Vlen):
            for u in range(self.Ulen):
                num2.append(u*self.Vlen+v)
            num2.append(-1)
        print(str(num))
        print(str(num2))
        self.gridSep = coin.SoSeparator()
        #self.coords = coin.SoCoordinate3()
        #self.coords.point.setValues(0,len(self.pts),self.pts)

        self.Line = coin.SoIndexedLineSet()
        self.Line.coordIndex.setValues(0,len(num),num)
        self.Node = coin.SoSeparator()
        #self.Node.addChild(self.coords)
        self.Node.addChild(self.colorBlue)
        self.Node.addChild(self.Line)

        self.Line2 = coin.SoIndexedLineSet()
        self.Line2.coordIndex.setValues(0,len(num2),num2)
        self.Node2 = coin.SoSeparator()
        #self.Node2.addChild(self.coords)
        self.Node2.addChild(self.colorPurple)
        self.Node2.addChild(self.Line2)
        
        self.gridSep.addChild(self.Node)
        self.gridSep.addChild(self.Node2) 
开发者ID:tomate44,项目名称:CurvesWB,代码行数:57,代码来源:SurfaceEdit.py

示例8: attach

# 需要导入模块: from pivy import coin [as 别名]
# 或者: from pivy.coin import SoBaseColor [as 别名]
def attach(self, vobj):
        self.ViewObject = vobj
        self.Object = vobj.Object
        
        #self.selectionNode = coin.SoType.fromName("SoFCSelection").createInstance()
        #self.selectionNode.documentName.setValue(FreeCAD.ActiveDocument.Name)
        #self.selectionNode.objectName.setValue(vobj.Object.Name) # here obj is the ViewObject, we need its associated App Object
        #self.selectionNode.subElementName.setValue("Vertex")
        
        
        #self.node = coin.SoSeparator()
        #self.node.setName("Hook")
        #self.coord = coin.SoCoordinate3()
        #self.marker = coin.SoSphere() #coin.SoMarkerSet() #((1,0,0),coin.SoMarkerSet.DIAMOND_FILLED_9_9)
        ##self.marker.markerIndex = coin.SoMarkerSet.DIAMOND_FILLED_9_9
        #self.color = coin.SoBaseColor()
        #self.color.rgb = (1,0,0)
        
        
        ##self.node.addChild(self.color)
        ##self.node.addChild(self.coord)
        ##self.node.addChild(self.marker)
        #self.selectionNode.addChild(self.color)
        #self.selectionNode.addChild(self.coord)
        #self.selectionNode.addChild(self.marker)
        
        #vobj.addDisplayMode(self.selectionNode,"Wireframe")

    #def updateData(self, fp, prop):
        #if prop == "Center":
            #vec = coin.SbVec3f(fp.Center.x, fp.Center.y, fp.Center.z)
            #self.coord.point.setValue(vec)
            ##self.coord.point.setValues(0,len([vec]),[vec])

    #def getDisplayModes(self,obj):
         #"Return a list of display modes."
         #modes=[]
         #modes.append("Wireframe")
         #return modes

    #def getDefaultDisplayMode(self):
         #'''Return the name of the default display mode. It must be defined in getDisplayModes.'''
         #return "Wireframe"

    #def setDisplayMode(self,mode):
         #return mode 
开发者ID:tomate44,项目名称:CurvesWB,代码行数:48,代码来源:hooks.py


注:本文中的pivy.coin.SoBaseColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。