Displaying Graphics
Functions Introduced:
• ProGraphicsPenPosition()
• ProGraphicsLineDraw()
• ProGraphicsPolylineDraw()
• ProGraphicsMultiPolylinesDraw()
• ProGraphicsArcDraw()
• ProGraphicsCircleDraw()
• ProGraphicsPolygonDraw()
• ProGraphicsModelPolygonDraw()
All the functions in this section draw graphics in the current window (the Creo+ current window, unless redefined by a call to ProWindowCurrentSet()), and use the color and line style set by calls to ProGraphicsColorSet() and ProLinestyleSet(). The functions draw the graphics in the Creo+ graphics color. The default graphics color is white.
By default, the graphics elements are not stored in the
Creo+ display list, so they do not get redrawn by
Creo+ when the user selects the
Repaint command or the orientation commands in the
Orientation group in the
View tab. However, if you store graphics elements in either 2-D or 3-D display lists,
Creo+ redraws them. See the section
Display Lists for more information.
The functions ProGraphicsPenPosition() and ProGraphicsLineDraw() draw three-dimensional polylines in solid mode, and take solid coordinates.
The function ProGraphicsPenPosition() sets the point at which you want to start drawing the line. The function ProGraphicsLineDraw() draws a line to the given point from the position given in the last call to either of the two functions. You call ProGraphicsPenPosition() for the start of the polyline, and ProGraphicsLineDraw() for each vertex.
If you use these functions in Drawing mode they work correctly, but use screen coordinates instead of solid coordinates.
The ProGraphicsPolylineDraw() and ProGraphicsMultiPolylinesDraw() functions also draw polylines, but you need to have the whole polyline defined in a local array before you call either function. If you are drawing many lines, use ProGraphicsMultiPolylinesDraw() to minimize the number of function calls.
The function ProGraphicsArcDraw() draws an arc, in screen coordinates.
The function ProGraphicsCircleDraw() uses solid coordinates for the center of the circle and the radius value, but draws the circle parallel to the plane of the window. You can position the circle at a chosen solid vertex, for example, and the circle will always be clearly visible as a circle, regardless of the current solid orientation.
The function ProGraphicsModelPolygonDraw() draws filled or unfilled polygons in the window. The input arguments are:
• point_array—Specifies a ProArray of X and Y coordinates. If the current object is a part or an assembly, define the points in the corresponding part or assembly coordinate system. Use ProArrayFree() to release the allocated memory.
• fill_color—Specifies the fill color using the ProColortype object.
|
Note:
|
This function is primarily intended to clear areas within graphics windows. It does not affect any part of the interface.
|