SHAPER  9.12.0
GeomValidators_ShapeType Class Reference

A validator for shape types, such as vertex, line, circe or arc. More...

Inheritance diagram for GeomValidators_ShapeType:
Inheritance graph

Public Types

enum  TypeOfShape {
  Empty , Vertex , Edge , Line ,
  Circle , Wire , Face , Plane ,
  Shell , Solid , CompSolid , Compound ,
  AnyShape
}
 Type of shape. More...
 

Public Member Functions

virtual bool isValid (const AttributePtr &theAttribute, const std::list< std::string > &theArguments, Events_InfoMessage &theError) const
 Returns true if attribute has shape type listed in the parameter arguments. More...
 

Static Public Member Functions

static TypeOfShape shapeType (const std::string &theType)
 Convert string to TypeOfShape value. More...
 

Protected Member Functions

bool isValidAttribute (const AttributePtr &theAttribute, const TypeOfShape theShapeType, Events_InfoMessage &theError) const
 Returns true if the attibute's object type satisfies the argument value. More...
 
bool isValidObject (const ObjectPtr &theObject, const TypeOfShape theShapeType, const bool theIsGeometricalSelection, Events_InfoMessage &theError) const
 Returns true if the attibute's object type satisfies the argument value. More...
 
bool isValidShape (const GeomShapePtr theShape, const TypeOfShape theShapeType, const bool theIsGeometricalSelection, Events_InfoMessage &theError) const
 Returns true if the attibute's object type satisfies the argument value. More...
 

Detailed Description

A validator for shape types, such as vertex, line, circe or arc.

If there are some argument parameters, this validator returns true if the attribute satisfied at least one argument (OR combination of arguments).

Member Enumeration Documentation

◆ TypeOfShape

Member Function Documentation

◆ isValid()

bool GeomValidators_ShapeType::isValid ( const AttributePtr &  theAttribute,
const std::list< std::string > &  theArguments,
Events_InfoMessage theError 
) const
virtual

Returns true if attribute has shape type listed in the parameter arguments.

Parameters
[in]theAttributethe checked attribute
[in]theArgumentsarguments of the attribute
[out]theErrorerror message.

Implements ModelAPI_AttributeValidator.

Reimplemented in FiltersPlugin_ShapeTypeValidator.

◆ shapeType()

GeomValidators_ShapeType::TypeOfShape GeomValidators_ShapeType::shapeType ( const std::string &  theType)
static

Convert string to TypeOfShape value.

Parameters
theTypea string value

◆ isValidAttribute()

bool GeomValidators_ShapeType::isValidAttribute ( const AttributePtr &  theAttribute,
const TypeOfShape  theShapeType,
Events_InfoMessage theError 
) const
protected

Returns true if the attibute's object type satisfies the argument value.

Parameters
[in]theAttributea checked attribute
[in]theShapeTypea type of shape
[out]theErrorerror message.

◆ isValidObject()

bool GeomValidators_ShapeType::isValidObject ( const ObjectPtr &  theObject,
const TypeOfShape  theShapeType,
const bool  theIsGeometricalSelection,
Events_InfoMessage theError 
) const
protected

Returns true if the attibute's object type satisfies the argument value.

Parameters
[in]theObjecta checked object
[in]theShapeTypea shape type
[out]theErrorerror message.

◆ isValidShape()

bool GeomValidators_ShapeType::isValidShape ( const GeomShapePtr  theShape,
const TypeOfShape  theShapeType,
const bool  theIsGeometricalSelection,
Events_InfoMessage theError 
) const
protected

Returns true if the attibute's object type satisfies the argument value.

Parameters
[in]theShapea checked shape
[in]theShapeTypea shape type
[out]theErrorerror message.