Gui::SoFCSelectionRoot Class Reference

#include <SoFCUnifiedSelection.h>

Classes

struct  SelContext
 
class  Stack
 
struct  StackComp
 

Public Types

enum  SelectStyles { Full , Box , PassThrough }
 

Public Member Functions

virtual void callback (SoCallbackAction *action)
 
virtual void doAction (SoAction *action)
 
virtual void getBoundingBox (SoGetBoundingBoxAction *action)
 
virtual void getMatrix (SoGetMatrixAction *action)
 
virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)
 
virtual void GLRenderBelowPath (SoGLRenderAction *action)
 
virtual void GLRenderInPath (SoGLRenderAction *action)
 
virtual void handleEvent (SoHandleEventAction *action)
 
bool hasColorOverride () const
 
virtual void pick (SoPickAction *action)
 
virtual void rayPick (SoRayPickAction *action)
 
void removeColorOverride ()
 
void resetContext ()
 
virtual void search (SoSearchAction *action)
 
void setColorOverride (App::Color c)
 
 SoFCSelectionRoot (bool trackCacheMode=false)
 
- Public Member Functions inherited from Gui::SoFCSeparator
virtual void GLRenderBelowPath (SoGLRenderAction *action)
 
 SoFCSeparator (bool trackCacheMode=true)
 

Static Public Member Functions

static bool checkColorOverride (SoState *state)
 
static void checkSelection (bool &sel, SbColor &selColor, bool &hl, SbColor &hlColor)
 
static void finish (void)
 
template<class T >
static std::shared_ptr< T > getActionContext (SoAction *action, SoNode *node, std::shared_ptr< T > def=std::shared_ptr< T >(), bool create=true)
 Get the selection context for an action. More...
 
static SoNodegetCurrentRoot (bool front, SoNode *def)
 
template<class T >
static std::shared_ptr< T > getRenderContext (SoNode *node, std::shared_ptr< T > def, std::shared_ptr< T > &ctx2)
 Returns selection context for rendering. More...
 
template<class T >
static std::shared_ptr< T > getRenderContext (SoNode *node, std::shared_ptr< T > def=std::shared_ptr< T >())
 
template<class T >
static std::shared_ptr< T > getSecondaryActionContext (SoAction *action, SoNode *node)
 
static void initClass (void)
 
static void moveActionStack (SoAction *from, SoAction *to, bool erase)
 
static bool removeActionContext (SoAction *action, SoNode *node)
 
static bool renderBBox (SoGLRenderAction *action, SoNode *node, SbColor color)
 
- Static Public Member Functions inherited from Gui::SoFCSeparator
static void finish (void)
 
static CacheEnabled getCacheMode ()
 
static void initClass (void)
 
static void setCacheMode (CacheEnabled mode)
 

Public Attributes

SoSFEnum selectionStyle
 

Protected Types

typedef std::vector< SbColor > ColorStack
 
typedef std::map< Stack, SoFCSelectionContextBasePtr, StackCompContextMap
 
typedef std::shared_ptr< SelContextSelContextPtr
 

Protected Member Functions

bool doActionPrivate (Stack &stack, SoAction *)
 
void renderPrivate (SoGLRenderAction *, bool inPath)
 
virtual ~SoFCSelectionRoot ()
 

Static Protected Member Functions

static std::pair< bool, SoFCSelectionContextBasePtr * > findActionContext (SoAction *action, SoNode *node, bool create, bool erase)
 
static SoFCSelectionContextBasePtr getNodeContext (Stack &stack, SoNode *node, SoFCSelectionContextBasePtr def)
 
static SoFCSelectionContextBasePtr getNodeContext2 (Stack &stack, SoNode *node, SoFCSelectionContextBase::MergeFunc *merge)
 

Protected Attributes

SbColor colorOverride
 
ContextMap contextMap
 
ContextMap contextMap2
 
bool overrideColor = false
 
SoColorPacker shapeColorPacker
 
float transOverride = 0.0f
 

Static Protected Attributes

static std::unordered_map< SoAction *, StackActionStacks
 
static ColorStack HlColorStack
 
static ColorStack SelColorStack
 
static Stack SelStack
 
static SoFCSelectionRootShapeColorNode
 

Member Typedef Documentation

◆ ColorStack

typedef std::vector<SbColor> Gui::SoFCSelectionRoot::ColorStack
protected

◆ ContextMap

◆ SelContextPtr

typedef std::shared_ptr<SelContext> Gui::SoFCSelectionRoot::SelContextPtr
protected

Member Enumeration Documentation

◆ SelectStyles

