Path.Area: added Sections python attribute
This commit is contained in:
parent
67a16db6cb
commit
aec39ec6ff
|
@ -206,6 +206,12 @@ public:
|
|||
/** Get the combined shape */
|
||||
TopoDS_Shape getShape(int index);
|
||||
|
||||
/** Return the number of sections */
|
||||
std::size_t getSectionCount() {
|
||||
build();
|
||||
return mySections.size();
|
||||
}
|
||||
|
||||
/** Add a OCC wire shape to CArea
|
||||
*
|
||||
* \arg \c area: output converted curved object to here
|
||||
|
|
|
@ -63,5 +63,11 @@ any operation</UserDocu>
|
|||
<UserDocu>Get current algorithm parameters as a dictionary.</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Attribute Name="Sections" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>List of sections in this area.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Sections" Type="List"/>
|
||||
</Attribute>
|
||||
</PythonExport>
|
||||
</GenerateModel>
|
||||
|
|
|
@ -295,6 +295,14 @@ PyObject* AreaPy::getParamsDesc(PyObject *args, PyObject *keywds)
|
|||
return dict;
|
||||
}
|
||||
|
||||
Py::List AreaPy::getSections(void) const {
|
||||
Py::List ret;
|
||||
Area *area = getAreaPtr();
|
||||
for(size_t i=0,count=area->getSectionCount(); i<count;++i)
|
||||
ret.append(Part::shape2pyshape(getAreaPtr()->getShape(i)));
|
||||
return ret;
|
||||
}
|
||||
|
||||
// custom attributes get/set
|
||||
|
||||
PyObject *AreaPy::getCustomAttributes(const char* /*attr*/) const
|
||||
|
|
Loading…
Reference in New Issue
Block a user