FeaturesAPI_SharedFaces::FeaturesAPI_SharedFaces(
const std::shared_ptr<ModelAPI_Feature>& theFeature,
const ModelHighAPI_Selection& theobject,
- const ModelHighAPI_Integer& theTransparency,
const std::string & theNameGroup)
:ModelHighAPI_Interface(theFeature)
{
if (initialize()) {
fillAttribute(theobject, myobjectselected);
- fillAttribute(theTransparency, mytransparency);
fillAttribute(theNameGroup, mygroupname);
execute();
}
anAttrObject = aBase->selection(FeaturesPlugin_GroupSharedFaces::OBJECT_ID());
theDumper << aBase << " = model.getSharedFaces(" << aDocName << ", " << anAttrObject;
- theDumper << ", " << aBase->integer(FeaturesPlugin_GroupSharedFaces::TRANSPARENCY_ID());
theDumper << ", " << aBase->string(FeaturesPlugin_GroupSharedFaces::GROUP_NAME_ID());
theDumper << ")" << std::endl;
}
//=================================================================================================
SharedFacesPtr getSharedFaces(const std::shared_ptr<ModelAPI_Document>& thePart,
const ModelHighAPI_Selection& theobject,
- const ModelHighAPI_Integer& theTransparency,
const std::string & theNameGroup)
{
aSharedFaces.reset(new FeaturesAPI_SharedFaces(aFeature,
theobject,
- theTransparency,
theNameGroup));
return aSharedFaces;
FEATURESAPI_EXPORT
explicit FeaturesAPI_SharedFaces(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const ModelHighAPI_Selection& theobject,
- const ModelHighAPI_Integer& theTransparency,
const std::string & theNameGroup);
/// Destructor.
FEATURESAPI_EXPORT
virtual ~FeaturesAPI_SharedFaces();
- INTERFACE_3(FeaturesPlugin_GroupSharedFaces::ID(),
+ INTERFACE_2(FeaturesPlugin_GroupSharedFaces::ID(),
objectselected, FeaturesPlugin_GroupSharedFaces::OBJECT_ID(),
ModelAPI_AttributeSelection,
/** object selected*/,
- transparency, FeaturesPlugin_GroupSharedFaces::TRANSPARENCY_ID(),
- ModelAPI_AttributeInteger,
- /** transparency*/,
groupname, FeaturesPlugin_GroupSharedFaces::GROUP_NAME_ID(),
ModelAPI_AttributeString,
/** group name*/)
FEATURESAPI_EXPORT
SharedFacesPtr getSharedFaces(const std::shared_ptr<ModelAPI_Document>& thePart,
const ModelHighAPI_Selection& theObject,
- const ModelHighAPI_Integer& theTransparency,
const std::string & theNameGroup);
#endif // FeaturesAPI_SharedFaces_H_
data()->addAttribute(TRANSPARENCY_ID(), ModelAPI_AttributeInteger::typeId());
data()->addAttribute(GROUP_NAME_ID(), ModelAPI_AttributeString::typeId());
+ ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), TRANSPARENCY_ID());
+
}
}
}
- if (selection(OBJECT_ID())->isInitialized()) {
+ if (selection(OBJECT_ID())->isInitialized() && integer(TRANSPARENCY_ID())->isInitialized()) {
AttributeSelectionPtr ancompSolidAttr = selection(OBJECT_ID());
ResultPtr aResult = ancompSolidAttr->context();
CompSolid_1 = model.addCompSolid(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Box_2_1")])
### Create Shared_faces
- Shared_faces_1 = model.getSharedFaces(Part_1_doc, model.selection("COMPSOLID", "CompSolid_1_1"), 50, "mygroup")
+ Shared_faces_1 = model.getSharedFaces(Part_1_doc, model.selection("COMPSOLID", "CompSolid_1_1"), "mygroup")
model.do()
# Check results
**TUI Command**:
-.. py:function:: model.getSharedFaces(Part_doc, shape, transparency, nameGroup)
+.. py:function:: model.getSharedFaces(Part_doc, shape, nameGroup)
:param part: The current part object.
:param object: A composolid or compound in format *model.selection("Type", shape)*.
- :param number: value for the transparency.
:param string: name of group created.
:return: Created group.
CompSolid_1 = model.addCompSolid(Part_1_doc, [model.selection("SOLID", "Box_1_1"), model.selection("SOLID", "Box_2_1")])
### Create Shared_faces
-Shared_faces_1 = model.getSharedFaces(Part_1_doc, model.selection("COMPSOLID", "CompSolid_1_1"), 50, "mygroup")
+Shared_faces_1 = model.getSharedFaces(Part_1_doc, model.selection("COMPSOLID", "CompSolid_1_1"), "mygroup")
model.do()
model.end()