Global actions for the current graphical display
pw:: | Global actions for the current graphical display |
Static Attributes | |
Projection | This attribute is the type of projection of the display. |
ShowBodyAxes | This attribute controls showing the rotation point axes in the display. |
ShowXYZAxes | This attribute controls showing the XYZ axes in the display centered at the origin. |
ShowDatabase | This attribute controls showing database entities in the display. |
ShowSources | This attribute controls showing source entities in the display. |
ShowNodes | This attribute controls showing node entities in the display. |
ShowConnectors | This attribute is the status of showing connector entities in the display. |
ShowDomains | This attribute is the status of showing domain entities in the display. |
ShowOverset | This attribute is the status of showing overset data in the display. |
ShowDisabledEntities | This attribute is the status of showing disabled entities in the display. |
ShowDrawingGuide | This attribute is the status of showing the drawing guide in the display. |
ShowViewManipulator | This attribute is the status of showing the view manipulator in the display. |
DoublePrecision | This attribute controls the floating point precision used in the display. |
AutomaticPrecision | This attribute controls whether the display switches between single and double precision graphics modes as needed. |
CurrentLayer | This attribute is the current layer which is always visible and new entities are added to this layer. |
Static Actions | |
update | This action updates the graphics in the display to their current setting. |
resetView | This action resets the view so that the entire system is visible and centered in the display. |
resetRotationPoint | This action resets the view rotation point to the center of visible objects. |
setRotationPoint | This action sets the view rotation point to the position specified. |
getCurrentView | This action gets the current view of the display. |
setCurrentView | This action updates the display to the current view. |
calculateView | This action computes the view to center the specified extents in the display with the given view angle. |
saveView | This action saves a view into a slot. |
recallView | This action restores the view specified by slot or name. |
clearView | This action clears the view specified by slot or name. |
isSavedView | This action checks to see if a view is saved in a slot or has the given name. |
getViewName | This action returns the name of the saved view. |
setViewName | This action sets the name of the view in the given slot. |
isLayerVisible | This action checks if the given layer is visible. |
isolateLayer | This action isolates the given layer by hiding all other layers, showing this layer and setting it as the current layer. |
showLayer | This action sets the given layers to be shown in the current display. |
showAllLayers | This action sets all of the layers to be shown in the current display. |
hideLayer | This action sets the given layers to be hidden in the current display. |
hideAllLayers | This action sets all of the layers to be hidden in the current display. |
toggleLayer | This action toggles the visibility of the given layers in the current display. |
toggleAllLayers | This action toggles all of the layers in the current display. |
selectEntities | This action allows the user to interactively select entities. |
getSelectedEntities | This action allows the user to query the display for the current set of selected entities. |
setSelectedEntities | This action allows the specification of entities that will be selected when the script ends. |
createSelectionMask | This action creates a selection mask for use with selectEntities. |
selectPoint | This action enters an interactive mode where the user can select a single point. |
setLightDirection | This action controls the display’s lighting direction and whether the lighting is fixed with the view or with the scene. |
getLightDirection | This action returns the display’s lighting direction. |
getSize | This action returns the size of the current display window. |
getImageFormats | This action returns a list of available image format options for the saveImage command. |
saveImage | This action saves an image of the current display to a file. |
zoomToEntities | This action changes the zoom level and pans to center the display around the list of given entities. |
zoomToFit | This action changes the zoom level and pans to center the display around all currently visible entities. |
pw::Display get/setProjection < Perspective | *Orthonormal* >
This attribute is the type of projection of the display.
This attribute is a string with options < Perspective | Orthonormal >.
The default for this attribute is Orthonormal.
pw::Display get/setShowBodyAxes true
This attribute controls showing the rotation point axes in the display.
This attribute is a boolean with true = show, false = hide.
The default for this attribute is true.
pw::Display get/setShowXYZAxes true
This attribute controls showing the XYZ axes in the display centered at the origin.
This attribute is a boolean with true = show, false = hide.
The default for this attribute is false.
pw::Display get/setShowDatabase show
This attribute controls showing database entities in the display.
This attribute is a boolean with true = show, false = hide.
The default for this attribute is true.
pw::Display get/setShowSources show
This attribute controls showing source entities in the display.
This attribute is a boolean with true = show, false = hide.
The default for this attribute is true.
pw::Display get/setShowNodes show
This attribute controls showing node entities in the display.
This attribute is a boolean with true = show, false = hide.
The default for this attribute is true.
pw::Display get/setShowConnectors show
This attribute is the status of showing connector entities in the display.
This attribute is a boolean with true = show, false = hide.
The default for this attribute is true.
pw::Display get/setShowDomains show
This attribute is the status of showing domain entities in the display.
This attribute is a boolean with true = show, false = hide.
The default for this attribute is true.
pw::Display get/setShowOverset show
This attribute is the status of showing overset data in the display.
This attribute is a boolean with true = show, false = hide.
The default for this attribute is true.
pw::Display get/setShowDisabledEntities show
This attribute is the status of showing disabled entities in the display.
This attribute is a boolean with true = show, false = hide.
The default for this attribute is false.
pw::Display get/setShowDrawingGuide show
This attribute is the status of showing the drawing guide in the display.
This attribute is a boolean with true = show, false = hide.
The default for this attribute is false.
pw::Display get/setShowViewManipulator show
This attribute is the status of showing the view manipulator in the display.
This attribute is a boolean with true = show, false = hide.
The default for this attribute is false.
pw::Display get/setDoublePrecision bool
This attribute controls the floating point precision used in the display. If set to true, the display will be drawn with a higher precision but at the cost of rendering speed. If set to false, the display will be drawn quicker but with some loss in precision.
This attribute is a boolean with true = double precision and false = single precision.
The default for this attribute is true.
pw::Display get/setAutomaticPrecision bool
This attribute controls whether the display switches between single and double precision graphics modes as needed. If set to true, the display will switch to double precision mode when the view is extremely magnified for better fidelity. Otherwise, the display will be drawn with single precision accuracy for better rendering performance.
This attribute is a boolean. When true, the precision will be switched between double and single precision as needed. When false, the mode specified with pw::Display.DoublePrecision will be honored.
The default for this attribute is false.
pw::Display get/setCurrentLayer layer
This attribute is the current layer which is always visible and new entities are added to this layer.
This attribute is an integer with the range [0, number of layers].
The default for this attribute is 0.
pw::Display resetView ?< +X | -X | +Y | -Y | +Z | -Z >?
This action resets the view so that the entire system is visible and centered in the display.
+X | This optional flag is a notification to reset the direction of view to +X axis. |
-X | This optional flag is a notification to reset the direction of view to -X axis. |
+Y | This optional flag is a notification to reset the direction of view to +Y axis. |
-Y | This optional flag is a notification to reset the direction of view to -Y axis. |
+Z | This optional flag is a notification to reset the direction of view to +Z axis. |
-Z | This optional flag is a notification to reset the direction of view to -Z axis. This is the default when no flag is set. |
This action returns nothing.
The rotation center point is not changed.
pw::Display setRotationPoint position
This action sets the view rotation point to the position specified.
position | The specified vector value is used to set the new position of the rotation point. |
This action returns nothing.
pw::Display setCurrentView ?-animate seconds? view
This action updates the display to the current view.
-animate | This specifies that the view transition should be animated over the specified number of seconds. |
view | This parameter is the view to save which includes the list of three vectors (center, translation, and rotation axis) and two floats (rotation angle and zoom). |
This action returns a boolean indicating whether or not the view was updated to the requested view. This will only return false if an animation was requested and the user halted the animation before it completed.
pw::Display calculateView ?-center? ?-view direction? ?-up direction? extent_minimum extent_maximum
This action computes the view to center the specified extents in the display with the given view angle.
-center | If specified, the rotation point will be moved to the center of the bounding box. |
-view | The specified vector value is interpreted as the viewing direction. If absent, the negative Z vector is used. |
-up | The specified vector value is interpreted as the direction to be aligned with the screen Y direction. If not specified, the current “up” vector is used to determine a suitable value. |
extent_minimum | This represents the minimum XYZ value of the bounding box of the volume to be viewed. It is a vector. |
extent_maximum | This represents the maximum XYZ value of the bounding box of the volume to be viewed. It is a vector. |
This action returns the calculated view as a list of three vectors (center, translation, and rotation axis) and two floats (rotation angle and zoom).
pw::Display saveView slot view ?name?
This action saves a view into a slot.
slot | This parameter is the saved view integer slot with the range [1, 6]. |
view | This parameter is the view to save which includes the list of three vectors (center, translation, and rotation axis) and two floats (rotation angle and zoom). |
name | This parameter is the new view name string. |
This action returns nothing.
pw::Display isSavedView < slot | name >
This action checks to see if a view is saved in a slot or has the given name.
slot | This parameter is the saved view integer slot with the range [1, 6]. |
name | This parameter is the saved view name string. |
This action returns true if the view is saved.
pw::Display isolateLayer layer
This action isolates the given layer by hiding all other layers, showing this layer and setting it as the current layer.
layer | This parameter is the integer layer number with the range [0, 1023]. |
This action returns nothing.
pw::Display toggleLayer < layer | layer_list >
This action toggles the visibility of the given layers in the current display.
layer | This parameter is the integer layer number with the range [0, 1023]. |
layer_list | This parameter is a list of layer number integers. |
This action returns nothing.
pw::Display selectEntities ?-description desc? ?-selectionmask mask? ?-single? ?-preselect ents? ?<-exclude ents | -pool ents>? resultVar
This action allows the user to interactively select entities.
resultVar | This option specifies the name of an array variable to receive the results. The array indices and the values are listed below. The array will be cleared prior to setting any new values. |
-description desc | This option causes the text string represented by desc to be displayed in the GUI panel. It should provide some sort of guidance to the user as to what should be picked. |
-selectionmask mask | This options controls what types of entities can be selected. It takes the output of the createSelectionMask command. |
-single | This flag, if present, specifies that only one entity can be selected. If the flag is not present, multiple entities can be selected. |
-preselect ents | This flag, if present, specifies which entities should be preselected for the user. If not present, nothing will be selected initially. This option is not valid when using the single pick option. The entities will only be preselected if they are visible at the start of the function. |
-exclude ents | This flag, if present, specifies which entities should be excluded from picking. If not present, no entities are explicitly excluded. This option cannot be specified with the -pool flag. The base entities for excluded database boundaries and subconnector spacings will be shown regardless of their hidden or layer status. |
-pool ents | This flag, if present, specifies the pool of entities which can be picked. Only entities specified by the ents argument can be selected. This flag cannot be specified with the -exclude flag. The pool entities will be highlighted on the display to indicate what can be selected. All entities specified will be forced into being visible for the duration of the command regardless of the entity’s hidden or layer status. |
This action returns a boolean value of true if entities were picked. An error is raised if this command is called from a non-interactive script.
The array is divided into the following elements.
Connectors | This element is comprised of a list of the pw::Connector objects selected by the user. |
Domains | This element is comprised of a list of the pw::Domain objects selected by the user. |
Blocks | This element is comprised of a list of the pw::Block objects selected by the user. |
Databases | This element is comprised of a list of the pw::DatabaseEntity objects selected by the user. |
Spacings | This element is comprised of a list of subconnector spacing descriptions selected by the user. Each entry in the list is a list of three values. The first value of the entry is the connector. The second value is the subconnector index, starting from 1. The third value is the string “Begin” or “End” indicating which side of the subconnector the spacing object represents. |
Boundaries | This element is comprised of a list of the database boundary descriptions selected by the user. Each entry in the list is a two- or three-element list and can be used as input to any function that takes boundaries as arguments. Parametric surfaces are represented as three values: the database surface, either “U” or “V” indicating the constant parameter, and the constant value of the parameter (either 0.0 or 1.0). Other surface boundaries are represented as two values: the database surface and the boundary index, starting with 1. |
pw::Display getSelectedEntities ?-selectionmask mask? resultVar
This action allows the user to query the display for the current set of selected entities. An error is raised if this command is called from a non-interactive script.
resultVar | This option specifies the name of an array variable to receive the results. The array indices and the values are listed below. The array will be cleared prior to setting any new values. |
-selectionmask mask | This options controls what types of entities can be selected. It takes the output of the createSelectionMask command. |
This action returns a boolean value of true if one or more entities were selected.
The array is divided into the following elements.
Connectors | This element is comprised of a list of the pw::Connector objects selected by the user. |
Domains | This element is comprised of a list of the pw::Domain objects selected by the user. |
Blocks | This element is comprised of a list of the pw::Block objects selected by the user. |
Databases | This element is comprised of a list of the pw::DatabaseEntity objects selected by the user. |
Sources | This element is comprised of a list of the pw::SourceEntity objects selected by the user. |
Spacings | This element is comprised of a list of subconnector spacing descriptions selected by the user. Each entry in the list is a list of three values. The first value of the entry is the connector. The second value is the subconnector index, starting from 1. The third value is the string “Begin” or “End” indicating which side of the subconnector the spacing object represents. |
Boundaries | This element is comprised of a list of the database boundary descriptions selected by the user. Each entry in the list is a two- or three-element list and can be used as input to any function that takes boundaries as arguments. Parametric surfaces are represented as three values: the database surface, either “U” or “V” indicating the constant parameter, and the constant value of the parameter (either 0.0 or 1.0). Other surface boundaries are represented as two values: the database surface and the boundary index, starting with 1. |
pw::Display setSelectedEntities entities
This action allows the specification of entities that will be selected when the script ends. This also affects what subsequent calls to getSelectedEntities return. Use an empty list to clear the selection. Note that only visible entities will be selected. An error is raised if this command is called from a non-interactive script.
entities | This specifies the entities that will be selected. |
This action returns nothing.
The list of entities can be comprised of connectors, domains, blocks, database entities, subconnector spacings, and database boundaries. Connectors, domains, blocks, and database entities are specified via their pw::Connector, pw::Domain, pw::Block, and pw::DatabaseEntity objects, respectively. Subconnector spacings are specified as a list of three values. The first value of the entry is the connector. The second value is the subconnector index, starting from 1. The third value is the string “Begin” or “End” indicating which side of the subconnector the spacing object represents. Database boundaries are sepcified as a two- or three-element list. Parametric surface boundaries are represented as three values: the database surface, either “U” or “V” indicating the constant parameter, and the constant value of the parameter (either 0.0 or 1.0). Other surface boundaries are represented as two values: the database surface and the boundary index, starting with 1.
pw::Display createSelectionMask ?-requireConnector filters? ?-requireDomain filters? ?-requireBlock filters? ?-requireDatabase filters? ?-requireDatabaseBoundary filters? ?-requireSpacing filters? ?-requireSource filters? ?-blockConnector filters? ?-blockDomain filters? ?-blockBlock filters? ?-blockDatabase filters? ?-blockSpacing filters? ?-blockSource filters?
This action creates a selection mask for use with selectEntities.
-requireConnector filters | This flag allows connectors to be selected. The filters argument is described below along with the valid options. |
-requireDomain filters | This flag allows domains to be selected. The filters argument is described below along with the valid options. |
-requireBlock filters | This flag allows blocks to be selected. The filters argument is described below along with the valid options. |
-requireDatabase filters | This flag allows database entities to be selected. The filters argument is described below along with the valid options. |
-requireDatabaseBoundary filters | This flag allows database boundaries to be selected. The filters argument is described below along with the valid options. |
-requireSpacing filters | This flag allows subconnector spacing objects to be selected. The filters argument is described below along with the valid options. |
-requireSource filters | This flag allows sources to be selected. The filters argument is described below along with the valid options. |
-blockConnector filters | This flag provides a method of preventing any connectors with the specified features from being selected as described below. |
-blockDomain filters | This flag provides a method of preventing any domains with the specified features from being selected as described below. |
-blockBlock filters | This flag provides a method of preventing any blocks with the specified features from being selected as described below. |
-blockDatabase filters | This flag provides a method of preventing any database entities with the specified features from being selected as described below. |
-blockSpacing filters | This flag provides a method of preventing any subconnector spacing objects with the specified features from being selected as described below. |
-blockSource filters | This flag provides a method of preventing any sources with the specified features from being selected as described below. |
This action returns a pick mask object.
require flag | Parameters that start with -require (such as -requireConnector or -requireDomain) turn on selection for that entity type. The filters argument is a list of string values describing attributes that an entity is required to possess in order to be selected. Each entity type has a different set of filter options as listed below. If no filters are specified, then no explicit attributes are required of entities in order to be selected. |
block flag | Parameters that start with -block (such as -blockDatabase or -blockConnector) provide a means of disqualifying entities for selection. The filters argument is a list of string values describing attributes that an entity cannot possess in order to be selected. If an entity has any attribute listed as a block attribute, then the user will not be able to select it. Each entity type has a different set of filter options as listed below. Specifying an empty filters argument is equivalent to not specifying the -block parameter. |
The options for filtering connector selection are listed below. If the options are used with the -requireConnector parameter, then connectors must match all options listed in order to be eligible for selection. If the options are used with the -blockConnector parameter, then only connectors that do not possess any of the specified options will be eligible for selection.
Dimensioned | This option specifies connectors that have been dimensioned. |
Constrained | This option applies to domains that have at least one point constrained by a database entity. |
Periodic | This option specifies connectors that have a periodic link with another connector. |
Pole | This option specifies pole connectors (connectors whose shape is a single point). |
InDomain | This option specifies connectors that belong to one or more domains. |
InBlock | This option specifies connectors that belong to one or more blocks. |
Free | This option describes connectors that are not used by any domains. |
Lamina | This option describes connectors that are used by exactly one domain. |
Manifold | This option describes connectors that are used by exactly two domains. |
NonManifold | This option describes connectors that are used by three or more domains. |
Hidden | This option specifies connectors that are hidden. |
The options for filtering domain selection are listed below. If the options are used with the -requireDomain parameter, then domains must match all options listed in order to be eligible for selection. If the options are used with the -blockDomain parameter, then only domains that do not possess any of the specified options will be eligible for selection.
Structured | This option specifies structured domains. |
Unstructured | This option specifies unstructured domains. |
TRex | This option specifies T-Rex domains. |
Defined | The option specifies domains that have internal grid points. For structured domains, this means domains that have balanced dimensions. For unstructured domains, this means domains that have been successfully initialized. |
Solved | This option specifies domains which have been refined. |
Constrained | This option applies to domains that have at least one point constrained by a database entity. |
Periodic | This option specifies domains that have a periodic link with another domain. |
InBlock | This option specifies domains that belong to one or more blocks. |
Free | This option describes domains that are not used by any blocks. |
Lamina | This option describes domains that are used by exactly one block. |
Manifold | This option describes domains that are used by exactly two blocks. |
NonManifold | This option describes domains that are used by three or more blocks. |
Hidden | This option specifies domains that are hidden. |
The options for filtering block selection are listed below. If the options are used with the -requireBlock parameter, then blocks must match all options listed in order to be eligible for selection. If the options are used with the -blockBlock parameter, then only blocks that do not possess any of the specified options will be eligible for selection.
Structured | This option specifies structured blocks. |
Unstructured | This option specifies unstructured blocks. |
Prism | This option specifies a prism block (a block extruded from unstructured domains). |
TRex | This option specifies T-Rex blocks. |
Defined | This option describes a block with defined interior grid points. For a structured block, this means that the faces are dimensionally balanced. For unstructured blocks, this means that the interior has been initialized. For prism blocks, this means blocks that have preserved their interior points from the extrusion. |
Solved | This option specifies blocks which have been refined. |
Hidden | This option specifies blocks that are hidden. |
The options for filtering database selection are listed below. If the options are used with the -requireDatabase parameter, then databases must match all options listed in order to be eligible for selection. If the options are used with the -blockDatabase parameter, then only databases that do not possess any of the specified options will be eligible for selection.
Models | This option specifies model entities. |
Quilts | This option specifies quilt entities. |
TrimSurfaces | This option specifies trimmed surface entities. |
Shells | This option specifies shell entities. |
Surfaces | This option specifies all surface entities |
Planes | This option specifies plane entities. |
Curves | This option specifies curve entities. |
Points | This option specifies point entities. |
Notes | This option specifies note entities. |
Groups | This option specifies group entities. |
Hidden | This option specifies database entities that are hidden. |
BaseForProjection | This option specifies database entities that are suitable for grid point projection. |
BaseForConnector | This option specifies database entities that are capable of supporting connectors. |
BaseForDomainStructured | This option specifies database entities that can be used for creating structured domains. |
BaseForDomainUnstructured | This option specifies database entities that can be used for creating unstructured domains. |
CanIntersect | This option specifies database entities that can be intersected with other database entities. |
DatabaseSupport | This option specifies database entities that are currently in use as support for other database entities (such as a parametric surface supporting a trimmed surface). |
Editable | This option specifies database entities that can be edited at the point level. |
Parametric | This option specifies database entities that are defined parametrically. |
The options for filtering subconnector end spacing selection are listed below. If the options are used with the -requireSpacing parameter, then subconnector spacing objects must match all options listed in order to be eligible for selection. If the options are used with the -blockSpacing parameter, then only subconnector spacing objects that do not possess any of the specified options will be eligible for selection.
Begin | This option specifies subconnector spacing objects that are at the beginning of a subconnector. |
End | This option specifies subconnector spacing objects that are at the end of a subconnector. |
Interior | This option specifies subconnector spacing objects that are on interior breakpoints. |
Constrained | This option specifies subconnector spacing objects that have been given a value other than 0.0. |
There are no options for database boundary filtering currently. The only valid argument to the -requireDatabaseBoundary parameter is an empty list. Future releases may add options, so requiring an empty list will allow the scripts to continue to work with future versions of Glyph. Since there are no options for filtering database boundaries, there is no need for a -blockDatabaseBoundary parameter.
The options for filtering source selection are listed below. If the options are used with the -requireSource parameter, then sources must match all options listed in order to be eligible for selection. If the options are used with the -blockSource parameter, then only sources that do not possess any of the specified options will be eligible for selection.
Shapes | This option specifies shape-defined sources. |
Curves | This option specifies curve-defined sources. |
Points | This option specifies single point and point cloud sources. |
Code
# Create a filter for selecting any domains set sm [pw::Display createSelectionMask -requireDomain {}] # Create a filter for selecting dimensioned connectors set sm [pw::Display createSelectionMask \ -requireConnector {Dimensioned}] # Create a filter for selecting undimensioned connectors set sm [pw::Display createSelectionMask \ -blockConnector {Dimensioned}] # Create a filter for selecting dimensioned, non-pole connectors set sm [pw::Display createSelectionMask \ -requireConnector {Dimensioned} -blockConnector {Pole}] # Create a filter for selecting unstructured, non-T-Rex domains set sm [pw::Display createSelectionMask \ -requireDomain {Unstructured} -blockDomain {TRex}] # Create a filter for selecting unstructured, T-Rex domains set sm [pw::Display createSelectionMask \ -requireDomain [list Unstructured TRex]]
pw::Display selectPoint ?-description message? ?<-controlPoint conList | -connector conList | -domain domList | -database dbList | -source srcList>? ?-details varName?
This action enters an interactive mode where the user can select a single point.
-description desc | This option causes the text string represented by desc to be displayed in the GUI panel. It should provide some sort of guidance to the user as to what should be selected. |
-controlPoint conList | This option limits point selection to the control points of the connectors specified in conList. The entities in conList will be made visible and highlighted regardless of their visibility or layer attributes. It is an error if conList is empty. |
-connector conList | This option limits point selection to the connectors specified in conList. The entities in conList will be made visible and highlighted regardless of their visibility or layer attributes. If conList is empty, all visible connectors will be eligible for point selection and no highlighting will occur. |
-domain domList | This option limits point selection to the domains specified in domList. The entities in domList will be made visible and highlighted regardless of their visibility or layer attributes. If domList is empty, all visible domains will be eligible for point selection and no highlighting will occur. |
-database dbList | This option limits point selection to the databases specified in dbList. The entities in dbList will be made visible and highlighted regardless of their visibility or layer attributes. If dbList is empty, all visible databases will be eligible for point selection and no highlighting will occur. |
-source srcList | This option limits point selection to the sources specified in srcList. The entities in srcList will be made visible and highlighted regardless of their visibility or layer attributes. If srcList is empty, all visible sources will be eligible for point selection and no highlighting will occur. |
-details var | This option specifies the name of an array variable to receive additional information about the point selected. The array will be cleared prior to setting any new values. |
This action returns a vector representing the XYZ value of the selected point. It is an error if this action is issued from a non-interactive script or if the user cancels the selection.
Only zero or one of the entity list options (-controlPoint, -connector, -domain, -database, -source) may be specified for this action.
If a single entity list option with a non-empty list is specified, the entities in the list will be made visible and highlighted regardless of their hidden or layer attributes.
If a single entity list option with an empty list is specified, all visible entities of the specified type will be eligible for point selection and no highlighting will occur.
If zero entity list options are specified, all visible entities of any type are eligible for point selection and no highlighting will occur.
After a successful point selection, the details array variable will contain one or more of the following elements:
Entity | This element is always present. It contains the entity on which the point was selected. It may be a connector, domain, database, source, or node entity. This will be a node only if the user selected the end point of an undimensioned connector. |
Index | This element is only present if Entity is a connector or domain. If Entity is a connector selected using -controlPoint, Index will be a list of 2 integer values consisting of the segment index followed by the control point for that segment. If Entity is a connector selected using -connector, Index will be a single integer value representing the connector point index. If Entity is a domain, the Index will be a list of two integer values representing the domain point index. |
UV | This element will be set if the selected point is database constrained. It will be in the point format. |
Code
proc dump { xyz detailsArrVar } { upvar $detailsArrVar details set fmt "%-6.6s = %s" puts "--" puts [format $fmt "xyz" $xyz] foreach {key val} [array get details] { puts [format $fmt $key [list $val]] } } set xyz [pw::Display selectPoint -connector {} -details details] dump $xyz details set xyz [pw::Display selectPoint -connector {} -details details] dump $xyz details set xyz [pw::Display selectPoint -domain {} -details details] dump $xyz details set strDoms [pw::Grid getAll -type pw::DomainStructured] set xyz [pw::Display selectPoint -domain $strDoms -details details] dump $xyz details set xyz [pw::Display selectPoint -database {} -details details] dump $xyz details set xyz [pw::Display selectPoint -source {} -details details] dump $xyz details
Output
-- xyz = 47.8444898809553 7.53188256823589 -8.97280185214966 Entity = ::pw::Node_2 -- xyz = 55.59498148541687 -1.0131755687871173 -4.997621035413054 Index = 2 Entity = ::pw::Connector_6 UV = {0.5277972127705808 0.5005065827185664 ::pw::Plane_1} -- xyz = 55.59498148541687 3.9868244312096994 -4.997621035413054 Index = {2 2} Entity = ::pw::DomainStructured_6 UV = {0.5277972127705808 0.49800660771831795 ::pw::Plane_1} -- xyz = 55.59498148541719 8.986824431211442 -9.997621035413054 Index = {2 2} Entity = ::pw::DomainStructured_4 -- xyz = 11.1167905722305 -14.6824061106718 -0.442818802832527 Entity = ::pw::Curve_1 UV = {1.0 0.0 ::pw::Curve_1} -- xyz = 12.0 12.0 12.0 Entity = ::pw::SourcePointCloud_1
pw::Display setLightDirection ?-scene boolean? direction
This action controls the display’s lighting direction and whether the lighting is fixed with the view or with the scene. When the lighting is fixed relative to the scene, the light direction is in the grid coordinate system and will move with the scene as the viewing angle is rotated. When the lighting is fixed relative to the view, the direciton coordinate system is defined with the X-axis to the right, the Y-axis up, and the Z-axis out of the screen. The default lighting direction is view-based with a direction of (0, 0, -1) (ie, into the screen).
-scene | This option takes a boolean value and controls whether the direction is to be locked relative to the grid system’s coordinates (a true value) or locked relative to the viewing direction (a false value, which is also the default value). |
direction | This parameter is the lighting direction, either in the viewing or scene coordinates. It should be a vector of 3 floating point values. The default direction is (0, 0, -1) in the viewing coordinates. |
This action returns nothing.
pw::Display getLightDirection ?sceneVar?
This action returns the display’s lighting direction. Optionally, it will also return whether the display’s light is fixed with the view or with the scene.
sceneVar | This option should define a variable that will receive a boolean value. A value of true indicates that the light is fixed with the scene. A value of false indicates that the light direction is fixed with the view direction (the view direction is considered to be along the negative Z axis in view coordinates). |
This command returns a vector representing the current lighting direction.
pw::Display getSize
This action returns the size of the current display window.
This command returns the display size as a list of 2 integer values representing the width and the height, respectively, in pixels of the display window. If there is no display window, zero is returned for both dimensions.
pw::Display saveImage ?-foreground fgOption? ?-background bgOption? ?-dpi dpi? ?-size size? ?-format option? filename
This action saves an image of the current display to a file. This automatically causes an update of the display first to make sure the display is current.
-foreground fgOption | This option takes a string value representing the foreground color option. The available options are: Color, Grayscale, White, and Black. This controls how the color of all non-background objects are treated. The default Color option preserves the existing colors. The Grayscale option converts the colors to the corresponding gray values. The White option converts all colors to white, and the Black option converts all colors to Black. |
-background bgOption | The option takes a string value representing the background color option. The available options are: Color, Grayscale, White, Black, and Transparent. This controls how the background is represented in the image. The default Color option preserves the existing background colors. The Grayscale option converts the background colors to gray values. The White option converts the background to white (an error is raised if this is selected and the foreground option is also set to White). The Black option converts the background to black (an error is raised if the foreground is also set to Black). The Transparent option saves the image with a transparent background if the graphics hardware supports it and the PNG format is specified (either explicitly or implicitly through the filename’s extension). Otherwise the Color option is used. |
-dpi dpi | This option expects a positive non-zero integer value representing the dots-per-inch value saved in the image. The default value is 72. |
-size size | This option specifies the image size in inches. It is represented as a list of 2 real numbers denoting the width and height of the image. This value, along with the dots-per-inch setting are used to determine the pixel size of the image. If not specified, the image size in pixels will be the same as the current display. |
-format option | This should be a string value of the form PNG, BMP, or TIFF. Note that not all values are supported on all platforms. Use the getImageFormats command to see a list of supported values. The default format is determined by the extension of the filename if possible, or PNG if a non-standard extension is used. |
filename | This string value should contain the name of a writable file to which the image will be saved. If the format is not specified with the -format option, the format will be determined from the filename extension if possible. Recognized extensions are “.bmp”, “.png”, “.tif”, and “.tiff”. The format should be explicitly declared if a different extension is specified. |
This command returns a boolean value of true if the image was saved and false if the image was not saved.
pw::Display zoomToEntities ?-animate seconds? entities
This action changes the zoom level and pans to center the display around the list of given entities.
-animate | This option specifies that the view transition should be animated over the specified number of seconds. |
entities | This parameter is a list of entities, database boundaries, or connector end spacings. The display will be panned and zoomed to fit these entities. |
Connnector end spacings are represented as a list consisting of the connector, an optional sub-connector index, and either “Begin” or “End” to specify which spacing. If the sub-connector index is omitted, the “Begin” and “End” values refer to the beginning and ending spacings of the entire connector.
This action returns a boolean indicating whether or not the view was updated to the requested view. This will only return false if an animation was requested and the user halted the animation before it completed.
pw::Display zoomToFit ?-animate seconds?
This action changes the zoom level and pans to center the display around all currently visible entities.
-animate | This option specifies that the view transition should be animated over the specified number of seconds. |
This action returns a boolean indicating whether or not the view was updated to the requested view. This will only return false if an animation was requested and the user halted the animation before it completed.
This attribute is the type of projection of the display.
pw::Display get/setProjection < Perspective | *Orthonormal* >
This attribute controls showing the rotation point axes in the display.
pw::Display get/setShowBodyAxes true
This attribute controls showing the XYZ axes in the display centered at the origin.
pw::Display get/setShowXYZAxes true
This attribute controls showing database entities in the display.
pw::Display get/setShowDatabase show
This attribute controls showing source entities in the display.
pw::Display get/setShowSources show
This attribute controls showing node entities in the display.
pw::Display get/setShowNodes show
This attribute is the status of showing connector entities in the display.
pw::Display get/setShowConnectors show
This attribute is the status of showing domain entities in the display.
pw::Display get/setShowDomains show
This attribute is the status of showing overset data in the display.
pw::Display get/setShowOverset show
This attribute is the status of showing disabled entities in the display.
pw::Display get/setShowDisabledEntities show
This attribute is the status of showing the drawing guide in the display.
pw::Display get/setShowDrawingGuide show
This attribute is the status of showing the view manipulator in the display.
pw::Display get/setShowViewManipulator show
This attribute controls the floating point precision used in the display.
pw::Display get/setDoublePrecision bool
This attribute controls whether the display switches between single and double precision graphics modes as needed.
pw::Display get/setAutomaticPrecision bool
This attribute is the current layer which is always visible and new entities are added to this layer.
pw::Display get/setCurrentLayer layer
This action updates the graphics in the display to their current setting.
pw::Display update
This action resets the view so that the entire system is visible and centered in the display.
pw::Display resetView ?< +X | -X | +Y | -Y | +Z | -Z >?
This action resets the view rotation point to the center of visible objects.
pw::Display resetRotationPoint
This action sets the view rotation point to the position specified.
pw::Display setRotationPoint position
This action gets the current view of the display.
pw::Display getCurrentView
This action updates the display to the current view.
pw::Display setCurrentView ?-animate seconds? view
This action computes the view to center the specified extents in the display with the given view angle.
pw::Display calculateView ?-center? ?-view direction? ?-up direction? extent_minimum extent_maximum
This action saves a view into a slot.
pw::Display saveView slot view ?name?
This action restores the view specified by slot or name.
pw::Display recallView < slot | name >
This action clears the view specified by slot or name.
pw::Display clearView < slot | name >
This action checks to see if a view is saved in a slot or has the given name.
pw::Display isSavedView < slot | name >
This action returns the name of the saved view.
pw::Display getViewName slot
This action sets the name of the view in the given slot.
pw::Display setViewName slot name
This action checks if the given layer is visible.
pw::Display isLayerVisible layer
This action isolates the given layer by hiding all other layers, showing this layer and setting it as the current layer.
pw::Display isolateLayer layer
This action sets the given layers to be shown in the current display.
pw::Display showLayer < layer | layer_list >
This action sets all of the layers to be shown in the current display.
pw::Display showAllLayers
This action sets the given layers to be hidden in the current display.
pw::Display hideLayer < layer | layer_list >
This action sets all of the layers to be hidden in the current display.
pw::Display hideAllLayers
This action toggles the visibility of the given layers in the current display.
pw::Display toggleLayer < layer | layer_list >
This action toggles all of the layers in the current display.
pw::Display toggleAllLayers
This action allows the user to interactively select entities.
pw::Display selectEntities ?-description desc? ?-selectionmask mask? ?-single? ?-preselect ents? ?<-exclude ents | -pool ents>? resultVar
This action allows the user to query the display for the current set of selected entities.
pw::Display getSelectedEntities ?-selectionmask mask? resultVar
This action allows the specification of entities that will be selected when the script ends.
pw::Display setSelectedEntities entities
This action creates a selection mask for use with selectEntities.
pw::Display createSelectionMask ?-requireConnector filters? ?-requireDomain filters? ?-requireBlock filters? ?-requireDatabase filters? ?-requireDatabaseBoundary filters? ?-requireSpacing filters? ?-requireSource filters? ?-blockConnector filters? ?-blockDomain filters? ?-blockBlock filters? ?-blockDatabase filters? ?-blockSpacing filters? ?-blockSource filters?
This action enters an interactive mode where the user can select a single point.
pw::Display selectPoint ?-description message? ?<-controlPoint conList | -connector conList | -domain domList | -database dbList | -source srcList>? ?-details varName?
This action controls the display’s lighting direction and whether the lighting is fixed with the view or with the scene.
pw::Display setLightDirection ?-scene boolean? direction
This action returns the display’s lighting direction.
pw::Display getLightDirection ?sceneVar?
This action returns the size of the current display window.
pw::Display getSize
This action returns a list of available image format options for the saveImage command.
pw::Display getImageFormats
This action saves an image of the current display to a file.
pw::Display saveImage ?-foreground fgOption? ?-background bgOption? ?-dpi dpi? ?-size size? ?-format option? filename
This action changes the zoom level and pans to center the display around the list of given entities.
pw::Display zoomToEntities ?-animate seconds? entities
This action changes the zoom level and pans to center the display around all currently visible entities.
pw::Display zoomToFit ?-animate seconds?