oaLayerConstraint Class Reference

Inheritance diagram for oaLayerConstraint:

oaConstraint oaObject


Public Methods

oaLayerNum getLayer () const
oaPurposeNum getPurpose () const

Static Public Methods

oaLayerConstraint * create (oaLayerNum layer, const oaLayerConstraintDef *def, oaValue *value, oaBoolean isHard=true, const oaConstraintParamArray *params=NULL)
oaLayerConstraint * create (oaLayerNum layer, const oaLayerConstraintDef *def, const oaString &name, oaValue *value, oaBoolean isHard=true, const oaConstraintParamArray *params=NULL)
oaLayerConstraint * create (oaLayerNum layer, oaPurposeNum purpose, const oaLayerConstraintDef *def, oaValue *value, oaBoolean isHard=true, const oaConstraintParamArray *params=NULL)
oaLayerConstraint * create (oaLayerNum layer, oaPurposeNum purpose, const oaLayerConstraintDef *def, const oaString &name, oaValue *value, oaBoolean isHard=true, const oaConstraintParamArray *params=NULL)
oaLayerConstraint * find (const oaConstraintGroup *group, oaLayerNum layer, const oaLayerConstraintDef *def, oaBoolean hardOnly=false)
oaLayerConstraint * find (const oaConstraintGroup *group, oaLayerNum layer, oaPurposeNum purpose, const oaLayerConstraintDef *def, oaBoolean hardOnly=false)
oaCollection< oaLayerConstraint, oaConstraintGroupgetConstraints (const oaConstraintGroup *group, oaLayerNum layer, const oaLayerConstraintDef *def=NULL)

Detailed Description

The oaLayerConstraint class represents a constraint object that constrains objects on a specific layer. In addition to the layer, the oaLayerConstraint is described by its oaLayerConstraintDef. A layer constraint has a value associated with it and potentially a list of constraint parameters. A layer constraint may or may not be a hard constraint. A hard constraint is a constraint that must be met. oaLayerConstraints always have a value, and are created in the same database as that value. oaLayerConstraints get applied to objects by being placed in an oaConstraintGroup.

If a purpose is specified along with the layer associated with the oaLayerConstraint, the constraint applies only between shapes with the specified purpose on that layer.


Member Function Documentation

oaLayerConstraint * oaLayerConstraint::create oaLayerNum    layer,
oaPurposeNum    purpose,
const oaLayerConstraintDef *    def,
const oaString &    name,
oaValue *    value,
oaBoolean    isHard = true,
const oaConstraintParamArray *    params = NULL
[static]
 

This function creates an explicitly named constraint. The new layer constraint is created with the specified purpose in the same database as the value specified.

Parameters:
layer The layer associated with the constraint.
purpose The purpose number for this constraint
def The layer constraint definition.
name The constraint name.
value The constraint value.
isHard A Boolean indicating whether the constraint must be met.
params Optional constraint parameters.
Exceptions:
oacInvalidBasePurposeNumber 
oacValueAlreadyOwned 
oacInvalidDatabaseForLayerConstraint 
oacConstraintParamAlreadyOwned 
oacConstraintParamNotInSameDB 
oacInvalidValueForConstraintDef 
oacInvalidDBForConstraintDef 
oacConstraintNameExists 

oaLayerConstraint * oaLayerConstraint::create oaLayerNum    layer,
oaPurposeNum    purpose,
const oaLayerConstraintDef *    def,
oaValue *    value,
oaBoolean    isHard = true,
const oaConstraintParamArray *    params = NULL
[static]
 

This function creates an auto-named constraint. The new layer constraint is created with the specified purpose in the same database as the value specified.

Parameters:
layer The layer associated with the constraint.
purpose The purpose number for this constraint
def The layer constraint definition.
value The constraint value.
isHard A Boolean indicating whether the constraint must be met.
params Optional constraint parameters.
Exceptions:
oacInvalidBasePurposeNumber 
oacValueAlreadyOwned 
oacInvalidDatabaseForLayerConstraint 
oacConstraintParamAlreadyOwned 
oacConstraintParamNotInSameDB 
oacInvalidValueForConstraintDef 
oacInvalidDBForConstraintDef 

oaLayerConstraint * oaLayerConstraint::create oaLayerNum    layer,
const oaLayerConstraintDef *    def,
const oaString &    name,
oaValue *    value,
oaBoolean    isHard = true,
const oaConstraintParamArray *    params = NULL
[static]
 

This function creates an explicitly named constraint with the specified attributes. The constraint is created in the same database as the value. The constraint parameters must also exist in the same database as the value.

Parameters:
layer The layer associated with the constraint.
def The layer constraint definition.
name The constraint name.
value The constraint value.
isHard A Boolean indicating whether the constraint must be met.
params Optional constraint parameters.
Exceptions:
oacValueAlreadyOwned 
oacConstraintParamAlreadyOwned 

oaLayerConstraint * oaLayerConstraint::create oaLayerNum    layer,
const oaLayerConstraintDef *    def,
oaValue *    value,
oaBoolean    isHard = true,
const oaConstraintParamArray *    params = NULL
[static]
 

This function creates an auto-named constraint with the specified attributes. The constraint is created in the same database as the value. The constraint parameters must also exist in the same database as the value.

Parameters:
layer The layer associated with the constraint.
def The layer constraint definition.
value The constraint value.
isHard A Boolean indicating whether the constraint must be met.
params Optional constraint parameters
Exceptions:
oacValueAlreadyOwned 
oacConstraintParamAlreadyOwned 

oaLayerConstraint * oaLayerConstraint::find const oaConstraintGroup *    group,
oaLayerNum    layer,
oaPurposeNum    purpose,
const oaLayerConstraintDef *    def,
oaBoolean    hardOnly = false
[static]
 

This function returns the first constraint in this group that matches the definition, layer, purpose, and isHard attribute specified. If no such constraint is found, NULL is returned. If the purpose number is oavPurposeNumberAny, the returned constraint can have any purpose. If the purpose number is oavPurposeNumberNo, the returned constraint must have no purpose specified.

Parameters:
group The group to match.
purpose The purpose number to match.
layer The layer to match.
def The layer constraint definition to match.
hardOnly A boolean indicating whether the constraint to match is hard or soft.

oaLayerConstraint * oaLayerConstraint::find const oaConstraintGroup *    group,
oaLayerNum    layer,
const oaLayerConstraintDef *    def,
oaBoolean    hardOnly = false
[static]
 

This function returns the first hard or soft constraint in this group that matches the definition, and layer specified. If no such constraint is found, NULL is returned.

Parameters:
group The group to match.
layer The layer to match.
def The layer constraint definition to match.
hardOnly A boolean indicating a hard or soft constraint.

oaCollection< oaLayerConstraint, oaConstraintGroup > oaLayerConstraint::getConstraints const oaConstraintGroup *    group,
oaLayerNum    layer,
const oaLayerConstraintDef *    def = NULL
[static]
 

This function returns a collection of layer constraints in the specified group the definition of which matches the one given. If no definition is specified, all layer constraints on that layer in that group are returned.

Parameters:
group The group to search in.
layer The layer to search for.
def The layer constraint definition to filter with.

oaLayerNum oaLayerConstraint::getLayer   const
 

This function returns layer number associated with this layer constraint.

oaPurposeNum oaLayerConstraint::getPurpose   const
 

This function returns the purpose number associated with this layer constraint.


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

Return to top of page