FeaturePtr aBase = feature();
FeaturesPlugin_Boolean::OperationType aType =
- (FeaturesPlugin_Boolean::OperationType)aBase->integer(FeaturesPlugin_Boolean::TYPE_ID())->value();
+ (FeaturesPlugin_Boolean::OperationType)aBase->integer(
+ FeaturesPlugin_Boolean::TYPE_ID())->value();
theDumper << aBase << " = model.add";
}
const std::string& aDocName = theDumper.name(aBase->document());
- AttributeSelectionListPtr anObjects = aBase->selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID());
+ AttributeSelectionListPtr anObjects =
+ aBase->selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID());
AttributeSelectionListPtr aTools = aBase->selectionList(FeaturesPlugin_Boolean::TOOL_LIST_ID());
theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools << ")" << std::endl;
virtual ~FeaturesAPI_Boolean();
INTERFACE_3(FeaturesPlugin_Boolean::ID(),
- boolType, FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger, /** Operation type */,
- mainObjects, FeaturesPlugin_Boolean::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */,
- toolObjects, FeaturesPlugin_Boolean::TOOL_LIST_ID(), ModelAPI_AttributeSelectionList, /** Tool objects*/)
+ boolType, FeaturesPlugin_Boolean::TYPE_ID(),
+ ModelAPI_AttributeInteger, /** Operation type */,
+ mainObjects, FeaturesPlugin_Boolean::OBJECT_LIST_ID(),
+ ModelAPI_AttributeSelectionList, /** Main objects */,
+ toolObjects, FeaturesPlugin_Boolean::TOOL_LIST_ID(),
+ ModelAPI_AttributeSelectionList, /** Tool objects*/)
/// Set operation type.
FEATURESAPI_EXPORT
//==================================================================================================
FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Double& theSize)
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& theSize)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
//==================================================================================================
FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theDirection,
- const ModelHighAPI_Double& theSize)
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theDirection,
+ const ModelHighAPI_Double& theSize)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
//==================================================================================================
FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Double& theToSize,
- const ModelHighAPI_Double& theFromSize)
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& theToSize,
+ const ModelHighAPI_Double& theFromSize)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
//==================================================================================================
FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theDirection,
- const ModelHighAPI_Double& theToSize,
- const ModelHighAPI_Double& theFromSize)
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theDirection,
+ const ModelHighAPI_Double& theToSize,
+ const ModelHighAPI_Double& theFromSize)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
//==================================================================================================
FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theToObject,
- const ModelHighAPI_Double& theToOffset,
- const ModelHighAPI_Selection& theFromObject,
- const ModelHighAPI_Double& theFromOffset)
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theToObject,
+ const ModelHighAPI_Double& theToOffset,
+ const ModelHighAPI_Selection& theFromObject,
+ const ModelHighAPI_Double& theFromOffset)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
//==================================================================================================
FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theDirection,
- const ModelHighAPI_Selection& theToObject,
- const ModelHighAPI_Double& theToOffset,
- const ModelHighAPI_Selection& theFromObject,
- const ModelHighAPI_Double& theFromOffset)
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theDirection,
+ const ModelHighAPI_Selection& theToObject,
+ const ModelHighAPI_Double& theToOffset,
+ const ModelHighAPI_Selection& theFromObject,
+ const ModelHighAPI_Double& theFromOffset)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
const std::string& aDocName = theDumper.name(aBase->document());
AttributeReferencePtr anAttrSketch = aBase->reference(FeaturesPlugin_Extrusion::SKETCH_ID());
- AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Extrusion::BASE_OBJECTS_ID());
- AttributeSelectionPtr anAttrDirection = aBase->selection(FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID());
+ AttributeSelectionListPtr anAttrObjects =
+ aBase->selectionList(FeaturesPlugin_Extrusion::BASE_OBJECTS_ID());
+ AttributeSelectionPtr anAttrDirection =
+ aBase->selection(FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID());
theDumper << aBase << " = model.addExtrusion(" << aDocName << ", ";
anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects;
theDumper << ", " << anAttrDirection;
- std::string aCreationMethod = aBase->string(FeaturesPlugin_Extrusion::CREATION_METHOD())->value();
+ std::string aCreationMethod =
+ aBase->string(FeaturesPlugin_Extrusion::CREATION_METHOD())->value();
if(aCreationMethod == FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES()) {
AttributeDoublePtr anAttrToSize = aBase->real(FeaturesPlugin_Extrusion::TO_SIZE_ID());
theDumper << ", " << anAttrToSize << ", " << anAttrFromSize;
} else if(aCreationMethod == FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES()) {
- AttributeSelectionPtr anAttrToObject = aBase->selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID());
+ AttributeSelectionPtr anAttrToObject =
+ aBase->selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID());
AttributeDoublePtr anAttrToOffset = aBase->real(FeaturesPlugin_Extrusion::TO_OFFSET_ID());
- AttributeSelectionPtr anAttrFromObject = aBase->selection(FeaturesPlugin_Extrusion::FROM_OBJECT_ID());
+ AttributeSelectionPtr anAttrFromObject =
+ aBase->selection(FeaturesPlugin_Extrusion::FROM_OBJECT_ID());
AttributeDoublePtr anAttrFromOffset = aBase->real(FeaturesPlugin_Extrusion::FROM_OFFSET_ID());
- theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << ", " << anAttrFromObject << ", " << anAttrFromOffset;
+ theDumper << ", " << anAttrToObject << ", " << anAttrToOffset <<
+ ", " << anAttrFromObject << ", " << anAttrFromOffset;
}
theDumper << ")" << std::endl;
virtual ~FeaturesAPI_Extrusion();
INTERFACE_10(FeaturesPlugin_Extrusion::ID(),
- sketch, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */,
- baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
- direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), ModelAPI_AttributeSelection, /** Direction */,
- creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
- toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(), ModelAPI_AttributeDouble, /** To size */,
- fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(), ModelAPI_AttributeDouble, /** From size */,
- toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
- toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
- fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
- fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */)
+ sketch, FeaturesPlugin_Extrusion::SKETCH_ID(),
+ ModelAPI_AttributeReference, /** Sketch launcher */,
+ baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(),
+ ModelAPI_AttributeSelectionList, /** Base objects */,
+ direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** Direction */,
+ creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(),
+ ModelAPI_AttributeString, /** Creation method */,
+ toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(),
+ ModelAPI_AttributeDouble, /** To size */,
+ fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(),
+ ModelAPI_AttributeDouble, /** From size */,
+ toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** To object */,
+ toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(),
+ ModelAPI_AttributeDouble, /** To offset */,
+ fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** From object */,
+ fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(),
+ ModelAPI_AttributeDouble, /** From offset */)
/// Modify base attribute of the feature.
FEATURESAPI_EXPORT
/// Modify CreationMethod, to_size, from_size attributes of the feature.
FEATURESAPI_EXPORT
- void setSizes(const ModelHighAPI_Double& theToSize, const ModelHighAPI_Double& theFromSize);
+ void setSizes(const ModelHighAPI_Double& theToSize,
+ const ModelHighAPI_Double& theFromSize);
/// Modify creation_method, to_size, from_size attributes of the feature.
FEATURESAPI_EXPORT
void setSize(const ModelHighAPI_Double& theSize);
- /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
+ /// Modify creation_method, to_object, to_offset,
+ /// from_object, from_offset attributes of the feature.
FEATURESAPI_EXPORT
void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
const ModelHighAPI_Double& theToOffset,
#include <ModelHighAPI_Tools.h>
//==================================================================================================
-FeaturesAPI_ExtrusionBoolean::FeaturesAPI_ExtrusionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+FeaturesAPI_ExtrusionBoolean::FeaturesAPI_ExtrusionBoolean(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature)
: ModelHighAPI_Interface(theFeature)
{
}
}
//==================================================================================================
-void FeaturesAPI_ExtrusionBoolean::setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+void FeaturesAPI_ExtrusionBoolean::setBooleanObjects(
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
fillAttribute(theBooleanObjects, mybooleanObjects);
const std::string& aDocName = theDumper.name(aBase->document());
AttributeReferencePtr anAttrSketch = aBase->reference(FeaturesPlugin_Extrusion::SKETCH_ID());
- AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Extrusion::BASE_OBJECTS_ID());
- AttributeSelectionPtr anAttrDirection = aBase->selection(FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID());
+ AttributeSelectionListPtr anAttrObjects =
+ aBase->selectionList(FeaturesPlugin_Extrusion::BASE_OBJECTS_ID());
+ AttributeSelectionPtr anAttrDirection =
+ aBase->selection(FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID());
theDumper << aBase << " = model.addExtrusion";
if(aBase->getKind() == FeaturesPlugin_ExtrusionCut::ID()) {
anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects;
theDumper << ", " << anAttrDirection;
- std::string aCreationMethod = aBase->string(FeaturesPlugin_Extrusion::CREATION_METHOD())->value();
+ std::string aCreationMethod =
+ aBase->string(FeaturesPlugin_Extrusion::CREATION_METHOD())->value();
if(aCreationMethod == FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES()) {
AttributeDoublePtr anAttrToSize = aBase->real(FeaturesPlugin_Extrusion::TO_SIZE_ID());
theDumper << ", " << anAttrToSize << ", " << anAttrFromSize;
} else if(aCreationMethod == FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES()) {
- AttributeSelectionPtr anAttrToObject = aBase->selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID());
+ AttributeSelectionPtr anAttrToObject =
+ aBase->selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID());
AttributeDoublePtr anAttrToOffset = aBase->real(FeaturesPlugin_Extrusion::TO_OFFSET_ID());
- AttributeSelectionPtr anAttrFromObject = aBase->selection(FeaturesPlugin_Extrusion::FROM_OBJECT_ID());
+ AttributeSelectionPtr anAttrFromObject =
+ aBase->selection(FeaturesPlugin_Extrusion::FROM_OBJECT_ID());
AttributeDoublePtr anAttrFromOffset = aBase->real(FeaturesPlugin_Extrusion::FROM_OFFSET_ID());
- theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << ", " << anAttrFromObject << ", " << anAttrFromOffset;
+ theDumper << ", " << anAttrToObject << ", " << anAttrToOffset <<
+ ", " << anAttrFromObject << ", " << anAttrFromOffset;
}
- AttributeSelectionListPtr anAttrBoolObjects = aBase->selectionList(FeaturesPlugin_CompositeBoolean::OBJECTS_ID());
+ AttributeSelectionListPtr anAttrBoolObjects =
+ aBase->selectionList(FeaturesPlugin_CompositeBoolean::OBJECTS_ID());
theDumper << ", " << anAttrBoolObjects << ")" << std::endl;
if(anAttrSketch->isInitialized()) {
//==================================================================================================
-FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
initialize();
}
//==================================================================================================
-FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Double& theSize,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& theSize,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theDirection,
- const ModelHighAPI_Double& theSize,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theDirection,
+ const ModelHighAPI_Double& theSize,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Double& theToSize,
- const ModelHighAPI_Double& theFromSize,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& theToSize,
+ const ModelHighAPI_Double& theFromSize,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theDirection,
- const ModelHighAPI_Double& theToSize,
- const ModelHighAPI_Double& theFromSize,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theDirection,
+ const ModelHighAPI_Double& theToSize,
+ const ModelHighAPI_Double& theFromSize,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theToObject,
- const ModelHighAPI_Double& theToOffset,
- const ModelHighAPI_Selection& theFromObject,
- const ModelHighAPI_Double& theFromOffset,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theToObject,
+ const ModelHighAPI_Double& theToOffset,
+ const ModelHighAPI_Selection& theFromObject,
+ const ModelHighAPI_Double& theFromOffset,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theDirection,
- const ModelHighAPI_Selection& theToObject,
- const ModelHighAPI_Double& theToOffset,
- const ModelHighAPI_Selection& theFromObject,
- const ModelHighAPI_Double& theFromOffset,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theDirection,
+ const ModelHighAPI_Selection& theToObject,
+ const ModelHighAPI_Double& theToOffset,
+ const ModelHighAPI_Selection& theFromObject,
+ const ModelHighAPI_Double& theFromOffset,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
if(initialize()) {
const ModelHighAPI_Double& theSize,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
- return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theSize, theBooleanObjects));
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
+ return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects,
+ theSize, theBooleanObjects));
}
//==================================================================================================
const ModelHighAPI_Double& theSize,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
- return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theDirection, theSize, theBooleanObjects));
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
+ return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theDirection,
+ theSize, theBooleanObjects));
}
//==================================================================================================
const ModelHighAPI_Double& theFromSize,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
- return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theToSize, theFromSize, theBooleanObjects));
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
+ return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects,
+ theToSize, theFromSize, theBooleanObjects));
}
//==================================================================================================
const ModelHighAPI_Double& theFromSize,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
theBaseObjects,
theDirection,
const ModelHighAPI_Double& theFromOffset,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
theBaseObjects,
theToObject,
const ModelHighAPI_Double& theFromOffset,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID());
return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature,
theBaseObjects,
theDirection,
//==================================================================================================
-FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
initialize();
}
//==================================================================================================
-FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Double& theSize,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& theSize,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theDirection,
- const ModelHighAPI_Double& theSize,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theDirection,
+ const ModelHighAPI_Double& theSize,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Double& theToSize,
- const ModelHighAPI_Double& theFromSize,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Double& theToSize,
+ const ModelHighAPI_Double& theFromSize,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theDirection,
- const ModelHighAPI_Double& theToSize,
- const ModelHighAPI_Double& theFromSize,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theDirection,
+ const ModelHighAPI_Double& theToSize,
+ const ModelHighAPI_Double& theFromSize,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theToObject,
- const ModelHighAPI_Double& theToOffset,
- const ModelHighAPI_Selection& theFromObject,
- const ModelHighAPI_Double& theFromOffset,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theToObject,
+ const ModelHighAPI_Double& theToOffset,
+ const ModelHighAPI_Selection& theFromObject,
+ const ModelHighAPI_Double& theFromOffset,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theDirection,
- const ModelHighAPI_Selection& theToObject,
- const ModelHighAPI_Double& theToOffset,
- const ModelHighAPI_Selection& theFromObject,
- const ModelHighAPI_Double& theFromOffset,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theDirection,
+ const ModelHighAPI_Selection& theToObject,
+ const ModelHighAPI_Double& theToOffset,
+ const ModelHighAPI_Selection& theFromObject,
+ const ModelHighAPI_Double& theFromOffset,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_ExtrusionBoolean(theFeature)
{
if(initialize()) {
const ModelHighAPI_Double& theSize,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
- return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theSize, theBooleanObjects));
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
+ return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects,
+ theSize, theBooleanObjects));
}
//==================================================================================================
const ModelHighAPI_Double& theSize,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
- return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theDirection, theSize, theBooleanObjects));
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
+ return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects,
+ theDirection, theSize, theBooleanObjects));
}
//==================================================================================================
const ModelHighAPI_Double& theFromSize,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
- return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theToSize, theFromSize, theBooleanObjects));
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
+ return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects,
+ theToSize, theFromSize, theBooleanObjects));
}
//==================================================================================================
const ModelHighAPI_Double& theFromSize,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,
theBaseObjects,
theDirection,
const ModelHighAPI_Double& theFromOffset,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,
theBaseObjects,
theToObject,
const ModelHighAPI_Double& theFromOffset,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID());
return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature,
theBaseObjects,
theDirection,
virtual ~FeaturesAPI_ExtrusionBoolean();
INTERFACE_11("",
- sketch, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */,
- baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
- direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), ModelAPI_AttributeSelection, /** Direction */,
- creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
- toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(), ModelAPI_AttributeDouble, /** To size */,
- fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(), ModelAPI_AttributeDouble, /** From size */,
- toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
- toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
- fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
- fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */,
- booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Boolean objects */)
+ sketch, FeaturesPlugin_Extrusion::SKETCH_ID(),
+ ModelAPI_AttributeReference, /** Sketch launcher */,
+ baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(),
+ ModelAPI_AttributeSelectionList, /** Base objects */,
+ direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** Direction */,
+ creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(),
+ ModelAPI_AttributeString, /** Creation method */,
+ toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(),
+ ModelAPI_AttributeDouble, /** To size */,
+ fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(),
+ ModelAPI_AttributeDouble, /** From size */,
+ toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** To object */,
+ toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(),
+ ModelAPI_AttributeDouble, /** To offset */,
+ fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** From object */,
+ fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(),
+ ModelAPI_AttributeDouble, /** From offset */,
+ booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(),
+ ModelAPI_AttributeSelectionList, /** Boolean objects */)
/// Modify base attribute of the feature.
FEATURESAPI_EXPORT
FEATURESAPI_EXPORT
void setSize(const ModelHighAPI_Double& theSize);
- /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
+ /// Modify creation_method, to_object, to_offset, from_object,
+ /// from_offset attributes of the feature.
FEATURESAPI_EXPORT
void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
const ModelHighAPI_Double& theToOffset,
virtual ~FeaturesAPI_Group();
INTERFACE_1(FeaturesPlugin_Group::ID(),
- groupList, FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList, /** Group list*/)
+ groupList, FeaturesPlugin_Group::LIST_ID(),
+ ModelAPI_AttributeSelectionList, /** Group list*/)
/// Set main objects.
FEATURESAPI_EXPORT
#include <ModelHighAPI_Tools.h>
//==================================================================================================
-FeaturesAPI_Intersection::FeaturesAPI_Intersection(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+FeaturesAPI_Intersection::FeaturesAPI_Intersection(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature)
: ModelHighAPI_Interface(theFeature)
{
initialize();
}
//==================================================================================================
-FeaturesAPI_Intersection::FeaturesAPI_Intersection(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theObjects,
- const std::list<ModelHighAPI_Selection>& theTools)
+FeaturesAPI_Intersection::FeaturesAPI_Intersection(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theObjects,
+ const std::list<ModelHighAPI_Selection>& theTools)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
FeaturePtr aBase = feature();
const std::string& aDocName = theDumper.name(aBase->document());
- AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID());
- AttributeSelectionListPtr anAttrTools = aBase->selectionList(FeaturesPlugin_Intersection::TOOL_LIST_ID());
+ AttributeSelectionListPtr anAttrObjects =
+ aBase->selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID());
+ AttributeSelectionListPtr anAttrTools =
+ aBase->selectionList(FeaturesPlugin_Intersection::TOOL_LIST_ID());
theDumper << aBase << " = model.addIntersection(" << aDocName << ", "
<< anAttrObjects << ", " << anAttrTools << ")" << std::endl;
virtual ~FeaturesAPI_Intersection();
INTERFACE_2(FeaturesPlugin_Intersection::ID(),
- objects, FeaturesPlugin_Intersection::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList, /** Objects */,
- tools, FeaturesPlugin_Intersection::TOOL_LIST_ID(), ModelAPI_AttributeSelectionList, /** Tools */)
+ objects, FeaturesPlugin_Intersection::OBJECT_LIST_ID(),
+ ModelAPI_AttributeSelectionList, /** Objects */,
+ tools, FeaturesPlugin_Intersection::TOOL_LIST_ID(),
+ ModelAPI_AttributeSelectionList, /** Tools */)
/// Modify objects attribute of the feature.
FEATURESAPI_EXPORT
//==================================================================================================
FeaturesAPI_Partition::FeaturesAPI_Partition(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects)
+ const std::list<ModelHighAPI_Selection>& theBaseObjects)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
FeaturePtr aBase = feature();
const std::string& aDocName = theDumper.name(aBase->document());
- AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Partition::BASE_OBJECTS_ID());
+ AttributeSelectionListPtr anAttrObjects =
+ aBase->selectionList(FeaturesPlugin_Partition::BASE_OBJECTS_ID());
- theDumper << aBase << " = model.addPartition(" << aDocName << ", " << anAttrObjects << ")" << std::endl;
+ theDumper << aBase << " = model.addPartition(" << aDocName <<
+ ", " << anAttrObjects << ")" << std::endl;
}
//==================================================================================================
virtual ~FeaturesAPI_Partition();
INTERFACE_1(FeaturesPlugin_Partition::ID(),
- baseObjects, FeaturesPlugin_Partition::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */)
+ baseObjects, FeaturesPlugin_Partition::BASE_OBJECTS_ID(),
+ ModelAPI_AttributeSelectionList, /** Base objects */)
/// Modify base attribute of the feature.
FEATURESAPI_EXPORT
}
//==================================================================================================
-void FeaturesAPI_Pipe::setByBasePathBiNormal(const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& thePath,
- const ModelHighAPI_Selection& theBiNoramal)
+void FeaturesAPI_Pipe::setByBasePathBiNormal(
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& thePath,
+ const ModelHighAPI_Selection& theBiNoramal)
{
fillAttribute(FeaturesPlugin_Pipe::CREATION_METHOD_BINORMAL(), mycreationMethod);
fillAttribute(theBaseObjects, mybaseObjects);
}
//==================================================================================================
-void FeaturesAPI_Pipe::setByBasePathLocations(const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& thePath,
- const std::list<ModelHighAPI_Selection>& theLocations)
+void FeaturesAPI_Pipe::setByBasePathLocations(
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& thePath,
+ const std::list<ModelHighAPI_Selection>& theLocations)
{
fillAttribute(FeaturesPlugin_Pipe::CREATION_METHOD_LOCATIONS(), mycreationMethod);
fillAttribute(theBaseObjects, mybaseObjects);
FeaturePtr aBase = feature();
const std::string& aDocName = theDumper.name(aBase->document());
- AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Pipe::BASE_OBJECTS_ID());
+ AttributeSelectionListPtr anAttrObjects =
+ aBase->selectionList(FeaturesPlugin_Pipe::BASE_OBJECTS_ID());
AttributeSelectionPtr anAttrPath = aBase->selection(FeaturesPlugin_Pipe::PATH_OBJECT_ID());
theDumper << aBase << " = model.addPipe(" << aDocName << ", "
theDumper << ", " << anAttrBiNormal;
} else if(aCreationMethod == FeaturesPlugin_Pipe::CREATION_METHOD_LOCATIONS()) {
- AttributeSelectionListPtr anAttrLocations = aBase->selectionList(FeaturesPlugin_Pipe::LOCATIONS_ID());
+ AttributeSelectionListPtr anAttrLocations =
+ aBase->selectionList(FeaturesPlugin_Pipe::LOCATIONS_ID());
theDumper << ", " << anAttrLocations;
}
virtual ~FeaturesAPI_Pipe();
INTERFACE_5(FeaturesPlugin_Pipe::ID(),
- baseObjects, FeaturesPlugin_Pipe::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
- path, FeaturesPlugin_Pipe::PATH_OBJECT_ID(), ModelAPI_AttributeSelection, /** Path */,
- creationMethod, FeaturesPlugin_Pipe::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
- biNormal, FeaturesPlugin_Pipe::BINORMAL_ID(), ModelAPI_AttributeSelection, /** Bi-Normal */,
- locations, FeaturesPlugin_Pipe::LOCATIONS_ID(), ModelAPI_AttributeSelectionList, /** Locations */)
+ baseObjects, FeaturesPlugin_Pipe::BASE_OBJECTS_ID(),
+ ModelAPI_AttributeSelectionList, /** Base objects */,
+ path, FeaturesPlugin_Pipe::PATH_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** Path */,
+ creationMethod, FeaturesPlugin_Pipe::CREATION_METHOD(),
+ ModelAPI_AttributeString, /** Creation method */,
+ biNormal, FeaturesPlugin_Pipe::BINORMAL_ID(),
+ ModelAPI_AttributeSelection, /** Bi-Normal */,
+ locations, FeaturesPlugin_Pipe::LOCATIONS_ID(),
+ ModelAPI_AttributeSelectionList, /** Locations */)
/// Modify base attribute of the feature.
FEATURESAPI_EXPORT
FeaturePtr aBase = feature();
const std::string& aDocName = theDumper.name(aBase->document());
- AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Placement::OBJECTS_LIST_ID());
- AttributeSelectionPtr anAttrStartShape = aBase->selection(FeaturesPlugin_Placement::START_SHAPE_ID());
+ AttributeSelectionListPtr anAttrObjects =
+ aBase->selectionList(FeaturesPlugin_Placement::OBJECTS_LIST_ID());
+ AttributeSelectionPtr anAttrStartShape =
+ aBase->selection(FeaturesPlugin_Placement::START_SHAPE_ID());
AttributeSelectionPtr anAttrEndShape = aBase->selection(FeaturesPlugin_Placement::END_SHAPE_ID());
AttributeBooleanPtr anAttrReverse = aBase->boolean(FeaturesPlugin_Placement::REVERSE_ID());
AttributeBooleanPtr anAttrCentering = aBase->boolean(FeaturesPlugin_Placement::CENTERING_ID());
virtual ~FeaturesAPI_Placement();
INTERFACE_5(FeaturesPlugin_Placement::ID(),
- objects, FeaturesPlugin_Placement::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */,
- startShape, FeaturesPlugin_Placement::START_SHAPE_ID(), ModelAPI_AttributeSelection, /** Start shape */,
- endShape, FeaturesPlugin_Placement::END_SHAPE_ID(), ModelAPI_AttributeSelection, /** End shape */,
- reverseDirection, FeaturesPlugin_Placement::REVERSE_ID(), ModelAPI_AttributeBoolean, /** Reverse direction flag */,
- centering, FeaturesPlugin_Placement::CENTERING_ID(), ModelAPI_AttributeBoolean, /** Centering flag */)
+ objects, FeaturesPlugin_Placement::OBJECTS_LIST_ID(),
+ ModelAPI_AttributeSelectionList, /** Main objects */,
+ startShape, FeaturesPlugin_Placement::START_SHAPE_ID(),
+ ModelAPI_AttributeSelection, /** Start shape */,
+ endShape, FeaturesPlugin_Placement::END_SHAPE_ID(),
+ ModelAPI_AttributeSelection, /** End shape */,
+ reverseDirection, FeaturesPlugin_Placement::REVERSE_ID(),
+ ModelAPI_AttributeBoolean, /** Reverse direction flag */,
+ centering, FeaturesPlugin_Placement::CENTERING_ID(),
+ ModelAPI_AttributeBoolean, /** Centering flag */)
/// Set objects.
FEATURESAPI_EXPORT
FeaturePtr aBase = feature();
const std::string& aDocName = theDumper.name(aBase->document());
- AttributeReferencePtr anAttrBaseFeature = aBase->reference(FeaturesPlugin_Recover::BASE_FEATURE());
- AttributeRefListPtr anAttrRecoveredEntities = aBase->reflist(FeaturesPlugin_Recover::RECOVERED_ENTITIES());
+ AttributeReferencePtr anAttrBaseFeature =
+ aBase->reference(FeaturesPlugin_Recover::BASE_FEATURE());
+ AttributeRefListPtr anAttrRecoveredEntities =
+ aBase->reflist(FeaturesPlugin_Recover::RECOVERED_ENTITIES());
AttributeBooleanPtr anAttrPersistent = aBase->boolean(FeaturesPlugin_Recover::PERSISTENT());
FeaturePtr aFeature = ModelAPI_Feature::feature(anAttrBaseFeature->value());
virtual ~FeaturesAPI_Recover();
INTERFACE_3(FeaturesPlugin_Recover::ID(),
- baseFeature, FeaturesPlugin_Recover::BASE_FEATURE(), ModelAPI_AttributeReference, /** Concealed feature */,
- recoveredList, FeaturesPlugin_Recover::RECOVERED_ENTITIES(), ModelAPI_AttributeRefList, /** Recover list*/,
- isPersistent, FeaturesPlugin_Recover::PERSISTENT(), ModelAPI_AttributeBoolean, /** Is persistent flag */)
+ baseFeature, FeaturesPlugin_Recover::BASE_FEATURE(),
+ ModelAPI_AttributeReference, /** Concealed feature */,
+ recoveredList, FeaturesPlugin_Recover::RECOVERED_ENTITIES(),
+ ModelAPI_AttributeRefList, /** Recover list*/,
+ isPersistent, FeaturesPlugin_Recover::PERSISTENT(),
+ ModelAPI_AttributeBoolean, /** Is persistent flag */)
/// Set base feature.
FEATURESAPI_EXPORT
#include <ModelHighAPI_Tools.h>
//==================================================================================================
-FeaturesAPI_RemoveSubShapes::FeaturesAPI_RemoveSubShapes(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+FeaturesAPI_RemoveSubShapes::FeaturesAPI_RemoveSubShapes(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature)
: ModelHighAPI_Interface(theFeature)
{
initialize();
}
//==================================================================================================
-FeaturesAPI_RemoveSubShapes::FeaturesAPI_RemoveSubShapes(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const ModelHighAPI_Selection& theBase)
+FeaturesAPI_RemoveSubShapes::FeaturesAPI_RemoveSubShapes(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const ModelHighAPI_Selection& theBase)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-void FeaturesAPI_RemoveSubShapes::setSubShapesToKeep(const std::list<ModelHighAPI_Selection>& theSubShapes)
+void FeaturesAPI_RemoveSubShapes::setSubShapesToKeep(
+ const std::list<ModelHighAPI_Selection>& theSubShapes)
{
fillAttribute(theSubShapes, mysubshapes);
FeaturePtr aBase = feature();
const std::string& aDocName = theDumper.name(aBase->document());
- AttributeSelectionPtr anAttrBaseShape = aBase->selection(FeaturesPlugin_RemoveSubShapes::BASE_SHAPE_ID());
- AttributeSelectionListPtr anAttrSubShapes = aBase->selectionList(FeaturesPlugin_RemoveSubShapes::SUBSHAPES_ID());
+ AttributeSelectionPtr anAttrBaseShape =
+ aBase->selection(FeaturesPlugin_RemoveSubShapes::BASE_SHAPE_ID());
+ AttributeSelectionListPtr anAttrSubShapes =
+ aBase->selectionList(FeaturesPlugin_RemoveSubShapes::SUBSHAPES_ID());
- theDumper << aBase << " = model.addRemoveSubShapes(" << aDocName << ", " << anAttrBaseShape << ")" << std::endl;
+ theDumper << aBase << " = model.addRemoveSubShapes(" << aDocName <<
+ ", " << anAttrBaseShape << ")" << std::endl;
theDumper << aBase << ".setSubShapesToKeep(" << anAttrSubShapes << ")" << std::endl;
}
RemoveSubShapesPtr addRemoveSubShapes(const std::shared_ptr<ModelAPI_Document>& thePart,
const ModelHighAPI_Selection& theBase)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_RemoveSubShapes::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesAPI_RemoveSubShapes::ID());
return RemoveSubShapesPtr(new FeaturesAPI_RemoveSubShapes(aFeature, theBase));
}
virtual ~FeaturesAPI_RemoveSubShapes();
INTERFACE_2(FeaturesPlugin_RemoveSubShapes::ID(),
- base, FeaturesPlugin_RemoveSubShapes::BASE_SHAPE_ID(), ModelAPI_AttributeSelection, /** Base */,
- subshapes, FeaturesPlugin_RemoveSubShapes::SUBSHAPES_ID(), ModelAPI_AttributeSelectionList, /** Subshapes */)
+ base, FeaturesPlugin_RemoveSubShapes::BASE_SHAPE_ID(),
+ ModelAPI_AttributeSelection, /** Base */,
+ subshapes, FeaturesPlugin_RemoveSubShapes::SUBSHAPES_ID(),
+ ModelAPI_AttributeSelectionList, /** Subshapes */)
/// Modify objects attribute of the feature.
FEATURESAPI_EXPORT
}
//==================================================================================================
-FeaturesAPI_Revolution::FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theAxis,
- const ModelHighAPI_Double& theAngle)
+FeaturesAPI_Revolution::FeaturesAPI_Revolution(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theAxis,
+ const ModelHighAPI_Double& theAngle)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_Revolution::FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theAxis,
- const ModelHighAPI_Double& theToAngle,
- const ModelHighAPI_Double& theFromAngle)
+FeaturesAPI_Revolution::FeaturesAPI_Revolution(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theAxis,
+ const ModelHighAPI_Double& theToAngle,
+ const ModelHighAPI_Double& theFromAngle)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_Revolution::FeaturesAPI_Revolution(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theAxis,
- const ModelHighAPI_Selection& theToObject,
- const ModelHighAPI_Double& theToOffset,
- const ModelHighAPI_Selection& theFromObject,
- const ModelHighAPI_Double& theFromOffset)
+FeaturesAPI_Revolution::FeaturesAPI_Revolution(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theAxis,
+ const ModelHighAPI_Selection& theToObject,
+ const ModelHighAPI_Double& theToOffset,
+ const ModelHighAPI_Selection& theFromObject,
+ const ModelHighAPI_Double& theFromOffset)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
const std::string& aDocName = theDumper.name(aBase->document());
AttributeReferencePtr anAttrSketch = aBase->reference(FeaturesPlugin_Revolution::SKETCH_ID());
- AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Revolution::BASE_OBJECTS_ID());
+ AttributeSelectionListPtr anAttrObjects =
+ aBase->selectionList(FeaturesPlugin_Revolution::BASE_OBJECTS_ID());
AttributeSelectionPtr anAttrAxis = aBase->selection(FeaturesPlugin_Revolution::AXIS_OBJECT_ID());
theDumper << aBase << " = model.addRevolution(" << aDocName << ", ";
anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects;
theDumper << ", " << anAttrAxis;
- std::string aCreationMethod = aBase->string(FeaturesPlugin_Revolution::CREATION_METHOD())->value();
+ std::string aCreationMethod =
+ aBase->string(FeaturesPlugin_Revolution::CREATION_METHOD())->value();
if(aCreationMethod == FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES()) {
AttributeDoublePtr anAttrToAngle = aBase->real(FeaturesPlugin_Revolution::TO_ANGLE_ID());
theDumper << ", " << anAttrToAngle << ", " << anAttrFromAngle;
} else if(aCreationMethod == FeaturesPlugin_Revolution::CREATION_METHOD_BY_PLANES()) {
- AttributeSelectionPtr anAttrToObject = aBase->selection(FeaturesPlugin_Revolution::TO_OBJECT_ID());
+ AttributeSelectionPtr anAttrToObject =
+ aBase->selection(FeaturesPlugin_Revolution::TO_OBJECT_ID());
AttributeDoublePtr anAttrToOffset = aBase->real(FeaturesPlugin_Revolution::TO_OFFSET_ID());
- AttributeSelectionPtr anAttrFromObject = aBase->selection(FeaturesPlugin_Revolution::FROM_OBJECT_ID());
+ AttributeSelectionPtr anAttrFromObject =
+ aBase->selection(FeaturesPlugin_Revolution::FROM_OBJECT_ID());
AttributeDoublePtr anAttrFromOffset = aBase->real(FeaturesPlugin_Revolution::FROM_OFFSET_ID());
- theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << ", " << anAttrFromObject << ", " << anAttrFromOffset;
+ theDumper << ", " << anAttrToObject << ", " << anAttrToOffset <<
+ ", " << anAttrFromObject << ", " << anAttrFromOffset;
}
theDumper << ")" << std::endl;
virtual ~FeaturesAPI_Revolution();
INTERFACE_10(FeaturesPlugin_Revolution::ID(),
- sketch, FeaturesPlugin_Revolution::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */,
- baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
- axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis */,
- creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
- toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(), ModelAPI_AttributeDouble, /** To angle */,
- fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(), ModelAPI_AttributeDouble, /** From angle */,
- toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
- toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
- fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
- fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */)
+ sketch, FeaturesPlugin_Revolution::SKETCH_ID(),
+ ModelAPI_AttributeReference, /** Sketch launcher */,
+ baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(),
+ ModelAPI_AttributeSelectionList, /** Base objects */,
+ axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** Axis */,
+ creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(),
+ ModelAPI_AttributeString, /** Creation method */,
+ toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(),
+ ModelAPI_AttributeDouble, /** To angle */,
+ fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(),
+ ModelAPI_AttributeDouble, /** From angle */,
+ toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** To object */,
+ toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(),
+ ModelAPI_AttributeDouble, /** To offset */,
+ fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** From object */,
+ fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(),
+ ModelAPI_AttributeDouble, /** From offset */)
/// Modify base attribute of the feature.
FEATURESAPI_EXPORT
/// Modify CreationMethod, to_angle, from_angle attributes of the feature.
FEATURESAPI_EXPORT
- void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle);
+ void setAngles(const ModelHighAPI_Double& theToAngle,
+ const ModelHighAPI_Double& theFromAngle);
/// Modify CreationMethod, to_angle, from_angle attributes of the feature.
FEATURESAPI_EXPORT
void setAngle(const ModelHighAPI_Double& theAngle);
- /// Modify CreationMethod, to_object, to_offset, from_object, from_offset attributes of the feature.
+ /// Modify CreationMethod, to_object, to_offset,
+ /// from_object, from_offset attributes of the feature.
FEATURESAPI_EXPORT
void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
const ModelHighAPI_Double& theToOffset,
#include <ModelHighAPI_Tools.h>
//==================================================================================================
-FeaturesAPI_RevolutionBoolean::FeaturesAPI_RevolutionBoolean(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+FeaturesAPI_RevolutionBoolean::FeaturesAPI_RevolutionBoolean(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature)
: ModelHighAPI_Interface(theFeature)
{
}
//==================================================================================================
void FeaturesAPI_RevolutionBoolean::setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
const ModelHighAPI_Double& theToOffset,
- const ModelHighAPI_Selection& theFromObject,
+ const ModelHighAPI_Selection& theFromObject,
const ModelHighAPI_Double& theFromOffset)
{
fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_PLANES(), mycreationMethod);
}
//==================================================================================================
-void FeaturesAPI_RevolutionBoolean::setBooleanObjects(const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+void FeaturesAPI_RevolutionBoolean::setBooleanObjects(
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
fillAttribute(theBooleanObjects, mybooleanObjects);
FeaturePtr aBase = feature();
const std::string& aDocName = theDumper.name(aBase->document());
- AttributeReferencePtr anAttrSketch = aBase->reference(FeaturesPlugin_Revolution::SKETCH_ID());
- AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Revolution::BASE_OBJECTS_ID());
- AttributeSelectionPtr anAttrAxis = aBase->selection(FeaturesPlugin_Revolution::AXIS_OBJECT_ID());
+ AttributeReferencePtr anAttrSketch =
+ aBase->reference(FeaturesPlugin_Revolution::SKETCH_ID());
+ AttributeSelectionListPtr anAttrObjects =
+ aBase->selectionList(FeaturesPlugin_Revolution::BASE_OBJECTS_ID());
+ AttributeSelectionPtr anAttrAxis =
+ aBase->selection(FeaturesPlugin_Revolution::AXIS_OBJECT_ID());
theDumper << aBase << " = model.addRevolution";
if(aBase->getKind() == FeaturesPlugin_RevolutionCut::ID()) {
anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects;
theDumper << ", " << anAttrAxis;
- std::string aCreationMethod = aBase->string(FeaturesPlugin_Revolution::CREATION_METHOD())->value();
+ std::string aCreationMethod =
+ aBase->string(FeaturesPlugin_Revolution::CREATION_METHOD())->value();
if(aCreationMethod == FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES()) {
AttributeDoublePtr anAttrToAngle = aBase->real(FeaturesPlugin_Revolution::TO_ANGLE_ID());
theDumper << ", " << anAttrToAngle << ", " << anAttrFromAngle;
} else if(aCreationMethod == FeaturesPlugin_Revolution::CREATION_METHOD_BY_PLANES()) {
- AttributeSelectionPtr anAttrToObject = aBase->selection(FeaturesPlugin_Revolution::TO_OBJECT_ID());
- AttributeDoublePtr anAttrToOffset = aBase->real(FeaturesPlugin_Revolution::TO_OFFSET_ID());
- AttributeSelectionPtr anAttrFromObject = aBase->selection(FeaturesPlugin_Revolution::FROM_OBJECT_ID());
- AttributeDoublePtr anAttrFromOffset = aBase->real(FeaturesPlugin_Revolution::FROM_OFFSET_ID());
-
- theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << ", " << anAttrFromObject << ", " << anAttrFromOffset;
+ AttributeSelectionPtr anAttrToObject =
+ aBase->selection(FeaturesPlugin_Revolution::TO_OBJECT_ID());
+ AttributeDoublePtr anAttrToOffset =
+ aBase->real(FeaturesPlugin_Revolution::TO_OFFSET_ID());
+ AttributeSelectionPtr anAttrFromObject =
+ aBase->selection(FeaturesPlugin_Revolution::FROM_OBJECT_ID());
+ AttributeDoublePtr anAttrFromOffset =
+ aBase->real(FeaturesPlugin_Revolution::FROM_OFFSET_ID());
+
+ theDumper << ", " << anAttrToObject << ", " << anAttrToOffset <<
+ ", " << anAttrFromObject << ", " << anAttrFromOffset;
}
- AttributeSelectionListPtr anAttrBoolObjects = aBase->selectionList(FeaturesPlugin_CompositeBoolean::OBJECTS_ID());
+ AttributeSelectionListPtr anAttrBoolObjects =
+ aBase->selectionList(FeaturesPlugin_CompositeBoolean::OBJECTS_ID());
theDumper << ", " << anAttrBoolObjects << ")" << std::endl;
if(anAttrSketch->isInitialized()) {
}
//==================================================================================================
-FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature)
: FeaturesAPI_RevolutionBoolean(theFeature)
{
initialize();
}
//==================================================================================================
-FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theAxis,
- const ModelHighAPI_Double& theSize,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theAxis,
+ const ModelHighAPI_Double& theSize,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_RevolutionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theAxis,
- const ModelHighAPI_Double& theToAngle,
- const ModelHighAPI_Double& theFromAngle,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theAxis,
+ const ModelHighAPI_Double& theToAngle,
+ const ModelHighAPI_Double& theFromAngle,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_RevolutionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theAxis,
- const ModelHighAPI_Selection& theToObject,
- const ModelHighAPI_Double& theToOffset,
- const ModelHighAPI_Selection& theFromObject,
- const ModelHighAPI_Double& theFromOffset,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theAxis,
+ const ModelHighAPI_Selection& theToObject,
+ const ModelHighAPI_Double& theToOffset,
+ const ModelHighAPI_Selection& theFromObject,
+ const ModelHighAPI_Double& theFromOffset,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_RevolutionBoolean(theFeature)
{
if(initialize()) {
const ModelHighAPI_Double& theSize,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID());
- return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, theAxis, theSize, theBooleanObjects));
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_RevolutionCut::ID());
+ return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects,
+ theAxis, theSize, theBooleanObjects));
}
//==================================================================================================
const ModelHighAPI_Double& theFromAngle,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_RevolutionCut::ID());
return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature,
theBaseObjects,
theAxis,
const ModelHighAPI_Double& theFromOffset,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_RevolutionCut::ID());
return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature,
theBaseObjects,
theAxis,
//==================================================================================================
-FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature)
: FeaturesAPI_RevolutionBoolean(theFeature)
{
initialize();
}
//==================================================================================================
-FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theAxis,
- const ModelHighAPI_Double& theSize,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theAxis,
+ const ModelHighAPI_Double& theSize,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_RevolutionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theAxis,
- const ModelHighAPI_Double& theToAngle,
- const ModelHighAPI_Double& theFromAngle,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theAxis,
+ const ModelHighAPI_Double& theToAngle,
+ const ModelHighAPI_Double& theFromAngle,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_RevolutionBoolean(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theBaseObjects,
- const ModelHighAPI_Selection& theAxis,
- const ModelHighAPI_Selection& theToObject,
- const ModelHighAPI_Double& theToOffset,
- const ModelHighAPI_Selection& theFromObject,
- const ModelHighAPI_Double& theFromOffset,
- const std::list<ModelHighAPI_Selection>& theBooleanObjects)
+FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theBaseObjects,
+ const ModelHighAPI_Selection& theAxis,
+ const ModelHighAPI_Selection& theToObject,
+ const ModelHighAPI_Double& theToOffset,
+ const ModelHighAPI_Selection& theFromObject,
+ const ModelHighAPI_Double& theFromOffset,
+ const std::list<ModelHighAPI_Selection>& theBooleanObjects)
: FeaturesAPI_RevolutionBoolean(theFeature)
{
if(initialize()) {
const ModelHighAPI_Double& theSize,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID());
- return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, theAxis, theSize, theBooleanObjects));
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID());
+ return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects,
+ theAxis, theSize, theBooleanObjects));
}
//==================================================================================================
const ModelHighAPI_Double& theFromAngle,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID());
return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature,
theBaseObjects,
theAxis,
const ModelHighAPI_Double& theFromOffset,
const std::list<ModelHighAPI_Selection>& theBooleanObjects)
{
- std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID());
+ std::shared_ptr<ModelAPI_Feature> aFeature =
+ thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID());
return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature,
theBaseObjects,
theAxis,
virtual ~FeaturesAPI_RevolutionBoolean();
INTERFACE_11("",
- sketch, FeaturesPlugin_Revolution::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */,
- baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */,
- axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis */,
- creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
- toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(), ModelAPI_AttributeDouble, /** To angle */,
- fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(), ModelAPI_AttributeDouble, /** From angle */,
- toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */,
- toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */,
- fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */,
- fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */,
- booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Boolean objects */)
+ sketch, FeaturesPlugin_Revolution::SKETCH_ID(),
+ ModelAPI_AttributeReference, /** Sketch launcher */,
+ baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(),
+ ModelAPI_AttributeSelectionList, /** Base objects */,
+ axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** Axis */,
+ creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(),
+ ModelAPI_AttributeString, /** Creation method */,
+ toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(),
+ ModelAPI_AttributeDouble, /** To angle */,
+ fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(),
+ ModelAPI_AttributeDouble, /** From angle */,
+ toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** To object */,
+ toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(),
+ ModelAPI_AttributeDouble, /** To offset */,
+ fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** From object */,
+ fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(),
+ ModelAPI_AttributeDouble, /** From offset */,
+ booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(),
+ ModelAPI_AttributeSelectionList, /** Boolean objects */)
/// Modify base attribute of the feature.
FEATURESAPI_EXPORT
FEATURESAPI_EXPORT
void setAngle(const ModelHighAPI_Double& theAngle);
- /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature.
+ /// Modify creation_method, to_object, to_offset, from_object,
+ /// from_offset attributes of the feature.
FEATURESAPI_EXPORT
void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject,
const ModelHighAPI_Double& theToOffset,
FeaturePtr aBase = feature();
const std::string& aDocName = theDumper.name(aBase->document());
- AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Rotation::OBJECTS_LIST_ID());
+ AttributeSelectionListPtr anAttrObjects =
+ aBase->selectionList(FeaturesPlugin_Rotation::OBJECTS_LIST_ID());
AttributeSelectionPtr anAttrAxis = aBase->selection(FeaturesPlugin_Rotation::AXIS_OBJECT_ID());
AttributeDoublePtr anAttrAngle = aBase->real(FeaturesPlugin_Rotation::ANGLE_ID());
virtual ~FeaturesAPI_Rotation();
INTERFACE_3(FeaturesPlugin_Rotation::ID(),
- mainObjects, FeaturesPlugin_Rotation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */,
- axisObject, FeaturesPlugin_Rotation::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis object */,
- angle, FeaturesPlugin_Rotation::ANGLE_ID(), ModelAPI_AttributeDouble, /** Angle */)
+ mainObjects, FeaturesPlugin_Rotation::OBJECTS_LIST_ID(),
+ ModelAPI_AttributeSelectionList, /** Main objects */,
+ axisObject, FeaturesPlugin_Rotation::AXIS_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** Axis object */,
+ angle, FeaturesPlugin_Rotation::ANGLE_ID(),
+ ModelAPI_AttributeDouble, /** Angle */)
/// Set main objects.
FEATURESAPI_EXPORT
#include <ModelHighAPI_Tools.h>
//==================================================================================================
-FeaturesAPI_Translation::FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature)
+FeaturesAPI_Translation::FeaturesAPI_Translation(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature)
: ModelHighAPI_Interface(theFeature)
{
initialize();
}
//==================================================================================================
-FeaturesAPI_Translation::FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<ModelHighAPI_Selection>& theMainObjects,
- const ModelHighAPI_Selection& theAxisObject,
- const ModelHighAPI_Double& theDistance)
+FeaturesAPI_Translation::FeaturesAPI_Translation(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<ModelHighAPI_Selection>& theMainObjects,
+ const ModelHighAPI_Selection& theAxisObject,
+ const ModelHighAPI_Double& theDistance)
: ModelHighAPI_Interface(theFeature)
{
if(initialize()) {
}
//==================================================================================================
-void FeaturesAPI_Translation::setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects)
+void FeaturesAPI_Translation::setMainObjects(
+ const std::list<ModelHighAPI_Selection>& theMainObjects)
{
fillAttribute(theMainObjects, mymainObjects);
FeaturePtr aBase = feature();
const std::string& aDocName = theDumper.name(aBase->document());
- AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Translation::OBJECTS_LIST_ID());
- AttributeSelectionPtr anAttrAxis = aBase->selection(FeaturesPlugin_Translation::AXIS_OBJECT_ID());
+ AttributeSelectionListPtr anAttrObjects =
+ aBase->selectionList(FeaturesPlugin_Translation::OBJECTS_LIST_ID());
+ AttributeSelectionPtr anAttrAxis =
+ aBase->selection(FeaturesPlugin_Translation::AXIS_OBJECT_ID());
AttributeDoublePtr anAttrDistance = aBase->real(FeaturesPlugin_Translation::DISTANCE_ID());
theDumper << aBase << " = model.addTranslation(" << aDocName << ", "
const ModelHighAPI_Double& theDistance)
{
std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Translation::ID());
- return TranslationPtr(new FeaturesAPI_Translation(aFeature, theMainObjects, theAxisObject, theDistance));
+ return TranslationPtr(new FeaturesAPI_Translation(aFeature, theMainObjects,
+ theAxisObject, theDistance));
}
virtual ~FeaturesAPI_Translation();
INTERFACE_3(FeaturesPlugin_Translation::ID(),
- mainObjects, FeaturesPlugin_Translation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */,
- axisObject, FeaturesPlugin_Translation::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis object */,
- distance, FeaturesPlugin_Translation::DISTANCE_ID(), ModelAPI_AttributeDouble, /** Distance */)
+ mainObjects, FeaturesPlugin_Translation::OBJECTS_LIST_ID(),
+ ModelAPI_AttributeSelectionList, /** Main objects */,
+ axisObject, FeaturesPlugin_Translation::AXIS_OBJECT_ID(),
+ ModelAPI_AttributeSelection, /** Axis object */,
+ distance, FeaturesPlugin_Translation::DISTANCE_ID(),
+ ModelAPI_AttributeDouble, /** Distance */)
/// Set main objects.
FEATURESAPI_EXPORT
#include <ModelHighAPI_Dumper.h>
#include <ModelHighAPI_Tools.h>
-//==================================================================================================
+//================================================================================================
FeaturesAPI_Union::FeaturesAPI_Union(const std::shared_ptr<ModelAPI_Feature>& theFeature)
: ModelHighAPI_Interface(theFeature)
{
initialize();
}
-//==================================================================================================
+//================================================================================================
FeaturesAPI_Union::FeaturesAPI_Union(const std::shared_ptr<ModelAPI_Feature>& theFeature,
const std::list<ModelHighAPI_Selection>& theBaseObjects)
: ModelHighAPI_Interface(theFeature)
}
}
-//==================================================================================================
+//================================================================================================
FeaturesAPI_Union::~FeaturesAPI_Union()
{
FeaturePtr aBase = feature();
const std::string& aDocName = theDumper.name(aBase->document());
- AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID());
+ AttributeSelectionListPtr anAttrObjects =
+ aBase->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID());
- theDumper << aBase << " = model.addUnion(" << aDocName << ", " << anAttrObjects << ")" << std::endl;
+ theDumper << aBase << " = model.addUnion(" << aDocName <<
+ ", " << anAttrObjects << ")" << std::endl;
}
//==================================================================================================
virtual ~FeaturesAPI_Union();
INTERFACE_1(FeaturesPlugin_Union::ID(),
- baseObjects, FeaturesPlugin_Union::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */)
+ baseObjects, FeaturesPlugin_Union::BASE_OBJECTS_ID(),
+ ModelAPI_AttributeSelectionList, /** Base objects */)
/// Modify base attribute of the feature.
FEATURESAPI_EXPORT
std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape> aCompSolidsObjects;
// Getting objects.
- AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID());
+ AttributeSelectionListPtr anObjectsSelList =
+ selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID());
for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
AttributeSelectionPtr anObjectAttr = anObjectsSelList->value(anObjectsIndex);
std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
if(aResCompSolidPtr.get()) {
std::shared_ptr<GeomAPI_Shape> aContextShape = aResCompSolidPtr->shape();
- std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator anIt = aCompSolidsObjects.begin();
+ std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
+ anIt = aCompSolidsObjects.begin();
for(; anIt != aCompSolidsObjects.end(); anIt++) {
if(anIt->first->isEqual(aContextShape)) {
aCompSolidsObjects[anIt->first].push_back(anObject);
}
// For solids cut each object with all tools.
- for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) {
+ for(ListOfShape::iterator
+ anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) {
std::shared_ptr<GeomAPI_Shape> anObject = *anObjectsIt;
ListOfShape aListWithObject;
aListWithObject.push_back(anObject);
switch(aType) {
case BOOL_CUT: {
- aBoolAlgo = GeomAlgoAPI_Boolean(aListWithObject, aTools, GeomAlgoAPI_Boolean::BOOL_CUT);
+ aBoolAlgo =
+ GeomAlgoAPI_Boolean(aListWithObject, aTools, GeomAlgoAPI_Boolean::BOOL_CUT);
aResShape = aBoolAlgo.shape();
break;
}
case BOOL_COMMON: {
- aBoolAlgo = GeomAlgoAPI_Boolean(aListWithObject, aTools, GeomAlgoAPI_Boolean::BOOL_COMMON);
+ aBoolAlgo =
+ GeomAlgoAPI_Boolean(aListWithObject, aTools, GeomAlgoAPI_Boolean::BOOL_COMMON);
aResShape = aBoolAlgo.shape();
break;
}
}
if(GeomAlgoAPI_ShapeTools::volume(aResShape) > 1.e-27) {
- std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
- loadNamingDS(aResultBody, anObject, aTools, aResShape, aBoolAlgo, *aBoolAlgo.mapOfSubShapes().get());
+ std::shared_ptr<ModelAPI_ResultBody> aResultBody =
+ document()->createBody(data(), aResultIndex);
+ loadNamingDS(aResultBody, anObject, aTools, aResShape,
+ aBoolAlgo, *aBoolAlgo.mapOfSubShapes().get());
setResult(aResultBody, aResultIndex);
aResultIndex++;
}
}
// Compsolids handling
- for(std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator anIt = aCompSolidsObjects.begin();
- anIt != aCompSolidsObjects.end(); anIt++) {
+ for(std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
+ anIt = aCompSolidsObjects.begin();
+ anIt != aCompSolidsObjects.end(); anIt++) {
std::shared_ptr<GeomAPI_Shape> aCompSolid = anIt->first;
ListOfShape& aUsedInOperationSolids = anIt->second;
// Collecting solids from compsolids which will not be modified in boolean operation.
ListOfShape aNotUsedSolids;
- for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
+ for(GeomAPI_ShapeExplorer
+ anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
std::shared_ptr<GeomAPI_Shape> aSolidInCompSolid = anExp.current();
ListOfShape::iterator anIt = aUsedInOperationSolids.begin();
for(; anIt != aUsedInOperationSolids.end(); anIt++) {
// Add result to not used solids from compsolid.
ListOfShape aShapesToAdd = aNotUsedSolids;
aShapesToAdd.push_back(aBoolAlgo->shape());
- std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
+ std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
+ new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
if(!aFillerAlgo->isDone()) {
std::string aFeatureError = "Error: PaveFiller algorithm failed.";
setError(aFeatureError);
aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes());
if(GeomAlgoAPI_ShapeTools::volume(aFillerAlgo->shape()) > 1.e-27) {
- std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
- loadNamingDS(aResultBody, aCompSolid, aTools, aFillerAlgo->shape(), aMakeShapeList, aMapOfShapes);
+ std::shared_ptr<ModelAPI_ResultBody> aResultBody =
+ document()->createBody(data(), aResultIndex);
+ loadNamingDS(aResultBody, aCompSolid, aTools,
+ aFillerAlgo->shape(), aMakeShapeList, aMapOfShapes);
setResult(aResultBody, aResultIndex);
aResultIndex++;
}
break;
}
case BOOL_FUSE: {
- if((anObjects.size() + aTools.size() + aCompSolidsObjects.size() + anEdgesAndFaces.size()) < 2) {
+ if((anObjects.size() + aTools.size() +
+ aCompSolidsObjects.size() + anEdgesAndFaces.size()) < 2) {
std::string aFeatureError = "Error: Not enough objects for boolean operation.";
setError(aFeatureError);
return;
aSolidsToFuse.insert(aSolidsToFuse.end(), anObjects.begin(), anObjects.end());
aSolidsToFuse.insert(aSolidsToFuse.end(), aTools.begin(), aTools.end());
- // Collecting solids from compsolids which will not be modified in boolean operation and will be added to result.
+ // Collecting solids from compsolids which will not be modified
+ // in boolean operation and will be added to result.
ListOfShape aShapesToAdd;
- for(std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator anIt = aCompSolidsObjects.begin();
- anIt != aCompSolidsObjects.end(); anIt++) {
+ for(std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
+ anIt = aCompSolidsObjects.begin();
+ anIt != aCompSolidsObjects.end(); anIt++) {
std::shared_ptr<GeomAPI_Shape> aCompSolid = anIt->first;
ListOfShape& aUsedInOperationSolids = anIt->second;
- aSolidsToFuse.insert(aSolidsToFuse.end(), aUsedInOperationSolids.begin(), aUsedInOperationSolids.end());
+ aSolidsToFuse.insert(aSolidsToFuse.end(), aUsedInOperationSolids.begin(),
+ aUsedInOperationSolids.end());
// Collect solids from compsolid which will not be modified in boolean operation.
- for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
+ for(GeomAPI_ShapeExplorer
+ anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
std::shared_ptr<GeomAPI_Shape> aSolidInCompSolid = anExp.current();
ListOfShape::iterator anIt = aUsedInOperationSolids.begin();
for(; anIt != aUsedInOperationSolids.end(); anIt++) {
GeomAPI_DataMapOfShapeShape aMapOfShapes;
std::shared_ptr<GeomAPI_Shape> aCuttedEdgesAndFaces;
if(!anEdgesAndFaces.empty()) {
- std::shared_ptr<GeomAlgoAPI_Boolean> aCutAlgo(new GeomAlgoAPI_Boolean(anEdgesAndFaces, anOriginalShapes, GeomAlgoAPI_Boolean::BOOL_CUT));
+ std::shared_ptr<GeomAlgoAPI_Boolean> aCutAlgo(new GeomAlgoAPI_Boolean(anEdgesAndFaces,
+ anOriginalShapes, GeomAlgoAPI_Boolean::BOOL_CUT));
if(aCutAlgo->isDone()) {
aCuttedEdgesAndFaces = aCutAlgo->shape();
aMakeShapeList.appendAlgo(aCutAlgo);
aMapOfShapes.merge(aCutAlgo->mapOfSubShapes());
}
}
- anOriginalShapes.insert(anOriginalShapes.end(), anEdgesAndFaces.begin(), anEdgesAndFaces.end());
+ anOriginalShapes.insert(anOriginalShapes.end(), anEdgesAndFaces.begin(),
+ anEdgesAndFaces.end());
// If we have compsolids then cut with not used solids all others.
if(!aShapesToAdd.empty()) {
aSolidsToFuse.clear();
- for(ListOfShape::iterator anIt = anOriginalShapes.begin(); anIt != anOriginalShapes.end(); anIt++) {
+ for(ListOfShape::iterator
+ anIt = anOriginalShapes.begin(); anIt != anOriginalShapes.end(); anIt++) {
ListOfShape aOneObjectList;
aOneObjectList.push_back(*anIt);
- std::shared_ptr<GeomAlgoAPI_Boolean> aCutAlgo(new GeomAlgoAPI_Boolean(aOneObjectList, aShapesToAdd, GeomAlgoAPI_Boolean::BOOL_CUT));
+ std::shared_ptr<GeomAlgoAPI_Boolean> aCutAlgo(
+ new GeomAlgoAPI_Boolean(aOneObjectList, aShapesToAdd, GeomAlgoAPI_Boolean::BOOL_CUT));
if(GeomAlgoAPI_ShapeTools::volume(aCutAlgo->shape()) > 1.e-27) {
aSolidsToFuse.push_back(aCutAlgo->shape());
aShape = aTools.front();
} else if((anObjects.size() + aTools.size()) > 1){
std::shared_ptr<GeomAlgoAPI_Boolean> aFuseAlgo(new GeomAlgoAPI_Boolean(anObjects,
- aTools,
- GeomAlgoAPI_Boolean::BOOL_FUSE));
+ aTools,
+ GeomAlgoAPI_Boolean::BOOL_FUSE));
// Checking that the algorithm worked properly.
if(!aFuseAlgo->isDone()) {
if(aShape.get()) {
aShapesToAdd.push_back(aShape);
}
- std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
+ std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
+ new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
if(!aFillerAlgo->isDone()) {
std::string aFeatureError = "Error: PaveFiller algorithm failed.";
setError(aFeatureError);
std::shared_ptr<GeomAPI_Shape> aBackShape = anOriginalShapes.back();
anOriginalShapes.pop_back();
- std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
- loadNamingDS(aResultBody, aBackShape, anOriginalShapes, aShape, aMakeShapeList, aMapOfShapes);
+ std::shared_ptr<ModelAPI_ResultBody> aResultBody =
+ document()->createBody(data(), aResultIndex);
+ loadNamingDS(aResultBody, aBackShape, anOriginalShapes,
+ aShape, aMakeShapeList, aMapOfShapes);
setResult(aResultBody, aResultIndex);
aResultIndex++;
break;
ListOfShape aShapesToSmash;
aShapesToSmash.insert(aShapesToSmash.end(), anObjects.begin(), anObjects.end());
- // Collecting solids from compsolids which will not be modified in boolean operation and will be added to result.
+ // Collecting solids from compsolids which will not be modified in
+ // boolean operation and will be added to result.
ListOfShape aShapesToAdd;
- for(std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator anIt = aCompSolidsObjects.begin();
+ for(std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
+ anIt = aCompSolidsObjects.begin();
anIt != aCompSolidsObjects.end(); anIt++) {
std::shared_ptr<GeomAPI_Shape> aCompSolid = anIt->first;
ListOfShape& aUsedInOperationSolids = anIt->second;
anOriginalShapes.push_back(aCompSolid);
- aShapesToSmash.insert(aShapesToSmash.end(), aUsedInOperationSolids.begin(), aUsedInOperationSolids.end());
+ aShapesToSmash.insert(aShapesToSmash.end(), aUsedInOperationSolids.begin(),
+ aUsedInOperationSolids.end());
// Collect solids from compsolid which will not be modified in boolean operation.
- for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
+ for(GeomAPI_ShapeExplorer
+ anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
std::shared_ptr<GeomAPI_Shape> aSolidInCompSolid = anExp.current();
ListOfShape::iterator anIt = aUsedInOperationSolids.begin();
for(; anIt != aUsedInOperationSolids.end(); anIt++) {
GeomAPI_DataMapOfShapeShape aMapOfShapes;
if(!aShapesToAdd.empty()) {
// Cut objects with not used solids.
- std::shared_ptr<GeomAlgoAPI_Boolean> anObjectsCutAlgo(new GeomAlgoAPI_Boolean(aShapesToSmash,
- aShapesToAdd,
- GeomAlgoAPI_Boolean::BOOL_CUT));
+ std::shared_ptr<GeomAlgoAPI_Boolean> anObjectsCutAlgo(new GeomAlgoAPI_Boolean(
+ aShapesToSmash,
+ aShapesToAdd,
+ GeomAlgoAPI_Boolean::BOOL_CUT));
if(GeomAlgoAPI_ShapeTools::volume(anObjectsCutAlgo->shape()) > 1.e-27) {
aShapesToSmash.clear();
// Cut tools with not used solids.
std::shared_ptr<GeomAlgoAPI_Boolean> aToolsCutAlgo(new GeomAlgoAPI_Boolean(aTools,
- aShapesToAdd,
- GeomAlgoAPI_Boolean::BOOL_CUT));
+ aShapesToAdd,
+ GeomAlgoAPI_Boolean::BOOL_CUT));
if(GeomAlgoAPI_ShapeTools::volume(aToolsCutAlgo->shape()) > 1.e-27) {
aTools.clear();
// Cut objects with tools.
std::shared_ptr<GeomAlgoAPI_Boolean> aBoolAlgo(new GeomAlgoAPI_Boolean(aShapesToSmash,
- aTools,
- GeomAlgoAPI_Boolean::BOOL_CUT));
+ aTools,
+ GeomAlgoAPI_Boolean::BOOL_CUT));
// Checking that the algorithm worked properly.
if(!aBoolAlgo->isDone()) {
aShapesToAdd.push_back(aBoolAlgo->shape());
aShapesToAdd.insert(aShapesToAdd.end(), aTools.begin(), aTools.end());
- std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
+ std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd,
+ true));
if(!aFillerAlgo->isDone()) {
std::string aFeatureError = "Error: PaveFiller algorithm failed.";
setError(aFeatureError);
std::shared_ptr<GeomAPI_Shape> aFrontShape = anOriginalShapes.front();
anOriginalShapes.pop_front();
- std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
- loadNamingDS(aResultBody, aFrontShape, anOriginalShapes, aShape, aMakeShapeList, aMapOfShapes);
+ std::shared_ptr<ModelAPI_ResultBody> aResultBody =
+ document()->createBody(data(), aResultIndex);
+ loadNamingDS(aResultBody, aFrontShape, anOriginalShapes,
+ aShape, aMakeShapeList, aMapOfShapes);
setResult(aResultBody, aResultIndex);
aResultIndex++;
} else {
const int aModifyTag = 1;
const int aDeletedTag = 2;
- const int aSubsolidsTag = 3; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
+ /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
+ const int aSubsolidsTag = 3;
const int anEdgesAndFacesTag = 10000;
theResultBody->storeModified(theBaseShape, theResultShape, aSubsolidsTag);
theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE,
aModifyTag, aModName, theMapOfShapes);
- theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE, aDeletedTag);
+ theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape,
+ GeomAPI_Shape::FACE, aDeletedTag);
int aTag;
std::string aName;
- for(ListOfShape::const_iterator anIter = theTools.begin(); anIter != theTools.end(); anIter++) {
+ for(ListOfShape::const_iterator
+ anIter = theTools.begin(); anIter != theTools.end(); anIter++) {
if((*anIter)->shapeType() == GeomAPI_Shape::EDGE) {
aTag = anEdgesAndFacesTag;
aName = aModEName;
aTag = aModifyTag;
aName = aModName;
}
- theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, aName == aModEName ? GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE,
- aTag, aName, theMapOfShapes);
+ theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter,
+ aName == aModEName ? GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE,
+ aTag, aName, theMapOfShapes);
theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE, aDeletedTag);
}
}
// Getting tools.
ListOfShape aTools;
- for(ListOfMakeShape::const_iterator anIt = aGenMakeShapes.cbegin(); anIt != aGenMakeShapes.cend(); ++anIt) {
+ for(ListOfMakeShape::const_iterator
+ anIt = aGenMakeShapes.cbegin(); anIt != aGenMakeShapes.cend(); ++anIt) {
aTools.push_back((*anIt)->shape());
}
}
// For solids cut each object with all tools.
- for(ListOfShape::const_iterator anIt = anObjects.cbegin(); anIt != anObjects.cend(); ++anIt) {
+ for(ListOfShape::const_iterator
+ anIt = anObjects.cbegin(); anIt != anObjects.cend(); ++anIt) {
GeomShapePtr anObject = *anIt;
ListOfShape aListWithObject;
aListWithObject.push_back(anObject);
std::shared_ptr<GeomAlgoAPI_Boolean> aBoolAlgo(new GeomAlgoAPI_Boolean(aListWithObject,
- theTools,
- GeomAlgoAPI_Boolean::BOOL_CUT));
+ theTools,
+ GeomAlgoAPI_Boolean::BOOL_CUT));
// Checking that the algorithm worked properly.
if(!aBoolAlgo->isDone() || aBoolAlgo->shape()->isNull() || !aBoolAlgo->isValid()) {
// Collecting solids from compsolids which will not be modified in boolean operation.
ListOfShape aShapesToAdd;
- for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
+ for(GeomAPI_ShapeExplorer
+ anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
GeomShapePtr aSolidInCompSolid = anExp.current();
ListOfShape::const_iterator aUsedShapesIt = aUsedShapes.cbegin();
for(; aUsedShapesIt != aUsedShapes.cend(); ++aUsedShapesIt) {
}
std::shared_ptr<GeomAlgoAPI_Boolean> aBoolAlgo(new GeomAlgoAPI_Boolean(aUsedShapes,
- theTools,
- GeomAlgoAPI_Boolean::BOOL_CUT));
+ theTools,
+ GeomAlgoAPI_Boolean::BOOL_CUT));
// Checking that the algorithm worked properly.
if(!aBoolAlgo->isDone() || aBoolAlgo->shape()->isNull() || !aBoolAlgo->isValid()) {
// Add result to not used solids from compsolid.
aShapesToAdd.push_back(aBoolAlgo->shape());
- std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
+ std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
+ new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
if(!aFillerAlgo->isDone() || aFillerAlgo->shape()->isNull() || !aFillerAlgo->isValid()) {
myFeature->setError("Error: PaveFiller algorithm failed.");
return false;
}
}
- if((anObjects.size() + aTools.size() + aCompSolidsObjects.size() + anEdgesAndFaces.size()) < 2) {
+ if((anObjects.size() + aTools.size() +
+ aCompSolidsObjects.size() + anEdgesAndFaces.size()) < 2) {
myFeature->setError("Error: Not enough objects for boolean operation.");
return false;
}
aSolidsToFuse.insert(aSolidsToFuse.end(), anObjects.begin(), anObjects.end());
aSolidsToFuse.insert(aSolidsToFuse.end(), aTools.begin(), aTools.end());
- // Collecting solids from compsolids which will not be modified in boolean operation and will be added to result.
+ // Collecting solids from compsolids which will not be
+ // modified in boolean operation and will be added to result.
ListOfShape aShapesToAdd;
for(std::map<GeomShapePtr, ListOfShape>::iterator anIt = aCompSolidsObjects.begin();
anIt != aCompSolidsObjects.end(); anIt++) {
aSolidsToFuse.insert(aSolidsToFuse.end(), aUsedShapes.begin(), aUsedShapes.end());
// Collect solids from compsolid which will not be modified in boolean operation.
- for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
+ for(GeomAPI_ShapeExplorer
+ anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) {
GeomShapePtr aSolidInCompSolid = anExp.current();
ListOfShape::iterator anIt = aUsedShapes.begin();
for(; anIt != aUsedShapes.end(); anIt++) {
std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
if(!anEdgesAndFaces.empty() && !aCutTools.empty()) {
std::shared_ptr<GeomAlgoAPI_Boolean> aCutAlgo(new GeomAlgoAPI_Boolean(anEdgesAndFaces,
- aCutTools,
- GeomAlgoAPI_Boolean::BOOL_CUT));
+ aCutTools,
+ GeomAlgoAPI_Boolean::BOOL_CUT));
if(aCutAlgo->isDone() && !aCutAlgo->shape()->isNull() && aCutAlgo->isValid()) {
anEdgesAndFaces.clear();
anEdgesAndFaces.push_back(aCutAlgo->shape());
// If we have compsolids then cut with not used solids all others.
if(!aShapesToAdd.empty()) {
std::shared_ptr<GeomAlgoAPI_Boolean> aCutAlgo(new GeomAlgoAPI_Boolean(aSolidsToFuse,
- aShapesToAdd,
- GeomAlgoAPI_Boolean::BOOL_CUT));
+ aShapesToAdd,
+ GeomAlgoAPI_Boolean::BOOL_CUT));
if(aCutAlgo->isDone() && GeomAlgoAPI_ShapeTools::volume(aCutAlgo->shape()) > 1.e-27) {
aSolidsToFuse.clear();
aSolidsToFuse.push_back(aCutAlgo->shape());
aTools = aSolidsToFuse;
std::shared_ptr<GeomAlgoAPI_Boolean> aFuseAlgo(new GeomAlgoAPI_Boolean(anObjects,
- aTools,
- GeomAlgoAPI_Boolean::BOOL_FUSE));
+ aTools,
+ GeomAlgoAPI_Boolean::BOOL_FUSE));
// Checking that the algorithm worked properly.
if(!aFuseAlgo->isDone() || aFuseAlgo->shape()->isNull() || !aFuseAlgo->isValid()) {
aShapesToAdd.push_back(aFusedShape);
}
- std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
+ std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
+ new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
if(!aFillerAlgo->isDone() || aFillerAlgo->shape()->isNull() || !aFillerAlgo->isValid()) {
myFeature->setError("Error: PaveFiller algorithm failed.");
return false;
aTag = aModTag;
aName = aModName;
}
- theResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), *anIt, (*anIt)->shapeType() == GeomAPI_Shape::EDGE ?
- GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, aTag, aName, *aMap.get());
+ theResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), *anIt,
+ (*anIt)->shapeType() == GeomAPI_Shape::EDGE ?
+ GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, aTag, aName, *aMap.get());
theResultBody->loadDeletedShapes(theMakeShape.get(), *anIt, GeomAPI_Shape::FACE, aDelTag);
}
}
}
//=================================================================================================
-std::shared_ptr<ModelAPI_Feature> FeaturesPlugin_CompositeSketch::subFeature(const int theIndex, bool forTree)
+std::shared_ptr<ModelAPI_Feature> FeaturesPlugin_CompositeSketch::subFeature(const int theIndex,
+ bool forTree)
{
if(theIndex == 0) {
return std::dynamic_pointer_cast<ModelAPI_Feature>(data()->reference(SKETCH_ID())->value());
}
ResultConstructionPtr aConstruction =
std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aBaseObjectSelection->context());
- if(aConstruction.get() && !aBaseShape->isEqual(aConstruction->shape()) && aST == GeomAPI_Shape::WIRE) {
+ if(aConstruction.get() && !aBaseShape->isEqual(aConstruction->shape()) &&
+ aST == GeomAPI_Shape::WIRE) {
// It is a wire on the sketch, store it to make face later.
aSketchWiresMap[aConstruction].push_back(aBaseShape);
continue;
aBaseShape = aConstruction->shape();
if(aBaseShape.get() && !aBaseShape->isNull()) {
GeomAPI_Shape::ShapeType aST = aBaseShape->shapeType();
- if(aST != GeomAPI_Shape::VERTEX && aST != GeomAPI_Shape::EDGE && aST != GeomAPI_Shape::WIRE &&
+ if(aST != GeomAPI_Shape::VERTEX && aST != GeomAPI_Shape::EDGE &&
+ aST != GeomAPI_Shape::WIRE &&
aST != GeomAPI_Shape::FACE && aST != GeomAPI_Shape::SHELL) {
setError("Error: Selected shapes has unsupported type.");
return;
ListOfShape aShells;
ListOfShape aFreeFaces;
GeomShapePtr aFacesCompound = GeomAlgoAPI_CompoundBuilder::compound(aBaseFacesList);
- GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, aShells, aFreeFaces);
+ GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL,
+ aShells, aFreeFaces);
theBaseShapesList.insert(theBaseShapesList.end(), aFreeFaces.begin(), aFreeFaces.end());
theBaseShapesList.insert(theBaseShapesList.end(), aShells.begin(), aShells.end());
} else {
- theBaseShapesList.insert(theBaseShapesList.end(), aBaseFacesList.begin(), aBaseFacesList.end());
+ theBaseShapesList.insert(theBaseShapesList.end(), aBaseFacesList.begin(),
+ aBaseFacesList.end());
}
}
//=================================================================================================
-bool FeaturesPlugin_CompositeSketch::isMakeShapeValid(const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
+bool FeaturesPlugin_CompositeSketch::isMakeShapeValid(
+ const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
{
// Check that algo is done.
if(!theMakeShape->isDone()) {
//=================================================================================================
void FeaturesPlugin_CompositeSketch::storeResult(const GeomShapePtr theBaseShape,
- const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
- const int theIndex)
+ const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
+ const int theIndex)
{
// Create result body.
ResultBodyPtr aResultBody = document()->createBody(data(), theIndex);
//=================================================================================================
void FeaturesPlugin_CompositeSketch::storeGenerationHistory(ResultBodyPtr theResultBody,
- const GeomShapePtr theBaseShape,
- const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
- int& theTag)
+ const GeomShapePtr theBaseShape,
+ const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
+ int& theTag)
{
GeomAPI_Shape::ShapeType aBaseShapeType = theBaseShape->shapeType();
GeomAPI_Shape::ShapeType aShapeTypeToExplode = GeomAPI_Shape::SHAPE;
}
}
- if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX || aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
- theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape, GeomAPI_Shape::VERTEX,
- theTag++, aGenName + "Edge", *aMapOfSubShapes.get());
+ if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX ||
+ aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
+ theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape,
+ GeomAPI_Shape::VERTEX,
+ theTag++, aGenName + "Edge",
+ *aMapOfSubShapes.get());
}
- if(aShapeTypeToExplode == GeomAPI_Shape::EDGE || aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
- theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape, GeomAPI_Shape::EDGE,
- theTag++, aGenName + "Face", *aMapOfSubShapes.get());
+ if(aShapeTypeToExplode == GeomAPI_Shape::EDGE ||
+ aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
+ theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(),
+ theBaseShape, GeomAPI_Shape::EDGE,
+ theTag++, aGenName + "Face",
+ *aMapOfSubShapes.get());
}
- std::shared_ptr<GeomAlgoAPI_MakeSweep> aMakeSweep = std::dynamic_pointer_cast<GeomAlgoAPI_MakeSweep>(theMakeShape);
+ std::shared_ptr<GeomAlgoAPI_MakeSweep> aMakeSweep =
+ std::dynamic_pointer_cast<GeomAlgoAPI_MakeSweep>(theMakeShape);
if(aMakeSweep.get()) {
// Store from shapes.
- storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes, aMakeSweep->fromShapes(), "From_", theTag);
+ storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes,
+ aMakeSweep->fromShapes(), "From_", theTag);
// Store to shapes.
- storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes, aMakeSweep->toShapes(), "To_", theTag);
+ storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes,
+ aMakeSweep->toShapes(), "To_", theTag);
}
}
//=================================================================================================
void FeaturesPlugin_CompositeSketch::storeShapes(ResultBodyPtr theResultBody,
- const GeomAPI_Shape::ShapeType theBaseShapeType,
- const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
- const ListOfShape& theShapes,
- const std::string theName,
- int& theTag)
+ const GeomAPI_Shape::ShapeType theBaseShapeType,
+ const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
+ const ListOfShape& theShapes,
+ const std::string theName,
+ int& theTag)
{
GeomAPI_Shape::ShapeType aShapeTypeToExplore = GeomAPI_Shape::FACE;
std::string aShapeTypeStr = "Face";
FEATURESPLUGIN_EXPORT virtual int numberOfSubs(bool forTree = false) const;
/// \return the sub-feature by zero-base index.
- FEATURESPLUGIN_EXPORT virtual std::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex, bool forTree = false);
+ FEATURESPLUGIN_EXPORT virtual
+ std::shared_ptr<ModelAPI_Feature> subFeature(const int theIndex, bool forTree = false);
/// \return the sub-feature unique identifier in this composite feature by zero-base index.
FEATURESPLUGIN_EXPORT virtual int subFeatureId(const int theIndex) const;
int aResultIndex = 0;
ListOfShape::const_iterator aBaseIt = aBaseShapesList.cbegin();
ListOfMakeShape::const_iterator anAlgoIt = aMakeShapesList.cbegin();
- for(; aBaseIt != aBaseShapesList.cend() && anAlgoIt != aMakeShapesList.cend(); ++aBaseIt, ++anAlgoIt) {
+ for(; aBaseIt != aBaseShapesList.cend() && anAlgoIt != aMakeShapesList.cend();
+ ++aBaseIt, ++anAlgoIt) {
storeResult(*aBaseIt, *anAlgoIt, aResultIndex++);
}
}
// Generating result for each base shape.
- for(ListOfShape::const_iterator anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) {
+ for(ListOfShape::const_iterator
+ anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *anIter;
std::shared_ptr<GeomAlgoAPI_Prism> aPrismAlgo(new GeomAlgoAPI_Prism(aBaseShape, aDir,
//=================================================================================================
void FeaturesPlugin_ExtrusionBoolean::storeGenerationHistory(ResultBodyPtr theResultBody,
- const GeomShapePtr theBaseShape,
- const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
- int& theTag)
+ const GeomShapePtr theBaseShape,
+ const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
+ int& theTag)
{
- FeaturesPlugin_Extrusion::storeGenerationHistory(theResultBody, theBaseShape, theMakeShape, theTag);
+ FeaturesPlugin_Extrusion::storeGenerationHistory(theResultBody, theBaseShape,
+ theMakeShape, theTag);
}
/// \class FeaturesPlugin_ExtrusionBoolean
/// \ingroup Plugins
/// \brief Interface for the composite extrusion feature.
-class FeaturesPlugin_ExtrusionBoolean: public FeaturesPlugin_Extrusion, public FeaturesPlugin_CompositeBoolean
+class FeaturesPlugin_ExtrusionBoolean: public FeaturesPlugin_Extrusion,
+ public FeaturesPlugin_CompositeBoolean
{
public:
/// Request for initialization of data model of the feature: adding all attributes.
//=================================================================================================
void FeaturesPlugin_Intersection::initAttributes()
{
- data()->addAttribute(FeaturesPlugin_Intersection::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
- data()->addAttribute(FeaturesPlugin_Intersection::TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
+ data()->addAttribute(FeaturesPlugin_Intersection::OBJECT_LIST_ID(),
+ ModelAPI_AttributeSelectionList::typeId());
+ data()->addAttribute(FeaturesPlugin_Intersection::TOOL_LIST_ID(),
+ ModelAPI_AttributeSelectionList::typeId());
}
//=================================================================================================
ListOfShape anObjects, aTools;
// Getting objects.
- AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID());
+ AttributeSelectionListPtr anObjectsSelList =
+ selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID());
for (int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
- std::shared_ptr<ModelAPI_AttributeSelection> anObjectAttr = anObjectsSelList->value(anObjectsIndex);
+ std::shared_ptr<ModelAPI_AttributeSelection> anObjectAttr =
+ anObjectsSelList->value(anObjectsIndex);
std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
if (!anObject.get()) {
return;
}
// Getting tools.
- AttributeSelectionListPtr aToolsSelList = selectionList(FeaturesPlugin_Intersection::TOOL_LIST_ID());
+ AttributeSelectionListPtr aToolsSelList =
+ selectionList(FeaturesPlugin_Intersection::TOOL_LIST_ID());
for (int aToolsIndex = 0; aToolsIndex < aToolsSelList->size(); aToolsIndex++) {
std::shared_ptr<ModelAPI_AttributeSelection> aToolAttr = aToolsSelList->value(aToolsIndex);
std::shared_ptr<GeomAPI_Shape> aTool = aToolAttr->value();
int aResultIndex = 0;
// Create result for each object.
- for (ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) {
+ for (ListOfShape::iterator
+ anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) {
std::shared_ptr<GeomAPI_Shape> anObject = *anObjectsIt;
ListOfShape aListWithObject; aListWithObject.push_back(anObject);
GeomAlgoAPI_Intersection anIntersectionAlgo(aListWithObject, aTools);
std::shared_ptr<GeomAPI_Shape> aResultShape = theMakeShape.shape();
std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfShapes = theMakeShape.mapOfSubShapes();
const int aDeletedTag = 1;
- const int aSubsolidsTag = 2; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
+ /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
+ const int aSubsolidsTag = 2;
const int aModifyTag = 100000;
int aModifyToolsTag = 200000;
std::ostringstream aStream;
aStream.clear();
aStream << aModName << "_" << anIndex++;
theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::VERTEX,
- aModifyToolsTag, aStream.str(), *aMapOfShapes.get(), true);
+ aModifyToolsTag, aStream.str(), *aMapOfShapes.get(), true);
theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::EDGE,
- aModifyToolsTag, aStream.str(), *aMapOfShapes.get(), true);
+ aModifyToolsTag, aStream.str(), *aMapOfShapes.get(), true);
theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE, aDeletedTag);
aModifyToolsTag += 10000;
}
/// \class FeaturesPlugin_Intersection
/// \ingroup Plugins
/// \brief Intersection feature takes a list of shapes as objects and list of shapes as tools.
-/// The types of objects and tools may be different: whole objects, compsoilds, solids, shells, faces or edges.
+/// The types of objects and tools may be different:
+/// whole objects, compsoilds, solids, shells, faces or edges.
/// The result is less than the minimal dimension from pair of intersection:
/// for two solids or two faces it is wire, for the edge and face it is vertex, etc.
class FeaturesPlugin_Intersection : public ModelAPI_Feature
}
// Create single result.
- std::shared_ptr<GeomAlgoAPI_Partition> aPartitionAlgo(new GeomAlgoAPI_Partition(anObjects, aTools));
+ std::shared_ptr<GeomAlgoAPI_Partition> aPartitionAlgo(
+ new GeomAlgoAPI_Partition(anObjects, aTools));
// Checking that the algorithm worked properly.
if (!aPartitionAlgo->isDone()) {
}
const int aDelTag = 1;
- const int aSubTag = 2; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
+ /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
+ const int aSubTag = 2;
int aModTag = aSubTag + 10000;
const std::string aModName = "Modified";
GeomShapePtr anObjectSubShape = anObjectSubShapesExp.current();
ListOfShape aModifiedShapes;
theMakeShape->modified(anObjectSubShape, aModifiedShapes);
- for(ListOfShape::const_iterator aModIt = aModifiedShapes.cbegin(); aModIt != aModifiedShapes.cend(); ++aModIt) {
+ for(ListOfShape::const_iterator
+ aModIt = aModifiedShapes.cbegin(); aModIt != aModifiedShapes.cend(); ++aModIt) {
GeomShapePtr aModShape = *aModIt;
if(aMapOfSubShapes->isBound(aModShape)) {
aModShape = aMapOfSubShapes->find(aModShape);
GeomAPI_Shape::ShapeType aST = aBaseShape->shapeType();
ResultConstructionPtr aConstruction =
std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aBaseObjectSelection->context());
- if(aConstruction.get() && !aBaseShape->isEqual(aConstruction->shape()) && aST == GeomAPI_Shape::WIRE) {
+ if(aConstruction.get() && !aBaseShape->isEqual(aConstruction->shape()) &&
+ aST == GeomAPI_Shape::WIRE) {
// It is a wire on the sketch, store it to make face later.
aSketchWiresMap[aConstruction].push_back(aBaseShape);
continue;
}
} else {
// This may be the whole sketch result selected, check and get faces.
- ResultConstructionPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aBaseObjectSelection->context());
+ ResultConstructionPtr aConstruction =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aBaseObjectSelection->context());
if(!aConstruction.get()) {
setError("Error: One of selected sketches does not have results.");
return;
}
} else {
for(int aFaceIndex = 0; aFaceIndex < aFacesNum; aFaceIndex++) {
- std::shared_ptr<GeomAPI_Shape> aBaseFace = std::dynamic_pointer_cast<GeomAPI_Shape>(aConstruction->face(aFaceIndex));
+ std::shared_ptr<GeomAPI_Shape> aBaseFace =
+ std::dynamic_pointer_cast<GeomAPI_Shape>(aConstruction->face(aFaceIndex));
if(!aBaseFace.get() || aBaseFace->isNull()) {
setError("Error: One of the faces on selected sketch is Null.");
return;
if(aCreationMethod == CREATION_METHOD_SIMPLE()) {
ListOfShape aShells;
ListOfShape aFreeFaces;
- std::shared_ptr<GeomAPI_Shape> aFacesCompound = GeomAlgoAPI_CompoundBuilder::compound(aBaseFacesList);
- GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, aShells, aFreeFaces);
+ std::shared_ptr<GeomAPI_Shape> aFacesCompound =
+ GeomAlgoAPI_CompoundBuilder::compound(aBaseFacesList);
+ GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL,
+ aShells, aFreeFaces);
aBaseShapesList.insert(aBaseShapesList.end(), aFreeFaces.begin(), aFreeFaces.end());
aBaseShapesList.insert(aBaseShapesList.end(), aShells.begin(), aShells.end());
} else {
setError("Error: Path selection is empty.");
return;
}
- std::shared_ptr<GeomAPI_Shape> aPathShape = std::dynamic_pointer_cast<GeomAPI_Shape>(aPathSelection->value());
+ std::shared_ptr<GeomAPI_Shape> aPathShape =
+ std::dynamic_pointer_cast<GeomAPI_Shape>(aPathSelection->value());
if(!aPathShape.get()) {
// Probaply it is a construction.
aPathShape = aPathSelection->context()->shape();
// Generating result for each object.
int aResultIndex = 0;
- if(aCreationMethod == CREATION_METHOD_SIMPLE() || aCreationMethod == CREATION_METHOD_BINORMAL()) {
- for(ListOfShape::const_iterator anIter = aBaseShapesList.cbegin(); anIter != aBaseShapesList.cend(); anIter++) {
+ if(aCreationMethod == CREATION_METHOD_SIMPLE() ||
+ aCreationMethod == CREATION_METHOD_BINORMAL()) {
+ for(ListOfShape::const_iterator
+ anIter = aBaseShapesList.cbegin(); anIter != aBaseShapesList.cend(); anIter++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *anIter;
GeomAlgoAPI_Pipe aPipeAlgo = aCreationMethod ==
}
}
- if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX || aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
+ if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX ||
+ aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, GeomAPI_Shape::VERTEX,
- aGenTag++, aGenName + "Edge", *aMapOfSubShapes.get());
+ aGenTag++, aGenName + "Edge", *aMapOfSubShapes.get());
}
- if(aShapeTypeToExplode == GeomAPI_Shape::EDGE || aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
+ if(aShapeTypeToExplode == GeomAPI_Shape::EDGE ||
+ aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) {
aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, GeomAPI_Shape::EDGE,
- aGenTag++, aGenName + "Face", *aMapOfSubShapes.get());
+ aGenTag++, aGenName + "Face", *aMapOfSubShapes.get());
}
- aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, aShapeTypeToExplode, aGenTag++, aGenName, *aMapOfSubShapes.get());
+ aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, aShapeTypeToExplode,
+ aGenTag++, aGenName, *aMapOfSubShapes.get());
// Store from shapes.
int aFromTag = aGenTag;
- storeShapes(aResultBody, aBaseShapeType, aMapOfSubShapes, thePipeAlgo.fromShapes(), "From_", aFromTag);
+ storeShapes(aResultBody, aBaseShapeType, aMapOfSubShapes,
+ thePipeAlgo.fromShapes(), "From_", aFromTag);
// Store to shapes.
int aToTag = aFromTag;
int aGenTag = 1;
std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfSubShapes = thePipeAlgo.mapOfSubShapes();
- for(ListOfShape::const_iterator anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) {
+ for(ListOfShape::const_iterator
+ anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) {
GeomShapePtr aBaseShape = *anIter;
GeomAPI_Shape::ShapeType aBaseShapeType = aBaseShape->shapeType();
GeomAPI_Shape::ShapeType aShapeTypeToExplode;
break;
}
}
- aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, aBaseShape, aShapeTypeToExplode, aGenTag++, aGenName, *aMapOfSubShapes.get());
+ aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, aBaseShape, aShapeTypeToExplode,
+ aGenTag++, aGenName, *aMapOfSubShapes.get());
}
// Store from shapes.
int aFromTag = aGenTag;
- storeShapes(aResultBody, theBaseShapes.front()->shapeType(), aMapOfSubShapes, thePipeAlgo.fromShapes(), "From", aFromTag);
+ storeShapes(aResultBody, theBaseShapes.front()->shapeType(), aMapOfSubShapes,
+ thePipeAlgo.fromShapes(), "From", aFromTag);
// Store to shapes.
int aToTag = aFromTag;
- storeShapes(aResultBody, theBaseShapes.back()->shapeType(), aMapOfSubShapes, thePipeAlgo.toShapes(), "To", aToTag);
+ storeShapes(aResultBody, theBaseShapes.back()->shapeType(),
+ aMapOfSubShapes, thePipeAlgo.toShapes(), "To", aToTag);
setResult(aResultBody, theResultIndex);
//==================================================================================================
void FeaturesPlugin_Pipe::storeShapes(ResultBodyPtr theResultBody,
- const GeomAPI_Shape::ShapeType theBaseShapeType,
- const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
- const ListOfShape& theShapes,
- const std::string theName,
- int& theTag)
+ const GeomAPI_Shape::ShapeType theBaseShapeType,
+ const std::shared_ptr<GeomAPI_DataMapOfShapeShape> theMapOfSubShapes,
+ const ListOfShape& theShapes,
+ const std::string theName,
+ int& theTag)
{
GeomAPI_Shape::ShapeType aShapeTypeToExplore = GeomAPI_Shape::FACE;
std::string aShapeTypeStr = "Face";
/// \class FeaturesPlugin_Pipe
/// \ingroup Plugins
/// \brief Feature for creation of extrusion along a path.
-/// Pipe creates extrusion of objects along a path. It produces the following results from objects:\n
+/// Pipe creates extrusion of objects along a path.
+/// It produces the following results from objects:\n
/// Vertex -> Edge\n
/// Edge -> Face\n
/// Wire -> Shell\n
return;
}
for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
- std::shared_ptr<ModelAPI_AttributeSelection> anObjectAttr = anObjectsSelList->value(anObjectsIndex);
+ std::shared_ptr<ModelAPI_AttributeSelection> anObjectAttr =
+ anObjectsSelList->value(anObjectsIndex);
std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
if(!anObject.get()) { // may be for not-activated parts
eraseResults();
for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
anObjectsIt++, aContext++) {
- if ((*aContext)->groupName() == ModelAPI_ResultPart::group()) { // for part results just set transformation
+ // for part results just set transformation
+ if ((*aContext)->groupName() == ModelAPI_ResultPart::group()) {
ResultPartPtr anOrigin = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aContext);
ResultPartPtr aResultPart = document()->copyPart(anOrigin, data(), aResultIndex);
aResultPart->setTrsf(aContextRes, aTrsf);
}
//LoadNamingDS
- std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
+ std::shared_ptr<ModelAPI_ResultBody> aResultBody =
+ document()->createBody(data(), aResultIndex);
loadNamingDS(aTransformAlgo, aResultBody, aBaseShape);
setResult(aResultBody, aResultIndex);
}
case GeomAPI_Shape::SOLID:
case GeomAPI_Shape::SHELL:
theResultBody->loadAndOrientModifiedShapes(&theTransformAlgo,
- theBaseShape, GeomAPI_Shape::FACE,
- aPlacedTag, aPlacedName + "_Face", *aSubShapes.get());
+ theBaseShape, GeomAPI_Shape::FACE,
+ aPlacedTag, aPlacedName + "_Face", *aSubShapes.get());
case GeomAPI_Shape::FACE:
case GeomAPI_Shape::WIRE:
theResultBody->loadAndOrientModifiedShapes(&theTransformAlgo,
theBaseShape, GeomAPI_Shape::EDGE,
- ++aPlacedTag, aPlacedName + "_Edge", *aSubShapes.get());
+ ++aPlacedTag, aPlacedName + "_Edge", *aSubShapes.get());
case GeomAPI_Shape::EDGE:
theResultBody->loadAndOrientModifiedShapes(&theTransformAlgo,
theBaseShape, GeomAPI_Shape::VERTEX,
- ++aPlacedTag, aPlacedName + "_Vertex", *aSubShapes.get());
+ ++aPlacedTag, aPlacedName + "_Vertex", *aSubShapes.get());
}
}
aSubShapesAttrList->clear();
ResultPtr aContext = aShapeAttrSelection->context();
- ResultCompSolidPtr aResultCompSolid = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aContext);
+ ResultCompSolidPtr aResultCompSolid =
+ std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aContext);
if(!aResultCompSolid.get()) {
return;
}
int aResultIndex = 0;
ListOfShape::const_iterator aBaseIt = aBaseShapesList.cbegin();
ListOfMakeShape::const_iterator anAlgoIt = aMakeShapesList.cbegin();
- for(; aBaseIt != aBaseShapesList.cend() && anAlgoIt != aMakeShapesList.cend(); ++aBaseIt, ++anAlgoIt) {
+ for(; aBaseIt != aBaseShapesList.cend() && anAlgoIt != aMakeShapesList.cend();
+ ++aBaseIt, ++anAlgoIt) {
storeResult(*aBaseIt, *anAlgoIt, aResultIndex++);
}
}
// Generating result for each base shape.
- for(ListOfShape::const_iterator anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) {
+ for(ListOfShape::const_iterator
+ anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) {
GeomShapePtr aBaseShape = *anIter;
- std::shared_ptr<GeomAlgoAPI_Revolution> aRevolAlgo(new GeomAlgoAPI_Revolution(aBaseShape, anAxis,
- aToShape, aToAngle,
- aFromShape, aFromAngle));
+ std::shared_ptr<GeomAlgoAPI_Revolution> aRevolAlgo(new GeomAlgoAPI_Revolution(
+ aBaseShape, anAxis,
+ aToShape, aToAngle,
+ aFromShape, aFromAngle));
if(!isMakeShapeValid(aRevolAlgo)) {
return false;
}
//=================================================================================================
void FeaturesPlugin_RevolutionBoolean::storeGenerationHistory(ResultBodyPtr theResultBody,
- const GeomShapePtr theBaseShape,
- const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
- int& theTag)
+ const GeomShapePtr theBaseShape,
+ const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
+ int& theTag)
{
- FeaturesPlugin_Revolution::storeGenerationHistory(theResultBody, theBaseShape, theMakeShape, theTag);
+ FeaturesPlugin_Revolution::storeGenerationHistory(theResultBody, theBaseShape,
+ theMakeShape, theTag);
}
/// \class FeaturesPlugin_RevolutionBoolean
/// \ingroup Plugins
/// \brief Interface for the composite revolution feature.
-class FeaturesPlugin_RevolutionBoolean : public FeaturesPlugin_Revolution, public FeaturesPlugin_CompositeBoolean
+class FeaturesPlugin_RevolutionBoolean : public FeaturesPlugin_Revolution,
+ public FeaturesPlugin_CompositeBoolean
{
public:
/// Request for initialization of data model of the feature: adding all attributes.
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(data()->addAttribute(
FeaturesPlugin_Rotation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
- data()->addAttribute(FeaturesPlugin_Rotation::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
+ data()->addAttribute(FeaturesPlugin_Rotation::AXIS_OBJECT_ID(),
+ ModelAPI_AttributeSelection::typeId());
data()->addAttribute(FeaturesPlugin_Rotation::ANGLE_ID(), ModelAPI_AttributeDouble::typeId());
}
// Getting objects.
ListOfShape anObjects;
std::list<ResultPtr> aContextes;
- AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Rotation::OBJECTS_LIST_ID());
+ AttributeSelectionListPtr anObjectsSelList =
+ selectionList(FeaturesPlugin_Rotation::OBJECTS_LIST_ID());
if (anObjectsSelList->size() == 0) {
return;
}
for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
- std::shared_ptr<ModelAPI_AttributeSelection> anObjectAttr = anObjectsSelList->value(anObjectsIndex);
+ std::shared_ptr<ModelAPI_AttributeSelection> anObjectAttr =
+ anObjectsSelList->value(anObjectsIndex);
std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
if(!anObject.get()) {
return;
//Getting axis.
std::shared_ptr<GeomAPI_Ax1> anAxis;
std::shared_ptr<GeomAPI_Edge> anEdge;
- std::shared_ptr<ModelAPI_AttributeSelection> anObjRef = selection(FeaturesPlugin_Rotation::AXIS_OBJECT_ID());
+ std::shared_ptr<ModelAPI_AttributeSelection> anObjRef =
+ selection(FeaturesPlugin_Rotation::AXIS_OBJECT_ID());
if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) {
anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->value()));
} else if (anObjRef && !anObjRef->value() && anObjRef->context() &&
anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->context()->shape()));
}
if(anEdge) {
- anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(), anEdge->line()->direction()));
+ anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(),
+ anEdge->line()->direction()));
}
// Getting angle.
case GeomAPI_Shape::SOLID:
case GeomAPI_Shape::SHELL:
theResultBody->loadAndOrientModifiedShapes(&theRotaionAlgo,
- theBaseShape, GeomAPI_Shape::FACE,
- aRotatedTag, aRotatedName + "_Face", *aSubShapes.get());
+ theBaseShape, GeomAPI_Shape::FACE,
+ aRotatedTag, aRotatedName + "_Face", *aSubShapes.get());
case GeomAPI_Shape::FACE:
case GeomAPI_Shape::WIRE:
theResultBody->loadAndOrientModifiedShapes(&theRotaionAlgo,
- theBaseShape, GeomAPI_Shape::EDGE,
- ++aRotatedTag, aRotatedName + "_Edge", *aSubShapes.get());
+ theBaseShape, GeomAPI_Shape::EDGE,
+ ++aRotatedTag, aRotatedName + "_Edge", *aSubShapes.get());
case GeomAPI_Shape::EDGE:
theResultBody->loadAndOrientModifiedShapes(&theRotaionAlgo,
- theBaseShape, GeomAPI_Shape::VERTEX,
- ++aRotatedTag, aRotatedName + "_Vertex", *aSubShapes.get());
+ theBaseShape, GeomAPI_Shape::VERTEX,
+ ++aRotatedTag, aRotatedName + "_Vertex", *aSubShapes.get());
}
}
std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(data()->addAttribute(
FeaturesPlugin_Translation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()));
- data()->addAttribute(FeaturesPlugin_Translation::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
- data()->addAttribute(FeaturesPlugin_Translation::DISTANCE_ID(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(FeaturesPlugin_Translation::AXIS_OBJECT_ID(),
+ ModelAPI_AttributeSelection::typeId());
+ data()->addAttribute(FeaturesPlugin_Translation::DISTANCE_ID(),
+ ModelAPI_AttributeDouble::typeId());
}
//=================================================================================================
// Getting objects.
ListOfShape anObjects;
std::list<ResultPtr> aContextes;
- AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Translation::OBJECTS_LIST_ID());
+ AttributeSelectionListPtr anObjectsSelList =
+ selectionList(FeaturesPlugin_Translation::OBJECTS_LIST_ID());
if (anObjectsSelList->size() == 0) {
return;
}
for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
- std::shared_ptr<ModelAPI_AttributeSelection> anObjectAttr = anObjectsSelList->value(anObjectsIndex);
+ std::shared_ptr<ModelAPI_AttributeSelection> anObjectAttr =
+ anObjectsSelList->value(anObjectsIndex);
std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
if(!anObject.get()) { // may be for not-activated parts
eraseResults();
//Getting axis.
std::shared_ptr<GeomAPI_Ax1> anAxis;
std::shared_ptr<GeomAPI_Edge> anEdge;
- std::shared_ptr<ModelAPI_AttributeSelection> anObjRef = selection(FeaturesPlugin_Translation::AXIS_OBJECT_ID());
+ std::shared_ptr<ModelAPI_AttributeSelection> anObjRef =
+ selection(FeaturesPlugin_Translation::AXIS_OBJECT_ID());
if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) {
anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->value()));
} else if (anObjRef && !anObjRef->value() && anObjRef->context() &&
anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->context()->shape()));
}
if(anEdge) {
- anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(), anEdge->line()->direction()));
+ anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(),
+ anEdge->line()->direction()));
}
// Getting distance.
case GeomAPI_Shape::SOLID:
case GeomAPI_Shape::SHELL:
theResultBody->loadAndOrientModifiedShapes(&theTranslationAlgo,
- theBaseShape, GeomAPI_Shape::FACE,
- aTranslatedTag, aTranslatedName + "_Face", *aSubShapes.get());
+ theBaseShape, GeomAPI_Shape::FACE,
+ aTranslatedTag, aTranslatedName + "_Face", *aSubShapes.get());
case GeomAPI_Shape::FACE:
case GeomAPI_Shape::WIRE:
theResultBody->loadAndOrientModifiedShapes(&theTranslationAlgo,
- theBaseShape, GeomAPI_Shape::EDGE,
- ++aTranslatedTag, aTranslatedName + "_Edge", *aSubShapes.get());
+ theBaseShape, GeomAPI_Shape::EDGE,
+ ++aTranslatedTag, aTranslatedName + "_Edge", *aSubShapes.get());
case GeomAPI_Shape::EDGE:
theResultBody->loadAndOrientModifiedShapes(&theTranslationAlgo,
- theBaseShape, GeomAPI_Shape::VERTEX,
- ++aTranslatedTag, aTranslatedName + "_Vertex", *aSubShapes.get());
+ theBaseShape, GeomAPI_Shape::VERTEX,
+ ++aTranslatedTag, aTranslatedName + "_Vertex", *aSubShapes.get());
}
}
std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape> aCompSolidsObjects;
// Getting objects.
- AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID());
+ AttributeSelectionListPtr anObjectsSelList =
+ selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID());
for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) {
AttributeSelectionPtr anObjectAttr = anObjectsSelList->value(anObjectsIndex);
std::shared_ptr<GeomAPI_Shape> anObject = anObjectAttr->value();
ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext);
if(aResCompSolidPtr.get()) {
std::shared_ptr<GeomAPI_Shape> aContextShape = aResCompSolidPtr->shape();
- std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator anIt = aCompSolidsObjects.begin();
+ std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
+ anIt = aCompSolidsObjects.begin();
for(; anIt != aCompSolidsObjects.end(); anIt++) {
if(anIt->first->isEqual(aContextShape)) {
aCompSolidsObjects[anIt->first].push_back(anObject);
}
}
- // Collecting solids from compsolids which will not be modified in boolean operation and will be added to result.
+ // Collecting solids from compsolids which will not be modified in
+ // boolean operation and will be added to result.
ListOfShape aShapesToAdd;
- for(std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator anIt = aCompSolidsObjects.begin();
+ for(std::map<std::shared_ptr<GeomAPI_Shape>, ListOfShape>::iterator
+ anIt = aCompSolidsObjects.begin();
anIt != aCompSolidsObjects.end(); anIt++) {
std::shared_ptr<GeomAPI_Shape> aCompSolid = anIt->first;
ListOfShape& aUsedInOperationSolids = anIt->second;
ListOfShape aTools;
aTools.splice(aTools.begin(), anObjects, anObjects.begin());
std::shared_ptr<GeomAlgoAPI_Boolean> aFuseAlgo(new GeomAlgoAPI_Boolean(anObjects,
- aTools,
- GeomAlgoAPI_Boolean::BOOL_FUSE));
+ aTools,
+ GeomAlgoAPI_Boolean::BOOL_FUSE));
// Checking that the algorithm worked properly.
GeomAlgoAPI_MakeShapeList aMakeShapeList;
// Combine result with not used solids from compsolid.
if(aShapesToAdd.size() > 0) {
aShapesToAdd.push_back(aShape);
- std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
+ std::shared_ptr<GeomAlgoAPI_PaveFiller> aFillerAlgo(
+ new GeomAlgoAPI_PaveFiller(aShapesToAdd, true));
if(!aFillerAlgo->isDone()) {
setError("Error: PaveFiller algorithm failed.");
return;
// Store result and naming.
const int aModifyTag = 1;
const int aDeletedTag = 2;
- const int aSubsolidsTag = 3; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
+ /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
+ const int aSubsolidsTag = 3;
const std::string aModName = "Modified";
std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data());
if (!aValid) {
std::string aResultGroupName = isPartSetDocument ? ModelAPI_ResultPart::group()
: ModelAPI_ResultBody::group();
- theError = "Objects from the %1 group can be selected in the %2 document, but an objects from the %3 group is selected.";
+ theError = "Objects from the %1 group can be selected in the %2 document, \
+ but an objects from the %3 group is selected.";
theError.arg(aResultGroupName).arg(aDocument->kind()).arg(anErrorGroupName);
}
return aValid;
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const
{
- AttributeSelectionPtr aPathAttrSelection = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
+ AttributeSelectionPtr aPathAttrSelection =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
if(!aPathAttrSelection.get()) {
theError = "Error: This validator can only work with path selector in \"Pipe\" feature.";
return false;
return false;
}
GeomShapePtr aContextShape = aContext->shape();
- if(aPathShape.get() && aPathShape->shapeType() == GeomAPI_Shape::WIRE && !aPathShape->isEqual(aContextShape)) {
+ if(aPathShape.get() && aPathShape->shapeType() == GeomAPI_Shape::WIRE &&
+ !aPathShape->isEqual(aContextShape)) {
theError = "Error: Local selection of wires not allowed.";
return false;
}
}
//==================================================================================================
-bool FeaturesPlugin_ValidatorPipeLocations::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<std::string>& theArguments,
- Events_InfoMessage& theError) const
+bool FeaturesPlugin_ValidatorPipeLocations::isValid(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<std::string>& theArguments,
+ Events_InfoMessage& theError) const
{
static const std::string aCreationMethodID = "creation_method";
static const std::string aBaseObjectsID = "base_objects";
return false;
}
- if(aLocationsSelectionList->size() > 0 && aLocationsSelectionList->size() != aBaseObjectsSelectionList->size()) {
+ if(aLocationsSelectionList->size() > 0 &&
+ aLocationsSelectionList->size() != aBaseObjectsSelectionList->size()) {
theError = "Error: Number of locations should be the same as base objects.";
return false;
}
}
//==================================================================================================
-bool FeaturesPlugin_ValidatorPipeLocations::isNotObligatory(std::string theFeature, std::string theAttribute)
+bool FeaturesPlugin_ValidatorPipeLocations::isNotObligatory(std::string theFeature,
+ std::string theAttribute)
{
return false;
}
GeomAPI_DataMapOfShapeShape aSelectedWiresFromObjects;
std::string anAttributeType = theAttribute->attributeType();
if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) {
- AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+ AttributeSelectionListPtr aListAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) {
AttributeSelectionPtr aSelectionAttr = aListAttr->value(anIndex);
ResultPtr aContext = aSelectionAttr->context();
return false;
}
- ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
+ ResultConstructionPtr aResultConstruction =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
if(!aResultConstruction.get()) {
- // It is not a result construction. If shape is compound check that it contains only faces and edges.
+ // It is not a result construction.
+ // If shape is compound check that it contains only faces and edges.
GeomShapePtr aShape = aSelectionAttr->value();
if(!aShape.get()) {
aShape = aContext->shape();
GeomShapePtr aContextShape = aResultConstruction->shape();
if(!aShape.get()) {
// Whole sketch selected.
- if(aSelectedSketchesFromObjects.find(aResultConstruction) != aSelectedSketchesFromObjects.cend()) {
- theError = "Error: Object from this sketch is already selected. Sketch is not allowed for selection.";
+ if(aSelectedSketchesFromObjects.find(aResultConstruction) !=
+ aSelectedSketchesFromObjects.cend()) {
+ theError = "Error: Object from this sketch is already selected. \
+ Sketch is not allowed for selection.";
return false;
}
} else {
// Object from sketch selected.
if(aSelectedSketches.find(aResultConstruction) != aSelectedSketches.cend()) {
- theError = "Error: Whole sketch with this object is already selected. Don't allow to select this object.";
+ theError = "Error: Whole sketch with this object is already selected. \
+ Don't allow to select this object.";
return false;
}
}
if(aSelectedWiresFromObjects.isBound(aWire)) {
- theError = "Error: Objects with such wire already selected. Don't allow to select this object.";
+ theError =
+ "Error: Objects with such wire already selected. Don't allow to select this object.";
return false;
}
//==================================================================================================
bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments,
- Events_InfoMessage& theError) const
+ const std::list<std::string>& theArguments,
+ Events_InfoMessage& theError) const
{
if(!theAttribute.get()) {
theError = "Error: Empty attribute.";
std::string anAttributeType = theAttribute->attributeType();
if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) {
- AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+ AttributeSelectionListPtr aListAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) {
// If at least one attribute is invalid, the result is false.
if(!isValidAttribute(aListAttr->value(anIndex), theArguments, theError)) {
}
} else if(anAttributeType == ModelAPI_AttributeSelection::typeId()) {
// Getting context.
- AttributeSelectionPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
+ AttributeSelectionPtr anAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
ResultPtr aContext = anAttr->context();
if(!aContext.get()) {
theError = "Error: Attribute have empty context.";
return false;
}
- ResultConstructionPtr aConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
+ ResultConstructionPtr aConstruction =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
if(aConstruction.get()) {
// Construciotn selected. Check that is is not infinite.
if(aConstruction->isInfinite()) {
}
} else {
// Shape on construction selected. Check that it is a face or wire.
- if(aShape->shapeType() == GeomAPI_Shape::WIRE || aShape->shapeType() == GeomAPI_Shape::FACE) {
+ if(aShape->shapeType() == GeomAPI_Shape::WIRE ||
+ aShape->shapeType() == GeomAPI_Shape::FACE) {
return true;
}
}
if(!aShape->isEqual(aContextShape)) {
// Local selection on body does not allowed.
- theError = "Error: Selected shape is in the local selection. Only global selection is allowed.";
+ theError =
+ "Error: Selected shape is in the local selection. Only global selection is allowed.";
return false;
}
// Check that object is a shape with allowed type.
GeomValidators_ShapeType aShapeTypeValidator;
if(!aShapeTypeValidator.isValid(anAttr, theArguments, theError)) {
- theError = "Error: Selected shape has unacceptable type. Acceptable types are: faces or wires on sketch, whole sketch(if it has at least one face), and whole objects with shape types: %1";
+ theError = "Error: Selected shape has unacceptable type. Acceptable types are: faces or \
+ wires on sketch, whole sketch(if it has at least one face), \
+ and whole objects with shape types: %1";
std::string anArgumentString;
for(auto anIt = theArguments.cbegin(); anIt != theArguments.cend(); ++anIt) {
if (!anArgumentString.empty())
}
//==================================================================================================
-bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<std::string>& theArguments,
- Events_InfoMessage& theError) const
+bool FeaturesPlugin_ValidatorExtrusionDir::isValid(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<std::string>& theArguments,
+ Events_InfoMessage& theError) const
{
if(theArguments.size() != 2) {
theError = "Error: Validator should be used with 2 parameters for extrusion.";
return false;
}
- std::list<std::string>::const_iterator anArgsIt = theArguments.begin(), aLast = theArguments.end();
+ std::list<std::string>::const_iterator
+ anArgsIt = theArguments.begin(), aLast = theArguments.end();
AttributePtr aCheckAttribute = theFeature->attribute(*anArgsIt);
++anArgsIt;
if(!aDirShape.get()) {
// Check that dir can be empty.
if(!isShapesCanBeEmpty(aCheckAttribute, theError)) {
- theError = "Error: Base objects list contains vertex or edge, so attribute \"%1\" can not be used with default value. Select direction for extrusion.";
+ theError = "Error: Base objects list contains vertex or edge, so attribute \"%1\" \
+ can not be used with default value. Select direction for extrusion.";
theError.arg(*anArgsIt);
return false;
} else {
std::shared_ptr<GeomAPI_Edge> aDirEdge(new GeomAPI_Edge(aDirShape));
// If faces selected check that direction not parallel with them.
- AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(aCheckAttribute);
+ AttributeSelectionListPtr aListAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(aCheckAttribute);
for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) {
AttributeSelectionPtr anAttr = aListAttr->value(anIndex);
GeomShapePtr aShapeInList = anAttr->value();
aShapeInList = anAttr->context()->shape();
}
bool isParallel = true;
- if(aShapeInList->shapeType() == GeomAPI_Shape::FACE || aShapeInList->shapeType() == GeomAPI_Shape::SHELL) {
- for(GeomAPI_ShapeExplorer anExp(aShapeInList, GeomAPI_Shape::FACE); anExp.more(); anExp.next()) {
+ if(aShapeInList->shapeType() == GeomAPI_Shape::FACE ||
+ aShapeInList->shapeType() == GeomAPI_Shape::SHELL) {
+ for(GeomAPI_ShapeExplorer
+ anExp(aShapeInList, GeomAPI_Shape::FACE); anExp.more(); anExp.next()) {
std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(anExp.current()));
isParallel = GeomAlgoAPI_ShapeTools::isParallel(aDirEdge, aFace);
if(isParallel) {
}
}
} else if(aShapeInList->shapeType() == GeomAPI_Shape::COMPOUND) {
- std::shared_ptr<GeomAPI_PlanarEdges> aPlanarEdges = std::dynamic_pointer_cast<GeomAPI_PlanarEdges>(aShapeInList);
+ std::shared_ptr<GeomAPI_PlanarEdges> aPlanarEdges =
+ std::dynamic_pointer_cast<GeomAPI_PlanarEdges>(aShapeInList);
if(aPlanarEdges.get()) {
std::shared_ptr<GeomAPI_Dir> aSketchDir = aPlanarEdges->norm();
if(aDirEdge->isLine()) {
isParallel = false;
}
if(isParallel) {
- theError = "Error: Direction is parallel to one of the selected face or face on selected shell.";
+ theError =
+ "Error: Direction is parallel to one of the selected face or face on selected shell.";
return false;
}
}
}
//==================================================================================================
-bool FeaturesPlugin_ValidatorExtrusionDir::isNotObligatory(std::string theFeature, std::string theAttribute)
+bool FeaturesPlugin_ValidatorExtrusionDir::isNotObligatory(std::string theFeature,
+ std::string theAttribute)
{
return false;
}
std::string anAttributeType = theAttribute->attributeType();
if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) {
- AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+ AttributeSelectionListPtr aListAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) {
// If at least one attribute is invalid, the result is false.
if(!isShapesCanBeEmpty(aListAttr->value(anIndex), theError)) {
}
} else if(anAttributeType == ModelAPI_AttributeSelection::typeId()) {
// Getting context.
- AttributeSelectionPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
+ AttributeSelectionPtr anAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
ResultPtr aContext = anAttr->context();
if(!aContext.get()) {
return false;
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const
{
- AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+ AttributeSelectionListPtr anAttrSelectionList =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if(!anAttrSelectionList.get()) {
- theError = "Error: This validator can only work with selection list attributes in \"Boolean\" feature.";
+ theError =
+ "Error: This validator can only work with selection list attributes in \"Boolean\" feature.";
return false;
}
FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theAttribute->owner());
//==================================================================================================
bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments,
- Events_InfoMessage& theError) const
+ const std::list<std::string>& theArguments,
+ Events_InfoMessage& theError) const
{
- AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+ AttributeSelectionListPtr anAttrSelectionList =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if(!anAttrSelectionList.get()) {
theError = "Error: This validator can only work with selection list in \"Partition\" feature.";
return false;
}
ResultPtr aContext = aSelectAttr->context();
- ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
+ ResultConstructionPtr aResultConstruction =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aContext);
if(aResultConstruction.get()) {
theError = "Error: Only body shapes and construction planes are allowed for selection.";
return false;
}
- ResultCompSolidPtr aResultCompsolid = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aContext);
+ ResultCompSolidPtr aResultCompsolid =
+ std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aContext);
if(aResultCompsolid.get()) {
continue;
}
//==================================================================================================
bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePtr& theAttribute,
- const std::list<std::string>& theArguments,
- Events_InfoMessage& theError) const
+ const std::list<std::string>& theArguments,
+ Events_InfoMessage& theError) const
{
- AttributeSelectionListPtr aSubShapesAttrList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+ AttributeSelectionListPtr aSubShapesAttrList =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if(!aSubShapesAttrList.get()) {
- theError = "Error: This validator can only work with selection list in \"Remove Sub-Shapes\" feature.";
+ theError =
+ "Error: This validator can only work with selection list in \"Remove Sub-Shapes\" feature.";
return false;
}
}
//==================================================================================================
-bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<std::string>& theArguments,
- Events_InfoMessage& theError) const
+bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<std::string>& theArguments,
+ Events_InfoMessage& theError) const
{
static const std::string aBaseShapeID = "base_shape";
static const std::string aSubShapesID = "subshapes";
const std::list<std::string>& theArguments,
Events_InfoMessage& theError) const
{
- AttributeSelectionListPtr aBaseObjectsAttrList = std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+ AttributeSelectionListPtr aBaseObjectsAttrList =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
if(!aBaseObjectsAttrList.get()) {
theError = "Error: This validator can only work with selection list in \"%1\" feature.";
theError.arg(FeaturesPlugin_Union::ID());
for(int anIndex = 0; anIndex < aBaseObjectsAttrList->size(); ++anIndex) {
bool isSameFound = false;
AttributeSelectionPtr anAttrSelectionInList = aBaseObjectsAttrList->value(anIndex);
- ResultCompSolidPtr aResult = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(anAttrSelectionInList->context());
+ ResultCompSolidPtr aResult =
+ std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(anAttrSelectionInList->context());
if(!aResult.get()) {
continue;
}
}
//==================================================================================================
-bool FeaturesPlugin_ValidatorUnionArguments::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
- const std::list<std::string>& theArguments,
- Events_InfoMessage& theError) const
+bool FeaturesPlugin_ValidatorUnionArguments::isValid(
+ const std::shared_ptr<ModelAPI_Feature>& theFeature,
+ const std::list<std::string>& theArguments,
+ Events_InfoMessage& theError) const
{
// Check feature kind.
if(theFeature->getKind() != FeaturesPlugin_Union::ID()) {
}
// Get base objects attribute list.
- AttributeSelectionListPtr aBaseObejctsAttrList = theFeature->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID());
+ AttributeSelectionListPtr aBaseObejctsAttrList =
+ theFeature->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID());
if(!aBaseObejctsAttrList.get()) {
theError = "Error: Could not get \"%1\" attribute.";
theError.arg(FeaturesPlugin_Union::BASE_OBJECTS_ID());