Merge from BR_phase16 branch (09/12/09)

This commit is contained in:
vsr 2009-12-09 13:26:30 +00:00
parent 499b281dc4
commit f697bd6392
5 changed files with 650 additions and 682 deletions

View File

@ -18,7 +18,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "GEOM_SelectionFilter.h"
#include "GEOM_Client.hxx"
@ -65,6 +65,19 @@ bool GEOM_SelectionFilter::isOk( const SUIT_DataOwner* sOwner ) const
if ( getShape( obj, shape ) )
return contains( shape.ShapeType() ) && isShapeOk( shape );
}
// IMP 0020435: fine local selection
{
const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>(sOwner);
if (owner) {
QString entry = owner->entry();
int index = entry.lastIndexOf("_");
if (index > 0) {
return true;
}
}
}
return false;
}
@ -72,7 +85,8 @@ bool GEOM_SelectionFilter::isOk( const SUIT_DataOwner* sOwner ) const
// function : getObject
// purpose :
//=======================================================================
GEOM::GEOM_Object_ptr GEOM_SelectionFilter::getObject( const SUIT_DataOwner* sOwner, const bool extractReference ) const
GEOM::GEOM_Object_ptr GEOM_SelectionFilter::getObject (const SUIT_DataOwner* sOwner,
const bool extractReference) const
{
GEOM::GEOM_Object_var anObj;

View File

@ -1025,6 +1025,44 @@ SALOME_Prs* GEOM_Displayer::buildPresentation( const QString& entry,
return prs;
}
//=================================================================
/*!
* GEOM_Displayer::buildSubshapePresentation
* Builds/finds object's presentation for the current viewer
* Calls corresponding Update() method by means of double dispatch
* For not published objects (for Mantis issue 0020435)
*/
//=================================================================
SALOME_Prs* GEOM_Displayer::buildSubshapePresentation(const TopoDS_Shape& aShape,
const QString& entry,
SALOME_View* theViewFrame)
{
SALOME_Prs* prs = 0;
internalReset();
myViewFrame = theViewFrame ? theViewFrame : GetActiveView();
if (myViewFrame)
{
prs = LightApp_Displayer::buildPresentation(entry, theViewFrame);
if (prs)
{
Handle(SALOME_InteractiveObject) theIO = new SALOME_InteractiveObject();
theIO->setEntry(entry.toLatin1().constData());
if (!theIO.IsNull())
{
// set interactive object
setIO(theIO);
// finally set shape
setShape(aShape);
myType = GEOM_SUBSHAPE;
}
UpdatePrs(prs); // Update presentation by using of the double dispatch
}
}
return prs;
}
//=================================================================
/*!
* GEOM_Displayer::internalReset

View File

@ -155,9 +155,14 @@ public:
static SALOMEDS::Color getUniqueColor( const QList<SALOMEDS::Color>& );
/* Builds presentation of not published object */
virtual SALOME_Prs* buildSubshapePresentation(const TopoDS_Shape& aShape,
const QString&,
SALOME_View* = 0);
protected:
/* internal methods */
/* Builds presentation accordint to the current viewer type */
/* Builds presentation according to the current viewer type */
virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 );
/* Sets interactive object */

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@
// GEOM GEOMGUI : GUI for Geometry component
// File : GroupGUI_GroupDlg.h
// Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
//
#ifndef GROUPGUI_GROUPDLG_H
#define GROUPGUI_GROUPDLG_H
@ -30,6 +30,7 @@
#include <TopAbs_ShapeEnum.hxx>
#include <TColStd_DataMapOfIntegerInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
class QGroupBox;
class QLineEdit;
@ -74,6 +75,7 @@ private slots:
void selectAllSubShapes();
void add();
void remove();
void showOnlySelected();
void selectionChanged();
private:
@ -83,10 +85,11 @@ private:
TopAbs_ShapeEnum getShapeType() const;
void setShapeType( const TopAbs_ShapeEnum );
void activateSelection();
void updateState();
void updateState(bool isAdd = false);
void highlightSubShapes();
void onGetInPlace();
void setInPlaceObj( GEOM::GEOM_Object_var, const bool isVisible=1);
int getSelectedSubshapes (TColStd_IndexedMapOfInteger& theMapIndex);
private:
Mode myMode;
@ -102,11 +105,14 @@ private:
QLineEdit* myMainName;
QPushButton* mySelBtn2;
QLineEdit* myShape2Name;
QGroupBox* mySelectionWayGroupBox;
QButtonGroup* mySelectionWayGroup;
QGroupBox* myRestrictGroupBox;
QButtonGroup* myRestrictGroup;
QPushButton* mySelAllBtn;
QPushButton* myAddBtn;
QPushButton* myRemBtn;
QPushButton* myShowOnlyBtn;
QPushButton* myHideSelBtn;
QPushButton* myShowAllBtn;
QListWidget* myIdList;
};