oaLayerPairConstraint Class Reference

Inheritance diagram for oaLayerPairConstraint:

oaConstraint oaObject


Public Methods

oaLayerNum getLayer1 () const
oaLayerNum getLayer2 () const
oaPurposeNum getPurpose1 () const
oaPurposeNum getPurpose2 () const

Static Public Methods

oaLayerPairConstraint * create (oaLayerNum layer1, oaLayerNum layer2, const oaLayerPairConstraintDef *def, oaValue *value, oaBoolean isHard=true, const oaConstraintParamArray *params=NULL)
oaLayerPairConstraint * create (oaLayerNum layer1, oaLayerNum layer2, const oaLayerPairConstraintDef *def, const oaString &name, oaValue *value, oaBoolean isHard=true, const oaConstraintParamArray *params=NULL)
oaLayerPairConstraint * create (oaLayerNum layer1, oaPurposeNum purpose1, oaLayerNum layer2, oaPurposeNum purpose2, const oaLayerPairConstraintDef *def, oaValue *value, oaBoolean isHard=true, const oaConstraintParamArray *params=NULL)
oaLayerPairConstraint * create (oaLayerNum layer1, oaPurposeNum purpose1, oaLayerNum layer2, oaPurposeNum purpose2, const oaLayerPairConstraintDef *def, const oaString &name, oaValue *value, oaBoolean isHard=true, const oaConstraintParamArray *params=NULL)
oaLayerPairConstraint * find (const oaConstraintGroup *group, oaLayerNum layer1, oaLayerNum layer2, const oaLayerPairConstraintDef *def, oaBoolean hardOnly=false)
oaLayerPairConstraint * find (const oaConstraintGroup *group, oaLayerNum layer1, oaPurposeNum purpose1, oaLayerNum layer2, oaPurposeNum purpose2, const oaLayerPairConstraintDef *def, oaBoolean hardOnly=false)
oaCollection< oaLayerPairConstraint, oaConstraintGroupgetConstraints (const oaConstraintGroup *group, oaLayerNum layer1, oaLayerNum layer2, const oaLayerPairConstraintDef *def=NULL)

Detailed Description

The oaLayerPairConstraint class represents a constraint object that constrains interactions between two ordered layers. In addition to the layers, the oaLayerPairConstraint is described by its oaLayerPairConstraintDef. A layerPair constraint has a value associated with it and potentially a list of constraint parameters. A layerPair constraint may or may not be a hard constraint. A hard constraint is a constraint that must be met. oaLayerPairConstraints always have a value, and are created in the same database as that value. oaLayerPairConstraints get applied to objects by being placed in an oaConstraintGroup.

If a purpose is specified corresponding to one or both of the layers associated with the oaLayerPairConstraint, the constraint applies only between shapes on those layers with the specified purpose or purposes.


Member Function Documentation

oaLayerPairConstraint * oaLayerPairConstraint::create oaLayerNum    layer1,
oaPurposeNum    purpose1,
oaLayerNum    layer2,
oaPurposeNum    purpose2,
const oaLayerPairConstraintDef *    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 new layer pair constraint is created with the specified purposes in the same database as the value specified.

Parameters:
layer1 Layer associated with constraint.
purpose1 The layer1 purpose.
layer2 The second layer associated with this constraint.
purpose2 The layer2 purpose.
def Layer pair 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 
oacInvalidDatabaseForLayerPairConstraint 
oacConstraintParamAlreadyOwned 
oacConstraintParamNotInSameDB 
oacInvalidValueForConstraintDef 
oacInvalidDBForConstraintDef 
oacConstraintNameExists 

oaLayerPairConstraint * oaLayerPairConstraint::create oaLayerNum    layer1,
oaPurposeNum    purpose1,
oaLayerNum    layer2,
oaPurposeNum    purpose2,
const oaLayerPairConstraintDef *    def,
oaValue *    value,
oaBoolean    isHard = true,
const oaConstraintParamArray *    params = NULL
[static]
 

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

