From: Nicolas RECHATIN Date: Fri, 2 Jun 2023 10:21:45 +0000 (+0200) Subject: feat : AddNode with translation and no swallow X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=666d41ad82b10b85c04e9d6a058566f711ef61d6;p=modules%2Fshaper.git feat : AddNode with translation and no swallow --- diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp index 378b2a442..52cb79909 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp @@ -703,8 +703,6 @@ void ExchangePlugin_ExportFeature::exportROOT(const std::string &theFileName) // Handling data std::list aListOfMedias; - std::map aListOfVolumes; - std::map>> aCopyData; // Add feature in the file std::list aFeatures = document()->allFeatures(); @@ -729,61 +727,35 @@ void ExchangePlugin_ExportFeature::exportROOT(const std::string &theFileName) } else if (aFeature->getKind() == "Volume") { - std::map aFeatureDimensions; - aFeatureDimensions = ExchangePlugin_ExportRoot::computeVolume(aFeature); - std::wstring anObjectName = aFeature->firstResult()->data()->name(); + std::list> aFeatureDimensionsList; + aFeatureDimensionsList = ExchangePlugin_ExportRoot::computeVolume(aFeature); + + const std::list &aResultList = aFeature->results(); + auto aResIt = aResultList.begin(); - //Filter on already created medias - std::list::iterator anIter = std::find(aListOfMedias.begin(), aListOfMedias.end(), aFeatureDimensions["medium"]); - if (anIter != aListOfMedias.end()) - anAlgo->buildVolume(anObjectName, aFeatureDimensions, -1); - else + std::list>::iterator itList = aFeatureDimensionsList.begin(); + for (; itList != aFeatureDimensionsList.end(); ++itList) { - aListOfMedias.push_back(aFeatureDimensions["medium"]); - anAlgo->buildVolume(anObjectName, aFeatureDimensions, ++aMediumIndex); - } - // Add volume to known ones with no translation - aListOfVolumes[anObjectName] = ""; + std::map aFeatureDimensions = *itList; + std::wstring anObjectName = (*aResIt)->data()->name(); + // Filter on already created medias + std::list::iterator anIter = std::find(aListOfMedias.begin(), aListOfMedias.end(), aFeatureDimensions["medium"]); + if (anIter != aListOfMedias.end()) + anAlgo->buildVolume(anObjectName, aFeatureDimensions, -1); + else + { + aListOfMedias.push_back(aFeatureDimensions["medium"]); + anAlgo->buildVolume(anObjectName, aFeatureDimensions, ++aMediumIndex); + } + aResIt++; + } } else if (aFeature->getKind() == "AddNode") - { - std::map aFeatureDimensions; - aFeatureDimensions = ExchangePlugin_ExportRoot::computeAddNode(aFeature); - std::wstring anObjectName = aFeature->firstResult()->data()->name(); - - //Filter copied volumes - auto anIter = aListOfVolumes.find(aFeatureDimensions["tool"]); - if (anIter != aListOfVolumes.end()) - anAlgo->buildAddNode(aFeatureDimensions, anIter->second, aCopyData); - } - else if (aFeature->getKind() == "Copy") - { - std::map>> aFeatureDimensions; - aFeatureDimensions = ExchangePlugin_ExportRoot::computeCopy(aFeature); - aCopyData.insert(aFeatureDimensions.begin(), aFeatureDimensions.end()); - } - else if (aFeature->getKind() == "Translation") { std::map aFeatureDimensions; - aFeatureDimensions = ExchangePlugin_ExportRoot::computeTranslation(aFeature); - if (aFeatureDimensions.size()) - { - std::map::iterator it; - for (std::map::iterator it = aFeatureDimensions.begin(); it != aFeatureDimensions.end(); it++) - { - std::wstring aWStr(it->first.begin(), it->first.end()); - if (aListOfVolumes.find(aWStr) != aListOfVolumes.end()) - aListOfVolumes[aWStr] = it->second; - else - { - for (auto jt = aCopyData.begin(); jt != aCopyData.end(); jt++) - for (int k = 0; k < jt->second.size(); k++ ) - if (jt->second[k][0] == it->first) - jt->second[k][1] = it->second; - } - } - } else {std::cout << "Ignoring translation" << std::endl;} //Filter translation not on volume or addNode + aFeatureDimensions = ExchangePlugin_ExportRoot::computeAddNode(aFeature); + anAlgo->buildAddNode(aFeatureDimensions); } } diff --git a/src/ExchangePlugin/ExchangePlugin_ExportRoot.cpp b/src/ExchangePlugin/ExchangePlugin_ExportRoot.cpp index d02c5deaf..32f309d71 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportRoot.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportRoot.cpp @@ -17,8 +17,6 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#include -#include #include #include @@ -28,13 +26,7 @@ #include -#include -#include -#include - #include -#include -#include #include "math.h" namespace ExchangePlugin_ExportRoot @@ -124,32 +116,39 @@ } //=============================================================================================== - std::map computeVolume(FeaturePtr theFeature) + std::list> computeVolume(FeaturePtr theFeature) { std::string aMedium; + std::list> aVolList; //Get attributes aMedium = (theFeature->data()->string(OperaPlugin_Volume::MEDIUM_ID())->value()); - AttributeSelectionPtr aSel = theFeature->data()->selectionList(OperaPlugin_Volume::OBJECTS_LIST_ID())->value(0); - - //Get feature - ResultPtr aResult = aSel->context(); - FeaturePtr aSelFeature = aResult->document()->feature(aResult); - std::string aKind = aSelFeature->getKind(); + AttributeSelectionListPtr aSelList = theFeature->data()->selectionList(OperaPlugin_Volume::OBJECTS_LIST_ID()); + std::cout << "size = " << aSelList->size() << std::endl; - //Data out - std::wstring aWShapeName = aResult ? aResult->data()->name() : aSelFeature->firstResult()->data()->name(); - std::map aFeatureDim; - aFeatureDim["medium"] = aMedium; + for (int anIndex = 0; anIndex < aSelList->size(); ++anIndex) + { + std::cout << "i = " << anIndex << std::endl; + // Get feature + ResultPtr aResult = aSelList->value(anIndex)->context(); + FeaturePtr aSelFeature = aResult->document()->feature(aResult); + std::string aKind = aSelFeature->getKind(); + + // Data out + std::wstring aWShapeName = aResult ? aResult->data()->name() : aSelFeature->firstResult()->data()->name(); + std::map aFeatureDim; + aFeatureDim["medium"] = aMedium; - std::string aShapeName(aWShapeName.begin(), aWShapeName.end()); - aFeatureDim["shape"] = aShapeName; + std::string aShapeName(aWShapeName.begin(), aWShapeName.end()); + aFeatureDim["shape"] = aShapeName; - return aFeatureDim; + aVolList.push_back(aFeatureDim); + } + return aVolList; } //=============================================================================================== - std::map computeAddNode(FeaturePtr theFeature) + std::map computeAddNode(FeaturePtr theFeature) { //Get attributes std::string aMedium; @@ -157,6 +156,9 @@ // Get attributes AttributeSelectionPtr aMainSel = theFeature->data()->selection(OperaPlugin_AddNode::MAIN_OBJECT_ID()); AttributeSelectionPtr aToolSel = theFeature->data()->selection(OperaPlugin_AddNode::TOOL_OBJECT_ID()); + double DX = (theFeature->data()->real(OperaPlugin_AddNode::DX_ID())->value()); + double DY = (theFeature->data()->real(OperaPlugin_AddNode::DY_ID())->value()); + double DZ = (theFeature->data()->real(OperaPlugin_AddNode::DZ_ID())->value()); // Get main data ResultPtr aMainResult = aMainSel->context(); @@ -167,80 +169,19 @@ ResultPtr aToolResult = aToolSel->context(); FeaturePtr aToolSelFeature = aToolResult->document()->feature(aToolResult); std::wstring aWToolName = aToolResult ? aToolResult->data()->name() : aToolSelFeature->firstResult()->data()->name(); + //Convert Wstring to string + std::string aMainName(aWMainName.begin(), aWMainName.end()); + std::string aToolName(aWToolName.begin(), aWToolName.end()); // Data out - std::map aFeatureDim; - aFeatureDim["main"] = aWMainName; - aFeatureDim["tool"] = aWToolName; + std::map aFeatureDim; + aFeatureDim["main"] = aMainName; + aFeatureDim["tool"] = aToolName; + aFeatureDim["dx"] = std::to_string(DX); + aFeatureDim["dy"] = std::to_string(DY); + aFeatureDim["dz"] = std::to_string(DZ); return aFeatureDim; } - //=============================================================================================== - std::map>> computeCopy(FeaturePtr theFeature) - { - // Initialisation - std::map>> aFeatureDim; - - // Get attributes - AttributeSelectionListPtr aBaseObjectList = theFeature->data()->selectionList(FeaturesPlugin_Copy::OBJECTS()); - int aNumberOfCopies = theFeature->data()->integer(FeaturesPlugin_Copy::NUMBER())->value(); - - for (int anIndex = 0; anIndex < aBaseObjectList->size(); ++anIndex) - { - AttributeSelectionPtr aSelection = aBaseObjectList->value(anIndex); - ResultPtr aMainResult = aSelection->context(); - FeaturePtr aSelectionFeature = aMainResult->document()->feature(aMainResult); - std::wstring aWSelName = aMainResult ? aMainResult->data()->name() : aSelectionFeature->firstResult()->data()->name(); - std::string aSelName(aWSelName.begin(), aWSelName.end()); - std::vector> aNewBaseCopies; - for (int i = 0; i < aNumberOfCopies; i++) - { - std::array aNewCopy = {aSelName + "_" + std::to_string(i+1), "0,0,0"}; //TODO : Get "copy result name" - aNewBaseCopies.push_back(aNewCopy); - } - aFeatureDim[aSelName] = aNewBaseCopies; - } - return aFeatureDim; - } - - //=============================================================================================== - std::map computeTranslation(FeaturePtr theFeature) - { - AttributeStringPtr aMethodTypeAttr = theFeature->data()->string(FeaturesPlugin_Translation::CREATION_METHOD()); - std::string aMethodType = aMethodTypeAttr->value(); - - if (aMethodType == FeaturesPlugin_Translation::CREATION_METHOD_BY_DIMENSIONS()) - { - double DX, DY, DZ; - std::map aFeatureDim; - - DX = (theFeature->data()->real(FeaturesPlugin_Translation::DX_ID())->value()); - DY = (theFeature->data()->real(FeaturesPlugin_Translation::DY_ID())->value()); - DZ = (theFeature->data()->real(FeaturesPlugin_Translation::DZ_ID())->value()); - - AttributeSelectionListPtr aBaseObjectList = theFeature->data()->selectionList(FeaturesPlugin_Translation::OBJECTS_LIST_ID()); - for (int anIndex = 0; anIndex < aBaseObjectList->size(); ++anIndex) - { - //Get new target object name - AttributeSelectionPtr aSelection = aBaseObjectList->value(anIndex); - ResultPtr aMainResult = aSelection->context(); - FeaturePtr aSelectionFeature = aMainResult->document()->feature(aMainResult); - std::wstring aWSelName = aMainResult ? aMainResult->data()->name() : aSelectionFeature->firstResult()->data()->name(); - std::string aSelName(aWSelName.begin(), aWSelName.end()); - //Add it to translated objects - std::stringstream ss; - ss << std::fixed << std::setprecision(3) << DX << "," << DY << "," << DZ; - std::string aTrStr = ss.str(); - aFeatureDim[aSelName] = aTrStr; - } - return aFeatureDim; - } - else - { - std::map aFeatureDim; - return aFeatureDim; - } - } - } // namespace ExchangePlugin_ExportRoot diff --git a/src/ExchangePlugin/ExchangePlugin_ExportRoot.h b/src/ExchangePlugin/ExchangePlugin_ExportRoot.h index 705f91a3e..77871eba4 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportRoot.h +++ b/src/ExchangePlugin/ExchangePlugin_ExportRoot.h @@ -28,10 +28,8 @@ namespace ExchangePlugin_ExportRoot /// \param[out] theDimensions dimensions of the box EXCHANGEPLUGIN_EXPORT std::map computeBox(FeaturePtr theFeature); EXCHANGEPLUGIN_EXPORT std::map computeCylinder(FeaturePtr theFeature); - EXCHANGEPLUGIN_EXPORT std::map computeVolume(FeaturePtr theFeature); - EXCHANGEPLUGIN_EXPORT std::map computeAddNode(FeaturePtr theFeature); - EXCHANGEPLUGIN_EXPORT std::map>> computeCopy(FeaturePtr theFeature); - EXCHANGEPLUGIN_EXPORT std::map computeTranslation(FeaturePtr theFeature); + EXCHANGEPLUGIN_EXPORT std::list> computeVolume(FeaturePtr theFeature); + EXCHANGEPLUGIN_EXPORT std::map computeAddNode(FeaturePtr theFeature); } #endif /* EXCHANGEPLUGIN_EXPORTROOT_H_ */ diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ROOTExport.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ROOTExport.cpp index 451568a38..3590dfaa9 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ROOTExport.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ROOTExport.cpp @@ -26,6 +26,8 @@ #include #include +#include +#include "math.h" //================================================================================================= static std::string doubleToString(const double &theValue) @@ -147,42 +149,22 @@ void GeomAlgoAPI_ROOTExport::buildVolume(const std::wstring &theObjectName, } //================================================================================================= -void GeomAlgoAPI_ROOTExport::buildAddNode(const std::map theFeatureDim, - const std::string theVolumeTranslation, - const std::map>> theCopyData) +void GeomAlgoAPI_ROOTExport::buildAddNode(const std::map theFeatureDim) { static int theAddNodeIndex = 0; - std::string aMainName(theFeatureDim["main"].begin(), theFeatureDim["main"].end()); - std::string aToolName(theFeatureDim["tool"].begin(), theFeatureDim["tool"].end()); + //Create string for translation + std::stringstream ss; + ss << std::fixed << std::setprecision(3) << theFeatureDim["dx"] << "," << theFeatureDim["dy"] << "," << theFeatureDim["dz"]; + std::string aVolumeTranslation = ss.str(); + //Write content myContent << "\t" << "//Exporting AddNode " << theAddNodeIndex << std::endl; - - if (theVolumeTranslation.empty()) - { - myContent << "\t" - << aMainName << "->AddNode(" << aToolName << ", " << ++theAddNodeIndex << ");" - << std::endl; - } - else - { - myContent << "\t" - << aMainName << "->AddNode(" << aToolName << ", " << ++theAddNodeIndex << ", " - << "new TGeoTranslation(" << theVolumeTranslation << "));" - << std::endl; - } - - for (auto const &[key, val] : theCopyData){ - if (key == aToolName){ - for (auto& el: val){ - myContent << "\t" - << aMainName << "->AddNode(" << aToolName << ", " << ++theAddNodeIndex << ", " - << "new TGeoTranslation(" << el[1] <<"));" - << std::endl; - } - } - } + myContent << "\t" + << theFeatureDim["main"] << "->AddNode(" << theFeatureDim["tool"] << ", " << ++theAddNodeIndex << ", " + << "new TGeoTranslation(" << aVolumeTranslation << "));" + << std::endl; myContent << std::endl; } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ROOTExport.h b/src/GeomAlgoAPI/GeomAlgoAPI_ROOTExport.h index 85b572093..b1492e0ac 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ROOTExport.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ROOTExport.h @@ -63,9 +63,7 @@ public: const int theMediumIndex); /// Build AddNode - GEOMALGOAPI_EXPORT void buildAddNode(const std::map theFeatureDim, - const std::string theVolumeTranslation, - const std::map>> theCopyData); + GEOMALGOAPI_EXPORT void buildAddNode(const std::map theFeatureDim); /// Build Medium GEOMALGOAPI_EXPORT void addMedium(const std::string theMediumName); diff --git a/src/OperaAPI/OperaAPI_AddNode.h b/src/OperaAPI/OperaAPI_AddNode.h index 0fa0bce94..6eda7dee6 100644 --- a/src/OperaAPI/OperaAPI_AddNode.h +++ b/src/OperaAPI/OperaAPI_AddNode.h @@ -48,11 +48,17 @@ public: OPERAAPI_EXPORT virtual ~OperaAPI_AddNode(); - INTERFACE_2(OperaPlugin_AddNode::ID(), + INTERFACE_5(OperaPlugin_AddNode::ID(), mainObject, OperaPlugin_AddNode::MAIN_OBJECT_ID(), ModelAPI_AttributeSelection, /** Main Object */, toolObject, OperaPlugin_AddNode::TOOL_OBJECT_ID(), - ModelAPI_AttributeSelection, /** Tool Object*/) + ModelAPI_AttributeSelection, /** Tool Object*/, + dx, OperaPlugin_AddNode::DX_ID(), + ModelAPI_AttributeDouble, /** DX Value*/, + dy, OperaPlugin_AddNode::DY_ID(), + ModelAPI_AttributeDouble, /** DX Value*/, + dz, OperaPlugin_AddNode::DZ_ID(), + ModelAPI_AttributeDouble, /** DX Value*/) /// Set main object OPERAAPI_EXPORT diff --git a/src/OperaPlugin/OperaPlugin_AddNode.cpp b/src/OperaPlugin/OperaPlugin_AddNode.cpp index a78b5a013..d1c2c2858 100644 --- a/src/OperaPlugin/OperaPlugin_AddNode.cpp +++ b/src/OperaPlugin/OperaPlugin_AddNode.cpp @@ -19,7 +19,7 @@ #include "OperaPlugin_AddNode.h" -#include +#include //================================================================================================= OperaPlugin_AddNode::OperaPlugin_AddNode() // Nothing to do during instantiation @@ -31,9 +31,11 @@ void OperaPlugin_AddNode::initAttributes() { data()->addAttribute(MAIN_OBJECT_ID(), ModelAPI_AttributeSelection::typeId()); data()->addAttribute(TOOL_OBJECT_ID(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(DX_ID(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(DY_ID(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(DZ_ID(), ModelAPI_AttributeDouble::typeId()); } - //================================================================================================= void OperaPlugin_AddNode::handleNaming(const GeomMakeShapePtr& theBoolAlgo, const GeomShapePtr theTool, @@ -66,14 +68,65 @@ void OperaPlugin_AddNode::handleNaming(const GeomMakeShapePtr& theBoolAlgo, } } +//================================================================================================= +std::shared_ptr OperaPlugin_AddNode::getBoundingBoxCenter(const GeomShapePtr &theShape) +{ + // Bounding point min/max coordinates + std::string anError; + double aXmin, aXmax, aYmin, aYmax, aZmin, aZmax; + + // Bounding box points + if (!GetBoundingBox(theShape, aXmin, aXmax, aYmin, aYmax, aZmin, aZmax, anError)) + return NULL; + + //Retrun middle point from bounding box + return (GeomAlgoAPI_PointBuilder::vertex((aXmin + aXmax) / 2, (aYmin + aYmax) / 2, (aZmin + aZmax) / 2))->point(); +} //================================================================================================= void OperaPlugin_AddNode::performAlgo(const GeomShapePtr& theObject, GeomShapePtr theTool, const ListOfShape& theToolsList) { - //Intersecting tool case - if (theObject->intersect(theTool)){ + //Get points + std::string anError; + std::shared_ptr aStartPoint; + std::shared_ptr anEndPoint; + + //Get bounding box center for translation + aStartPoint = getBoundingBoxCenter(theTool); + anEndPoint = getBoundingBoxCenter(theObject); + + if (!aStartPoint || !anEndPoint) + return setError("Error in bounding box calculation :" + anError); + + //If not already in center, move it + float conf = 0.000001; // get Precision:Confusion + if (aStartPoint->distance(anEndPoint) > conf) + { + //Perform translation to tool's center of mass + std::shared_ptr aTranslationAlgoByPoint; + aTranslationAlgoByPoint.reset(new GeomAlgoAPI_Translation(theTool, aStartPoint, anEndPoint)); + // Check for error + if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aTranslationAlgoByPoint, getKind(), anError)) + return setError(anError); + theTool = aTranslationAlgoByPoint->shape(); + } + //Perform translation from tool's center of mass + double aDX = real(OperaPlugin_AddNode::DX_ID())->value(); + double aDY = real(OperaPlugin_AddNode::DY_ID())->value(); + double aDZ = real(OperaPlugin_AddNode::DZ_ID())->value(); + + std::shared_ptr aTranslationAlgoByDim; + aTranslationAlgoByDim.reset(new GeomAlgoAPI_Translation(theTool, aDX, aDY, aDZ)); + // Check for error + if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aTranslationAlgoByDim, getKind(), anError)) + return setError(anError); + theTool = aTranslationAlgoByDim->shape(); + + // Intersecting tool case + if (theObject->intersect(theTool)) + { std::shared_ptr aCommonAlgo; aCommonAlgo.reset(new GeomAlgoAPI_Boolean(theObject, theTool, @@ -81,13 +134,12 @@ void OperaPlugin_AddNode::performAlgo(const GeomShapePtr& theObject, theTool = aCommonAlgo->shape(); } - //Perform algorithm + //Perform Add Node Algorithm std::shared_ptr aBoolAlgo; aBoolAlgo.reset(new GeomAlgoAPI_Boolean(theObject, theTool, GeomAlgoAPI_Tools::BOOL_CUT)); //Check for error - std::string anError; if (GeomAlgoAPI_Tools::AlgoError::isAlgorithmFailed(aBoolAlgo, getKind(), anError)) return setError(anError); @@ -132,8 +184,6 @@ void OperaPlugin_AddNode::execute() } // Get Case - if (!aMainObjectShape->isIntersect(aToolShape)) - return setError("Error: All tools must intersect the main object"); if(aMainObjectShape == nullptr ) return setError("Error: cannot perform an AddNode with no main object."); if(aToolShape == nullptr) diff --git a/src/OperaPlugin/OperaPlugin_AddNode.h b/src/OperaPlugin/OperaPlugin_AddNode.h index f10b429fb..c58d86700 100644 --- a/src/OperaPlugin/OperaPlugin_AddNode.h +++ b/src/OperaPlugin/OperaPlugin_AddNode.h @@ -27,10 +27,15 @@ #include "GeomAPI_ShapeIterator.h" #include +#include +#include #include +#include #include #include "GeomAlgoAPI_Tools.h" +#include +#include #include #include #include @@ -67,19 +72,43 @@ class OperaPlugin_AddNode : public ModelAPI_Feature return MY_TOOL_OBJECT_ID; } + /// Attribute name of dimension in X. + inline static const std::string& DX_ID() + { + static const std::string MY_DX_ID("dx"); + return MY_DX_ID; + } + + /// Attribute name of dimension in X. + inline static const std::string &DY_ID() + { + static const std::string MY_DY_ID("dy"); + return MY_DY_ID; + } + + /// Attribute name of dimension in X. + inline static const std::string &DZ_ID() + { + static const std::string MY_DZ_ID("dz"); + return MY_DZ_ID; + } + /// Perform boolean alogrithm according to AddNode cases void performAlgo(const GeomShapePtr& theObject, GeomShapePtr theTool, const ListOfShape& theToolsList); /// Creates naming for AddNode results - void OperaPlugin_AddNode::handleNaming(const GeomMakeShapePtr& theBoolAlgo, - const GeomShapePtr theTool, - const ListOfShape& theToolsList); + void handleNaming(const GeomMakeShapePtr& theBoolAlgo, + const GeomShapePtr theTool, + const ListOfShape& theToolsList); /// Creates a new part document if needed OPERAPLUGIN_EXPORT virtual void execute(); + /// Get bounding box center for tranlation + OPERAPLUGIN_EXPORT virtual std::shared_ptr OperaPlugin_AddNode::getBoundingBoxCenter(const GeomShapePtr &theShape); + /// Request for initialization of data model of the feature: adding all attributes OPERAPLUGIN_EXPORT virtual void initAttributes(); diff --git a/src/OperaPlugin/addnode_widget.xml b/src/OperaPlugin/addnode_widget.xml index d8b3ddb6e..1a2fa49cb 100644 --- a/src/OperaPlugin/addnode_widget.xml +++ b/src/OperaPlugin/addnode_widget.xml @@ -1,16 +1,37 @@ - + label="Main object" + tooltip="Select a main object" + shape_types="solids compounds" + concealment="true"> + - + label="Tool object" + tooltip="Select a tool object" + shape_types="solids compounds" + concealment="false"> + + + + + + + diff --git a/src/OperaPlugin/volume_widget.xml b/src/OperaPlugin/volume_widget.xml index a0cbd22b7..25add9c2c 100644 --- a/src/OperaPlugin/volume_widget.xml +++ b/src/OperaPlugin/volume_widget.xml @@ -7,7 +7,7 @@ label="Objects" tooltip="Select solid objects" shape_types="solids" - concealment="true"> + concealment="false">