当前位置: 首页>>代码示例>>C++>>正文


C++ HeeksObj::GetFirstChild方法代码示例

本文整理汇总了C++中HeeksObj::GetFirstChild方法的典型用法代码示例。如果您正苦于以下问题:C++ HeeksObj::GetFirstChild方法的具体用法?C++ HeeksObj::GetFirstChild怎么用?C++ HeeksObj::GetFirstChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HeeksObj的用法示例。


在下文中一共展示了HeeksObj::GetFirstChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: tree

/**
	The fixture objects may be in the 'theApp.m_program->Fixtures()' tree (for globally applied fixtures) but
	they may also be children of operations 'theApp.m_program->Operations()'.
 */
CFixture *CFixtures::Find( const CFixture::eCoordinateSystemNumber_t coordinate_system_number, const bool only_public_fixtures /* = false */ )
{
    for(HeeksObj* ob = GetFirstChild(); ob; ob = GetNextChild())
    {
        if (ob->GetType() != FixtureType) continue;

        if (ob != NULL)
        {
            if (((CFixture *)ob)->m_coordinate_system_number == coordinate_system_number)
            {
                return( (CFixture *) ob );
            } // End if - then
        } // End if - then
    } // End for

    if (only_public_fixtures == false)
    {
        for(HeeksObj* operation = theApp.m_program->Operations()->GetFirstChild(); operation; operation = theApp.m_program->Operations()->GetNextChild())
        {
            for (HeeksObj *ob = operation->GetFirstChild(); ob != NULL; ob = operation->GetNextChild())
            {
                if (ob->GetType() != FixtureType) continue;

                if (ob != NULL)
                {
                    if (((CFixture *)ob)->m_coordinate_system_number == coordinate_system_number)
                    {
                        return( (CFixture *) ob );
                    } // End if - then
                } // End if - then
            } // End for
        } // End for
    } // End if - then

    return(NULL);

} // End Find() method
开发者ID:DavidNicholls,项目名称:heekscnc,代码行数:41,代码来源:Fixtures.cpp

示例2: OnLabelLeftDown

