// name : SMESH_NumberFilter::SMESH_NumberFilter
// Purpose : Constructor
//=======================================================================
-SMESH_NumberFilter::SMESH_NumberFilter (const char* theKind,
+SMESH_NumberFilter::SMESH_NumberFilter (const QString& theKind,
const TopAbs_ShapeEnum theSubShapeType,
const int theNumber,
const TopAbs_ShapeEnum theShapeType,
GEOM::GEOM_Object_ptr theMainObj,
const bool theIsClosedOnly)
{
- myKind = (char*)theKind;
+ myKind = theKind;
mySubShapeType = theSubShapeType;
myNumber = theNumber;
myIsClosedOnly = theIsClosedOnly;
// name : SMESH_NumberFilter::SMESH_NumberFilter
// Purpose : Constructor
//=======================================================================
-SMESH_NumberFilter::SMESH_NumberFilter (const char* theKind,
+SMESH_NumberFilter::SMESH_NumberFilter (const QString& theKind,
const TopAbs_ShapeEnum theSubShapeType,
const int theNumber,
const TColStd_MapOfInteger& theShapeTypes,
GEOM::GEOM_Object_ptr theMainObj,
const bool theIsClosedOnly )
{
- myKind = (char*)theKind;
+ myKind = theKind;
mySubShapeType = theSubShapeType;
myNumber = theNumber;
myIsClosedOnly = theIsClosedOnly;
if (!aSO)
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();
anObj = GEOM::GEOM_Object::_narrow(anObject);
if (!CORBA::is_nil(anObj))
#include "SUIT_SelectionFilter.h"
+#include <qstring.h>
+
#include <TopAbs_ShapeEnum.hxx>
#include <TColStd_MapOfInteger.hxx>
class SMESH_NumberFilter : public SUIT_SelectionFilter
{
public:
- SMESH_NumberFilter (const char* theKind,
+ SMESH_NumberFilter (const QString& theKind,
const TopAbs_ShapeEnum theSubShapeType,
const int theNumber,
const TopAbs_ShapeEnum theShapeType = TopAbs_SHAPE,
GEOM::GEOM_Object_ptr theMainObj = GEOM::GEOM_Object::_nil(),
const bool theIsClosedOnly = false );
- SMESH_NumberFilter (const char* theKind,
+ SMESH_NumberFilter (const QString& theKind,
const TopAbs_ShapeEnum theSubShapeType,
const int theNumber,
const TColStd_MapOfInteger& theShapeTypes,
GEOM::GEOM_Object_ptr getGeom (const SUIT_DataOwner*) const;
private:
- char* myKind;
+ QString myKind;
TopAbs_ShapeEnum mySubShapeType;
int myNumber;
bool myIsClosedOnly;