Exemplo n.º 1
0
void CAdaptive::GetProperties(std::list<Property *> *list)
{
	AddSolidsProperties(list, this);
	AddSketchesProperties(list, this);
	m_params.GetProperties(this, list);
	COp::GetProperties(list);
}
Exemplo n.º 2
0
Python CAttachOp::AppendTextToProgram(CMachineState *pMachineState)
{
	Python python;

 #ifdef OP_SKETCHES_AS_CHILDREN
   ReloadPointers();   // Make sure all the solids in m_solids are included as child objects.
#endif

	python << COp::AppendTextToProgram(pMachineState);

	//write stl file
	std::list<HeeksObj*> solids;
	std::list<HeeksObj*> copies_to_delete;
#ifdef OP_SKETCHES_AS_CHILDREN
    for (HeeksObj *object = GetFirstChild(); object != NULL; object = GetNextChild())
    {
	    if (object->GetType() != SolidType && object->GetType() != StlSolidType)
	    {
	        continue;
	    }

#else
	for (std::list<int>::iterator It = m_solids.begin(); It != m_solids.end(); It++)
    {
		HeeksObj* object = heeksCAD->GetIDObject(SolidType, *It);
#endif
		if (object != NULL)
		{
			if(1/* to do pMachineState->Fixture().GetMatrix() == gp_Trsf()*/)
			{
				solids.push_back(object);
			}
		} // End if - then
	} // End for


    wxStandardPaths standard_paths;
    wxFileName filepath( standard_paths.GetTempDir().c_str(), wxString::Format(_T("surface%d.stl"), number_for_stl_file).c_str() );
	number_for_stl_file++;

	heeksCAD->SaveSTLFile(solids, filepath.GetFullPath(), 0.01);

	// We don't need the duplicate solids any more.  Delete them.
	for (std::list<HeeksObj*>::iterator l_itSolid = copies_to_delete.begin(); l_itSolid != copies_to_delete.end(); l_itSolid++)
	{
		delete *l_itSolid;
	} // End for

	python << _T("nc.attach.units = ") << theApp.m_program->m_units << _T("\n");
	python << _T("nc.attach.attach_begin()\n");
	python << _T("nc.nc.creator.stl = ocl_funcs.STLSurfFromFile(") << PythonString(filepath.GetFullPath()) << _T(")\n");
	python << _T("nc.nc.creator.minz = ") << m_min_z << _T("\n");
	python << _T("nc.nc.creator.material_allowance = ") << m_material_allowance << _T("\n");

	pMachineState->m_attached_to_surface = this;

	return(python);
} // End AppendTextToProgram() method

static void on_set_tolerance(double value, HeeksObj* object){((CAttachOp*)object)->m_tolerance = value;}
static void on_set_min_z(double value, HeeksObj* object){((CAttachOp*)object)->m_min_z = value;}
static void on_set_material_allowance(double value, HeeksObj* object){((CAttachOp*)object)->m_material_allowance = value;}

void CAttachOp::GetProperties(std::list<Property *> *list)
{
#ifdef OP_SKETCHES_AS_CHILDREN
	AddSolidsProperties(list, this);
#else
	AddSolidsProperties(list, m_solids);
#endif
	list->push_back(new PropertyLength(_("tolerance"), m_tolerance, this, on_set_tolerance));
	list->push_back(new PropertyLength(_("minimum z"), m_min_z, this, on_set_min_z));
	list->push_back(new PropertyLength(_("material allowance"), m_material_allowance, this, on_set_material_allowance));
	COp::GetProperties(list);
}
Exemplo n.º 3
0
void CWaterline::GetProperties(std::list<Property *> *list)
{
	AddSolidsProperties(list, this);
	m_params.GetProperties(this, list);
	CDepthOp::GetProperties(list);
}