Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pipe validator fix
[modules/shaper.git]
/
src
/
PartSet
/
PartSet_SketcherMgr.cpp
diff --git
a/src/PartSet/PartSet_SketcherMgr.cpp
b/src/PartSet/PartSet_SketcherMgr.cpp
index 06fbec26cddd5bf4e0e5f2647c27293ae1e39cf2..22c4b653a1c586ccf11b1a317a6da2db49a12372 100755
(executable)
--- a/
src/PartSet/PartSet_SketcherMgr.cpp
+++ b/
src/PartSet/PartSet_SketcherMgr.cpp
@@
-36,6
+36,7
@@
#include <ModuleBase_OperationFeature.h>
#include <ModuleBase_Operation.h>
#include <ModuleBase_WidgetEditor.h>
#include <ModuleBase_OperationFeature.h>
#include <ModuleBase_Operation.h>
#include <ModuleBase_WidgetEditor.h>
+#include <ModuleBase_ViewerPrs.h>
#include <GeomDataAPI_Point2D.h>
#include <GeomDataAPI_Point2D.h>
@@
-89,15
+90,15
@@
//#define DEBUG_CURSOR
/// Returns list of unique objects by sum of objects from List1 and List2
//#define DEBUG_CURSOR
/// Returns list of unique objects by sum of objects from List1 and List2
-/*QList<ModuleBase_ViewerPrs
> getSumList(const QList<ModuleBase_ViewerPrs
>& theList1,
- const QList<ModuleBase_ViewerPrs>& theList2)
+/*QList<ModuleBase_ViewerPrs
Ptr> getSumList(const QList<ModuleBase_ViewerPrsPtr
>& theList1,
+ const QList<ModuleBase_ViewerPrs
Ptr
>& theList2)
{
{
- QList<ModuleBase_ViewerPrs> aRes;
- foreach (ModuleBase_ViewerPrs aPrs, theList1) {
+ QList<ModuleBase_ViewerPrs
Ptr
> aRes;
+ foreach (ModuleBase_ViewerPrs
Ptr
aPrs, theList1) {
if (!aRes.contains(aPrs))
aRes.append(aPrs);
}
if (!aRes.contains(aPrs))
aRes.append(aPrs);
}
- foreach (ModuleBase_ViewerPrs aPrs, theList2) {
+ foreach (ModuleBase_ViewerPrs
Ptr
aPrs, theList2) {
if (!aRes.contains(aPrs))
aRes.append(aPrs);
}
if (!aRes.contains(aPrs))
aRes.append(aPrs);
}
@@
-109,18
+110,18
@@
// \param theSketch a sketch to project a vertex shape of a presentation to the plane
// and find the corresponded attribute
// \param theFeatureList an output list of features
// \param theSketch a sketch to project a vertex shape of a presentation to the plane
// and find the corresponded attribute
// \param theFeatureList an output list of features
-void fillFeatureList(const QList<ModuleBase_ViewerPrs>& theList,
+void fillFeatureList(const QList<ModuleBase_ViewerPrs
Ptr
>& theList,
const FeaturePtr theSketch,
QList<FeaturePtr>& theFeatureList)
{
const FeaturePtr theSketch,
QList<FeaturePtr>& theFeatureList)
{
- QList<ModuleBase_ViewerPrs> aRes;
+ QList<ModuleBase_ViewerPrs
Ptr
> aRes;
- QList<ModuleBase_ViewerPrs>::const_iterator anIt = theList.begin(),
+ QList<ModuleBase_ViewerPrs
Ptr
>::const_iterator anIt = theList.begin(),
aLast = theList.end();
for (; anIt != aLast; anIt++)
{
aLast = theList.end();
for (; anIt != aLast; anIt++)
{
- ModuleBase_ViewerPrs aPrs = *anIt;
- FeaturePtr aFeature = ModelAPI_Feature::feature(aPrs
.
object());
+ ModuleBase_ViewerPrs
Ptr
aPrs = *anIt;
+ FeaturePtr aFeature = ModelAPI_Feature::feature(aPrs
->
object());
if (aFeature.get() && !theFeatureList.contains(aFeature))
theFeatureList.append(aFeature);
}
if (aFeature.get() && !theFeatureList.contains(aFeature))
theFeatureList.append(aFeature);
}
@@
-890,18
+891,13
@@
void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation)
myModule->workshop()->viewer()->addSelectionFilter(myPlaneFilter);
bool aHasPlane = false;
std::shared_ptr<GeomAPI_Pln> aPln;
myModule->workshop()->viewer()->addSelectionFilter(myPlaneFilter);
bool aHasPlane = false;
std::shared_ptr<GeomAPI_Pln> aPln;
- if (aFOperation->isEditOperation()) {
- // If it is editing of sketch then it means that plane is already defined
- aPln = PartSet_Tools::sketchPlane(myCurrentSketch);
- if (aPln.get())
- aHasPlane = true;
- }
+ aPln = PartSet_Tools::sketchPlane(myCurrentSketch);
myPlaneFilter->setPlane(aPln);
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
myPlaneFilter->setPlane(aPln);
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
- // all
sketch objects should be activated in the sketch selection modes by edit operation start
- //
in case of creation operation, there is an active widget, which activates own selection mode
- if (a
FOperation->isEditOperation() && aHasPlane
)
+ // all
displayed objects should be activated in current selection modes according to switched
+ //
plane filter
+ if (a
Pln.get()
)
aConnector->activateModuleSelectionModes();
}
aConnector->activateModuleSelectionModes();
}
@@
-1621,7
+1617,7
@@
void PartSet_SketcherMgr::storeSelection(const bool theHighlightedOnly)
ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
ModuleBase_ISelection* aSelect = aWorkshop->selection();
ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
ModuleBase_ISelection* aSelect = aWorkshop->selection();
- QList<ModuleBase_ViewerPrs> aHighlighted = aSelect->getHighlighted();
+ QList<ModuleBase_ViewerPrs
Ptr
> aHighlighted = aSelect->getHighlighted();
QList<FeaturePtr> aFeatureList;
if (theHighlightedOnly) {
QList<FeaturePtr> aFeatureList;
if (theHighlightedOnly) {
@@
-1630,7
+1626,7
@@
void PartSet_SketcherMgr::storeSelection(const bool theHighlightedOnly)
else {
fillFeatureList(aHighlighted, myCurrentSketch, aFeatureList);
else {
fillFeatureList(aHighlighted, myCurrentSketch, aFeatureList);
- QList<ModuleBase_ViewerPrs> aSelected = aSelect->getSelected(ModuleBase_ISelection::AllControls);
+ QList<ModuleBase_ViewerPrs
Ptr
> aSelected = aSelect->getSelected(ModuleBase_ISelection::AllControls);
fillFeatureList(aSelected, myCurrentSketch, aFeatureList);
}
fillFeatureList(aSelected, myCurrentSketch, aFeatureList);
}