Open CASCADE Technology  6.9.0
Public Member Functions | Static Public Member Functions

Interface_Category Class Reference

This class manages categories A category is defined by a name and a number, and can be seen as a way of rough classification, i.e. less precise than a cdl type. Hence, it is possible to dispatch every entity in about a dozen of categories, twenty is a reasonable maximum. More...

#include <Interface_Category.hxx>

Public Member Functions

 Interface_Category ()
 Creates a Category, with no protocol yet. More...
 
 Interface_Category (const Handle< Interface_Protocol > &proto)
 Creates a Category with a given protocol. More...
 
 Interface_Category (const Handle< Interface_GTool > &gtool)
 Creates a Category with a given GTool. More...
 
void SetProtocol (const Handle< Interface_Protocol > &proto)
 Sets/Changes Protocol. More...
 
Standard_Integer CatNum (const Handle< Standard_Transient > &ent, const Interface_ShareTool &shares)
 Determines the Category Number for an entity in its context, by using general service CategoryNumber. More...
 
void ClearNums ()
 Clears the recorded list of category numbers for a Model. More...
 
void Compute (const Handle< Interface_InterfaceModel > &model, const Interface_ShareTool &shares)
 Computes the Category Number for each entity and records it, in an array (ent.number -> category number) Hence, it can be queried by the method Num. The Model itself is not recorded, this method is intended to be used in a wider context (which detains also a Graph, etc) More...
 
Standard_Integer Num (const Standard_Integer nument) const
 Returns the category number recorded for an entity number Returns 0 if out of range. More...
 

Static Public Member Functions

static Standard_Integer AddCategory (const Standard_CString name)
 Records a new Category defined by its names, produces a number New if not yet recorded. More...
 
static Standard_Integer NbCategories ()
 Returns the count of recorded categories. More...
 
static Standard_CString Name (const Standard_Integer num)
 Returns the name of a category, according to its number. More...
 
static Standard_Integer Number (const Standard_CString name)
 Returns the number of a category, according to its name. More...
 
static void Init ()
 Default initialisation (protected against several calls : passes only once) More...
 

Detailed Description

This class manages categories A category is defined by a name and a number, and can be seen as a way of rough classification, i.e. less precise than a cdl type. Hence, it is possible to dispatch every entity in about a dozen of categories, twenty is a reasonable maximum.

Basically, the system provides the following categories : Shape (Geometry, BRep, CSG, Features, etc...) Drawing (Drawing, Views, Annotations, Pictures, Scketches ...) Structure (Component & Part, Groups & Patterns ...) Description (Meta-Data : Relations, Properties, Product ...) Auxiliary (those which do not enter in the above list) and some dedicated categories FEA , Kinematics , Piping , etc... plus Professional for other dedicated non-classed categories

In addition, this class provides a way to compute then quickly query category numbers for an entire model. Values are just recorded as a list of numbers, control must then be done in a wider context (which must provide a Graph)

Constructor & Destructor Documentation

Interface_Category::Interface_Category ( )

Creates a Category, with no protocol yet.

Interface_Category::Interface_Category ( const Handle< Interface_Protocol > &  proto)

Creates a Category with a given protocol.

Interface_Category::Interface_Category ( const Handle< Interface_GTool > &  gtool)

Creates a Category with a given GTool.

Member Function Documentation

static Standard_Integer Interface_Category::AddCategory ( const Standard_CString  name)
static

Records a new Category defined by its names, produces a number New if not yet recorded.

Standard_Integer Interface_Category::CatNum ( const Handle< Standard_Transient > &  ent,
const Interface_ShareTool shares 
)

Determines the Category Number for an entity in its context, by using general service CategoryNumber.

void Interface_Category::ClearNums ( )

Clears the recorded list of category numbers for a Model.

void Interface_Category::Compute ( const Handle< Interface_InterfaceModel > &  model,
const Interface_ShareTool shares 
)

Computes the Category Number for each entity and records it, in an array (ent.number -> category number) Hence, it can be queried by the method Num. The Model itself is not recorded, this method is intended to be used in a wider context (which detains also a Graph, etc)

static void Interface_Category::Init ( )
static

Default initialisation (protected against several calls : passes only once)

static Standard_CString Interface_Category::Name ( const Standard_Integer  num)
static

Returns the name of a category, according to its number.

static Standard_Integer Interface_Category::NbCategories ( )
static

Returns the count of recorded categories.

Standard_Integer Interface_Category::Num ( const Standard_Integer  nument) const

Returns the category number recorded for an entity number Returns 0 if out of range.

static Standard_Integer Interface_Category::Number ( const Standard_CString  name)
static

Returns the number of a category, according to its name.

void Interface_Category::SetProtocol ( const Handle< Interface_Protocol > &  proto)

Sets/Changes Protocol.


The documentation for this class was generated from the following file: