Functions | |
void | Set_Heuristics (const char *list) |
void | QSet_Heuristics (const char *segment, const char *list) |
void | UnSet_Heuristics (void) |
void | UnSet_One_Heuristic (const char *which) |
void | QUnSet_Heuristics (const char *segment) |
void | QUnSet_One_Heuristic (const char *segment, const char *which) |
void Set_Heuristics | ( | const char * | list | ) |
Gives hints to the system about good short cuts to take during program execution.
list | - A quoted string or a string variable containing a list of the desired settings. |
The list of heuristics is passed to the system as an arbitrarily long formatted string containing one or more specifications, separated from each other by commas. Each specification can be preceded by the word "no". Uppercase versus lowercase is not significant, nor are any leading or trailing blanks on any specification. Embedded blanks within the option name itself are significant.
Each individual Heuristic inherits up and down the segment tree and is Set independently of all the other choices; you might find yourself calling Set_Heuristics() several times in a row, feeding in more choices each time. The new choices are merged with the old as they arrive. This avoids having to make the call just once with a long specification string. (Note that UnSet_Heuristics() removes all the information for the attribute for that segment. Use UnSet_One_Heuristic() to remove the setting for just one heuristic.)
The following choices are recognized:
[no] backplane cull [= on | off]
"backplane cull" is a 3-D update optimization that tells the system it's OK to remove any polygons, circles, or ellipses, or shell or mesh faces that land "facing away" from the camera during drawing. This removes the need to fill the pixels representing the farther face of a closed polyhedron, for example. Backplane cull will not work properly on self-intersecting polygons. With the exception of a closed Shell---for which the handedness is automatically defined---you will need to also specify polygon handedness (see below) to make "backplane cull" meaningful. The default is "backplane cull".
If you choose "no clipping" you are guaranteeing that nothing you draw will fall outside its screen window and need to be trimmed off, nor will anything fall behind a perspective viewing camera. The default is "clipping".
[no] concave polygons [= on | off]
"No concave polygons" guarantees that all polygons are convex (though concave shell and mesh faces are still ok), and significantly improves the performance of polygon drawing. The default is "no concave polygons".
[no] culling = [(option, option, option...)]
Tells HOOPS not to draw certain objects, depending on settings. Valid choices for option are as follows:
The default is "view frustum, maximum extent = 1". See also the backplane cull option.
[no] detail selection [= on | off]
Instructs selection events to honor the exact shape of the glyphs of a curve, edge or polyline. This means that both the pattern and the weight of a line/edge will affect its selectability. The default setting is "no detail selection".
[no] exclude bounding [= on | off]
Removes the current segment and its children from bounding box calculations. Default is "no exclude bounding".
If the value is greater than zero, then this segment will be placed on a defer list and be drawn after all other segments with "force defer batch = 0" have been drawn. Segments will be drawn from the defer list in order with the segments with a lower "force defer batch" value being drawn first. This attribute does not inherit and the default value for each segment is "force defer batch = 0".
[no] hidden surfaces [= on | off]
"No hidden surfaces" tells the system that it's not necessary to figure out which parts of your 3-D scene are in front of and should hide other parts of the scene---either nothing overlaps (you don't especially care what happens when geometries overlap, you're really only working 2-D), or the ordering will be done manually by calls to Bring_To_Front() .
"Hidden surfaces", on the other hand, tells the system that it is necessary to carefully figure out what lies in front of what according to their Z -values, and to paint the result onto the screen in the proper order. (This ability can be implemented in hardware, depending on your machine.) It's legal to mix hidden-surface and nonhidden-surface segments within a window; Bring_To_Front() can be used to determine the order they come out in.
By default, hardware hidden surface removal will be used when available. A Different algorithm can be chosen from a selection with Set_Rendering_Options() .
Note: When "hidden surfaces" (or "bring to front") is in effect the system will be less able to add geometry incrementally to a scene, and will generally redraw everything from scratch upon any change.
The default is "hidden surfaces".
[no] incremental updates [= on | off]
"Incremental updates" tells the system to try to perform an Update by adjusting the existing screen image, rather than just erasing and starting over. This should always be enabled, but you might want to turn it off for debugging. The default is "incremental updates".
[no] intersecting polygons [= on | off]
"No intersecting polygons" is a hidden-surfaces optimization, and tells the system not to make extra checks for polygons, lines, meshes, etc. that are projecting through each other. The default is "no intersecting polygons".
[no] internal selection limit = (ddd|(shells=ddd, polyline=ddd))
Certain types of geometry (shells, meshes, and polylines) can have multiple sub-entities selected (faces, edges and/or vertices). However, building up the lists of these sub-entities is a computationally intensive task and is best skipped, unless the user actively requests the information by setting the 'internal selection limit'. Setting this heuristic causes Show_Selection_Elements() to calculate/retrieve a specified number of faces, edges and vertices during a selection. For example, settting 'no internal selection limit' would resultin all internal items getting selected.
A single input value applies the selection limit to shell, mesh, and polyline geometries. Otherwise, specific values can be set for shells and meshes, and polylines separately, for example "(shells=50, polyline=10)". Note: setting "internal selection limit = -1" tells 3dGS not to perform any detailed internal selection, and this can improve selection performance. However, this special setting will also cause Show_Selection_Element not to return subgeometry entities that are normally guaranteed to be the closest match to a selection ray. The default setting is "internal selection limit = 1".
[no] memory purge [= on | off]
Turning on memory purging tells the system that the geometry in the scope of the option will only be needed for drawing once. You're promising that once HOOPS has drawn the geometry on the screen once, it will never need to be redrawn. Therefore, it will be safe for the system to automatically free up the computer memory occupied by the geometry. The default is "no memory purge".
This can be useful if you're running on a machine with limited memory, or if your picture is very complex or detailed---if you're careful, you can build up scenes that would normally overflow your computer memory or cause excessive page faults.
You would typically turn on the heuristic, create some part of your scene, update the screen with Await_Event() or Update_Display() , then create and update some more. The computer's memory will be reused with each create or update cycle. (Memory purging differs from just doing a Delete in that it doesn't cause the screen to be erased and redrawn---the visible scene is left alone.) You'll have to determine the amount of your picture that it is reasonable to draw in each cycle.
If some missing geometry is needed again by the system, you'll get a warning message. A hidden-surface scene, for example, will usually require taking a look at everything on every update.
The default is "no memory purge".
By setting lmv, developers are informing HOOPS that this model contains a large number of segments and/or geometry. Setting this heuristic allows HOOPS to use algorithms more appropriate for large models. The default setting is "model type = default".
[no] partial erase [= on | off]
Partial erase assists in minimizing screen updates under special circumstances. When this heuristic is set, and a piece of geometry is removed from a scene, HOOPS redraws the geometry in the containing window color to erase it rather than redrawing the entire scene.
The default is "no partial erase".
See the Restrictions section regarding partial erase. In addition, there is an alternative method for accomplishing partial erase. The combination of partial erase and incremental updates is expensive in terms of memory consumption, since HOOPS has to remember the drawing context for geometry that might be partially erased. An alternative method for partial erase is to use Control_Update() in conjunction with setting geometry to the color of the window. This alternative uses less memory but requires more programming effort.
[no] polygon crossings [= on | off]
"No polygon crossings" guarantees that for any single polygon, no two edges actually cross each other. This may speed up Insert_Polygon() and polygon filling. The default is no polygon crossing.
[no] polygon handedness [= left | right]
In order to do a backplane cull (see above), there must be some definition of a polygon's "front" and "back" (or equivalently "inside face" and "outside face"). This orientation is determined by the order in which the polygon's vertices were originally defined, and the polygon handedness setting (and not the coordinate system handedness - see below). If you wrap the fingers of the chosen hand along the vertices of the polygon, with your wrist at the first vertex specified and your fingertips at the last, then extend your thumb perpendicular to your fingers, by definition, your thumb is extending out of the front face of the polygon. When polygon handedness is set, the HOOPS renderer enters an optimized lighting mode, so-called "single-sided lighting" mode. The default is "no polygon handedness", i.e., no opinion.
Note: Polygon handedness does not take into account the coordinate system handedness and instead assumes that the coordinate system is left handed. The benefit of this is that developers can change the coordinate system handedness without having to also change the polygon handedness; though it also means that in a right handed system you will need to set a polygon handedness that is opposite to what it actually is.
[no] quick moves [= on | spriting | off]
The quick moves heuristic tells the system that changes and screen updates are going to come quickly for a particular segment. Specifically, the heuristic says that it's going to be worthwhile to do extra labor to allow moves or deletions to be updated to the screen without the usual repaint on the segment's containing window.
on
This option causes geometry in the current segment to be drawn on top of all the other geometry within the scene. For this, HOOPS can use either an exclusive-or (xor) or overlay algorithm. The algorithm may be set using the quick moves preference option for Set_Driver_Options().
spriting
This option allows 3D objects embedded in the scene to be drawn and redrawn quickly, and employs the HOOPS spriting algorithm instead of "exclusive-or" or "overlay" methods. Instead of continuously redrawing the entire scene, a transform with "quick moves = spriting" requires only 2 complete redraws: one at the beginning to update the scene minus the selected geometry, and one at the end after the selected geometry has been transformed. During the transform, only the geometry affected by the transformation is redrawn. Spriting should be used for all operations on geometry such as translation, rotation, scaling, and editing...especially in complex scenes. NOTE: the quickmove preference driver option has no effect on rendering when "quick moves = spriting". If spriting cannot be achieved, full updates will be performed instead.
Quick moves are only of use for display drivers such as OpenGL, Direct3D, X11 or MSW.
Quick-move mode should be used judiciously. If used too much, it might become "slow move" mode, since all quick-move geometry is redrawn on every update.
The default is "no quick moves".
[no] related selection limit = (ddd)
Given a single mouse click, it takes significant work for the system to sort through and store all the geometry in a scene in its proximity order to the mouse. This happens even if Find_Related_Selection() is never called to look at the results. "Related selection limit" tells the system that no more than the number of items of geometry past the first will be needed.
To eliminate related selections, use "related selection limit = 0". "No related selection limit" is equivalent to "no limit". The limit should be consistent throughout each screen window.
The default is "related selection limit = 5".
selection level = (entity | geometry | segment | segment tree)
Allows the user to designate, on a per-segment basis, what will be returned when a particular item in or below that segment is hit by a selection event. This can simplify the amount of work a developer needs to do in processing selections, while also resulting in a possibly significant improvement in the selection performance. Each option has the following meaning:
[no] selection sorting [= on | off]
Forces HOOPS to jump any z-sorting of selected geometry. This heuristic can improve selection performance with wireframe/2d scenes. Default is "selection sorting = on".
[no] static model [= on | off]
Setting this heuristic tells HOOPS that the current segment tree will remain unchanged. This allows HOOPS to create a compiled "draw tree" for the scene which should result in better rendering performance. It is important to note that the compiled tree will need to be regenerated if a change occurs within the segment tree. The only segment tree modifications that will not result in a regeneration are a segment/geometry deletion or a geometry edit via a call to any of the Edit_* HOOPS/3dGS functions.
Generation of the compiled tree is relatively fast. For most moderately-sized models this allows recompilation to take place simultaneously with edits or other interactions. The setting should be turned off when excessive numbers of edits are occuring within a particularly large model, or when slow-downs in draw time are particularly sensitive (for example, when loading a new segment hierarchy or when highlighting). When using this setting, users are encouraged to place highlighting and redlining geometry in a location outside the static tree.
The default setting is "no static model".
[no] visual selection [= on | off]
If you turn on visble selection all selections will be post-processed and removed from the selection list if they are obscured in the current view by another object in the scene. This setting has no effect on object-space selections, such as Compute_Selection_By_Shell(), Compute_Selection_By_Ray(), or the "empty driver" cases of Compute_Selection() and Compute_Selection_By_Volume(). The default is 'no visual selection'.
The default setting of the Heuristics attribute---the setting on the root ("/") segment---can be given a new initial value on most systems by means of the environment variable "HOOPS_HEURISTICS".
void QSet_Heuristics | ( | const char * | segment, | |
const char * | list | |||
) |
Similar to Set_Heuristics(), but operates on a given segment rather than the currently open one.
segment | - Name of the segment(s) to be changed. | |
list | - A quoted string or a string variable containing a list of the desired settings. |
void UnSet_Heuristics | ( | void | ) |
Removes all settings established by a previous call to Set_Heuristics().
void UnSet_One_Heuristic | ( | const char * | which | ) |
Removes a given setting established by a previous call to Set_Heuristics(), rather than all settings.
which | - A particular heuristic to be unset. |
void QUnSet_Heuristics | ( | const char * | segment | ) |
Removes all settings established by a previous call Set_Heuristics(), but operates on a given segment rather than the currently open one.
segment | - Name of the segment(s) to be changed. |
void QUnSet_One_Heuristic | ( | const char * | segment, | |
const char * | which | |||
) |
Removes a given setting established by a previous call to Set_Heuristics(), but operates on a given segment rather than the currently open one.
segment | - Name of the segment(s) to be changed. | |
which | - A particular heuristic to be unset. |