SelectionChanger Class Reference

#include <lib_selectionchanger.h>

Detailed Description

Convenience class for changing a selection type i.e. polygon selection to edge selection. The class owns all returned selections. Must be initialized before use.

Note
Has to be created with Alloc() and destroyed with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Private Member Functions

 SelectionChanger ()
 
 ~SelectionChanger ()
 

Alloc/Free

static SelectionChangerAlloc ()
 
static void Free (SelectionChanger *&node)
 

Init

Bool InitFromTag (BaseTag *targtag, PolygonObject *op=nullptr)
 
Bool InitFromSelection (BaseSelect *selection, Int32 selection_mode, PolygonObject *op=nullptr)
 

Get Conversion

BaseSelectGetPointS ()
 
BaseSelectGetPolygonS ()
 
BaseSelectGetEdgeS ()
 

Constructor & Destructor Documentation

◆ SelectionChanger()

SelectionChanger ( )
private

◆ ~SelectionChanger()

~SelectionChanger ( )
private

Member Function Documentation

◆ Alloc()

static SelectionChanger* Alloc ( )
static

Allocates a selection changer. Destroy the allocated selection changer with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Returns
The allocated selection changer, or nullptr if the allocation failed.

◆ Free()

static void Free ( SelectionChanger *&  node)
static

Destructs selection changers allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.

Parameters
[in,out]nodeThe selection changer to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆ InitFromTag()

Bool InitFromTag ( BaseTag targtag,
PolygonObject op = nullptr 
)

Initializes the selection changer from a selection tag.

Parameters
[in]targtagThe selection tag used for input. The caller owns the pointed tag.
[in]opThe object the tag is on. Generally required for most transformations to take place. The caller owns the pointed object.
Returns
true if successful, otherwise false.

◆ InitFromSelection()

Bool InitFromSelection ( BaseSelect selection,
Int32  selection_mode,
PolygonObject op = nullptr 
)

Initializes the selection changer from a selection object and a specific selection mode.

Parameters
[in]selectionThe selection used for input.
[in]selection_modeThe mode of the selection: Mpoints or Mpolygons or Medges.
[in]opThe object the tag is on. Generally required if the selection is on a polygon object (but not on a spline object).
Returns
true if successful, otherwise false.

◆ GetPointS()

BaseSelect* GetPointS ( )

Retrieves the converted selection in points mode.

Returns
The converted selection. The selection changer owns the pointed selection.

◆ GetPolygonS()

BaseSelect* GetPolygonS ( )

Retrieves the converted selection in polygon mode.

Returns
The converted selection. The selection changer owns the pointed selection.

◆ GetEdgeS()

BaseSelect* GetEdgeS ( )

Retrieves the converted selection in edge mode.

Returns
The converted selection. The selection changer owns the pointed selection.