private SMFByteBufferPackedMeshes( final SMFParserEventsDataMetaOptionalSupplierType in_meta, final SMFByteBufferPackerEventsType in_events) { this.meta = NullCheck.notNull(in_meta, "Meta"); this.events = NullCheck.notNull(in_events, "Events"); this.errors = List.empty(); this.warnings = List.empty(); }
private static <E, T> Validation<List<E>, T> flatten( final Validation<List<List<E>>, T> v) { return v.mapError(xs -> xs.fold(List.empty(), List::appendAll)); }
@Override public void onStart() { this.errors = List.empty(); this.attr_buffers = TreeMap.empty(); this.attr_packers = TreeMap.empty(); this.mesh = null; this.header = null; this.tri_buffer = null; this.tri_packer = null; }
@Override public final Optional<List<String>> line() throws IOException { final String line = this.lineNextRaw(); this.position.setLine(Math.addExact(this.position.line(), 1)); if (line == null) { return Optional.empty(); } final String trimmed = line.trim(); if (trimmed.isEmpty()) { return Optional.of(List.empty()); } if (trimmed.startsWith("#")) { return Optional.of(List.empty()); } return Optional.of(this.lexer.lex(trimmed)); }
Loader( final JCGLInterfaceGL33Type in_g, final SMFParserEventsMetaType in_meta, final SMFArrayObjectConfiguration in_configuration) { this.g = NullCheck.notNull(in_g, "GL"); this.configuration = NullCheck.notNull(in_configuration, "Configuration"); this.meta = NullCheck.notNull(in_meta, "Meta"); this.attributes_by_index = new TreeMap<>(); this.attributes_by_name = new TreeMap<>(); this.vertex_size = 0; this.array_buffer_size = 0L; this.index_position = 0; this.errors = List.empty(); }
SMFTV1HeaderParser( final SMFTAbstractParser in_parent, final SMFParserEventsType in_events, final SMFTLineReaderType in_reader, final SMFFormatVersion in_version) { super( in_events, in_reader, NullCheck.notNull(in_parent, "Parent").state); this.attribute_lines = HashMap.empty(); this.attributes_list = List.empty(); this.ok_triangles = false; this.ok_vertices = false; this.schema_id = SMFSchemaIdentifier.of(0, 0, 0, 0); }
final Optional<String> optionalCommonAttributePathOfMappingInputs = entityMappingOutputTuple._2; mappingOutputAttributes.foldLeft(javaslang.collection.List.empty(), (currentAttributePath, currentAttribute) -> {
/** * sort components re. their natural order (begin from the end, i.e., component without output components) * * @param components original components set * @return */ private static javaslang.collection.List<Component> sortComponents(final Set<Component> components) { final Optional<Component> optionalLastComponent = components.stream() .filter(component -> { final Set<Component> outputComponents = component.getOutputComponents(); return outputComponents == null || outputComponents.isEmpty(); }) .findFirst(); if (!optionalLastComponent.isPresent()) { return javaslang.collection.List.ofAll(components); } final Component lastComponent = optionalLastComponent.get(); final javaslang.collection.List<Component> lastComponentList = javaslang.collection.List.of(lastComponent); final javaslang.collection.Map<String, Component> componentMap = javaslang.collection.HashSet.ofAll(components) .toMap(component -> Tuple.of(component.getUuid(), component)); final javaslang.collection.List<Component> emptyComponentList = javaslang.collection.List.empty(); return addComponents(lastComponentList, componentMap, emptyComponentList); }
final javaslang.collection.List<Component> emptyPreviousComponentList = javaslang.collection.List.empty();
@Override public Validation<List<SMFErrorType>, SMFHeader> validate( final SMFHeader header, final SMFSchema schema) { NullCheck.notNull(header, "Header"); NullCheck.notNull(schema, "Schema"); List<SMFErrorType> errors = List.empty(); final Optional<SMFSchemaIdentifier> file_id_opt = header.schemaIdentifier(); if (file_id_opt.isPresent()) { final SMFSchemaIdentifier file_id = file_id_opt.get(); final SMFSchemaIdentifier schema_id = schema.schemaIdentifier(); if (!Objects.equals(schema_id, file_id)) { errors = errors.append(errorWrongSchemaID(schema_id, file_id)); } } errors = checkVerticesAndTriangles(header, schema, errors); errors = checkAttributes(header, schema, errors); errors = checkCoordinateSystem(header, schema, errors); if (errors.isEmpty()) { return valid(header); } return invalid(errors); }
SMF_VERTICES_REQUIRED); List<SMFErrorType> errors = List.empty();
Seq<SMFProcessingError> errors = List.empty(); errors = checkAttributeExists(errors, by_name, this.attribute);
NullCheck.notNull(m, "Mesh"); List<SMFProcessingError> errors = List.empty(); final long vertices = m.header().vertexCount(); final Vector<Vector3L> triangles = m.triangles();
Seq<SMFProcessingError> errors = List.empty(); for (final SMFAttributeName name : this.attributes) { errors = checkAttributeExists(errors, by_name, name);
List.empty(), m.header().attributesByName(), this.source); if (!errors.isEmpty()) { return invalid(List.ofAll(errors));
m.header().attributesByName(); Seq<SMFProcessingError> errors = checkAttributeExists(List.empty(), by_name, this.source); errors = checkAttributeNonexistent(errors, by_name, this.target);