OCC.Display.OCCViewer module

class OCC.Display.OCCViewer.BaseDriver(window_handle)

Bases: object

The base driver class

Create(create_default_lights=True)
FitAll()
MoveTo(X, Y)
SetWindow(window_handle)
class OCC.Display.OCCViewer.Viewer3d(window_handle)

Bases: OCC.Display.OCCViewer.BaseDriver, OCC.Visualization.Display3d

DisableAntiAliasing()
DisplayColoredShape(shapes, color='YELLOW', update=False)
DisplayMessage(point, text_to_write, height=None, message_color=None, update=False)
Point:a gp_Pnt or gp_Pnt2d instance
Text_to_write:a string
Message_color:triple with the range 0-1
DisplayShape(shapes, material=None, texture=None, color=None, transparency=None, update=False)
DisplayVector(vec, pnt, update=False)
DynamicZoom(X1, Y1, X2, Y2)
EnableAntiAliasing()
EraseAll()
ExportToImage(image_filename)
GetSelectedShape()

Returns the current selected shape

GetSelectedShapes()
OnResize()
Pan(dx, dy)
Repaint()
ResetView()
Rotation(X, Y)
Select(X, Y)
SelectArea(Xmin, Ymin, Xmax, Ymax)
SetBackgroundImage(image_filename, stretch=True)
SetDoubleBuffer(on_or_off)

enables double buffering when shapes are moved in the viewer a very shaky picture is drawn, since double buffering is disabled by default. fixed here...

SetModeHLR()
SetModeShaded()
SetModeWireFrame()
SetOrthographic(_bool)

sets whether this view is a orthographic or perspective view @param _bool:

SetSelectionMode(mode=None)
SetSelectionModeEdge()
SetSelectionModeFace()
SetSelectionModeNeutral()
SetSelectionModeShape()
SetSelectionModeVertex()
ShiftSelect(X, Y)
StartRotation(X, Y)
Tumble(num_images, animation=True)
View_Bottom()
View_Front()
View_Iso()
View_Left()
View_Rear()
View_Right()
View_Top()
Zoom(X, Y)
ZoomArea(X1, Y1, X2, Y2)
ZoomFactor(zoom_factor)
display_graduated_trihedron()
display_trihedron()

Show a black trihedron in lower right corner

set_bg_gradient_color(R1, G1, B1, R2, G2, B2)

set a bg vertical gradient color. R, G and B are floats.

set_raytracing_mode(shadows=True, reflections=True, antialiasing=True)
OCC.Display.OCCViewer.color(r, g, b)
OCC.Display.OCCViewer.get_color_from_name(color_name)

from the string ‘WHITE’, returns Quantity_Color WHITE. color_name is the color name, case insensitive.

OCC.Display.OCCViewer.to_string(_string)