### Home Classes Methods

### In Files

- lib/goals.rb

### Parent

Goal

### Methods

- ::new
- #satisfied?

### Files

- LessThan5BlueLabels.txt
- AtLeast2LargeSegments.txt

### Class Index

Quicksearch

- AddLabelTool
- AllRulesAppliedGoal
- Area
- AreaConstraint
- Array
- BalancedBinaryTree
- BalancedBinaryTreeNode
- CloseObserver
- Constants
- Constraint
- CurrentLabelledShape
- DistinctShapeConstraint
- Execution
- Goal
- Grammar
- Label
- LabelledShape
- LineDescriptor
- LinearLinkedList
- LinearLinkedListNode
- NoLabelsGoal
- NoMoreRulesGoal
- NoScalesConstraint
- Numeric
- Object
- OrderedPoint
- PiList
- Point
- Project
- Robot
- Rule
- RuleGroupsObserver
- RuleLabelledShape
- RuleShapeObserver
- Segment
- ShaDeLayersObserver
- Shade
- ShadeUtils
- UndoObserver

No matching classes.

# NoLabelsGoal

Author | Manuela Ruiz (mruiz@lcc.uma.es)

A sort of goal: satisfied when there are no labels in the current shape

### Public Class Methods

new() click to toggle source

Initialize the goal

        # File lib/goals.rb, line 34
    34:         def initialize

    35:                 @name = Constants::NO_LABELS_GOAL_NAME

    36:         end

### Public Instance Methods

satisfied?() click to toggle source

returns | true iff the current shape has no labels

        # File lib/goals.rb, line 39
    39:         def satisfied?

    40:                 satisfied = true

    41:

    42:                 j = 0

    43:                 n_layers = Sketchup.active_model.layers.length

    44:                 layer_name = "Layer0"

    45:                 while (satisfied and (j < n_layers))

    46:                         layer_name = Sketchup.active_model.layers[j].name

    47:

    48:                         labels = Shade.project.execution.current_shape.p[layer_name]

    49:

    50:                         if (labels.size == 1) and (labels.first.key.value == Constants::INTERSECTION_LABEL)

    51:                                 satisfied = false

    52:                         elsif (labels.size > 1)

    53:                                 satisfied = false

    54:                         end

    55:

    56:                         j+=1

    57:                 end

    58:

    59:                 return satisfied

    60:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.