C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
VSN::ExplodeDispatcher Class Reference

Class ExplodeDispatcher is used to manage the process of disassembling objects of the geometric model (scene segments), it also provides support for working with GUI tabs and provides various viewing modes. More...

#include <vsn_explodedispatcher.h>

Public Types

enum  ControlParameterType {
}
 

Public Member Functions

 ExplodeDispatcher ()
 Default constructor.
 
 ~ExplodeDispatcher ()
 Destructor.
 
void Init (const std::string &mainTabName, const std::string &tabNameSeparator, SceneSegment *pSegmModel)
 The name of the main (main) tab and a pointer to the root segment of the model are passed as initialization parameters.
 
ResultState GetParameterValues (const ControlParameterType paramType, ExplodeParameterValues &paramValues) const
 Get parameter values.
 
ResultState GetParameterState (const ControlParameterType paramType, ExplodeParameterState &paramState)
 Get parameter state.
 
ExplodeDispatcher::ResultState SetParameter (const ControlParameterType paramType, const Variant &data, const bool recalculate=true)
 Set a new value for the control parameters and, if recalculate == ture, recalculate the geometry of decomposed objects (decomposition model).
 
std::vector< ControlParameterTypeGetControlParameters () const
 Get control parameters.
 
void Recalculate ()
 Recalculate the decomposition model using the current parameter values.
 
bool IsRecalculateRequired () const
 The method returns true if the geometry of decomposed objects needs to be recalculated after changes in the parameters.
 
void GetCameraOptions (Point3DF &position, Point3DF &targetPosition, Vector3DF &upVector) const
 Get camera parameters for the current view (current tab).
 
void SetCameraOptions (const Point3DF &position, const Point3DF &targetPosition, const Vector3DF &upVector)
 Set camera parameters for the current view (current tab).
 
const SceneSegmentGetSelectedSegment () const
 Get selected segment.
 
void SetSelectedSegment (const SceneSegment *pSegm)
 Set selected segment and update selection related parameters.
 
bool CreateNewItem (const std::string &tabName, const SceneSegment *pSegmSelected)
 Create a tab with a new view.
 
bool SwitchActiveItem (const std::string &tabName)
 Make the specified tab active.
 
bool RemoveItem (const std::string &tabName)
 Delete the specified tab (view mode).
 
int GetMaximumTabNumber () const
 Get the maximum number among existing tabs. Can be used when generating a new tab name.
 

Detailed Description

Class ExplodeDispatcher is used to manage the process of disassembling objects of the geometric model (scene segments), it also provides support for working with GUI tabs and provides various viewing modes.

The “Explosion” functionality can be used when the user needs to use a small number of actions to get an idea of the objects that make up the model, their relationships and internal structure of the model. In particular, you can get an idea of the bodies inside subassemblies, blocked by other bodies. In such cases, the use of approaches like hiding some bodies or changing the degree of their transparency can be much more time-consuming. The decomposition of objects is determined by a set of control parameters defined in the type ExplodeDispatcher::ControlParameterType. The cpt_Explode parameter is responsible for moving disassembled objects, with the zero value of this parameter corresponding to the initial state of the model before the decomposition. The speed at which objects move is determined by the cpt_Speed parameter. The functionality provides quite an extensive set of options for controlling the decomposition modes: the ability to set the center of decomposition relative to selected object (cpt_ExplodeFromItem), decomposition relative to the center of the scene (cpt_ExplodeFromCenter), decomposition is supported in radial direction (cpt_RadialTrajectory), axial direction (cpt_AxialTrajectory) and in the direction orthogonal to the axial (cpt_OrthToAxialTrajectory). The API supports multi-window GUI: it is possible to view selected assemblies in separate tabs and configure the desired decomposition mode in each tab, separately from other tabs. Other supported features: the ability to synchronize the decomposition modes between all tabs, synchronization of parameters that define the decomposition mode (cpt_SynchronizeExplode), synchronization of camera parameters (cpt_SynchronizeCamera) and selected objects (cpt_SynchronizeSelection). To visually reduce the amount of disassembled objects, you can set the level in the scene segment graph (parameter cpt_TreeLevel), starting from which subassemblies will be moved as part of their parent assemblies. For example, you can set the "ecomposition of root assemblies so that subassemblies at higher levels remain fixed relative to the root assemblies. Functionality provides additional features for quick selection of objects. From the selected object, you can get the subassemblies (cpt_SelectAssembly) containing the selected object at any level, including the root assembly (cpt_SelectRootItem). You can use the cpt_SelectAll option to select all items in the active tab. It is possible to set filters to hide objects, whose dimensions are less than the specified value (cpt_FilterHideSmallItems) or greater than the specified value (cpt_FilterHideBigItems), or hide objects located farther from the specified center than the specified value (cpt_FilterHideByDistance). In the active tab, you can switch to review mode (cpt_StartReviewMode) to view subassemblies of the selected assembly. It is also possible to call this mode again to view subassemblies of the current subassembly and so on. The cpt_StopReviewMode parameter is used to return from review mode to original mode. To create a new tab, the CreateNewItem() method is used, which receives as parameters the name of the tab and a pointer to a segment that defines a subassembly in the scene graph. The ability to create a new tab in the current mode can be determined by the state of the parameter (cpt_CreateNewExplodeView). For the current tab the cpt_ResetExplodeView parameter allows you to reset the view mode settings to their original state, the parameter cpt_RebuildExplodeView is used to recalculate and rebuild the configuration of expanding objects models relative to the selected center. If cpt_CollapsOnRebuild is set to true, then the configuration of objects during a rebuild will "collapse" into the initial state, while the selected the object will not change its position. With cpt_AutoRebuild set to true, after each selection, the configuration of disassembled objects will be automatically restructured with a new given center of decomposition. When selecting an object in the GUI, you must pass the appropriate scene graph segment in ExplodeDispatcher using the SetSelectedSegment() method. Method GetSelectedSegment() returns the selected object. The methods SetSelectedSegment() and GetSelectedSegment() are supposed to be used along with the selection functionality defined by the following parameters: cpt_SelectAssembly, cpt_SelectRootItem, cpt_SelectAll.