Enumerator
Full 
Box 
PassThrough 

Constructor & Destructor Documentation

◆ SoFCSelectionRoot()

SoFCSelectionRoot::SoFCSelectionRoot ( bool  trackCacheMode = false)

References Box, Full, PassThrough, and selectionStyle.

◆ ~SoFCSelectionRoot()

SoFCSelectionRoot::~SoFCSelectionRoot ( )
protectedvirtual

Member Function Documentation

◆ callback()

◆ checkColorOverride()

bool SoFCSelectionRoot::checkColorOverride ( SoState *  state)
static

◆ checkSelection()

void SoFCSelectionRoot::checkSelection ( bool sel,
SbColor &  selColor,
bool hl,
SbColor &  hlColor 
)
static

◆ doAction()

void SoFCSelectionRoot::doAction ( SoAction action)
virtual

References doActionPrivate().

◆ doActionPrivate()

◆ findActionContext()

std::pair< bool, SoFCSelectionContextBasePtr * > SoFCSelectionRoot::findActionContext ( SoAction action,
SoNode node,
bool  create,
bool  erase 
)
staticprotected

◆ finish()

void SoFCSelectionRoot::finish ( void  )
static

Referenced by drafttaskpanels.task_circulararray.TaskPanelCircularArray::accept(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::accept(), drafttaskpanels.task_polararray.TaskPanelPolarArray::accept(), draftguitools.gui_arcs.Arc::action(), draftguitools.gui_beziers.BezCurve::action(), draftguitools.gui_beziers.CubicBezCurve::action(), draftguitools.gui_dimensions.Dimension::action(), draftguitools.gui_ellipses.Ellipse::action(), draftguitools.gui_fillets.Fillet::action(), draftguitools.gui_labels.Label::action(), draftguitools.gui_lines.Line::action(), draftguitools.gui_mirror.Mirror::action(), draftguitools.gui_move.Move::action(), draftguitools.gui_offset.Offset::action(), draftguitools.gui_polygons.Polygon::action(), draftguitools.gui_rectangles.Rectangle::action(), draftguitools.gui_rotate.Rotate::action(), draftguitools.gui_scale.Scale::action(), draftguitools.gui_selectplane.Draft_SelectPlane::action(), draftguitools.gui_shapestrings.ShapeString::action(), draftguitools.gui_splines.BSpline::action(), draftguitools.gui_split.Split::action(), draftguitools.gui_stretch.Stretch::action(), draftguitools.gui_texts.Text::action(), draftguitools.gui_trimex.Trimex::action(), draftguitools.gui_subelements.SubelementHighlight::action(), draftguitools.gui_clone.Clone::Activated(), draftguitools.gui_dimensions.Dimension::Activated(), draftguitools.gui_downgrade.Downgrade::Activated(), draftguitools.gui_draft2sketch.Draft2Sketch::Activated(), draftguitools.gui_edit.Edit::Activated(), draftguitools.gui_facebinders.Facebinder::Activated(), draftguitools.gui_join.Join::Activated(), draftguitools.gui_shape2dview.Shape2DView::Activated(), draftguitools.gui_subelements.SubelementHighlight::Activated(), draftguitools.gui_upgrade.Upgrade::Activated(), draftguitools.gui_wire2spline.WireToBSpline::Activated(), draftguitools.gui_selectplane.Draft_SelectPlane::checkSelection(), DraftGui.DraftToolBar::checkSpecialChars(), draftguitools.gui_points.Point::click(), draftguitools.gui_labels.Label::create(), draftguitools.gui_ellipses.Ellipse::createObject(), draftguitools.gui_rectangles.Rectangle::createObject(), draftguitools.gui_shapestrings.ShapeString::createObject(), draftguitools.gui_texts.Text::createObject(), draftviewproviders.view_text.ViewProviderText::createObject(), draftguitools.gui_stretch.Stretch::doStretch(), draftguitools.gui_arcs.Arc::drawArc(), draftguitools.gui_polygons.Polygon::drawPolygon(), DraftGui.DraftToolBar::escape(), Gui::SoFCDB::finish(), draftguitools.gui_move.Move::get_object_selection(), draftguitools.gui_rotate.Rotate::get_object_selection(), draftguitools.gui_scale.Scale::get_object_selection(), draftguitools.gui_arcs.Arc_3Points::getPoint(), draftguitools.gui_edit.Edit::keyPressed(), draftguitools.gui_dimensions.Dimension::numericInput(), draftguitools.gui_trimex.Trimex::numericRadius(), draftguitools.gui_fillets.Fillet::numericRadius(), draftguitools.gui_offset.Offset::numericRadius(), draftguitools.gui_rotate.Rotate::numericRadius(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickAlign(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickAuto(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickCenter(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickFront(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickMove(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickPrevious(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickSide(), draftguitools.gui_selectplane.Draft_SelectPlane::onClickTop(), draftguitools.gui_array_simple.Array::proceed(), draftguitools.gui_clone.Clone::proceed(), draftguitools.gui_downgrade.Downgrade::proceed(), draftguitools.gui_draft2sketch.Draft2Sketch::proceed(), draftguitools.gui_edit.Edit::proceed(), draftguitools.gui_facebinders.Facebinder::proceed(), draftguitools.gui_join.Join::proceed(), draftguitools.gui_patharray.PathArray::proceed(), draftguitools.gui_pathtwistedarray.PathTwistedArray::proceed(), draftguitools.gui_pointarray.PointArray::proceed(), draftguitools.gui_shape2dview.Shape2DView::proceed(), draftguitools.gui_subelements.SubelementHighlight::proceed(), draftguitools.gui_trimex.Trimex::proceed(), draftguitools.gui_upgrade.Upgrade::proceed(), draftguitools.gui_split.Split::proceed(), draftguitools.gui_selectplane.Draft_SelectPlane::reject(), drafttaskpanels.task_circulararray.TaskPanelCircularArray::reject(), drafttaskpanels.task_orthoarray.TaskPanelOrthoArray::reject(), drafttaskpanels.task_polararray.TaskPanelPolarArray::reject(), and draftguitools.gui_edit.Edit::setTrackers().

◆ getActionContext()

template<class T >
static std::shared_ptr< T > Gui::SoFCSelectionRoot::getActionContext ( SoAction action,
SoNode node,
std::shared_ptr< T >  def = std::shared_ptr<T>(),
bool  create = true 
)
static

Get the selection context for an action.

Parameters
actionthe action. SoSelectionElementAction has any option to query for secondary context.
See also
getRenderContext for detail about secondary context
Parameters
nodethe querying node
defdefault context if none is found, only used if querying non-secondary context
createcreate a new context if none is found
Returns
If no SoFCSelectionRoot is found in the current path of action, def is returned. Otherwise a selection context returned. A new one will be created if none is found.

References femsolver.elmer.equations.elasticity::create().

Referenced by Gui::SoFCSelection::doAction(), PartGui::SoBrepEdgeSet::doAction(), PartGui::SoBrepFaceSet::doAction(), PartGui::SoBrepPointSet::doAction(), and doActionPrivate().

◆ getBoundingBox()

void SoFCSelectionRoot::getBoundingBox ( SoGetBoundingBoxAction *  action)
virtual

References doActionPrivate().

◆ getCurrentRoot()

SoNode * SoFCSelectionRoot::getCurrentRoot ( bool  front,
SoNode def 
)
static

References SelStack.

◆ getMatrix()

void SoFCSelectionRoot::getMatrix ( SoGetMatrixAction *  action)
virtual

References doActionPrivate().

◆ getNodeContext()

SoFCSelectionContextBasePtr SoFCSelectionRoot::getNodeContext ( Stack stack,
SoNode node,
SoFCSelectionContextBasePtr  def 
)
staticprotected

References contextMap.

◆ getNodeContext2()

SoFCSelectionContextBasePtr SoFCSelectionRoot::getNodeContext2 ( Stack stack,
SoNode node,
SoFCSelectionContextBase::MergeFunc merge 
)
staticprotected

Referenced by doActionPrivate().

◆ getPrimitiveCount()

void SoFCSelectionRoot::getPrimitiveCount ( SoGetPrimitiveCountAction *  action)
virtual

◆ getRenderContext() [1/2]

template<class T >
static std::shared_ptr< T > Gui::SoFCSelectionRoot::getRenderContext ( SoNode node,
std::shared_ptr< T >  def,
std::shared_ptr< T > &  ctx2 
)
static

Returns selection context for rendering.

Parameters
nodethe querying node
defdefault context if none is found
ctx2secondary context output
Returns
Returned the primary context for selection, and the context is always stored in the first encountered SoFCSelectionRoot in the path. It is keyed using the entire sequence of SoFCSelectionRoot along the path to node, replacing the first SoFCSelectionRoot with the given node.
Secondary context returned in ctx2 is for customized highlighting, and is not affected by mouse event. The highlight is applied manually using SoSelectionElementAction. It is stored in the last encountered SoFCSelectionRoot, and is keyed using the querying node and (if there are more than one SoFCSelectionRoot along the path) the first SoFCSelectionRoot. The reason is so that any link to a node (new links means additional SoFCSelectionRoot added in front) with customized subelement highlight will also show the highlight. Secondary context can be chained, which why the secondary context type must provide an function called merge() for getRenderContext() to merge the context. See SoFCSelectionContext::merge() for an implementation of merging multiple context.
Note
For simplicity reason, currently secondary context is only freed when the storage SoFCSSelectionRoot node is freed.

◆ getRenderContext() [2/2]

template<class T >
static std::shared_ptr< T > Gui::SoFCSelectionRoot::getRenderContext ( SoNode node,
std::shared_ptr< T >  def = std::shared_ptr<T>() 
)
static

◆ getSecondaryActionContext()

template<class T >
static std::shared_ptr< T > Gui::SoFCSelectionRoot::getSecondaryActionContext ( SoAction action,
SoNode node 
)
static

◆ GLRenderBelowPath()

void SoFCSelectionRoot::GLRenderBelowPath ( SoGLRenderAction action)
virtual

◆ GLRenderInPath()

void SoFCSelectionRoot::GLRenderInPath ( SoGLRenderAction action)
virtual

◆ handleEvent()

void SoFCSelectionRoot::handleEvent ( SoHandleEventAction *  action)
virtual

◆ hasColorOverride()

bool Gui::SoFCSelectionRoot::hasColorOverride ( ) const

◆ initClass()

void SoFCSelectionRoot::initClass ( void  )
static

Referenced by Gui::SoFCDB::init().

◆ moveActionStack()

void SoFCSelectionRoot::moveActionStack ( SoAction from,
SoAction to,
bool  erase 
)
static

◆ pick()

void SoFCSelectionRoot::pick ( SoPickAction *  action)
virtual

References doActionPrivate().

◆ rayPick()

void SoFCSelectionRoot::rayPick ( SoRayPickAction *  action)
virtual

References doActionPrivate().

◆ removeActionContext()

static bool Gui::SoFCSelectionRoot::removeActionContext ( SoAction action,
SoNode node 
)
static

◆ removeColorOverride()

void Gui::SoFCSelectionRoot::removeColorOverride ( )

◆ renderBBox()

bool SoFCSelectionRoot::renderBBox ( SoGLRenderAction action,
SoNode node,
SbColor  color 
)
static

◆ renderPrivate()

void SoFCSelectionRoot::renderPrivate ( SoGLRenderAction action,
bool  inPath 
)
protected

◆ resetContext()

void SoFCSelectionRoot::resetContext ( )

References contextMap.

Referenced by doActionPrivate().

◆ search()

void SoFCSelectionRoot::search ( SoSearchAction *  action)
virtual

◆ setColorOverride()

void Gui::SoFCSelectionRoot::setColorOverride ( App::Color  c)

Member Data Documentation

◆ ActionStacks

std::unordered_map< SoAction *, SoFCSelectionRoot::Stack > SoFCSelectionRoot::ActionStacks
staticprotected

◆ colorOverride

SbColor Gui::SoFCSelectionRoot::colorOverride
protected

Referenced by checkColorOverride().

◆ contextMap

ContextMap Gui::SoFCSelectionRoot::contextMap
protected

Referenced by getNodeContext(), and resetContext().

◆ contextMap2

ContextMap Gui::SoFCSelectionRoot::contextMap2
protected

◆ HlColorStack

SoFCSelectionRoot::ColorStack SoFCSelectionRoot::HlColorStack
staticprotected

Referenced by checkSelection().

◆ overrideColor

bool Gui::SoFCSelectionRoot::overrideColor = false
protected

◆ SelColorStack

SoFCSelectionRoot::ColorStack SoFCSelectionRoot::SelColorStack
staticprotected

Referenced by checkSelection().

◆ selectionStyle

SoSFEnum Gui::SoFCSelectionRoot::selectionStyle

◆ SelStack

SoFCSelectionRoot::Stack SoFCSelectionRoot::SelStack
staticprotected

Referenced by getCurrentRoot(), and renderPrivate().

◆ ShapeColorNode

SoFCSelectionRoot * SoFCSelectionRoot::ShapeColorNode
staticprotected

Referenced by checkColorOverride().

◆ shapeColorPacker

SoColorPacker Gui::SoFCSelectionRoot::shapeColorPacker
protected

Referenced by checkColorOverride().

◆ transOverride

float Gui::SoFCSelectionRoot::transOverride = 0.0f
protected

Referenced by checkColorOverride().


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