Class: Pdfrb::Model::Type::ThreeDStream

Inherits:
Cos::Stream show all
Defined in:
lib/pdfrb/model/type/three_d_stream.rb

Overview

3D Stream (s13.6.3). Carries a U3D or PRC binary 3D model.

Instance Attribute Summary

Attributes inherited from Cos::Stream

#stream

Attributes inherited from Object

#document, #gen, #oid, #value

Instance Method Summary collapse

Methods inherited from Cos::Stream

#decoded_stream, #encoded_stream=, #initialize

Methods inherited from Cos::Dictionary

#[], #[]=, arlington_available?, arlington_default, arlington_key_to_symbol, arlington_loaded_for?, arlington_mark_loaded, arlington_object, arlington_one_type_to_ruby, arlington_required?, arlington_types_to_ruby, arlington_version, define_field, define_field_from_arlington, #delete, #each, each_field, #each_raw, #empty?, field, #initialize, #key?, #keys, lookup_type, own_fields, #pdf_type, register_type, type_map, #validate

Methods inherited from Object

#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, #pdf_type, pdf_type

Constructor Details

This class inherits a constructor from Pdfrb::Model::Cos::Stream

Instance Method Details

#animationObject



12
# File 'lib/pdfrb/model/type/three_d_stream.rb', line 12

def animation; self[:AN]; end

#color_spaceObject



14
# File 'lib/pdfrb/model/type/three_d_stream.rb', line 14

def color_space; self[:ColorSpace]; end

#default_viewObject



11
# File 'lib/pdfrb/model/type/three_d_stream.rb', line 11

def default_view; self[:DV]; end

#each_viewObject



35
36
37
38
39
40
41
42
43
44
# File 'lib/pdfrb/model/type/three_d_stream.rb', line 35

def each_view
  return enum_for(:each_view) unless block_given?
  return unless views && document

  arr = views.is_a?(Pdfrb::Model::PdfArray) ? views.to_a : views
  arr.each do |ref|
    obj = ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
    yield obj if obj
  end
end

#on_instantiateObject



13
# File 'lib/pdfrb/model/type/three_d_stream.rb', line 13

def on_instantiate; self[:OnInstantiate]; end

#prc?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/pdfrb/model/type/three_d_stream.rb', line 20

def prc?
  subtype == :PRC
end

#step?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/pdfrb/model/type/three_d_stream.rb', line 24

def step?
  subtype == :STEP
end

#subtypeObject



9
# File 'lib/pdfrb/model/type/three_d_stream.rb', line 9

def subtype; self[:Subtype]&.to_sym; end

#typeObject



8
# File 'lib/pdfrb/model/type/three_d_stream.rb', line 8

def type; self[:Type]; end

#u3d?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/pdfrb/model/type/three_d_stream.rb', line 16

def u3d?
  subtype == :U3D
end

#view_countObject



28
29
30
31
32
33
# File 'lib/pdfrb/model/type/three_d_stream.rb', line 28

def view_count
  return 0 unless views

  arr = views.is_a?(Pdfrb::Model::PdfArray) ? views.to_a : views
  arr.is_a?(Array) ? arr.size : 0
end

#viewsObject



10
# File 'lib/pdfrb/model/type/three_d_stream.rb', line 10

def views; self[:VA]; end