The Explode function helps visualize the model structure in one click. Use it when some objects are hidden inside the subassemblies. Indeed, there are alternatives such as hidden or phantom objects, but they take a lot of efforts when handling large, complicated models.
You can “explode” the model in one click, and the model’s objects are separated to show its structure. There are flexible settings for easy navigation and viewing large, multi-component models.
This function also offers the Fireworks setting. When enabled, the components move away from the centers of their subassemblies, and the subassemblies move away from the model’s center.
The ExplodeDispatcher
class implements the exploded view function and manages its initialization. For settings, call SetParameter
with the command ID as the first argument. Such an approach reduces the code size and simplifies programming.
The key Exploded view features are listed below
- Multiple object separation options
- - from the model center:
m_explodeDispatcher.SetParameter(cpt_Explode, data);
- - from the selected object/assembly:
SceneSegment* pSegm; m_explodeDispatcher.SetSelectedSegment(pSegm); m_explodeDispatcher.SetParameter(cpt_ExplodeFromItem, Variant())
- - from a set of objects/assemblies:
SceneSegment* pSegm1; m_explodeDispatcher.SetSelectedSegment(pSegm1); SceneSegment* pSegm2; m_explodeDispatcher.SetSelectedSegment(pSegm2); m_explodeDispatcher.SetParameter(cpt_ExplodeFromItem, Variant())
- - from the model center:
- Optionally, you can the nested level of the objects to be exploded (assemblies, subassemblies, etc.)
- Top-level assembly/object explosion.
- Explosion of the assemblies/objects that are components of the top-level assemblies, etc.
m_explodeDispatcher.SetParameter(cpt_TreeLevel, data);
- The Fireworks option is a generalized exploded view when the assemblies are separated from the model’s center, and their components are separated from the centers of the respective assemblies:
m_explodeDispatcher.SetParameter(cpt_ExplodeFromItem, data);
- In explode views, objects move along intuitive paths. For instance, if two objects are concentric, they stay concentric after being exploded.
- There are large model handling tools that quickly hide objects from the scene.
- You can hide objects which are smaller or larger than a threshold:
m_explodeDispatcher.SetParameter(cpt_FilterHideSmallItems, data); m_explodeDispatcher.SetParameter(cpt_FilterHideBigItems, data);
- You can also hide objects located at a distance from the center longer than the threshold:
m_explodeDispatcher.SetParameter(cpt_FilterHideByDistance, data);
- You can hide objects which are smaller or larger than a threshold:
- More options.
- You can control the speed of separation:
m_explodeDispatcher.SetParameter(cpt_Speed, data);
- Objects can move along the symmetry axis, normal to it, or these two options can be combined:
m_explodeDispatcher.SetParameter(cpt_RadialTrajectory, data); m_explodeDispatcher.SetParameter(cpt_AxialTrajectory, data); m_explodeDispatcher.SetParameter(cpt_OrthToAxialTrajectory, data);
- You can control the speed of separation:
- The C3D functionality that calculates principal moments of inertia also finds the axes of symmetry. If the performance is slow, there is a simpler alternative to quickly detect the axes of symmetry:
m_explodeDispatcher.SetParameter(cpt_RefineAxisSymmetry, data);
- The Octree is used to quickly select the exploded objects in large, multi-component objects.
Another notable feature of the Explode function is creating multiple exploded views of the model within the same window. You can create a dedicated view for a subassembly and set up its individual exploded view settings. The number of such views is not limited. You can switch between these views. The function also controls the model orientation either individually or in synch with the orientation of the primary view:
SceneSegment* pSegmSelected; int maxTabNumber = m_explodeDispatcher.GetMaximumTabNumber(); std::string tabName = m_mainTabName + m_tabNameSeparator + std::to_string(++maxTabNumber == 1 ? ++maxTabNumber: maxTabNumber); if (m_explodeDispatcher.CreateNewItem(tabName, pSegmSelected)) m_tabWidget->setCurrentIndex(m_tabWidget->addTab(new QWidget(), tabName.c_str()));
To test the Explode function, check out Example 43 ExplodeManager included in the installation package.