Helper class for managing the Coin nodes of ViewProviderSketch. More...
#include <EditModeCoinManager.h>
Classes | |
struct | PreselectionResult |
This struct defines the information provided to other classes about preselection. More... | |
Public Member Functions | |
EditModeCoinManager (ViewProviderSketch &vp) | |
~EditModeCoinManager () | |
Temporary edit curves and markers | |
void | drawEditMarkers (const std::vector< Base::Vector2d > &EditMarkers, unsigned int augmentationlevel) |
void | drawEdit (const std::vector< Base::Vector2d > &EditCurve) |
void | drawEdit (const std::list< std::vector< Base::Vector2d > > &list) |
void | setPositionText (const Base::Vector2d &Pos, const SbString &txt) |
void | setPositionText (const Base::Vector2d &Pos) |
void | resetPositionText (void) |
void | setAxisPickStyle (bool on) |
handle preselection and selection of points | |
PreselectionResult | detectPreselection (SoPickedPoint *Point, const SbVec2s &cursorPos) |
SoGroup * | getSelectedConstraints () |
The client is responsible for unref-ing the SoGroup to release the memory. More... | |
update coin nodes | |
void | processGeometryConstraintsInformationOverlay (const GeoListFacade &geolistfacade, bool rebuildinformationlayer) |
void | updateVirtualSpace () |
void | drawConstraintIcons () |
Draw all constraint icons. More... | |
void | drawConstraintIcons (const GeoListFacade &geolistfacade) |
coin node access | |
SoSeparator * | getRootEditNode () |
update coin colors | |
void | updateColor () |
void | updateColor (const GeoListFacade &geolistfacade) |
change coin visualisation and behaviour | |
void | updateGridExtent () |
change constraints selectability | |
void | setConstraintSelectability (bool enabled=true) |
Helper class for managing the Coin nodes of ViewProviderSketch.
Given the substantial amount of code involved in coin node management, EditModeCoinManager further delegates on other specialised helper classes. Some of them share the ViewProviderSketchCoinAttorney, which defines the maximum coupling and minimum encapsulation.
The most important such delegates are: EditModeGeometryCoinManager and EditModeConstraintCoinManager.
EditModeCoinManager takes over the responsibility of creating the Coin (Inventor) scenograph and modifying it, including all the drawing of geometry, constraints and overlay layer. This is an exclusive responsibility under the Single Responsibility Principle.
EditModeCoinManager exposes a public interface to be used by ViewProviderSketch. Where, EditModeCoinManager needs special access to facilities of ViewProviderSketch in order to fulfil its responsibility, this access is defined by ViewProviderSketchCoinAttorney.
EditModeCoinManager is responsible, under the Single Responsibility Principle, to manage the coin EditRoot node. This node is ref-ed on creation and unref-ed on destruction to ensure that its lifetime matches the one of EditModecoinManager.
EditRoot is added on request to pcRoot by ViewProviderSketch. The node pcRoot belongs, under the Single Responsibility Principle, to ViewProviderSketch. EditModeCoinManager delegates addition and removal of child notes of EditRoot to specialised helper classes.
EditModeCoinManager is designed to define the span of time in which ViewProviderSketch is in edit mode.
In addition to the scenograph, EditModeCoinManager is responsible for keeping any necessary mapping between indices used at ViewProviderSketch level, and internal indexing used by EditModeCoinManager and its subclasses.
|
explicit |
EditModeCoinManager::~EditModeCoinManager | ( | ) |
EditModeCoinManager::PreselectionResult EditModeCoinManager::detectPreselection | ( | SoPickedPoint * | Point, |
const SbVec2s & | cursorPos | ||
) |
References SketcherGui::GeometryLayerParameters::CoinLayers, SketcherGui::EditModeScenegraphNodes::CurveSet, SketcherGui::CoinMapping::getCurveGeoId(), SketcherGui::CoinMapping::getPointVertexId(), SketcherGui::EditModeCoinManager::PreselectionResult::HorizontalAxis, SketcherGui::EditModeScenegraphNodes::PointSet, SketcherGui::EditModeScenegraphNodes::RootCrossSet, SketcherGui::EditModeCoinManager::PreselectionResult::RootPoint, and SketcherGui::EditModeCoinManager::PreselectionResult::VerticalAxis.
void EditModeCoinManager::drawConstraintIcons | ( | ) |
Draw all constraint icons.
Except maybe the radius and lock ones?
void EditModeCoinManager::drawConstraintIcons | ( | const GeoListFacade & | geolistfacade | ) |
void EditModeCoinManager::drawEdit | ( | const std::list< std::vector< Base::Vector2d > > & | list | ) |
void EditModeCoinManager::drawEdit | ( | const std::vector< Base::Vector2d > & | EditCurve | ) |
void EditModeCoinManager::drawEditMarkers | ( | const std::vector< Base::Vector2d > & | EditMarkers, |
unsigned int | augmentationlevel | ||
) |
References SketcherGui::EditModeScenegraphNodes::EditMarkersCoordinate, SketcherGui::EditModeScenegraphNodes::EditMarkerSet, SketcherGui::EditModeScenegraphNodes::EditMarkersMaterials, DraftVecUtils::find(), Gui::Inventor::MarkerBitmaps::getMarkerIndex(), Gui::Inventor::MarkerBitmaps::getSupportedSizes(), SketcherGui::DrawingParameters::InformationColor, SketcherGui::DrawingParameters::markerSize, and SketcherGui::DrawingParameters::zEdit.
SoSeparator * EditModeCoinManager::getRootEditNode | ( | ) |
References SketcherGui::EditModeScenegraphNodes::EditRoot.
SoGroup * EditModeCoinManager::getSelectedConstraints | ( | ) |
The client is responsible for unref-ing the SoGroup to release the memory.
References SketcherGui::EditModeScenegraphNodes::constrGroup.
void EditModeCoinManager::processGeometryConstraintsInformationOverlay | ( | const GeoListFacade & | geolistfacade, |
bool | rebuildinformationlayer | ||
) |
void EditModeCoinManager::resetPositionText | ( | void | ) |
References SketcherGui::EditModeScenegraphNodes::textX.
void EditModeCoinManager::setAxisPickStyle | ( | bool | on | ) |
void EditModeCoinManager::setConstraintSelectability | ( | bool | enabled = true | ) |
void EditModeCoinManager::setPositionText | ( | const Base::Vector2d & | Pos | ) |
References setPositionText(), Base::Vector2d::x, and Base::Vector2d::y.
void EditModeCoinManager::setPositionText | ( | const Base::Vector2d & | Pos, |
const SbString & | txt | ||
) |
void EditModeCoinManager::updateColor | ( | ) |
References updateColor().
Referenced by updateColor().
void EditModeCoinManager::updateColor | ( | const GeoListFacade & | geolistfacade | ) |
void EditModeCoinManager::updateGridExtent | ( | ) |
References SketcherGui::AnalysisResults::boundingBoxMagnitudeOrder.
Referenced by processGeometryConstraintsInformationOverlay().
void EditModeCoinManager::updateVirtualSpace | ( | ) |