Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
libnest2d::SelectionStrategyLike< SelectionStrategy > Class Template Reference

#include <src/libnest2d/include/libnest2d/nester.hpp>

+ Inheritance diagram for libnest2d::SelectionStrategyLike< SelectionStrategy >:

Public Types

using RawShape = typename SelectionStrategy::ShapeType
 
using Item = _Item< RawShape >
 
using PackGroup = _PackGroup< RawShape >
 
using Config = typename SelectionStrategy::Config
 

Public Member Functions

void configure (const Config &config)
 Provide a different configuration for the selection strategy.
 
void progressIndicator (ProgressFunction fn)
 A function callback which should be called whenever an item or a group of items where successfully packed.
 
void stopCondition (StopCondition cond)
 
template<class TPlacer , class TIterator , class TBin = typename PlacementStrategyLike<TPlacer>::BinType, class PConfig = typename PlacementStrategyLike<TPlacer>::Config>
void packItems (TIterator first, TIterator last, TBin &&bin, PConfig &&config=PConfig())
 A method to start the calculation on the input sequence.
 
const PackGroupgetResult () const
 Get the items for a particular bin.
 
int lastPackedBinId () const
 
void clear ()
 

Private Attributes

SelectionStrategy impl_
 

Detailed Description

template<class SelectionStrategy>
class libnest2d::SelectionStrategyLike< SelectionStrategy >

A wrapper interface (trait) class for any selections strategy provider.

Member Typedef Documentation

◆ Config

template<class SelectionStrategy >
using libnest2d::SelectionStrategyLike< SelectionStrategy >::Config = typename SelectionStrategy::Config

◆ Item

template<class SelectionStrategy >
using libnest2d::SelectionStrategyLike< SelectionStrategy >::Item = _Item<RawShape>

◆ PackGroup

template<class SelectionStrategy >
using libnest2d::SelectionStrategyLike< SelectionStrategy >::PackGroup = _PackGroup<RawShape>

◆ RawShape

template<class SelectionStrategy >
using libnest2d::SelectionStrategyLike< SelectionStrategy >::RawShape = typename SelectionStrategy::ShapeType

Member Function Documentation

◆ clear()

template<class SelectionStrategy >
void libnest2d::SelectionStrategyLike< SelectionStrategy >::clear ( )
inline
754{ impl_.clear(); }
SelectionStrategy impl_
Definition nester.hpp:685

References libnest2d::SelectionStrategyLike< SelectionStrategy >::impl_.

◆ configure()

template<class SelectionStrategy >
void libnest2d::SelectionStrategyLike< SelectionStrategy >::configure ( const Config config)
inline

Provide a different configuration for the selection strategy.

Note that it depends on the particular placer implementation how it reacts to config changes in the middle of a calculation.

Parameters
configThe configuration object defined by the selection strategy.
701 {
702 impl_.configure(config);
703 }

References libnest2d::SelectionStrategyLike< SelectionStrategy >::impl_.

Referenced by libnest2d::_Nester< PlacementStrategy, SelectionStrategy >::_Nester(), libnest2d::_Nester< PlacementStrategy, SelectionStrategy >::configure(), libnest2d::_Nester< PlacementStrategy, SelectionStrategy >::configure(), and libnest2d::_Nester< PlacementStrategy, SelectionStrategy >::configure().

+ Here is the caller graph for this function:

◆ getResult()

template<class SelectionStrategy >
const PackGroup & libnest2d::SelectionStrategyLike< SelectionStrategy >::getResult ( ) const
inline

Get the items for a particular bin.

Parameters
binIndexThe index of the requested bin.
Returns
Returns a list of all items packed into the requested bin.
746 {
747 return impl_.getResult();
748 }

References libnest2d::SelectionStrategyLike< SelectionStrategy >::impl_.

Referenced by libnest2d::_Nester< PlacementStrategy, SelectionStrategy >::execute(), and libnest2d::_Nester< PlacementStrategy, SelectionStrategy >::lastResult().

+ Here is the caller graph for this function:

◆ lastPackedBinId()

template<class SelectionStrategy >
int libnest2d::SelectionStrategyLike< SelectionStrategy >::lastPackedBinId ( ) const
inline
750 {
751 return impl_.lastPackedBinId();
752 }

References libnest2d::SelectionStrategyLike< SelectionStrategy >::impl_.

Referenced by libnest2d::_Nester< PlacementStrategy, SelectionStrategy >::lastPackedBinId().

+ Here is the caller graph for this function:

◆ packItems()

template<class SelectionStrategy >
template<class TPlacer , class TIterator , class TBin = typename PlacementStrategyLike<TPlacer>::BinType, class PConfig = typename PlacementStrategyLike<TPlacer>::Config>
void libnest2d::SelectionStrategyLike< SelectionStrategy >::packItems ( TIterator  first,
TIterator  last,
TBin &&  bin,
PConfig &&  config = PConfig() 
)
inline

A method to start the calculation on the input sequence.

Template Parameters
TPlacerThe only mandatory template parameter is the type of placer compatible with the PlacementStrategyLike interface.
Parameters
first,lastThe first and last iterator if the input sequence. It can be only an iterator of a type convertible to Item.
bin.The shape of the bin. It has to be supported by the placement strategy.
Anoptional config object for the placer.
735 {
736 impl_.template packItems<TPlacer>(first, last,
737 std::forward<TBin>(bin),
738 std::forward<PConfig>(config));
739 }

References libnest2d::SelectionStrategyLike< SelectionStrategy >::impl_.

◆ progressIndicator()

template<class SelectionStrategy >
void libnest2d::SelectionStrategyLike< SelectionStrategy >::progressIndicator ( ProgressFunction  fn)
inline

A function callback which should be called whenever an item or a group of items where successfully packed.

Parameters
fnA function callback object taking one unsigned integer as the number of the remaining items to pack.
711{ impl_.progressIndicator(fn); }

References libnest2d::SelectionStrategyLike< SelectionStrategy >::impl_.

Referenced by libnest2d::_Nester< PlacementStrategy, SelectionStrategy >::progressIndicator().

+ Here is the caller graph for this function:

◆ stopCondition()

template<class SelectionStrategy >
void libnest2d::SelectionStrategyLike< SelectionStrategy >::stopCondition ( StopCondition  cond)
inline
713{ impl_.stopCondition(cond); }

References libnest2d::SelectionStrategyLike< SelectionStrategy >::impl_.

Referenced by libnest2d::_Nester< PlacementStrategy, SelectionStrategy >::stopCondition().

+ Here is the caller graph for this function:

Member Data Documentation

◆ impl_


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