Note
The “Explosion” functionality is actually a special mode for displaying the model at the scene graph level. It is not supposed to replace specialized systems for documenting assemblies.

Member Enumeration Documentation

◆ ControlParameterType

Enumerator
cpt_ExplodeToggled 

Switch to model decomposition mode and return to the original mode (bool).

cpt_Explode 

A parameter that determines the coefficient of decomposition of model objects (int).

cpt_Speed 

A parameter that determines the speed of decomposition of model objects (int).

cpt_TreeLevel 

The parameter defines the level in the graph of segments of the scene, starting from which the subassemblies of the model will fly apart as part of their parent assemblies (int).

cpt_SelectAssembly 

The parameter is used to select the subassembly containing the selected segment (int) at the specified level of nesting of the scene graph.

cpt_CreateNewExplodeView 

The state of the parameter allows you to determine whether it is possible to create a new tab in the current mode.

cpt_StartReviewMode 

Enter subassembly viewing mode.

cpt_StopReviewMode 

Exit subassembly viewing mode.

cpt_RebuildExplodeView 

Rebuild the decomposition model relative to the selected center.

cpt_ResetExplodeView 

Reset model expansion options for this tab.

cpt_SelectAll 

Select all objects in this tab.

cpt_SelectRootItem 

Select, if possible, the subassembly containing the selected object at the root level of the model's scene graph.

cpt_ExplodeFromItem 

Set the decomposition mode of objects relative to a given assembly.

cpt_ExplodeFromCenter 

Set decomposition relative to the center of the scene.

cpt_AutoRebuild 

Set the mode of automatic rebuilding of the model when selecting an assembly as a new center of expansion.

cpt_CollapsOnRebuild 

Parameter that determines whether the decomposition model will "collapse" to its original state when the model is rebuilt with a new decomposition center.

cpt_RadialTrajectory 

Set radial decomposition model.

cpt_AxialTrajectory 

Set expansion mode along symmetry axis (bool).

cpt_OrthToAxialTrajectory 

Set expansion mode orthogonal to symmetry axis (bool).

cpt_RefineAxisSymmetry 

Apply symmetry axis correction algorithms (bool).

cpt_FilterHideSmallItems 

Set filter to hide objects whose dimensions are less than the specified parameter.

cpt_FilterHideBigItems 

Set filter to hide objects whose dimensions are greater than the specified parameter.

cpt_FilterHideByDistance 

Set filter to hide objects that are farther from the center than the specified parameter.

cpt_SynchronizeExplode 

Synchronize model decomposition parameters in all tabs (bool).

cpt_SynchronizeCamera 

Synchronize camera settings in all tabs (bool).

cpt_SynchronizeSelection 

Synchronize selected objects in all tabs (bool).


The documentation for this class was generated from the following file: