mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-15 10:08:34 +05:00
Now filter accepts and stores kind of object as qstring (instead char*) and takes kind into account in method isOK
This commit is contained in:
parent
c7d2780341
commit
388e2dfade
@ -28,14 +28,14 @@
|
|||||||
// name : SMESH_NumberFilter::SMESH_NumberFilter
|
// name : SMESH_NumberFilter::SMESH_NumberFilter
|
||||||
// Purpose : Constructor
|
// Purpose : Constructor
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMESH_NumberFilter::SMESH_NumberFilter (const char* theKind,
|
SMESH_NumberFilter::SMESH_NumberFilter (const QString& theKind,
|
||||||
const TopAbs_ShapeEnum theSubShapeType,
|
const TopAbs_ShapeEnum theSubShapeType,
|
||||||
const int theNumber,
|
const int theNumber,
|
||||||
const TopAbs_ShapeEnum theShapeType,
|
const TopAbs_ShapeEnum theShapeType,
|
||||||
GEOM::GEOM_Object_ptr theMainObj,
|
GEOM::GEOM_Object_ptr theMainObj,
|
||||||
const bool theIsClosedOnly)
|
const bool theIsClosedOnly)
|
||||||
{
|
{
|
||||||
myKind = (char*)theKind;
|
myKind = theKind;
|
||||||
mySubShapeType = theSubShapeType;
|
mySubShapeType = theSubShapeType;
|
||||||
myNumber = theNumber;
|
myNumber = theNumber;
|
||||||
myIsClosedOnly = theIsClosedOnly;
|
myIsClosedOnly = theIsClosedOnly;
|
||||||
@ -47,14 +47,14 @@ SMESH_NumberFilter::SMESH_NumberFilter (const char* theKind,
|
|||||||
// name : SMESH_NumberFilter::SMESH_NumberFilter
|
// name : SMESH_NumberFilter::SMESH_NumberFilter
|
||||||
// Purpose : Constructor
|
// Purpose : Constructor
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMESH_NumberFilter::SMESH_NumberFilter (const char* theKind,
|
SMESH_NumberFilter::SMESH_NumberFilter (const QString& theKind,
|
||||||
const TopAbs_ShapeEnum theSubShapeType,
|
const TopAbs_ShapeEnum theSubShapeType,
|
||||||
const int theNumber,
|
const int theNumber,
|
||||||
const TColStd_MapOfInteger& theShapeTypes,
|
const TColStd_MapOfInteger& theShapeTypes,
|
||||||
GEOM::GEOM_Object_ptr theMainObj,
|
GEOM::GEOM_Object_ptr theMainObj,
|
||||||
const bool theIsClosedOnly )
|
const bool theIsClosedOnly )
|
||||||
{
|
{
|
||||||
myKind = (char*)theKind;
|
myKind = theKind;
|
||||||
mySubShapeType = theSubShapeType;
|
mySubShapeType = theSubShapeType;
|
||||||
myNumber = theNumber;
|
myNumber = theNumber;
|
||||||
myIsClosedOnly = theIsClosedOnly;
|
myIsClosedOnly = theIsClosedOnly;
|
||||||
@ -145,6 +145,11 @@ GEOM::GEOM_Object_ptr SMESH_NumberFilter::getGeom
|
|||||||
if (!aSO)
|
if (!aSO)
|
||||||
return GEOM::GEOM_Object::_nil();
|
return GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
|
_PTR(SComponent) objComponent = aSO->GetFatherComponent();
|
||||||
|
if( !objComponent || objComponent->ComponentDataType()!=myKind )
|
||||||
|
return GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
|
|
||||||
CORBA::Object_var anObject = _CAST(SObject,aSO)->GetObject();
|
CORBA::Object_var anObject = _CAST(SObject,aSO)->GetObject();
|
||||||
anObj = GEOM::GEOM_Object::_narrow(anObject);
|
anObj = GEOM::GEOM_Object::_narrow(anObject);
|
||||||
if (!CORBA::is_nil(anObj))
|
if (!CORBA::is_nil(anObj))
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#include "SUIT_SelectionFilter.h"
|
#include "SUIT_SelectionFilter.h"
|
||||||
|
|
||||||
|
#include <qstring.h>
|
||||||
|
|
||||||
#include <TopAbs_ShapeEnum.hxx>
|
#include <TopAbs_ShapeEnum.hxx>
|
||||||
#include <TColStd_MapOfInteger.hxx>
|
#include <TColStd_MapOfInteger.hxx>
|
||||||
|
|
||||||
@ -29,14 +31,14 @@ class SUIT_DataOwner;
|
|||||||
class SMESH_NumberFilter : public SUIT_SelectionFilter
|
class SMESH_NumberFilter : public SUIT_SelectionFilter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SMESH_NumberFilter (const char* theKind,
|
SMESH_NumberFilter (const QString& theKind,
|
||||||
const TopAbs_ShapeEnum theSubShapeType,
|
const TopAbs_ShapeEnum theSubShapeType,
|
||||||
const int theNumber,
|
const int theNumber,
|
||||||
const TopAbs_ShapeEnum theShapeType = TopAbs_SHAPE,
|
const TopAbs_ShapeEnum theShapeType = TopAbs_SHAPE,
|
||||||
GEOM::GEOM_Object_ptr theMainObj = GEOM::GEOM_Object::_nil(),
|
GEOM::GEOM_Object_ptr theMainObj = GEOM::GEOM_Object::_nil(),
|
||||||
const bool theIsClosedOnly = false );
|
const bool theIsClosedOnly = false );
|
||||||
|
|
||||||
SMESH_NumberFilter (const char* theKind,
|
SMESH_NumberFilter (const QString& theKind,
|
||||||
const TopAbs_ShapeEnum theSubShapeType,
|
const TopAbs_ShapeEnum theSubShapeType,
|
||||||
const int theNumber,
|
const int theNumber,
|
||||||
const TColStd_MapOfInteger& theShapeTypes,
|
const TColStd_MapOfInteger& theShapeTypes,
|
||||||
@ -58,7 +60,7 @@ class SMESH_NumberFilter : public SUIT_SelectionFilter
|
|||||||
GEOM::GEOM_Object_ptr getGeom (const SUIT_DataOwner*) const;
|
GEOM::GEOM_Object_ptr getGeom (const SUIT_DataOwner*) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char* myKind;
|
QString myKind;
|
||||||
TopAbs_ShapeEnum mySubShapeType;
|
TopAbs_ShapeEnum mySubShapeType;
|
||||||
int myNumber;
|
int myNumber;
|
||||||
bool myIsClosedOnly;
|
bool myIsClosedOnly;
|
||||||
|
Loading…
Reference in New Issue
Block a user