# Module: EnfEditor::PropertyUtils

Included in:
  EEBrepEdge, EEBrepFace, EEBrepSurface, EEBrepVertex, EEBrepVolume

Defined in:
  lib/enfeditor/core_ext/property_utils.rb

## Overview

Mixin module to handle display property

## Instance Method Summary collapse

- #display=(value) ⇒ Object

  Setter for element display.

- #display? ⇒ Boolean

  Returns display status of element.

- #layer ⇒ Integer?

  Returns layer number.

- #layer=(value) ⇒ Object

  Setter for element layer.

## Instance Method Details

### #display=(value) ⇒ `Object`

Setter for element display

Examples:

    # Set display status of element to hide
    element.display = false

Parameters:

- value (`Boolean`, `nil`) —

  New display property value or set nil to remove display property

Since:

- 0.1.0.0

    80
    81
    82
    83
    84
    85
    86
    87
    88
    # File 'lib/enfeditor/core_ext/property_utils.rb', line 80

    def display=(value)
      if value.nil?
        self.remove_property(@@propkey_display)
      else
        raise TypeError, "wrong argument type (expected Boolean)" if !value.is_a?(TrueClass) && !value.is_a?(FalseClass)
        new_display_int = value ? 1 : 0
        self.set_integer_property(@@propkey_display,new_display_int)
      end
    end

### #display? ⇒ `Boolean`

Returns display status of element.

Examples:

    # Get display status of element
    puts element.display?  # => true

Returns:

- (`Boolean`) —

  Returns display status of element.

Since:

- 0.1.0.0

    68
    69
    70
    71
    # File 'lib/enfeditor/core_ext/property_utils.rb', line 68

    def display?
      return true unless self.has_property?(@@propkey_display)
      return self._integer_property(@@propkey_display) != 0
    end

### #layer ⇒ `Integer`?

Returns layer number

Examples:

    # Get layer number of element
    puts element.layer  # => 10

Returns:

- (`Integer`, `nil`) —

  Returns layer number

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/property_utils.rb', line 42

### #layer=(value) ⇒ `Object`

Setter for element layer

Examples:

    # Set layer number to 20
    element.layer = 20

Parameters:

- value (`Integer`, `nil`) —

  new value or set nil to remove layer property

Since:

- 0.1.0.0

    # File 'lib/enfeditor/core_ext/property_utils.rb', line 50