本文整理汇总了C++中CBox::MinX方法的典型用法代码示例。如果您正苦于以下问题:C++ CBox::MinX方法的具体用法?C++ CBox::MinX怎么用?C++ CBox::MinX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBox
的用法示例。
在下文中一共展示了CBox::MinX方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Run
void Run()
{
CBox box;
sketch_for_tools->GetBox(box);
double centre[3];
box.Centre(centre);
wxGetApp().m_digitizing->digitized_point = DigitizedPoint(gp_Pnt(box.MinX(), centre[1], centre[2]), DigitizeInputType);
Drawing *pDrawingMode = dynamic_cast<Drawing *>(wxGetApp().input_mode_object);
if (pDrawingMode != NULL)
{
pDrawingMode->AddPoint();
}
}
示例2: CBox
static void WriteCoords(std::wofstream &ofs)
{
CBox box;
GetWorldBox(box);
if(!box.m_valid)
{
box = CBox(-100, -100, -50, 100, 100, 50);
}
else
{
while(box.Width() < 100){box.m_x[0] -= 5.0; box.m_x[3] += 5.0;}
while(box.Height() < 100){box.m_x[1] -= 5.0; box.m_x[4] += 5.0;}
box.m_x[2] -= 10.0;
}
ofs<<"toolpath.coords = Coords("<<box.MinX()<<", "<<box.MinY()<<", "<<box.MinZ()<<", "<<box.MaxX()<<", "<<box.MaxY()<<", "<<box.MaxZ()<<")\n";
}
示例3: Pack
void CBOM::Pack(double bin_width, double height, int gap)
{
m_gap = gap;
Rectangles_t best_rects;
rects.clear();
HeeksObj* child = GetFirstChild();
while(child)
{
CTrsfNCCode* code = (CTrsfNCCode*)child;
CBox box;
code->GetBox(box);
//Figure out how to translate later
NCRect ncrect(0,0,box.Width()+gap,box.Height()+gap,code);
best_rects.push_back(ncrect);
rects.push_back(ncrect);
child = GetNextChild();
}
// Sort by height.
std::sort(best_rects.begin(),best_rects.end(),ByHeight());
// Make variables to track and record the best solution.
bool* is_positioned = new bool[best_rects.size()];
for(unsigned int i=0; i < best_rects.size(); i++)
is_positioned[i] = false;
int num_unpositioned = rects.size();
// Fill by stripes.
int max_y = 0;
for (unsigned int i = 0; i <= rects.size() - 1; i++)
{
// See if this rectangle is positioned.
if (!is_positioned[i])
{
// Start a new stripe.
num_unpositioned -= 1;
is_positioned[i] = true;
best_rects[i].m_x = 0;
best_rects[i].m_y = max_y;
FillBoundedArea(
best_rects[i].m_width, bin_width, max_y,
max_y + best_rects[i].m_height,
num_unpositioned, best_rects, is_positioned,0, false);
if (num_unpositioned == 0) break;
max_y += best_rects[i].m_height;
}
}
// Save the best solution.
rects = best_rects;
//Apply to the NCCODE
for(unsigned int i=0; i < rects.size(); i++)
{
CTrsfNCCode *code = rects[i].m_code;
CBox box;
code->GetBox(box);
code->m_x = rects[i].m_x - box.MinX();
code->m_y = rects[i].m_y - box.MinY();
}
}