本文整理汇总了C++中item_t::set_side_1方法的典型用法代码示例。如果您正苦于以下问题:C++ item_t::set_side_1方法的具体用法?C++ item_t::set_side_1怎么用?C++ item_t::set_side_1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类item_t
的用法示例。
在下文中一共展示了item_t::set_side_1方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool BoxPacker3D::checkFitsNoConstr( bin_t bin, item_t item, bin_v_t &bins )
{
cout << "\nBoxPacker3D::checkFitsNoConstr\n";
//sort both bin and item
if (bin->side_1()->size() < bin->side_2()->size())
{
Side *tmps;
tmps = bin->side_1();
bin->set_side_1(bin->side_2());
bin->set_side_2(tmps);
}
if (bin->side_1()->size() < bin->side_3()->size())
{
Side *tmps;
tmps = bin->side_1();
bin->set_side_1(bin->side_3());
bin->set_side_3(tmps);
}
if (bin->side_2()->size() < bin->side_3()->size())
{
Side *tmps;
tmps = bin->side_2();
bin->set_side_2(bin->side_3());
bin->set_side_3(tmps);
}
cout << "DBG1 ";
item->Print();
if (item->side_1()->size() < item->side_2()->size())
{
Side *tmps;
tmps = item->side_1();
item->set_side_1(item->side_2());
item->set_side_2(tmps);
}
if (item->side_1()->size() < item->side_3()->size())
{
Side *tmps;
tmps = item->side_1();
item->set_side_1(item->side_3());
item->set_side_3(tmps);
}
bin->Print();
item->Print();
if (item->side_2()->size() < item->side_3()->size())
{
Side *tmps;
tmps = item->side_2();
item->set_side_2(item->side_3());
item->set_side_3(tmps);
}
cout << "DBG2 ";
item->Print();
if (item->side_1()->size() <= bin->side_1()->size() &&
item->side_2()->size() <= bin->side_2()->size() &&
item->side_3()->size() <= bin->side_3()->size())
{
// packing item
bin->set_item(item);
item->setBin( bin->Root( bin )->progid() );
item->setHLocation( bin->getLocationHeight() );
item->setWLocation( bin->getLocationWidth() );
item->setLLocation( bin->getLocationLength() );
if( item->side_1()->orig_side() == 'w' )
item->SpinAxis( 1 );
else if( item->side_2()->orig_side() == 'h' )
item->SpinAxis( 2 );
else if( item->side_3()->orig_side() == 'l' )
item->SpinAxis( 3 );
else
item->SpinAxis( 0 );
bin->Print();
item->Print();
splitBinWidth(bin, item);
splitBinHeight(bin, item);
splitBinLength(bin, item);
if (bin->get_x_sub_bin() != NULL)
{
//.........这里部分代码省略.........