本文整理汇总了C++中HeeksObj::GetIDGroupType方法的典型用法代码示例。如果您正苦于以下问题:C++ HeeksObj::GetIDGroupType方法的具体用法?C++ HeeksObj::GetIDGroupType怎么用?C++ HeeksObj::GetIDGroupType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HeeksObj
的用法示例。
在下文中一共展示了HeeksObj::GetIDGroupType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddSolidsProperties
void AddSolidsProperties(std::list<Property *> *list, HeeksObj* object)
{
std::list<int> solids;
for(HeeksObj* child = object->GetFirstChild(); child; child = object->GetNextChild())
{
if(child->GetIDGroupType() == SolidType)solids.push_back(child->GetID());
}
#else
void AddSolidsProperties(std::list<Property *> *list, const std::list<int> &solids)
{
#endif
if(solids.size() == 0)list->push_back(new PropertyString(_("solids"), _("None"), NULL));
else if(solids.size() == 1)list->push_back(new PropertyInt(_("solid id"), solids.front(), NULL));
else list->push_back(new PropertyString(_("solids"), GetIntListString(solids), NULL));
}
#ifdef OP_SKETCHES_AS_CHILDREN
void AddSketchesProperties(std::list<Property *> *list, HeeksObj* object)
{
std::list<int> sketches;
for(HeeksObj* child = object->GetFirstChild(); child; child = object->GetNextChild())
{
if(child->GetIDGroupType() == SketchType)sketches.push_back(child->GetID());
}
#else
void AddSketchesProperties(std::list<Property *> *list, const std::list<int> &sketches)
{
#endif
if(sketches.size() == 0)list->push_back(new PropertyString(_("sketches"), _("None"), NULL));
else if(sketches.size() == 1)list->push_back(new PropertyInt(_("sketch id"), sketches.front(), NULL));
else list->push_back(new PropertyString(_("sketches"), GetIntListString(sketches), NULL));
}
示例2: GetWorldBox
static void GetWorldBox(CBox &box)
{
// gets the extents of the volume of all the solids
for(HeeksObj* object = wxGetApp().GetFirstChild(); object != NULL; object = wxGetApp().GetNextChild())
{
if(object->GetIDGroupType() == SolidType)
{
object->GetBox(box);
}
}
}
示例3: GetSymbols
static bool GetSymbols(std::list< std::pair<int,unsigned int> >& symbols )
{
// check for at least one sketch selected
const std::list<HeeksObj*>& list = heeksCAD->GetMarkedList();
for(std::list<HeeksObj*>::const_iterator It = list.begin(); It != list.end(); It++)
{
HeeksObj* object = *It;
if(object->GetIDGroupType() == SketchType)
{
symbols.push_back(std::make_pair(object->GetType(), object->m_id));
}
}
if(symbols.size() == 0)return false;
return true;
}
示例4: WriteXML
void CWaterline::WriteXML(TiXmlNode *root)
{
TiXmlElement * element = heeksCAD->NewXMLElement( "Waterline" );
heeksCAD->LinkXMLEndChild( root, element );
m_params.WriteXMLAttributes(element);
// write solid ids
for (HeeksObj *object = GetFirstChild(); object != NULL; object = GetNextChild())
{
if (object->GetIDGroupType() != SolidType)continue;
int solid = object->GetID();
TiXmlElement * solid_element = heeksCAD->NewXMLElement( "solid" );
heeksCAD->LinkXMLEndChild( element, solid_element );
solid_element->SetAttribute("id", solid);
}
WriteBaseXML(element);
}
示例5: GetSketches
static bool GetSketches(std::list<int>& sketches )
{
// check for at least one sketch selected
const std::list<HeeksObj*>& list = heeksCAD->GetMarkedList();
for(std::list<HeeksObj*>::const_iterator It = list.begin(); It != list.end(); It++)
{
HeeksObj* object = *It;
if(object->GetIDGroupType() == SketchType)
{
sketches.push_back(object->m_id);
}
}
if(sketches.size() == 0)return false;
return true;
}
示例6: WriteXML
void CAttachOp::WriteXML(TiXmlNode *root)
{
TiXmlElement * element = heeksCAD->NewXMLElement( "AttachOp" );
heeksCAD->LinkXMLEndChild( root, element );
element->SetDoubleAttribute( "tolerance", m_tolerance);
element->SetDoubleAttribute( "minz", m_min_z);
element->SetDoubleAttribute( "material_allowance", m_material_allowance);
// write solid ids
#ifdef OP_SKETCHES_AS_CHILDREN
for (HeeksObj *object = GetFirstChild(); object != NULL; object = GetNextChild())
{
if (object->GetIDGroupType() != SolidType)continue;
int solid = object->GetID();
#else
for (std::list<int>::iterator It = m_solids.begin(); It != m_solids.end(); It++)
{
int solid = *It;
#endif
TiXmlElement * solid_element = heeksCAD->NewXMLElement( "solid" );
heeksCAD->LinkXMLEndChild( element, solid_element );
solid_element->SetAttribute("id", solid);
}
COp::WriteBaseXML(element);
}
// static member function
HeeksObj* CAttachOp::ReadFromXMLElement(TiXmlElement* element)
{
CAttachOp* new_object = new CAttachOp;
element->Attribute("tolerance", &new_object->m_tolerance);
element->Attribute("minz", &new_object->m_min_z);
element->Attribute("material_allowance", &new_object->m_material_allowance);
std::list<TiXmlElement *> elements_to_remove;
// read solid ids
for(TiXmlElement* pElem = heeksCAD->FirstXMLChildElement( element ) ; pElem; pElem = pElem->NextSiblingElement())
{
std::string name(pElem->Value());
if(name == "solid"){
for(TiXmlAttribute* a = pElem->FirstAttribute(); a; a = a->Next())
{
std::string name(a->Name());
if(name == "id"){
int id = a->IntValue();
new_object->m_solids.push_back(id);
}
}
elements_to_remove.push_back(pElem);
}
}
for (std::list<TiXmlElement*>::iterator itElem = elements_to_remove.begin(); itElem != elements_to_remove.end(); itElem++)
{
heeksCAD->RemoveXMLChild( element, *itElem);
}
new_object->ReadBaseXML(element);
return new_object;
}