diff options
author | deepa-chaudhari | 2015-06-02 22:34:08 +0530 |
---|---|---|
committer | deepa-chaudhari | 2015-06-02 22:34:08 +0530 |
commit | af0232ace0890ee6e8afc97c0fefd03a224c42bb (patch) | |
tree | 6ba0b57fe30456f26362a6713718280440f8c2d9 /utilities | |
download | OsdagLive-af0232ace0890ee6e8afc97c0fefd03a224c42bb.tar.gz OsdagLive-af0232ace0890ee6e8afc97c0fefd03a224c42bb.tar.bz2 OsdagLive-af0232ace0890ee6e8afc97c0fefd03a224c42bb.zip |
Initial checkin
Diffstat (limited to 'utilities')
-rw-r--r-- | utilities/__init__.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/utilities/__init__.py b/utilities/__init__.py new file mode 100644 index 0000000..5498698 --- /dev/null +++ b/utilities/__init__.py @@ -0,0 +1,37 @@ +from OCC.AIS import AIS_Shape +from OCC.TopAbs import TopAbs_EDGE +from OCC.TopExp import TopExp_Explorer +from OCC.TopoDS import topods, TopoDS_Shape +from OCC.Quantity import Quantity_NOC_BLACK + + +def colorTheEdges(shp, display,color,width): + shapeList = [] + Ex = TopExp_Explorer(shp,TopAbs_EDGE) + ctx = display.Context + while Ex.More(): + aEdge = topods.Edge(Ex.Current()) + ais_shape = AIS_Shape(aEdge).GetHandle() + ctx.SetColor(ais_shape,color, False) + ctx.SetWidth(ais_shape,width, False) + ctx.Display(ais_shape, False) + Ex.Next() + +def setDefaultEdgeStyle(shp, display): + colorTheEdges(shp, display, Quantity_NOC_BLACK, 1.5) + #return shps + + +def osdagDisplayShape (display, shapes,material=None, texture=None, color=None, transparency=None, update=False): + setDefaultEdgeStyle(shapes, display) + display.DisplayShape(shapes,material,texture,color,transparency,update = True) + + + + + + + + + +
\ No newline at end of file |