void CTreeCanvas::OnLabelLeftDown(HeeksObj* object, wxMouseEvent& event)
{
	if(event.ShiftDown())
	{
		// mark a list of siblings
#ifdef MULTIPLE_OWNERS
		HeeksObj* parent = object->HEEKSOBJ_OWNER;
#else
		HeeksObj* parent = object->m_owner;
#endif
		std::set<HeeksObj*> sibling_set;
		std::list<HeeksObj*> sibling_list;
		for(HeeksObj* sibling = parent->GetFirstChild(); sibling; sibling = parent->GetNextChild())
		{
			sibling_set.insert(sibling);
			sibling_list.push_back(sibling);
		}
		// find most recently marked sibling
		std::list<HeeksObj*> &marked = wxGetApp().m_marked_list->list();
		HeeksObj* recently_marked_sibling = NULL;
		bool recent_first = false;
		for(std::list<HeeksObj*>::reverse_iterator It = marked.rbegin(); It != marked.rend(); It++)
		{
			if(*It == object)recent_first = true;
			if(sibling_set.find(*It) != sibling_set.end())
			{
				recently_marked_sibling = *It;
				break;
			}
		}

		if(recently_marked_sibling)
		{
			if(!event.ControlDown())
			{
				wxGetApp().m_marked_list->Clear(false);
			}

			bool marking = false;
			std::list<HeeksObj*> list_to_mark;
			bool finish_marking = false;
			for(std::list<HeeksObj*>::iterator It = sibling_list.begin(); !finish_marking && It != sibling_list.end(); It++)
			{
				HeeksObj* sibling = *It;
				if(sibling == object || sibling == recently_marked_sibling)
				{
					if(marking)finish_marking = true;
					else marking = true;
				}

				if(marking)
				{
					list_to_mark.push_back(sibling);
				}
			}

			wxGetApp().m_marked_list->Add(list_to_mark, true);
		}
		else
		{
			if(event.ControlDown())
			{
				if(wxGetApp().m_marked_list->ObjectMarked(object))
				{
					wxGetApp().m_marked_list->Remove(object, true);
				}
				else{
					wxGetApp().m_marked_list->Add(object, true);
				}
			}
			else
			{
				if(wxGetApp().m_marked_list->ObjectMarked(object))
				{
					m_waiting_until_left_up = true;
				}
				else
				{
					wxGetApp().m_marked_list->Clear(false);
					wxGetApp().m_marked_list->Add(object, true);
				}
			}
		}
	}
	else
	{
		// shift not down
		if(event.ControlDown())
		{
			if(wxGetApp().m_marked_list->ObjectMarked(object))
			{
				wxGetApp().m_marked_list->Remove(object, true);
			}
			else{
				wxGetApp().m_marked_list->Add(object, true);
			}
		}
		else
		{
			if(wxGetApp().m_marked_list->ObjectMarked(object))
//.........这里部分代码省略.........
开发者ID:CarlosGS,项目名称:heekscad,代码行数:101,代码来源:TreeCanvas.cpp

示例3: AppendTextToProgram


//.........这里部分代码省略.........
			python << _T("actp.settoolcornerrad(") << pTool->m_params.m_corner_radius << _T(")\n");
			python << _T("actp.settoolflatrad(") << pTool->m_params.m_flat_radius << _T(")\n");
		} // End if - then
	} // End if - then
	else
	{
		// This object has values and/or we don't have a  tool number to refer to.
		// Use these values instead.

		python << _T("actp.settoolcornerrad(") << m_params.m_toolcornerrad << _T(")\n");
		python << _T("actp.settoolflatrad(") << m_params.m_toolflatrad << _T(")\n");
	} // End if - else

	python << _T("actp.setsamplestep(") << m_params.m_samplestep << _T(")\n");

	python << _T("actp.setstepdown(") << m_params.m_stepdown << _T(")\n");

	python << _T("actp.setclearcuspheight(") << m_params.m_clearcuspheight << _T(")\n");

	python << _T("actp.settriangleweaveres(") << m_params.m_triangleweaveres << _T(")\n");

	python << _T("actp.setflatradweaveres(") << m_params.m_flatradweaveres << _T(")\n");

	python << _T("actp.setdchangright(") << m_params.m_dchangright << _T(")\n");

	python << _T("actp.setdchangrightoncontour(") << m_params.m_dchangrightoncontour << _T(")\n");

	python << _T("actp.setdchangleft(") << m_params.m_dchangleft << _T(")\n");

	python << _T("actp.setdchangefreespace(") << m_params.m_dchangefreespace << _T(")\n");

	python << _T("actp.setsidecutdisplch(") << m_params.m_sidecutdisplch << _T(")\n");

	python << _T("actp.setfcut(") << m_params.m_fcut << _T(")\n");

	python << _T("actp.setfretract(") << m_params.m_fretract << _T(")\n");

	python << _T("actp.setthintol(") << m_params.m_thintol << _T(")\n");

	python << _T("actp.setstartpoint(") << start.X() << _T(", ") << start.Y() << _T(", ") << m_params.m_startvel_x << _T(", ") << m_params.m_startvel_y << _T(")\n");

	python << _T("actp.setminz(") << m_params.m_minz << _T(")\n");

	python << _T("actp.boundaryclear(") << m_params.m_boundaryclear << _T(")\n");

	if(!m_sketches.empty())
	{
		std::list<HeeksObj*> sketches;
		for(std::list<int>::iterator It = m_sketches.begin(); It != m_sketches.end(); It++)
		{
			HeeksObj* sketch = heeksCAD->GetIDObject(SketchType, *It);
			if(sketch){
				for(HeeksObj* span_object = sketch->GetFirstChild(); span_object; span_object = sketch->GetNextChild())
				{
					double s[3] = {0, 0, 0};
					double e[3] = {0, 0, 0};
					if(span_object){
						int type = span_object->GetType();
						//TODO: add support for arcs
						if(type == LineType)
						{
							span_object->GetStartPoint(s);
							pMachineState->Fixture().Adjustment(s);

							span_object->GetEndPoint(e);
							pMachineState->Fixture().Adjustment(e);

							python << _T("actp.boundaryadd(") << s[0] << _T(", ") << s[1] << _T(")\n");
							python << _T("actp.boundaryadd(") << e[0] << _T(", ") << e[1] << _T(")\n");
						}
					}
				}
			}
			python << _T("actp.boundarybreak()\n");
		}
	}
	else
	{
		gp_Pnt boundary[2];
		boundary[0] = pMachineState->Fixture().Adjustment( gp_Pnt( m_params.m_boundary_x0, m_params.m_boundary_y0, 0.0 ) );
		boundary[1] = pMachineState->Fixture().Adjustment( gp_Pnt( m_params.m_boundary_x1, m_params.m_boundary_y1, 0.0 ) );

		python << _T("actp.boundaryadd(") << boundary[0].X() << _T(", ") << boundary[0].Y() << _T(")\n");

		python << _T("actp.boundaryadd(") << boundary[0].X() << _T(", ") << boundary[1].Y() << _T(")\n");

		python << _T("actp.boundaryadd(") << boundary[1].X() << _T(", ") << boundary[1].Y() << _T(")\n");

		python << _T("actp.boundaryadd(") << boundary[1].X() << _T(", ") << boundary[0].Y() << _T(")\n");

		python << _T("actp.boundarybreak()\n");

	}

	python << _T("actp_funcs.cut(") << PythonString(filepath.GetFullPath()) << _T(")\n");

	python << _T("rapid(z=") << m_params.m_retractzheight << _T(")\n");

	return(python);
}
开发者ID:JonasThomas,项目名称:heekscnc,代码行数:101,代码来源:Adaptive.cpp


注:本文中的HeeksObj::GetFirstChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。