Global Functions

The following is a global function. It affects all View3D widgets within an application.

Function NameDescription
XintView3DSetGlobalFlagsSet or Unset global flags


XintView3DSetGlobalFlags

This function sets or unsets the global flags. The global flags are useful for performance tuning.

     void XintView3DSetGlobalFlags(...)

XintView3DGlobalFlags *flagsSpecifies a pointer to a structure containing the flags to set.
unsigned longflag_maskSpecifies which members of flags to set. flag_mask is made by combining any number of the mask symbols listed below.

Arguments flags and flag_mask are used to set or unset the global flags. Argument flags is a pointer to a structure of type XintView3DGlobalFlags which is described below:

   typedef struct {
                   Boolean disable_normals;
                   Boolean disable_polygon_data;
                   Boolean offscreen_select;
                   Boolean local_storage;
                   Boolean swapping;
                   char *swap_file
                   unsigned long swap_size;
   } XintView3DGlobalFlags;

You need only set the components that you want to change. The following table lists the structure members, the default values and the corresponding mask.

MemberDefaultMask
disable_normalsFalseXintGLOBAL_DISABLE_NORMALS
disable_polygon_dataFalseXintGLOBAL_DISABLE_POLYGON_DATA
offscreen_selectFalseXintGLOBAL_OFFSCREEN_SELECT
local_storageTrueXintGLOBAL_LOCAL_STORAGE
swappingFalseXintGLOBAL_SWAPPING
swap_file/usr/tmp/View3DSwapXintGLOBAL_SWAP_FILE
swap_size0x01ffffffXintGLOBAL_SWAP_SIZE

The following table lists the effects of the global flags.

FlagValueEffect
disable_normalsTrueNo surface normals will be generated for any objects. This will also disable lighting. By setting this flag, each mesh surface will use 19% less memory.
disable_normalsFalseDefault setting. Lighting is functional.
disable_polygon_dataTrueNo polygon data will be generated for any of the mesh surfaces. This will also disable picking. Selection will work as if offscreen_select had been set to True. This will also save 56% of the memory required by mesh surfaces.
disable_polygon_dataFalseDefault setting. Polygon data will be generated for surfaces. This data is needed for Picking (but not selection). It is also useful for user applications such as Ray Tracing.
offscreen_selectTrueForces all View3D widgets to use an offscreen pixmap to perform selection. The extra memory required for offscreen selection is negligible. The system will generate a 5x5 pixmap for the selection. Offscreen selection will normally be slower than the regular selection method, but in many cases it will not be noticed.
offscreen_selectFalseDefault setting. All View3D widgets will use the polygon data of each mesh surface to perform selection.
local_storageTrueDefault setting. Whenever an object is created, the creation function (ex: XintView3DCreateMeshSurface) will allocate memory for all elements and copy the user supplied data. This will protect the user from accidently freeing resources that a View3D widget is using.
local_storageFalseWhenever an object is created, the creation function will not allocate any memory (except for the name of the object). The function will just assign pointers to the user supplied data. This feature is useful when large datasets are being used. It will decrease the time necessary to create an object, and reduce memory requirements. The user must make certain that any memory allocated is not freed while a View3D widget is using it. Warning: If an object is removed from a viewer (XintView3DRemovObject) the object will be dereferenced and possibly deleted. If the resources should not be freed, remember to reference the object before adding (XintView3DRefObject).
swappingTrueIf the datasets are larger than physical memory the swapping will be handled by View3D.
swappingFalseIf the datasets are larger than physical memory the swapping will be handled by the system.
swap_file/usr/tmp/View3DSwapWhen the dataset is larger than physical memory this file will be used to store the data, if View3D is handling the swapping.
swap_size32MBThe size of physical memory if View3D is handling the swapping.