boost::dynamic_pointer_cast<ModelAPI_Feature>(*aFIter)->results();
list<boost::shared_ptr<ModelAPI_Result> >::const_iterator aRIter = aResults.begin();
for(; aRIter != aResults.cend(); aRIter++) {
- if ((*aRIter)->isInHistory() && (*aRIter)->group() == theGroupID) {
+ if ((*aRIter)->isInHistory() && (*aRIter)->groupName() == theGroupID) {
if (anIndex == theIndex)
return *aRIter;
anIndex++;
boost::dynamic_pointer_cast<ModelAPI_Feature>(*aFIter)->results();
list<boost::shared_ptr<ModelAPI_Result> >::const_iterator aRIter = aResults.begin();
for(; aRIter != aResults.cend(); aRIter++) {
- if ((*aRIter)->isInHistory() && (*aRIter)->group() == theGroupID) {
+ if ((*aRIter)->isInHistory() && (*aRIter)->groupName() == theGroupID) {
aResult++;
}
}
ModelAPI_ResultBody.h
ModelAPI_ResultConstruction.h
ModelAPI_ResultPart.h
+ ModelAPI_ResultParameters.h
)
SET(PROJECT_SOURCES
//virtual boost::shared_ptr<ModelAPI_Feature> owner() = 0;
/// Returns the group identifier of this result
- virtual std::string group() = 0;
+ virtual std::string groupName() = 0;
};
//! Pointer on feature object
{
public:
/// Returns the group identifier of this result
- virtual std::string group()
+ virtual std::string groupName()
+ { return group(); }
+
+ /// Returns the group identifier of this result
+ static std::string group()
{static std::string MY_GROUP = "Bodies"; return MY_GROUP;}
/// Stores the shape (called by the execution method).
{
public:
/// Returns the group identifier of this result
- virtual std::string group()
+ virtual std::string groupName()
+ { return group(); }
+
+ /// Returns the group identifier of this result
+ static std::string group()
{static std::string MY_GROUP = "Construction"; return MY_GROUP;}
+
/// Returns the shape-result produced by this feature
virtual boost::shared_ptr<GeomAPI_Shape>& shape() = 0;
--- /dev/null
+// File: ModelAPI_ResultParameters.h
+// Created: 07 Jul 2014
+// Author: Vitaly SMETANNIKOV
+
+#ifndef ModelAPI_ResultParameters_HeaderFile
+#define ModelAPI_ResultParameters_HeaderFile
+
+#include "ModelAPI_Result.h"
+
+/**\class ModelAPI_ResultParameters
+ * \ingroup DataModel
+ * \brief The construction element result of a feature.
+ *
+ * Provides a shape that may be displayed in the viewer.
+ * Intermediate, light result that in many cases produces a result on the fly.
+ */
+class ModelAPI_ResultParameters : public ModelAPI_Result
+{
+public:
+ /// Returns the group identifier of this result
+ virtual std::string groupName()
+ { return group(); }
+
+ /// Returns the group identifier of this result
+ static std::string group()
+ {static std::string MY_GROUP = "Parameters"; return MY_GROUP;}
+};
+
+//! Pointer on feature object
+typedef boost::shared_ptr<ModelAPI_ResultParameters> ResultParametersPtr;
+
+#endif
{
public:
/// Returns the group identifier of this result
- virtual std::string group()
+ virtual std::string groupName()
+ { return group(); }
+
+ /// Returns the group identifier of this result
+ static std::string group()
{static std::string MY_GROUP = "Parts"; return MY_GROUP;}
/// Returns the part-document of this result
#include <QList>
#include <ModelAPI_Feature.h>
+#include <ModelAPI_Result.h>
typedef QList<int> QIntList; //!< list of int values
typedef QList<short> QShortList; //!< list of short int values
typedef QList<double> QDoubleList; //!< list of double values
typedef QList<FeaturePtr> QFeatureList; //!< List of features
+typedef QList<ResultPtr> QResultList; //!< List of results
#endif
\ No newline at end of file
#include "ModuleBase.h"
-#include <ModelAPI_Feature.h>
+#include <ModelAPI_Object.h>
#include <AIS_InteractiveContext.hxx>
virtual Handle(AIS_InteractiveContext) AISContext() const = 0;
//! Returns list of currently selected data objects
- virtual QList<FeaturePtr> selectedFeatures() const = 0;
+ virtual QList<ObjectPtr> selectedObjects() const = 0;
//! Returns instance of loaded module
virtual ModuleBase_IModule* module() const = 0;
--- /dev/null
+// File: ModuleBase_Tools.cpp
+// Created: 11 July 2014
+// Author: Vitaly Smetannikov
+
+#include "ModuleBase_Tools.h"
+#include <ModelAPI_ResultBody.h>
+#include <ModelAPI_ResultConstruction.h>
+
+namespace ModuleBase_Tools
+{
+
+//******************************************************************
+boost::shared_ptr<GeomAPI_Shape> shape(ResultPtr theResult)
+{
+ ResultBodyPtr aBody = boost::dynamic_pointer_cast<ModelAPI_ResultBody>(theResult);
+ if (aBody)
+ return aBody->shape();
+
+ ResultConstructionPtr aConstruct = boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theResult);
+ if (aConstruct)
+ return aConstruct->shape();
+
+ return boost::shared_ptr<GeomAPI_Shape>();
+}
+
+}
\ No newline at end of file
--- /dev/null
+// File: ModuleBase_Tools.h
+// Created: 11 July 2014
+// Author: Vitaly Smetannikov
+
+
+#ifndef ModuleBase_Tools_H
+#define ModuleBase_Tools_H
+
+#include "ModuleBase.h"
+
+#include <ModelAPI_Result.h>
+
+class GeomAPI_Shape;
+
+namespace ModuleBase_Tools
+{
+
+ /**
+ * Returns returns a shape if the result has a shape method. Otherwise returns NULL pointer
+ */
+ MODULEBASE_EXPORT boost::shared_ptr<GeomAPI_Shape> shape(ResultPtr theResult);
+
+};
+
+#endif
\ No newline at end of file
#include <TopoDS_Shape.hxx>
#include <SelectMgr_EntityOwner.hxx>
-#include <ModelAPI_Feature.h>
+#include <ModelAPI_Result.h>
/**\class ModuleBase_ViewerPrs
* \ingroup Module base
/// \param theFeature a model feature
/// \param theShape a viewer shape
/// \param theOwner a selection owner
- ModuleBase_ViewerPrs(FeaturePtr theFeature,
+ ModuleBase_ViewerPrs(ResultPtr theResult,
const TopoDS_Shape& theShape,
Handle_SelectMgr_EntityOwner theOwner)
- : myFeature(theFeature), myShape(theShape), myOwner(theOwner) {}
+ : myResult(theResult), myShape(theShape), myOwner(theOwner) {}
/// Destructor
virtual ~ModuleBase_ViewerPrs() {}
/// Sets the feature.
/// \param theFeature a feature instance
- void setFeature(FeaturePtr theFeature) { myFeature = theFeature; }
+ void setFeature(ResultPtr theResult) { myResult = theResult; }
/// Returns the feature.
/// \return a feature instance
- FeaturePtr feature() const { return myFeature; }
+ ResultPtr result() const { return myResult; }
/// Returns the presentation owner
/// \param the owner
bool operator==(const ModuleBase_ViewerPrs& thePrs)
{
- bool aFeature = (myFeature.get() == thePrs.feature().get());
+ bool aResult = (myResult.get() == thePrs.result().get());
bool aOwner = (myOwner.Access() == thePrs.owner().Access());
bool aShape = myShape.IsEqual(thePrs.shape());
- return aFeature && aOwner && aShape;
+ return aResult && aOwner && aShape;
}
private:
- FeaturePtr myFeature; /// the feature
+ ResultPtr myResult; /// the feature
Handle(SelectMgr_EntityOwner) myOwner; /// the selection owner
TopoDS_Shape myShape; /// the shape
};
return false;
myFeature = theFeature;
- myEditor->setText(theFeature ? theFeature->data()->getName().c_str() : "");
+ myEditor->setText(theFeature ? theFeature->data()->name().c_str() : "");
emit valuesChanged();
return true;
}
boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aData->attribute(attributeID()));
myFeature = aRef->feature();
- myEditor->setText(myFeature ? myFeature->data()->getName().c_str() : "");
+ myEditor->setText(myFeature ? myFeature->data()->name().c_str() : "");
return true;
}
std::string aText = "";
if (aFeature)
- aText = aFeature->data()->getName().c_str();
+ aText = aFeature->data()->name().c_str();
else if (myAttribute)
aText = myAttribute->attributeType().c_str();
#include "ModuleBase_WidgetSelector.h"
#include "ModuleBase_IWorkshop.h"
+#include "ModuleBase_Tools.h"
#include <Events_Loop.h>
#include <Model_Events.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_Object.h>
+#include <ModelAPI_Result.h>
#include <ModelAPI_AttributeReference.h>
#include <Config_WidgetAPI.h>
boost::dynamic_pointer_cast<ModelAPI_AttributeReference>(aData->attribute(attributeID()));
FeaturePtr aFeature = aRef->value();
- if (!(aFeature && aFeature->isSame(mySelectedFeature))) {
- aRef->setValue(mySelectedFeature);
+ if (!(aFeature && aFeature->isSame(mySelectedObject))) {
+ aRef->setValue(mySelectedObject);
Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
}
return true;
boost::shared_ptr<ModelAPI_AttributeReference> aRef = aData->reference(attributeID());
bool isBlocked = this->blockSignals(true);
- mySelectedFeature = aRef->value();
+ mySelectedObject = aRef->value();
updateSelectionName();
this->blockSignals(isBlocked);
//********************************************************************
void ModuleBase_WidgetSelector::onSelectionChanged()
{
- QList<FeaturePtr> aFeatures = myWorkshop->selectedFeatures();
- if (aFeatures.size() > 0) {
- FeaturePtr aFeature = aFeatures.first();
- if ((!mySelectedFeature) && (!aFeature))
+ QList<ObjectPtr> aObjects = myWorkshop->selectedObjects();
+ if (aObjects.size() > 0) {
+ ObjectPtr aObject = aObjects.first();
+ if ((!mySelectedObject) && (!aObject))
return;
- if (mySelectedFeature && aFeature && mySelectedFeature->isSame(aFeature))
+ if (mySelectedObject && aObject && mySelectedObject->isSame(aObject))
return;
// Check that the selection corresponds to selection type
- if (!isAccepted(aFeature)) return;
+ if (!isAccepted(aObject)) return;
- mySelectedFeature = aFeature;
- if (mySelectedFeature) {
+ mySelectedObject = aObject;
+ if (mySelectedObject) {
updateSelectionName();
activateSelection(false);
raisePanel();
}
//********************************************************************
-bool ModuleBase_WidgetSelector::isAccepted(const FeaturePtr theFeature) const
+bool ModuleBase_WidgetSelector::isAccepted(const ObjectPtr theResult) const
{
- boost::shared_ptr<GeomAPI_Shape> aShapePtr = theFeature->data()->shape();
+ ResultPtr aResult = boost::dynamic_pointer_cast<ModelAPI_Result>(theResult);
+ boost::shared_ptr<GeomAPI_Shape> aShapePtr = ModuleBase_Tools::shape(aResult);
if (!aShapePtr) return false;
TopoDS_Shape aShape = aShapePtr->impl<TopoDS_Shape>();
if (aShape.IsNull()) return false;
//********************************************************************
void ModuleBase_WidgetSelector::updateSelectionName()
{
- if (mySelectedFeature) {
- std::string aName;
- if (mySelectedFeature->data())
- aName = mySelectedFeature->data()->getName();
- else
- aName = boost::dynamic_pointer_cast<ModelAPI_Object>(mySelectedFeature)->getName();
+ if (mySelectedObject) {
+ std::string aName = mySelectedObject->data()->name();
myTextLine->setText(QString::fromStdString(aName));
} else
#include "ModuleBase.h"
#include "ModuleBase_ModelWidget.h"
-#include <ModelAPI_Feature.h>
+#include <ModelAPI_Object.h>
#include <TopAbs_ShapeEnum.hxx>
void setActivationOnStart(bool toActivate) { myActivateOnStart = toActivate; }
bool activateOnStart() const { return myActivateOnStart; }
- FeaturePtr selectedFeature() const { return mySelectedFeature; }
+ ObjectPtr selectedFeature() const { return mySelectedObject; }
public slots:
void enableOthersControls(bool toEnable) const;
void updateSelectionName();
void raisePanel() const;
- bool isAccepted(const FeaturePtr theFeature) const;
+ bool isAccepted(const ObjectPtr theFeature) const;
static TopAbs_ShapeEnum shapeType(const QString& theType);
bool myActivateOnStart;
- FeaturePtr mySelectedFeature;
+ ObjectPtr mySelectedObject;
QStringList myShapeTypes;
};
{
QMenu* aMenu = new QMenu();
XGUI_SelectionMgr* aSelMgr = myWorkshop->selector();
- QFeatureList aFeatures = aSelMgr->selection()->selectedFeatures();
+ QList<ObjectPtr> aFeatures = aSelMgr->selection()->selectedObjects();
if (aFeatures.size() == 1) {
PluginManagerPtr aMgr = ModelAPI_PluginManager::get();
FeaturePtr aFeature = aFeatures.first();
void XGUI_ContextMenuMgr::addViewerItems(QMenu* theMenu) const
{
XGUI_SelectionMgr* aSelMgr = myWorkshop->selector();
- QFeatureList aFeatures = aSelMgr->selection()->selectedFeatures();
- if (aFeatures.size() > 0) {
- if (aFeatures.size() == 1)
+ QList<ObjectPtr> aObjects = aSelMgr->selection()->selectedObjects();
+ if (aObjects.size() > 0) {
+ if (aObjects.size() == 1)
theMenu->addAction(action("EDIT_CMD"));
bool isVisible = false;
- foreach(FeaturePtr aFeature, aFeatures) {
- if (myWorkshop->displayer()->isVisible(aFeature)) {
+ foreach(ObjectPtr aObject, aObjects) {
+ ResultPtr aRes = boost::dynamic_pointer_cast<ModelAPI_Result>(aObject);
+ if (aRes && myWorkshop->displayer()->isVisible(aRes)) {
isVisible = true;
break;
}
//! Returns Feature object by the given Model index.
//! Returns 0 if the given index is not index of a feature
- virtual FeaturePtr feature(const QModelIndex& theIndex) const = 0;
+ virtual ObjectPtr feature(const QModelIndex& theIndex) const = 0;
//! Returns QModelIndex which corresponds to the given feature
//! If the feature is not found then index is not valid
- virtual QModelIndex featureIndex(const FeaturePtr& theFeature) const = 0;
+ virtual QModelIndex featureIndex(const ObjectPtr& theFeature) const = 0;
//! Returns parent index of the given feature
- virtual QModelIndex findParent(const FeaturePtr& theFeature) const = 0;
+ virtual QModelIndex findParent(const ObjectPtr& theFeature) const = 0;
//! Returns index corresponded to the group
virtual QModelIndex findGroup(const std::string& theGroup) const = 0;
virtual bool hasDocument(const DocumentPtr& theDoc) const = 0;
//! Return a Part object
- virtual FeaturePtr part() const = 0;
+ virtual ObjectPtr part() const = 0;
protected:
//! Id of the current part object in the document
#include "XGUI_Viewer.h"
#include "XGUI_Workshop.h"
#include "XGUI_ViewerProxy.h"
-#include "XGUI_Tools.h"
+#include "ModuleBase_Tools.h"
#include <ModelAPI_Document.h>
#include <ModelAPI_Data.h>
{
}
-bool XGUI_Displayer::isVisible(FeaturePtr theFeature)
+bool XGUI_Displayer::isVisible(ResultPtr theResult)
{
- FeaturePtr aFeature = XGUI_Tools::realFeature(theFeature);
- return myFeature2AISObjectMap.find(aFeature) != myFeature2AISObjectMap.end();
+ return myResult2AISObjectMap.find(theResult) != myResult2AISObjectMap.end();
}
-bool XGUI_Displayer::display(FeaturePtr theFeature, bool isUpdateViewer)
+bool XGUI_Displayer::display(ResultPtr theResult, bool isUpdateViewer)
{
- FeaturePtr aFeature = XGUI_Tools::realFeature(theFeature);
- boost::shared_ptr<GeomAPI_Shape> aShapePtr = aFeature->data()->shape();
+ boost::shared_ptr<GeomAPI_Shape> aShapePtr = ModuleBase_Tools::shape(theResult);
if (aShapePtr) {
boost::shared_ptr<GeomAPI_AISObject> anAIS(new GeomAPI_AISObject());
anAIS->createShape(aShapePtr);
- return display(aFeature, anAIS, isUpdateViewer);
+ return display(theResult, anAIS, isUpdateViewer);
}
return false;
}
-bool XGUI_Displayer::display(FeaturePtr theFeature,
+bool XGUI_Displayer::display(ResultPtr theResult,
boost::shared_ptr<GeomAPI_AISObject> theAIS, bool isUpdateViewer)
{
Handle(AIS_InteractiveContext) aContext = AISContext();
Handle(AIS_InteractiveObject) anAISIO = theAIS->impl<Handle(AIS_InteractiveObject)>();
if (!anAISIO.IsNull()) {
- myFeature2AISObjectMap[theFeature] = theAIS;
+ myResult2AISObjectMap[theResult] = theAIS;
aContext->Display(anAISIO, isUpdateViewer);
return true;
}
-void XGUI_Displayer::erase(FeaturePtr theFeature,
+void XGUI_Displayer::erase(ResultPtr theResult,
const bool isUpdateViewer)
{
- FeaturePtr aFeature = XGUI_Tools::realFeature(theFeature);
-
- if (myFeature2AISObjectMap.find(aFeature) == myFeature2AISObjectMap.end())
+ if (myResult2AISObjectMap.find(theResult) == myResult2AISObjectMap.end())
return;
Handle(AIS_InteractiveContext) aContext = AISContext();
- boost::shared_ptr<GeomAPI_AISObject> anObject = myFeature2AISObjectMap[aFeature];
+ boost::shared_ptr<GeomAPI_AISObject> anObject = myResult2AISObjectMap[theResult];
if (anObject) {
Handle(AIS_InteractiveObject) anAIS = anObject->impl<Handle(AIS_InteractiveObject)>();
if (!anAIS.IsNull()) {
}
}
- myFeature2AISObjectMap.erase(aFeature);
+ myResult2AISObjectMap.erase(theResult);
}
-bool XGUI_Displayer::redisplay(FeaturePtr theFeature,
+bool XGUI_Displayer::redisplay(ResultPtr theFeature,
boost::shared_ptr<GeomAPI_AISObject> theAIS,
const bool isUpdateViewer)
{
//aContext->SetPixelTolerance(MOUSE_SENSITIVITY_IN_PIXEL);
}
// display or redisplay presentation
- boost::shared_ptr<GeomAPI_AISObject> anObj = myFeature2AISObjectMap[theFeature];
+ boost::shared_ptr<GeomAPI_AISObject> anObj = myResult2AISObjectMap[theFeature];
if (isVisible(theFeature) && anObj && !anObj->empty()) {
aContext->RecomputeSelectionOnly(anAIS);
}
else {
- myFeature2AISObjectMap[theFeature] = theAIS;
+ myResult2AISObjectMap[theFeature] = theAIS;
aContext->Display(anAIS, false);
isCreated = true;
}
return isCreated;
}
-bool XGUI_Displayer::redisplay(FeaturePtr theFeature, bool isUpdateViewer)
+bool XGUI_Displayer::redisplay(ResultPtr theResult, bool isUpdateViewer)
{
- FeaturePtr aFeature = XGUI_Tools::realFeature(theFeature);
- if (!isVisible(aFeature))
+ if (!isVisible(theResult))
return false;
- boost::shared_ptr<GeomAPI_Shape> aShapePtr = aFeature->data()->shape();
+ boost::shared_ptr<GeomAPI_Shape> aShapePtr = ModuleBase_Tools::shape(theResult);
if (aShapePtr) {
- boost::shared_ptr<GeomAPI_AISObject> aAISObj = getAISObject(aFeature);
+ boost::shared_ptr<GeomAPI_AISObject> aAISObj = getAISObject(theResult);
Handle(AIS_Shape) aAISShape = Handle(AIS_Shape)::DownCast(aAISObj->impl<Handle(AIS_InteractiveObject)>());
if (!aAISShape.IsNull()) {
aAISShape->Set(aShapePtr->impl<TopoDS_Shape>());
return false;
}
-void XGUI_Displayer::activateInLocalContext(FeaturePtr theFeature,
+void XGUI_Displayer::activateInLocalContext(ResultPtr theResult,
const std::list<int>& theModes, const bool isUpdateViewer)
{
Handle(AIS_InteractiveContext) aContext = AISContext();
}
// display or redisplay presentation
Handle(AIS_InteractiveObject) anAIS;
- if (isVisible(theFeature))
+ if (isVisible(theResult))
{
- boost::shared_ptr<GeomAPI_AISObject> anObj = myFeature2AISObjectMap[theFeature];
+ boost::shared_ptr<GeomAPI_AISObject> anObj = myResult2AISObjectMap[theResult];
if (anObj)
anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
}
updateViewer();
}
-void XGUI_Displayer::stopSelection(const QFeatureList& theFeatures, const bool isStop,
+void XGUI_Displayer::stopSelection(const QResultList& theResults, const bool isStop,
const bool isUpdateViewer)
{
Handle(AIS_InteractiveContext) aContext = AISContext();
Handle(AIS_Shape) anAIS;
- QFeatureList::const_iterator anIt = theFeatures.begin(), aLast = theFeatures.end();
- FeaturePtr aFeature;
+ QResultList::const_iterator anIt = theResults.begin(), aLast = theResults.end();
+ ResultPtr aFeature;
for (; anIt != aLast; anIt++) {
aFeature = *anIt;
if (isVisible(aFeature))
- anAIS = Handle(AIS_Shape)::DownCast(myFeature2AISObjectMap[aFeature]->impl<Handle(AIS_InteractiveObject)>());
+ anAIS = Handle(AIS_Shape)::DownCast(myResult2AISObjectMap[aFeature]->impl<Handle(AIS_InteractiveObject)>());
if (anAIS.IsNull())
continue;
updateViewer();
}
-void XGUI_Displayer::setSelected(const QFeatureList& theFeatures, const bool isUpdateViewer)
+void XGUI_Displayer::setSelected(const QResultList& theResults, const bool isUpdateViewer)
{
Handle(AIS_InteractiveContext) aContext = AISContext();
// we need to unhighligth objects manually in the current local context
aLocalContext->UnhilightLastDetected(myWorkshop->viewer()->activeView());
aContext->ClearSelected();
- foreach(FeaturePtr aFeature, theFeatures) {
- FeaturePtr aRFeature = XGUI_Tools::realFeature(aFeature);
- if (myFeature2AISObjectMap.find(aRFeature) == myFeature2AISObjectMap.end())
+ foreach(ResultPtr aResult, theResults) {
+ if (myResult2AISObjectMap.find(aResult) == myResult2AISObjectMap.end())
return;
- boost::shared_ptr<GeomAPI_AISObject> anObj = myFeature2AISObjectMap[aRFeature];
+ boost::shared_ptr<GeomAPI_AISObject> anObj = myResult2AISObjectMap[aResult];
if (anObj)
{
Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
Handle(AIS_InteractiveObject) anIO = anIter.Value();
ic->Erase(anIO, false);
}
- myFeature2AISObjectMap.clear();
+ myResult2AISObjectMap.clear();
if (isUpdateViewer)
updateViewer();
}*/
-void XGUI_Displayer::eraseDeletedFeatures(const bool isUpdateViewer)
+void XGUI_Displayer::eraseDeletedResults(const bool isUpdateViewer)
{
Handle(AIS_InteractiveContext) aContext = AISContext();
- FeatureToAISMap::const_iterator aFIt = myFeature2AISObjectMap.begin(),
- aFLast = myFeature2AISObjectMap.end();
- std::list<FeaturePtr> aRemoved;
+ ResultToAISMap::const_iterator aFIt = myResult2AISObjectMap.begin(),
+ aFLast = myResult2AISObjectMap.end();
+ std::list<ResultPtr> aRemoved;
for (; aFIt != aFLast; aFIt++)
{
- FeaturePtr aFeature = (*aFIt).first;
+ ResultPtr aFeature = (*aFIt).first;
if (!aFeature || !aFeature->data() || !aFeature->data()->isValid()) {
boost::shared_ptr<GeomAPI_AISObject> anObj = (*aFIt).second;
if (!anObj) continue;
}
}
}
- std::list<FeaturePtr>::const_iterator anIt = aRemoved.begin(),
+ std::list<ResultPtr>::const_iterator anIt = aRemoved.begin(),
aLast = aRemoved.end();
for (; anIt != aLast; anIt++) {
- myFeature2AISObjectMap.erase(myFeature2AISObjectMap.find(*anIt));
+ myResult2AISObjectMap.erase(myResult2AISObjectMap.find(*anIt));
}
if (isUpdateViewer)
}
boost::shared_ptr<GeomAPI_AISObject> XGUI_Displayer::getAISObject(
- FeaturePtr theFeature) const
+ ResultPtr theFeature) const
{
boost::shared_ptr<GeomAPI_AISObject> anIO;
- if (myFeature2AISObjectMap.find(theFeature) != myFeature2AISObjectMap.end())
- anIO = (myFeature2AISObjectMap.find(theFeature))->second;
+ if (myResult2AISObjectMap.find(theFeature) != myResult2AISObjectMap.end())
+ anIO = (myResult2AISObjectMap.find(theFeature))->second;
return anIO;
}
-FeaturePtr XGUI_Displayer::getFeature(Handle(AIS_InteractiveObject) theIO) const
+ResultPtr XGUI_Displayer::getResult(Handle(AIS_InteractiveObject) theIO) const
{
- FeaturePtr aFeature;
- FeatureToAISMap::const_iterator aFIt = myFeature2AISObjectMap.begin(),
- aFLast = myFeature2AISObjectMap.end();
+ ResultPtr aFeature;
+ ResultToAISMap::const_iterator aFIt = myResult2AISObjectMap.begin(),
+ aFLast = myResult2AISObjectMap.end();
for (; aFIt != aFLast && !aFeature; aFIt++) {
boost::shared_ptr<GeomAPI_AISObject> anObj = (*aFIt).second;
if (!anObj) continue;
#include <AIS_InteractiveContext.hxx>
#include <NCollection_List.hxx>
-#include <ModelAPI_Feature.h>
+#include <ModelAPI_Result.h>
#include <ModuleBase_Definitions.h>
#include <ModuleBase_ViewerPrs.h>
/// Returns the feature visibility state.
/// \param theFeature a feature instance
- bool isVisible(FeaturePtr theFeature);
+ bool isVisible(ResultPtr theResult);
/// Display the feature. Obtain the visualized object from the feature.
/// \param theFeature a feature instance
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
/// Returns true if the Feature succesfully displayed
- bool display(FeaturePtr theFeature, bool isUpdateViewer = true);
+ bool display(ResultPtr theFeature, bool isUpdateViewer = true);
/// Display the feature and a shape. This shape would be associated to the given feature
/// \param theFeature a feature instance
/// \param theAIS AIS presentation
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
/// Returns true if the Feature succesfully displayed
- bool display(FeaturePtr theFeature, boost::shared_ptr<GeomAPI_AISObject> theAIS, bool isUpdateViewer = true);
+ bool display(ResultPtr theResult, boost::shared_ptr<GeomAPI_AISObject> theAIS, bool isUpdateViewer = true);
/// Display the shape and activate selection of sub-shapes
/// \param theFeature a feature instance
/// \param theAIS an AIS object
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
/// \returns true if the presentation is created
- bool redisplay(FeaturePtr theFeature,
+ bool redisplay(ResultPtr theFeature,
boost::shared_ptr<GeomAPI_AISObject> theAIS,
const bool isUpdateViewer = true);
* \param theFeature a feature instance
* \param isUpdateViewer the parameter whether the viewer should be update immediatelly
*/
- bool redisplay(FeaturePtr theFeature, bool isUpdateViewer = true);
+ bool redisplay(ResultPtr theFeature, bool isUpdateViewer = true);
/// Redisplay the shape and activate selection of sub-shapes
/// \param theFeature a feature instance
/// \param theShape a shape
/// \param theMode a list of local selection modes
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
- void activateInLocalContext(FeaturePtr theFeature,
+ void activateInLocalContext(ResultPtr theFeature,
const std::list<int>& theModes, const bool isUpdateViewer = true);
/// Stop the current selection and color the given features to the selection color
/// \param theFeatures a list of features to be disabled
/// \param theToStop the boolean state whether it it stopped or non stopped
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
- void stopSelection(const QFeatureList& theFeatures, const bool isStop,
+ void stopSelection(const QResultList& theFeatures, const bool isStop,
const bool isUpdateViewer);
/**
* \param theFeatures a list of features to be selected
* isUpdateViewer the parameter whether the viewer should be update immediatelly
*/
- void setSelected(const QFeatureList& theFeatures, bool isUpdateViewer = true);
+ void setSelected(const QResultList& theFeatures, bool isUpdateViewer = true);
/// Erase the feature and a shape.
/// \param theFeature a feature instance
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
- void erase(FeaturePtr theFeature, const bool isUpdateViewer = true);
+ void erase(ResultPtr theResult, const bool isUpdateViewer = true);
/// Erase all presentations
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
/// Erase AIS interactive objects, which has an empty feature in the internal map
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
- void eraseDeletedFeatures(const bool isUpdateViewer = true);
+ void eraseDeletedResults(const bool isUpdateViewer = true);
/// Deactivates selection of sub-shapes
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
/// Searches the interactive object by feature
/// \param theFeature the feature or NULL if it not visualized
/// \return theIO an interactive object
- boost::shared_ptr<GeomAPI_AISObject> getAISObject(FeaturePtr theFeature) const;
+ boost::shared_ptr<GeomAPI_AISObject> getAISObject(ResultPtr theFeature) const;
/// Searches the feature by interactive object
/// \param theIO an interactive object
/// \return feature the feature or NULL if it not visualized
- FeaturePtr getFeature(Handle(AIS_InteractiveObject) theIO) const;
+ ResultPtr getResult(Handle(AIS_InteractiveObject) theIO) const;
protected:
/// Deactivate local selection
protected:
XGUI_Workshop* myWorkshop;
- typedef std::map<FeaturePtr, boost::shared_ptr<GeomAPI_AISObject> > FeatureToAISMap;
- FeatureToAISMap myFeature2AISObjectMap;
+ typedef std::map<ResultPtr, boost::shared_ptr<GeomAPI_AISObject> > ResultToAISMap;
+ ResultToAISMap myResult2AISObjectMap;
};
}
-QFeatureList XGUI_ModuleConnector::selectedFeatures() const
+QList<ObjectPtr> XGUI_ModuleConnector::selectedObjects() const
{
- return myWorkshop->selector()->selection()->selectedFeatures();
+ return myWorkshop->selector()->selection()->selectedObjects();
}
ModuleBase_IModule* XGUI_ModuleConnector::module() const
virtual Handle(AIS_InteractiveContext) AISContext() const;
//! Returns list of currently selected data objects
- virtual QFeatureList selectedFeatures() const;
+ virtual QList<ObjectPtr> selectedObjects() const;
//! Returns instance of loaded module
virtual ModuleBase_IModule* module() const;
#include "XGUI.h"
#include <ModuleBase_Definitions.h>
+#include <ModelAPI_Object.h>
#include <QWidget>
#include <QTreeView>
virtual ~XGUI_DataTree();
//! Returns list of currently selected features
- QFeatureList selectedFeatures() const { return mySelectedData; }
+ QList<ObjectPtr> selectedFeatures() const { return mySelectedData; }
XGUI_DocumentDataModel* dataModel() const;
private:
//! List of currently selected data
- QFeatureList mySelectedData;
+ QList<ObjectPtr> mySelectedData;
};
XGUI_DocumentDataModel* dataModel() const { return myDocModel; }
//! Returns list of currently selected features
- QFeatureList selectedFeatures() const { return myFeaturesList; }
+ QList<ObjectPtr> selectedObjects() const { return myObjectsList; }
void setFeaturesSelected(const QFeatureList& theFeatures);
QLineEdit* myActiveDocLbl;
XGUI_DataTree* myTreeView;
- QFeatureList myFeaturesList;
+ QList<ObjectPtr> myObjectsList;
};
#endif
\ No newline at end of file
#include <ModelAPI_PluginManager.h>
#include <ModelAPI_Document.h>
#include <ModelAPI_Feature.h>
+#include <ModelAPI_Result.h>
#include <ModelAPI_Data.h>
#include <ModelAPI_AttributeDocRef.h>
#include <ModelAPI_Object.h>
+#include <ModelAPI_ResultPart.h>
+#include <ModelAPI_ResultConstruction.h>
#include <QIcon>
#include <QBrush>
-//FeaturePtr featureObj(const FeaturePtr& theFeature)
+//ObjectPtr featureObj(const ObjectPtr& theFeature)
//{
// ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(theFeature);
// if (aObject)
case ParamObject:
{
DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
- FeaturePtr aFeature = aRootDoc->feature(PARAMETERS_GROUP, theIndex.row());
+ ObjectPtr aFeature = aRootDoc->object(PARAMETERS_GROUP, theIndex.row());
if (aFeature)
- return boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature)->getName().c_str();
+ return boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature)->data()->name().c_str();
}
case ConstructFolder:
return tr("Constructions") + QString(" (%1)").arg(rowCount(theIndex));
case ConstructObject:
{
DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
- FeaturePtr aFeature = aRootDoc->feature(CONSTRUCTIONS_GROUP, theIndex.row());
+ ObjectPtr aFeature = aRootDoc->object(ModelAPI_ResultConstruction::group(), theIndex.row());
if (aFeature)
- return boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature)->getName().c_str();
+ return boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature)->data()->name().c_str();
}
}
break;
case ConstructObject:
{
DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
- FeaturePtr aFeature = aRootDoc->feature(CONSTRUCTIONS_GROUP, theIndex.row());
+ ObjectPtr aFeature = aRootDoc->object(ModelAPI_ResultConstruction::group(), theIndex.row());
if (aFeature)
return QIcon(XGUI_Workshop::featureIcon(aFeature->getKind()));
}
return rowCount(theParent) > 0;
}
-FeaturePtr XGUI_TopDataModel::feature(const QModelIndex& theIndex) const
+ObjectPtr XGUI_TopDataModel::feature(const QModelIndex& theIndex) const
{
switch (theIndex.internalId()) {
case ParamsFolder:
case ConstructFolder:
- return FeaturePtr();
+ return ObjectPtr();
case ParamObject:
{
DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
return aRootDoc->feature(CONSTRUCTIONS_GROUP, theIndex.row());
}
}
- return FeaturePtr();
+ return ObjectPtr();
}
-QModelIndex XGUI_TopDataModel::findParent(const FeaturePtr& theFeature) const
+QModelIndex XGUI_TopDataModel::findParent(const ObjectPtr& theFeature) const
{
return findGroup(theFeature->getGroup().c_str());
}
return QModelIndex();
}
-QModelIndex XGUI_TopDataModel::featureIndex(const FeaturePtr& theFeature) const
+QModelIndex XGUI_TopDataModel::featureIndex(const ObjectPtr& theFeature) const
{
QModelIndex aIndex;
if (theFeature) {
case MyRoot:
{
DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
- FeaturePtr aFeature = aRootDoc->feature(PARTS_GROUP, myId);
+ ObjectPtr aFeature = aRootDoc->feature(PARTS_GROUP, myId);
if (aFeature)
return boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature)->getName().c_str();
}
return tr("Bodies") + QString(" (%1)").arg(rowCount(theIndex));
case ParamObject:
{
- FeaturePtr aFeature = featureDocument()->feature(PARAMETERS_GROUP, theIndex.row());
+ ObjectPtr aFeature = featureDocument()->feature(PARAMETERS_GROUP, theIndex.row());
if (aFeature)
return boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature)->getName().c_str();
}
case ConstructObject:
{
- FeaturePtr aFeature = featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row());
+ ObjectPtr aFeature = featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row());
if (aFeature)
return boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature)->getName().c_str();
}
case HistoryObject:
{
- FeaturePtr aFeature = featureDocument()->feature(FEATURES_GROUP, theIndex.row() - 3);
+ ObjectPtr aFeature = featureDocument()->feature(FEATURES_GROUP, theIndex.row() - 3);
if (aFeature)
return aFeature->data()->getName().c_str();
}
return QIcon(":pictures/constr_folder.png");
case ConstructObject:
{
- FeaturePtr aFeature = featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row());
+ ObjectPtr aFeature = featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row());
if (aFeature)
return QIcon(XGUI_Workshop::featureIcon(aFeature->getKind()));
}
case HistoryObject:
{
- FeaturePtr aFeature = featureDocument()->feature(FEATURES_GROUP, theIndex.row() - 3);
+ ObjectPtr aFeature = featureDocument()->feature(FEATURES_GROUP, theIndex.row() - 3);
if (aFeature)
return QIcon(XGUI_Workshop::featureIcon(aFeature->getKind()));
}
DocumentPtr XGUI_PartDataModel::featureDocument() const
{
DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
- FeaturePtr aFeature = aRootDoc->feature(PARTS_GROUP, myId, true);
+ ObjectPtr aFeature = aRootDoc->feature(PARTS_GROUP, myId, true);
return aFeature->data()->docRef("PartDocument")->value();
}
-FeaturePtr XGUI_PartDataModel::feature(const QModelIndex& theIndex) const
+ObjectPtr XGUI_PartDataModel::feature(const QModelIndex& theIndex) const
{
switch (theIndex.internalId()) {
case MyRoot:
case ParamsFolder:
case ConstructFolder:
case BodiesFolder:
- return FeaturePtr();
+ return ObjectPtr();
case ParamObject:
return featureDocument()->feature(PARAMETERS_GROUP, theIndex.row());
case ConstructObject:
case HistoryObject:
return featureDocument()->feature(FEATURES_GROUP, theIndex.row() - 3);
}
- return FeaturePtr();
+ return ObjectPtr();
}
bool XGUI_PartDataModel::hasDocument(const DocumentPtr& theDoc) const
}
-QModelIndex XGUI_PartDataModel::findParent(const FeaturePtr& theFeature) const
+QModelIndex XGUI_PartDataModel::findParent(const ObjectPtr& theFeature) const
{
return findGroup(theFeature->getGroup().c_str());
}
return QModelIndex();
}
-FeaturePtr XGUI_PartDataModel::part() const
+ObjectPtr XGUI_PartDataModel::part() const
{
DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
- return aRootDoc->feature(PARTS_GROUP, myId, true);
+ return aRootDoc->object(ModelAPI_ResultPart::group(), myId);
}
-QModelIndex XGUI_PartDataModel::featureIndex(const FeaturePtr& theFeature) const
+QModelIndex XGUI_PartDataModel::featureIndex(const ObjectPtr& theObject) const
{
QModelIndex aIndex;
- if (theFeature) {
- if (part() == theFeature)
+ if (theObject) {
+ if (part() == theObject)
return aIndex;
//std::string aGroup = theFeature->getGroup();
- DocumentPtr aDoc = theFeature->document();
- int aNb = aDoc->size(FEATURES_GROUP);
+ DocumentPtr aDoc = theObject->document();
+ int aNb = aDoc->size(ModelAPI_Feature::group());
int aRow = -1;
for (int i = 0; i < aNb; i++) {
- if (aDoc->feature(FEATURES_GROUP, i) == theFeature) {
+ if (aDoc->object(ModelAPI_Feature::group(), i) == theObject) {
aRow = i;
break;
}
//! Returns Feature object by the given Model index.
//! Returns 0 if the given index is not index of a feature
- virtual FeaturePtr feature(const QModelIndex& theIndex) const;
+ virtual ObjectPtr feature(const QModelIndex& theIndex) const;
//! Returns QModelIndex which corresponds to the given feature
//! If the feature is not found then index is not valid
- virtual QModelIndex featureIndex(const FeaturePtr& theFeature) const;
+ virtual QModelIndex featureIndex(const ObjectPtr& theFeature) const;
//! Returns parent index of the given feature
- virtual QModelIndex findParent(const FeaturePtr& theFeature) const;
+ virtual QModelIndex findParent(const ObjectPtr& theFeature) const;
//! Returns index corresponded to the group
virtual QModelIndex findGroup(const std::string& theGroup) const;
//! Returns Feature object by the given Model index.
//! Returns 0 if the given index is not index of a feature
- virtual FeaturePtr feature(const QModelIndex& theIndex) const;
+ virtual ObjectPtr feature(const QModelIndex& theIndex) const;
//! Returns QModelIndex which corresponds to the given feature
//! If the feature is not found then index is not valid
- virtual QModelIndex featureIndex(const FeaturePtr& theFeature) const;
+ virtual QModelIndex featureIndex(const ObjectPtr& theFeature) const;
//! Returns true if the given document is a sub-document of this tree
virtual bool hasDocument(const DocumentPtr& theDoc) const;
//! Returns parent index of the given feature
- virtual QModelIndex findParent(const FeaturePtr& theFeature) const;
+ virtual QModelIndex findParent(const ObjectPtr& theFeature) const;
//! Returns index corresponded to the group
virtual QModelIndex findGroup(const std::string& theGroup) const;
//! Return a Part object
- virtual FeaturePtr part() const;
+ virtual ObjectPtr part() const;
private:
std::list<ModuleBase_ViewerPrs> XGUI_Selection::getSelected(int theShapeTypeToSkip) const
{
- std::set<FeaturePtr> aPrsFeatures;
+ std::set<ResultPtr> aPrsFeatures;
std::list<ModuleBase_ViewerPrs> aPresentations;
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
if (theShapeTypeToSkip >= 0 && !aShape.IsNull() && aShape.ShapeType() == theShapeTypeToSkip)
continue;
- FeaturePtr aFeature = myWorkshop->displayer()->getFeature(anIO);
+ ResultPtr aFeature = myWorkshop->displayer()->getResult(anIO);
if (aPrsFeatures.find(aFeature) != aPrsFeatures.end())
continue;
Handle(SelectMgr_EntityOwner) anOwner = aContext->SelectedOwner();
std::list<ModuleBase_ViewerPrs> XGUI_Selection::getHighlighted(int theShapeTypeToSkip) const
{
- std::set<FeaturePtr > aPrsFeatures;
+ std::set<ResultPtr> aPrsFeatures;
std::list<ModuleBase_ViewerPrs> aPresentations;
Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
if (theShapeTypeToSkip >= 0 && !aShape.IsNull() && aShape.ShapeType() == theShapeTypeToSkip)
continue;
- FeaturePtr aFeature = myWorkshop->displayer()->getFeature(anIO);
- if (aPrsFeatures.find(aFeature) != aPrsFeatures.end())
+ ResultPtr aResult = myWorkshop->displayer()->getResult(anIO);
+ if (aPrsFeatures.find(aResult) != aPrsFeatures.end())
continue;
- aPresentations.push_back(ModuleBase_ViewerPrs(aFeature, aShape, NULL));
- aPrsFeatures.insert(aFeature);
+ aPresentations.push_back(ModuleBase_ViewerPrs(aResult, aShape, NULL));
+ aPrsFeatures.insert(aResult);
}
return aPresentations;
}
-QFeatureList XGUI_Selection::selectedFeatures() const
+QList<ObjectPtr> XGUI_Selection::selectedObjects() const
{
- return myWorkshop->objectBrowser()->selectedFeatures();
- //QFeatureList aSelectedList;
-
- //Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
- //for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
- // Handle(AIS_InteractiveObject) anIO = aContext->SelectedInteractive();
- // FeaturePtr aFeature = myWorkshop->displayer()->getFeature(anIO);
- // if (aFeature)
- // aSelectedList.append(aFeature);
- //}
- //return aSelectedList;
+ return myWorkshop->objectBrowser()->selectedObjects();
+}
+
+QResultList XGUI_Selection::selectedResults() const
+{
+ QResultList aSelectedList;
+
+ Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+ for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
+ Handle(AIS_InteractiveObject) anIO = aContext->SelectedInteractive();
+ ResultPtr aResult = myWorkshop->displayer()->getResult(anIO);
+ if (aResult)
+ aSelectedList.append(aResult);
+ }
+ return aSelectedList;
}
std::list<ModuleBase_ViewerPrs> getHighlighted(int theShapeTypeToSkip = -1) const;
/**
- * Returns list of features currently selected in 3d viewer
+ * Returns list of currently selected objects
*/
- QFeatureList selectedFeatures() const;
+ QList<ObjectPtr> selectedObjects() const;
+
+ /**
+ * Returns list of currently selected results
+ */
+ QResultList selectedResults() const;
//! Returns list of currently selected QModelIndexes
QModelIndexList selectedIndexes() const;
XGUI_Selection* selection() const { return mySelection; }
- //! Returns list of currently selected data objects
- //QFeatureList selectedFeatures() const;
-
- //! Returns list of currently selected QModelIndexes
- //QModelIndexList selectedIndexes() const;
-
- //! Returns list of currently selected AIS objects
- //void selectedAISObjects(AIS_ListOfInteractive& theList) const;
-
- //! Returns list of currently selected shapes
- //void selectedShapes(NCollection_List<TopoDS_Shape>& theList) const;
-
//! Connects the manager to all viewers accessible by Workshop
void connectViewers();
#include <TopoDS_Shape.hxx>
#include <ModelAPI_Object.h>
+#include <GeomAPI_Shape.h>
#include <QDir>
}
//******************************************************************
-FeaturePtr realFeature(const FeaturePtr theFeature)
+/*FeaturePtr realFeature(const FeaturePtr theFeature)
{
if (theFeature->data()) {
return theFeature;
ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(theFeature);
return aObject->featureRef();
}
-}
+}*/
+
}
#include <boost/shared_ptr.hpp>
-class TopoDS_Shape;
/*!
\brief Return directory part of the file path.
\param theFeature a feature
*/
std::string XGUI_EXPORT featureInfo(FeaturePtr theFeature);
-
- /**
- * Returns pointer on real feature
- */
- FeaturePtr realFeature(const FeaturePtr theFeature);
}
#endif
aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OPERATION_LAUNCHED));
aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED));
- aLoop->registerListener(this, Events_Loop::eventByName(EVENT_FEATURE_TO_REDISPLAY));
+ aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
activateModule();
if (myMainWindow) {
// Process creation of Part
if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_CREATED)) {
- const Model_FeatureUpdatedMessage* aUpdMsg = dynamic_cast<const Model_FeatureUpdatedMessage*>(theMessage);
+ const Model_ObjectUpdatedMessage* aUpdMsg = dynamic_cast<const Model_ObjectUpdatedMessage*>(theMessage);
onFeatureCreatedMsg(aUpdMsg);
}
// Redisplay feature
- if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_TO_REDISPLAY)) {
- const Model_FeatureUpdatedMessage* aUpdMsg = dynamic_cast<const Model_FeatureUpdatedMessage*>(theMessage);
+ if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY)) {
+ const Model_ObjectUpdatedMessage* aUpdMsg = dynamic_cast<const Model_ObjectUpdatedMessage*>(theMessage);
onFeatureRedisplayMsg(aUpdMsg);
}
//Update property panel on corresponding message. If there is no current operation (no
//property panel), or received message has different feature to the current - do nothing.
if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_UPDATED)) {
- const Model_FeatureUpdatedMessage* anUpdateMsg =
- dynamic_cast<const Model_FeatureUpdatedMessage*>(theMessage);
+ const Model_ObjectUpdatedMessage* anUpdateMsg =
+ dynamic_cast<const Model_ObjectUpdatedMessage*>(theMessage);
onFeatureUpdatedMsg(anUpdateMsg);
}
}
//******************************************************
-void XGUI_Workshop::onFeatureUpdatedMsg(const Model_FeatureUpdatedMessage* theMsg)
+void XGUI_Workshop::onFeatureUpdatedMsg(const Model_ObjectUpdatedMessage* theMsg)
{
std::set<FeaturePtr> aFeatures = theMsg->features();
if (myOperationMgr->hasOperation())
}
//******************************************************
-void XGUI_Workshop::onFeatureRedisplayMsg(const Model_FeatureUpdatedMessage* theMsg)
+void XGUI_Workshop::onFeatureRedisplayMsg(const Model_ObjectUpdatedMessage* theMsg)
{
std::set<FeaturePtr> aFeatures = theMsg->features();
std::set<FeaturePtr>::const_iterator aIt;
}
//******************************************************
-void XGUI_Workshop::onFeatureCreatedMsg(const Model_FeatureUpdatedMessage* theMsg)
+void XGUI_Workshop::onFeatureCreatedMsg(const Model_ObjectUpdatedMessage* theMsg)
{
std::set<FeaturePtr> aFeatures = theMsg->features();
class QWidget;
class QDockWidget;
-class Model_FeatureUpdatedMessage;
+class Model_ObjectUpdatedMessage;
class QAction;
/**\class XGUI_Workshop
void connectWithOperation(ModuleBase_Operation* theOperation);
void saveDocument(QString theName);
- void onFeatureUpdatedMsg(const Model_FeatureUpdatedMessage* theMsg);
- void onFeatureCreatedMsg(const Model_FeatureUpdatedMessage* theMsg);
- void onFeatureRedisplayMsg(const Model_FeatureUpdatedMessage* theMsg);
+ void onFeatureUpdatedMsg(const Model_ObjectUpdatedMessage* theMsg);
+ void onFeatureCreatedMsg(const Model_ObjectUpdatedMessage* theMsg);
+ void onFeatureRedisplayMsg(const Model_ObjectUpdatedMessage* theMsg);
QList<QAction*> getModuleCommands() const;