Object/GLTFSaveOption.pm untested

filter: Statementstmt 0.0% 0 / 96 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 19 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 130 CC 6 SCAR 15.8
CC
6
Cov
0%
from_hash
12.0
_deserialize
12.0
TO_JSON
6.0
CRAP 4.8
1 =begin comment
2
3 Aspose.3D Cloud API Reference
4
5 No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
6
7 OpenAPI spec version: 3.0
8
9 Generated by: https://github.com/swagger-api/swagger-codegen.git
10
11 =end comment
12
13 =cut
14
15 #
16 # NOTE: This class is auto generated by the swagger code generator program.
17 # Do not edit the class manually.
18 # Ref: https://github.com/swagger-api/swagger-codegen
19 #
20 package AsposeThreeDCloud::Object::GLTFSaveOption;
21
22 require 5.6.0;
23 use strict;
24 use warnings;
25 use utf8;
26 use JSON qw(decode_json);
27 use Data::Dumper;
28 use Module::Runtime qw(use_module);
29 use Log::Any qw($log);
30 use Date::Parse;
31 use DateTime;
32
33 use AsposeThreeDCloud::Object::FileContentType;
34 use AsposeThreeDCloud::Object::SaveFormat;
35 use AsposeThreeDCloud::Object::SaveOptions;
36
37 use base ("Class::Accessor", "Class::Data::Inheritable");
38
39
40 #
41 #
42 #
43 # NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
44 # REF: https://github.com/swagger-api/swagger-codegen
45 #
46
47 =begin comment
48
49 Aspose.3D Cloud API Reference
50
51 No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
52
53 OpenAPI spec version: 3.0
54
55 Generated by: https://github.com/swagger-api/swagger-codegen.git
56
57 =end comment
58
59 =cut
60
61 #
62 # NOTE: This class is auto generated by the swagger code generator program.
63 # Do not edit the class manually.
64 # Ref: https://github.com/swagger-api/swagger-codegen
65 #
66 __PACKAGE__->mk_classdata('attribute_map' => {});
67 __PACKAGE__->mk_classdata('swagger_types' => {});
68 __PACKAGE__->mk_classdata('method_documentation' => {});
69 __PACKAGE__->mk_classdata('class_documentation' => {});
70
71 # new object
72 sub new {
73 my ($class, %args) = @_;
74
75 my $self = bless {}, $class;
76
77 foreach my $attribute (keys %{$class->attribute_map}) {
78 my $args_key = $class->attribute_map->{$attribute};
79 $self->$attribute( $args{ $args_key } );
80 }
81
82 return $self;
83 }
84
85 # return perl hash
86 sub to_hash {
87 return decode_json(JSON->new->convert_blessed->encode( shift ));
88 }
89
90 # used by JSON for serialization
91 sub TO_JSON {
92 my $self = shift;
93 my $_data = {};
94 foreach my $_key (keys %{$self->attribute_map}) {
95 if (defined $self->{$_key}) {
96 $_data->{$self->attribute_map->{$_key}} = $self->{$_key};
97 }
98 }
99 return $_data;
100 }
101
102 # from Perl hashref
103 sub from_hash {
104 my ($self, $hash) = @_;
105
106 # loop through attributes and use swagger_types to deserialize the data
107 while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
108 my $_json_attribute = $self->attribute_map->{$_key};
109 if ($_type =~ /^array\[/i) { # array
110 my $_subclass = substr($_type, 6, -1);
111 my @_array = ();
112 foreach my $_element (@{$hash->{$_json_attribute}}) {
113 push @_array, $self->_deserialize($_subclass, $_element);
114 }
115 $self->{$_key} = \@_array;
116 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
117 $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
118 } else {
119 $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
120 }
121 }
122
123 return $self;
124 }
125
126 # deserialize non-array data
127 sub _deserialize {
128 my ($self, $type, $data) = @_;
129 $log->debugf("deserializing %s with %s",Dumper($data), $type);
130
131 if ($type eq 'DateTime') {
132 return DateTime->from_epoch(epoch => str2time($data));
133 } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
134 return $data;
135 } else { # hash(model)
136 my $_instance = eval "AsposeThreeDCloud::Object::$type->new()";
137 return $_instance->from_hash($data);
138 }
139 }
140
141
142
143 __PACKAGE__->class_documentation({description => '',
144 class => 'GLTFSaveOption',
145 required => [], # TODO
146 } );
147
148 __PACKAGE__->method_documentation({
149 'save_format' => {
150 datatype => 'SaveFormat',
151 base_name => 'SaveFormat',
152 description => 'Gets or sets of the SaveFormat.',
153 format => '',
154 read_only => '',
155 },
156 'lookup_paths' => {
157 datatype => 'ARRAY[string]',
158 base_name => 'LookupPaths',
159 description => 'Some files like OBJ depends on external file, the lookup paths will allows Aspose.3D to look for external file to load',
160 format => '',
161 read_only => '',
162 },
163 'file_name' => {
164 datatype => 'string',
165 base_name => 'FileName',
166 description => 'The file name of the exporting/importing scene. This is optional, but useful when serialize external assets like OBJ's material.',
167 format => '',
168 read_only => '',
169 },
170 'file_format' => {
171 datatype => 'string',
172 base_name => 'FileFormat',
173 description => 'The file format like FBX,U3D,PDF ....',
174 format => '',
175 read_only => '',
176 },
177 'pretty_print' => {
178 datatype => 'boolean',
179 base_name => 'PrettyPrint',
180 description => 'The JSON content of GLTF file is indented for human reading, default value is false.',
181 format => '',
182 read_only => '',
183 },
184 'embed_assets' => {
185 datatype => 'boolean',
186 base_name => 'EmbedAssets',
187 description => 'Embed all external assets as base64 into single file in ASCII mode, default value is false.',
188 format => '',
189 read_only => '',
190 },
191 'use_common_materials' => {
192 datatype => 'boolean',
193 base_name => 'UseCommonMaterials',
194 description => 'Serialize materials using KHR common material extensions, default value is false. Set this to false will cause Aspose.3D export a set of vertex/fragment shader if Aspose.ThreeD.Formats.GLTFSaveOptions.ExportShaders',
195 format => '',
196 read_only => '',
197 },
198 'flip_tex_coord_v' => {
199 datatype => 'boolean',
200 base_name => 'FlipTexCoordV',
201 description => 'Flip texture coordinate v(t) component, default value is true.',
202 format => '',
203 read_only => '',
204 },
205 'buffer_file' => {
206 datatype => 'boolean',
207 base_name => 'BufferFile',
208 description => 'The file name of the external buffer file used to store binary data. If this file is not specified, Aspose.3D will generate a name for you. This is ignored when export glTF in binary mode.',
209 format => '',
210 read_only => '',
211 },
212 'save_extras' => {
213 datatype => 'boolean',
214 base_name => 'SaveExtras',
215 description => 'Save scene object's dynamic properties into 'extra' fields in the generated glTF file. This is useful to provide application-specific data. Default value is false..',
216 format => '',
217 read_only => '',
218 },
219 'draco_compression' => {
220 datatype => 'boolean',
221 base_name => 'DracoCompression',
222 description => 'Gets or sets whether to enable draco compression.',
223 format => '',
224 read_only => '',
225 },
226 'file_content_type' => {
227 datatype => 'FileContentType',
228 base_name => 'FileContentType',
229 description => 'Gets or sets of the FileContent type.',
230 format => '',
231 read_only => '',
232 },
233 });
234
235 __PACKAGE__->swagger_types( {
236 'save_format' => 'SaveFormat',
237 'lookup_paths' => 'ARRAY[string]',
238 'file_name' => 'string',
239 'file_format' => 'string',
240 'pretty_print' => 'boolean',
241 'embed_assets' => 'boolean',
242 'use_common_materials' => 'boolean',
243 'flip_tex_coord_v' => 'boolean',
244 'buffer_file' => 'boolean',
245 'save_extras' => 'boolean',
246 'draco_compression' => 'boolean',
247 'file_content_type' => 'FileContentType'
248 } );
249
250 __PACKAGE__->attribute_map( {
251 'save_format' => 'SaveFormat',
252 'lookup_paths' => 'LookupPaths',
253 'file_name' => 'FileName',
254 'file_format' => 'FileFormat',
255 'pretty_print' => 'PrettyPrint',
256 'embed_assets' => 'EmbedAssets',
257 'use_common_materials' => 'UseCommonMaterials',
258 'flip_tex_coord_v' => 'FlipTexCoordV',
259 'buffer_file' => 'BufferFile',
260 'save_extras' => 'SaveExtras',
261 'draco_compression' => 'DracoCompression',
262 'file_content_type' => 'FileContentType'
263 } );
264
265 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
266
267
268 1;