Parameters:
layer1 The first layer of the pair associated with this constraint.
purpose1 The layer1 purpose.
layer2 The second layer of the pair associated with this constraint.
purpose2 The layer2 purpose.
def Layer pair constraint definition
value Constraint value
isHard Boolean indicating whether constraint must be met
params Optional constraint parameters
Exceptions:
oacInvalidBasePurposeNumber 
oacValueAlreadyOwned 
oacInvalidDatabaseForLayerPairConstraint 
oacConstraintParamAlreadyOwned 
oacConstraintParamNotInSameDB 
oacInvalidValueForConstraintDef 
oacInvalidDBForConstraintDef 

oaLayerPairConstraint * oaLayerPairConstraint::create oaLayerNum    layer1,
oaLayerNum    layer2,
const oaLayerPairConstraintDef *    def,
const oaString &    name,
oaValue *    value,
oaBoolean    isHard = true,
const oaConstraintParamArray *    params = NULL
[static]
 

This function creates an explicitly name 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:
layer1 Layer associated with constraint.
layer2 Second layer associated with a constraint.
def Layer pair constraint definition
name Constraint name
value Constraint value
isHard Boolean indicating whether constraint must be met
params Optional constraint parameters
Exceptions:
oacValueAlreadyOwned 
oacConstraintParamAlreadyOwned 

oaLayerPairConstraint * oaLayerPairConstraint::create oaLayerNum    layer1,
oaLayerNum    layer2,
const oaLayerPairConstraintDef *    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:
layer1 Layer associated with constraint.
layer2 Second layer associated with a constraint.
def Layer pair constraint definition
value Constraint value
isHard Boolean indicating whether constraint must be met
params Optional constraint parameters
Exceptions:
oacValueAlreadyOwned 
oacConstraintParamAlreadyOwned 

oaLayerPairConstraint * oaLayerPairConstraint::find const oaConstraintGroup *    group,
oaLayerNum    layer1,
oaPurposeNum    purpose1,
oaLayerNum    layer2,
oaPurposeNum    purpose2,
const oaLayerPairConstraintDef *    def,
oaBoolean    hardOnly = false
[static]
 

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

Parameters:
group The group to match.
layer1 The first layer to match.
purpose1 The purpose of the first layer.
layer2 The second layer to match.
purpose2 The purpose of the second layer.
def The layer pair constraint definition to match.
hardOnly A boolean indicating whether the constraint to match is hard.

oaLayerPairConstraint * oaLayerPairConstraint::find const oaConstraintGroup *    group,
oaLayerNum    layer1,
oaLayerNum    layer2,
const oaLayerPairConstraintDef *    def,
oaBoolean    hard = false
[static]
 

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

Parameters:
group Group to search
layer1 First layer to search for
layer2 Second layer to search for
def Layer pair constraint definition to search for
hard Boolean indicating whether or not the constraint to be searched for is hard or soft

oaCollection< oaLayerPairConstraint, oaConstraintGroup > oaLayerPairConstraint::getConstraints const oaConstraintGroup *    group,
oaLayerNum    layer1,
oaLayerNum    layer2,
const oaLayerPairConstraintDef *    def = NULL
[static]
 

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

Parameters:
group Constraint group to search in
layer1 First layer to search for
layer2 Second layer to search for
def Layer pair constraint definition to filter with

oaLayerNum oaLayerPairConstraint::getLayer1   const
 

This function returns the first layer associated with this constraint.

oaLayerNum oaLayerPairConstraint::getLayer2   const
 

This function returns the second layer associated with this constraint.

oaPurposeNum oaLayerPairConstraint::getPurpose1   const
 

This function returns the purpose number associated with the first layer of the pair for this constraint.

oaPurposeNum oaLayerPairConstraint::getPurpose2   const
 

This function returns the purpose number associated with the second layer of the pair for this constraint.


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

Return to top of page