Skip to main content
Version: Next

View

class compolyx.View(name, position=(0.0, 0.0, 0.0), orientation=(0.0, 0.0, 0.0), rotation_point=(0.0, 0.0, 0.0), parallel_scale=1.0, projection='perspective', locked=False, parent=None)

ComPoLyX class to capture view properties.

Access:

>>> import compolyx
>>> db = compolyx.DB()
>>> view1 = db.create_view(name='View.1', position=[1.5, 5.75, 7.], orientation=[-0.4, -0.4, 0.8], rotation_point=[-6.0, 0.6, 0.75], projection='perspective')

Attributes

NameDescription
View.is_dict_itemSpecifies whether the object is an item of a dict
View.is_list_itemSpecifies whether the object is an item of a list
View.link_pathRoot path of the current node in the tree for links to this object
View.lockedA View which is imported from an other source can not be modified
View.nameName of object
View.orientationGet/set the view orientation
View.parallel_scaleGet/set the view parallel perspective scale factor
View.parentParent object in tree
View.positionGet/set the view position
View.projectionGet/set the projection method parallel or perspective
View.root_pathRoot path of the current node in the tree
View.rotation_pointGet/set the view rotation point

Methods

NameDescription
View.find_parent(type)Function steps up the tree and returns the first parent with given type
View.serialize()Serialize to Python string
View.visit(visitor)Walk through the tree and let the visitor perform action on every descendant node